]> git.saurik.com Git - bison.git/blob - ChangeLog
Add a marker for when 1.875c was published.
[bison.git] / ChangeLog
1 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
2
3 Support %destructor and merge error locations in lalr1.cc.
4
5 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
6 (Parser::stos_): Define unconditionally.
7 (Parser::destruct_): New method. Generate its body with
8 b4_yydestruct_generate.
9 (Parser::error_start_): New attribute.
10 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
11 token which are discarded.
12 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
13 error_start_ when erroneous token are discarded.
14 (Parser::parse) <yyerrlab1>: Compute the location of the error
15 token so that it covers all the discarded tokens.
16 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
17 it can be called with `%skeleton "lalr1.cc"', and do that.
18
19 2004-02-02 Paul Eggert <eggert@twinsun.com>
20
21 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
22 $(top_srcdir)/lib and ../lib. This fixes a bug reported
23 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
24 There's no need to mention top_builddir since Automake does that
25 for us.
26 (INCLUDES): Remove, as Automake says it's obsolescent.
27 Contents migrated into AM_CPPFLAGS as described above.
28 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
29
30 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
31
32 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
33 (yyreportSyntaxError): Handle case where lookahead token is
34 YYEMPTY.
35
36 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
37
38 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
39 resulting parsers are compilable with C++.
40
41 2003-12-23 Paul Eggert <eggert@twinsun.com>
42
43 * config/depcomp, config/install-sh: Sync with Automake 1.8.
44 * src/output.c (output_skeleton): Rename local var.
45 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
46 Bison tokens, as this runs afoul of the 2003-10-07 change that
47 disallowed NUL bytes in character constants or string literals.
48
49 * tests/local.at: Require Autoconf 2.59's Autotest.
50 * tests/testsuite.at: Don't include local.at, since we now assume
51 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
52 including it.
53 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
54 multiple inclusion warnings.
55
56 2003-12-02 Akim Demaille <akim@epita.fr>
57
58 * doc/bison.texinfo (How Can I Reset the Parser): More about start
59 conditions.
60 From Bruno Haible.
61
62 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
63
64 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
65
66 2003-10-07 Paul Eggert <eggert@twinsun.com>
67
68 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
69 if testsuite doesn't exist.
70
71 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
72 literals, unfortunately.
73 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
74 Complain about NUL bytes in character constants or string literals.
75
76 2003-10-05 Paul Eggert <eggert@twinsun.com>
77
78 * NEWS: Don't document %no-default-prec, as it's still
79 too experimental.
80 * doc/bison.texinfo: Document %no-default-prec only if
81 the defaultprec flag is set. Normally it's not.
82
83 2003-10-04 Paul Eggert <eggert@twinsun.com>
84
85 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
86 non-modifiable lvalue, instead of a modifiable one.
87 * doc/bison.texinfo (Actions): Document that $$ can
88 be assigned to. Do not claim that $$ and $N are
89 array element references: user code should not rely on this.
90
91 2003-10-01 Paul Eggert <eggert@twinsun.com>
92
93 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
94 (grammar_declaration): Use it.
95 * src/scan-gram.l: New token %no-default-prec.
96 * tests/conflicts.at: Revamp tests to use %no-default-prec.
97 * NEWS, doc/bison.texinfo: Document the above.
98
99 2003-10-01 Akim Demaille <akim@epita.fr>
100
101 VCG no longer supports long_straight_phase.
102
103 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
104 * src/print_graph.c (print_graph): Adjust.
105
106 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
107 and Paul Eggert <eggert@twinsun.com>
108
109 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
110 Table of Symbols): Document %default-prec.
111 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
112 (grammar_declaration): Set default_prec on %default-prec.
113 * src/scan-gram.l (%default-prec): New token.
114 * src/reader.h (default_prec): New flag.
115 * src/reader.c: Likewise.
116 (packgram): Handle it.
117 * tests/conflicts.at (%default-prec without %prec,
118 %default-prec with %prec, %default-prec 1): New tests.
119
120 2003-09-30 Paul Eggert <eggert@twinsun.com>
121
122 * tests/testsuite.at: Include local.at, not input.at, fixing
123 a typo in the 2003-08-25 patch.
124
125 2003-08-27 Akim Demaille <akim@epita.fr>
126
127 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
128 GCC warnings.
129
130 2003-08-26 Akim Demaille <akim@epita.fr>
131
132 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
133 "<\#" to avoid magic from Gnus when posting parts of this script.
134
135 2003-08-26 Akim Demaille <akim@epita.fr>
136
137 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
138 (Parser::parse): here.
139 Adjust: nerrs and errstatus is now replaced by...
140 (Parser::nerrs_, Parser::errstatus_): New.
141
142 2003-08-25 Akim Demaille <akim@epita.fr>
143
144 * config/announce-gen, Makefile.cfg: New.
145 * Makefile.am: Adjust.
146 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
147 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
148
149 2003-08-25 Akim Demaille <akim@epita.fr>
150
151 When reducing initial empty rules, Bison parser read an initial
152 location that is not defined. This results in garbage, and that
153 affects Bison's own parser. Therefore we need (i) to extend Bison
154 to support a means to initialize this location, and (ii) to use
155 this CVS Bison to fix CVS Bison's parser.
156
157 * src/reader.h, reader.c (epilogue_augment): Remove, replace
158 with...
159 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
160 * src/parse-gram.y: Adjust.
161 (%initial-action): New.
162 (%error-verbose): Since we require CVS Bison, there is no reason
163 not to use it.
164 * src/scan-gram.l: Adjust.
165 * src/Makefile.am (YACC): New, to make sure we use our own parser.
166 * data/yacc.c (yyparse): Use b4_initial_action.
167
168 2003-08-25 Akim Demaille <akim@epita.fr>
169
170 * doc/bison.texinfo: Don't promote stdout for error messages.
171
172 2003-08-25 Akim Demaille <akim@epita.fr>
173
174 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
175 From Alexandre Duret-Lutz.
176
177 2003-08-25 Akim Demaille <akim@epita.fr>
178
179 Version 1.875c.
180
181 2003-08-25 Akim Demaille <akim@epita.fr>
182
183 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
184 Use them.
185
186 2003-08-25 Akim Demaille <akim@epita.fr>
187
188 * data/lalr1.cc (Parser::reduce_print_): New.
189 Use it.
190
191 2003-08-25 Akim Demaille <akim@epita.fr>
192
193 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
194 error recovery loops. This patch is based on
195 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
196 Also, augment the similarity between lalr1.cc and yacc.c.
197 Note: the locations of error recovery rules are not correct yet.
198
199 * data/lalr1.cc: Comment changes to augment the similarity between
200 lalr1.cc and yacc.c.
201 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
202 (yyerrlab1): Remove, but where it used to be (now the bottom part of
203 yyerrlab), when hitting EOF, pop the whole stack here instead of
204 merely falling thru the default error handling mechanism.
205 (yyerrorlab): New label, with the old contents of YYERROR,
206 plus the following change: pop the stack of rhs corresponding
207 to the production that invoked YYERROR. That is how Yacc
208 behaves (required by POSIX).
209 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
210 fail.
211
212 2003-08-25 Akim Demaille <akim@epita.fr>
213
214 Tune local.at so that people can "autom4te -l autotest calc.at -o
215 calc" for instance, to extract a sub test suite.
216
217 * tests/testsuite.at: Move the initialization, Autotest version
218 requirement, and AT_TESTED invocation into...
219 * tests/local.at: here.
220 * tests/testsuite.at: Include it for compatibility with Autoconf
221 2.57.
222 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
223 be ignore.
224
225 2003-08-04 Paul Eggert <eggert@twinsun.com>
226
227 Rework code slightly to avoid gcc -Wtraditional warnings.
228 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
229 The returned value is now stored in *YY0. All callers changed.
230 * src/output.c (merge_output): Adjust to the above change.
231
232 2003-07-26 Paul Eggert <eggert@twinsun.com>
233
234 * data/glr.c (YYASSERT): New macro.
235 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
236 yyresolveStates, yyprocessOneStack):
237 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
238 Derived from a suggestion by Frank Heckenbach.
239
240 2003-07-25 Paul Eggert <eggert@twinsun.com>
241
242 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
243 for portability to K&R C (after ansi2knr, presumably). See
244 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
245 by Frank Heckenbach, though I have omitted the structure-initialization
246 part of his glr-knr.diff patch since I recall that the Portable
247 C Compiler didn't require that change.
248
249 Let the user specify how to allocate and free memory.
250 Derived from a suggestion by Frank Heckenbach in
251 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
252 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
253 All uses of free, malloc, realloc changed to use these macros,
254 and unnecessary casts removed.
255 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
256
257 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
258
259 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
260 use s.empty() rather than s == "" to test for empty string; see
261 <http://mail.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
262 (trivial change)
263
264 2003-06-25 Akim Demaille <akim@epita.fr>
265
266 * config/depcomp, config/install-sh: Update from masters.
267
268 2003-06-20 Paul Eggert <eggert@twinsun.com>
269
270 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
271 and return properly parenthesized result.
272 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
273 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
274 Remove unnecessary parentheses from uses.
275 * doc/bison.texinfo (Location Default Action): Describe the
276 conventions for parentheses.
277
278 2003-06-19 Paul Eggert <eggert@twinsun.com>
279
280 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
281 yyreportTree): Do not assume that size_t is the same width as int,
282 when printing sizes. Print sizes using an unsigned format.
283 Problem reported by Frank Heckenbach in
284 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
285
286 Port to Forte Developer 7 C compiler.
287 * data/glr.c (struct YYLTYPE): If locations are not being used,
288 declare a single dummy member, as empty structs do not conform
289 to the C standard.
290 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
291 the Forte Developer 7 C compiler complains that end-of-loop
292 code is not reached.
293
294 2003-06-17 Paul Eggert <eggert@twinsun.com>
295
296 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
297 avoid warnings from picky compilers about redefinition of PARAMS.
298
299 2003-06-17 Paul Eggert <eggert@twinsun.com>
300
301 Version 1.875b.
302
303 * NEWS: Document 1.875b.
304
305 * lib/bbitset.h: Do not include config.h; that's the includer's job.
306 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
307 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
308 Don't use 'index' in comments, as it's a builtin fn on some hosts.
309 * lib/bitset_stats.c: Include gettext.h unconditionally, as
310 per recent gettext manual's suggestion.
311 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
312 Use prototypes, not old-style definitions.
313 * lib/lbitset.c (lbitset_unused_clear): Likewise.
314 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
315 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
316 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
317 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
318 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
319 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
320 vbitset_or_and_cmp, vbitset_copy): Likewise.
321
322 * lib/libiberty.h: Do not include config.h; that's the includer's job.
323 Do not include <stdlib.h>.
324 (PARAMS): Define unconditionally for C89.
325 (ATTRIBUTE_NORETURN): Remove.
326 (ATTRIBUTE_UNUSED): Define unconditionally.
327
328 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
329 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
330 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
331 * lib/vbitset.c, lib/vbitset.h: New files.
332 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
333 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
334 from libbitset.
335
336 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
337 `How Can I Reset @code{yyparse}', since texinfo does not allow
338 arbitrary @ in node names.
339
340 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
341 shouldn't be needed according to the gettext 0.12.1 documentation
342 but which seem to be needed anyway: codeset.m4 glibc21.m4
343 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
344 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
345 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
346
347 * lib/.cvsignore: Add stdbool.h.
348 * m4/.cvsignore: Add nls.m4, po.m4.
349
350 Upgrade to CVS gnulib.
351 * stdbool_.h: File renamed from stdbool.h.in.
352 * configure.ac (AM_STDBOOL_H): Invoke this instead of
353 AC_HEADER_STDBOOL.
354 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
355 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
356 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
357 (MOSTLYCLEANFILES): New var.
358 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
359 (stdbool.h): New rule.
360 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
361 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
362 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
363 m4/quote.m4: Upgrade to today's gnulib.
364
365 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
366 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
367 the tests right now.
368 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
369 yyerror are declared before use; C99 requires this.
370
371 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
372
373 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
374 first.
375 (yyrecoverSyntaxError): Correct the logic for setting and testing
376 yyerrState.
377 Correct comment on handling EOF.
378 Allow states with only a default reduction, rather than failing
379 (I can't quite reconstruct why these were not allowed before).
380
381 Fixes to avoid problem that $-N rules in GLR parsers can cause
382 buffer overruns, corrupting state.
383
384 * src/output.c (prepare_rules): Output max_left_semantic_context
385 definition.
386 * src/reader.h (max_left_semantic_context): New variable declaration.
387 * src/scan-gram.l (max_left_semantic_context): Define.
388 (handle_action_dollar): Update max_left_semantic_context.
389 * data/glr.c (YYMAXLEFT): New definition.
390 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
391 (yyresolveAction): Ditto.
392
393 Fixes to problems with location handling in GLR parsers reported by
394 Frank Heckenbach (2003/06/05).
395
396 * data/glr.c (YYLTYPE): Make trivial if locations not used.
397 (YYRHSLOC): Add parentheses, and define only if locations used.
398 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
399 locations not used.
400 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
401 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
402
403 * tests/cxx-type.at: Exercise location information; update tests
404 to differentiate output with and without locations.
405 Remove forward declarations of yylex and yyerror---caused errors
406 because default YYLTYPE not yet defined.
407 Change semantic actions to compute strings, rather than printing
408 them directly (to test proper passing of semantics values). Change
409 output to prefix notation and update test data and expected results.
410 (yylex): Track locations.
411 (stmtMerge): Return value rather than printing, and include arguments
412 in value.
413
414 2003-06-03 Paul Eggert <eggert@twinsun.com>
415
416 Avoid warnings generated by GCC 2.95.4 when Bison is
417 configured with --enable-gcc-warnings.
418 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
419 yy::]b4_parser_class_name[::translate_,
420 yy::Stack::operator[] (unsigned),
421 yy::Stack::operator[] (unsigned) const,
422 yy::Slice::operator[] (unsigned),
423 yy::Slice::operator[] (unsigned) const):
424 Rename local vars to avoid warnings.
425 * tests/glr-regression.at (Improper handling of embedded actions
426 and $-N in GLR parsers): Remove unused local variable from yylex.
427 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
428 (void) as arg when not pure, since we now assume C89 when building
429 Bison. Pacify GCC by using parameter.
430
431 2003-06-02 Paul Eggert <eggert@twinsun.com>
432
433 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
434 yy::Location::lines, yy::Location::columns): Rename arguments
435 to avoid shadowing; this removes a warning generated by GCC 3.3.
436
437 2003-06-01 Paul Eggert <eggert@twinsun.com>
438
439 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
440 to g++, as GCC 3.3 complains if you do it.
441 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
442 everything that WARNING_CFLAGS has, except omit warnings
443 not suitable for C++.
444 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
445 * tests/atlocal.in (CXXFLAGS): New var.
446 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
447
448 Fix a GLR parser bug I reported in February; see
449 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
450 The problem was that GLR parsers did not conform to the C standard,
451 because actions like { $1 = $2 + $3; } expanded to expressions
452 that invoked YYFILL in separate subexpressions, and YYFILL assigned
453 to a local variable. The C standard says that expressions
454 like (var = f ()) + (var = f ()) have undefined behavior.
455 Another problem was that GCC sometimes issues warnings that
456 yyfill and its parameters are unused.
457
458 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
459 as possibly unused.
460 (yyfill): New function.
461 (YYFILL): Use it.
462 (yyuserAction): Change type of yynormal to bool, so that it matches
463 the new yyfill signature. Mark it as possibly unused.
464
465
466 Follow up on a bug I reported in February, where a Bison-generated
467 parser can loop. Provide a test case and a fix for yacc.c. I
468 don't have a fix for lalr1.cc or for glr.c, unfortunately.
469 The original bug report is in:
470 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
471
472 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
473 macro's size was becoming unwieldy.
474 (yyerrlab): Do not discard an empty lookahead symbol, as this
475 might destroy garbage.
476 (yyerrorlab): New label, with the old contents of YYERROR,
477 plus the following change: pop the stack of rhs corresponding
478 to the production that invoked YYERROR. That is how Yacc
479 behaves, and POSIX requires this behavior.
480 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
481 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
482 Define 'alarm' to do nothing if unistd.h is not available.
483 Add a new rule "exp: '-' error;" to test the above change to
484 data/yacc.c. Use 'alarm' to abort any test taking longer than
485 10 seconds, as it's probably looping.
486 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
487 Also, the new yacc.c generates two fewer diagnostics for an
488 existing test.
489
490 2003-05-24 Paul Eggert <eggert@twinsun.com>
491
492 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
493 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
494 This fixes a problem reported by John Bowman when the Compaq/HP
495 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
496 -ansi -Wall -gall).
497 * data/yacc.c (union yyalloc): Likewise.
498 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
499
500 Switch from 'int' to 'bool' where that makes sense.
501
502 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
503 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
504 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
505 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
506 Return or accept bool, not int. All callers changed.
507 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
508 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
509 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
510 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
511 bitset_or_and_cmp_): Likewise.
512 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
513 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
514 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
515 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
516 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
517 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
518 bitset_stats_or_and_cmp): Likewise.
519 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
520 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
521 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
522 ebitset_xor_cmp): Likewise.
523 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
524 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
525 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
526 lbitset_xor_cmp): Likewise.
527 * lib/bbitset.h: Include <stdbool.h>.
528 (struct bitset_vtable): The following members now return bool, not
529 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
530 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
531 or_and_cmp).
532 * src/conflicts.c (count_rr_conflicts): Likewise.
533 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
534 All uses changed.
535 * lib/ebitset.c (ebitset_obstack_init): Likewise.
536 * lib/lbitset.c (lbitset_obstack_init): Likewise.
537 * src/getargs.c (debug_flag, defines_flag, locations_flag,
538 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
539 graph_flag): Likewise.
540 * src/getargs.h (debug_flag, defines_flag, locations_flag,
541 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
542 graph_flag): Likewise.
543 * src/output.c (error_verbose): Likewise.
544 * src/output.h (error_verbose): Likewise.
545 * src/reader.c (start_flag, typed): Likewise.
546 * src/reader.h (typed): Likewise.
547 * src/getargs.c (LOCATIONS_OPTION): New constant.
548 (long_options, getargs): Use it.
549 * src/lalr.c (build_relations): Use bool, not int.
550 * src/nullable.c (nullable_compute): Likewise.
551 * src/print.c (print_reductions): Likewise.
552 * src/tables.c (action_row, pack_vector): Likewise.
553 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
554 * src/output.c (prepare): Use it.
555 * src/output.c (token_definitions_output,
556 symbol_destructors_output, symbol_destructors_output): Use string,
557 not boolean integer, to keep track of whether to output separator.
558 * src/print_graph.c (print_core): Likewise.
559 * src/state.c (state_rule_lookaheads_print): Likewise.
560
561 * config/install-sh: Sync from automake 1.7.5.
562
563 2003-05-14 Paul Eggert <eggert@twinsun.com>
564
565 * src/parse-gram.y (rules_or_grammar_declaration): Require a
566 semicolon after a grammar declaration, in the interest of possible
567 future changes to the Bison input language.
568 Do not allow a stray semicolon at the start of the grammar.
569 (rhses.1): Allow one or more semicolons after any rule, including
570 just before "|" as required by POSIX.
571 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
572 grammar.
573
574 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
575
576 %parse-param support for lalr1.cc.
577
578 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
579 b4_cc_constructor_calls, b4_cc_constructor_call,
580 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
581 definitions.
582 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
583 parse-param arguments.
584 (yy::b4_parser_class_name): Declare instance variables to
585 hold parse-param arguments.
586 * tests/calc.at: s/value/semantic_value/ because value clashes
587 with a member of yy::b4_parser_class_name. Adjust C++ code
588 to handle %parse-param. Enable %parse-param test in C++.
589
590 2003-05-12 Paul Eggert <eggert@twinsun.com>
591
592 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
593 English a bit. Fix fclose typo. Change "const char" to "char
594 const", and use ANSI C rather than K&R for "main". Suggest
595 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
596 and suggest yy_switch_to_buffer.
597
598 2003-05-05 Paul Eggert <eggert@twinsun.com>
599
600 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
601 C89. This avoids a diagnostic on compilers that define __STDC__
602 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
603 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
604
605 2003-05-03 Paul Eggert <eggert@twinsun.com>
606
607 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
608 Do not overrun array bounds.
609 This should fix a bug reported today by Olatunji Oluwabukunmi in
610 <http://mail.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
611
612 2003-04-29 Akim Demaille <akim@epita.fr>
613
614 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
615 * src/getargs.c, src/getargs.h: here, as bool, not int.
616 (nondeterministic_parser): New.
617 * src/parse-gram.y, src/scan-gram.l: Support
618 %nondeterministic-parser.
619 * src/output.c (prepare): Use nondeterministic_parser instead
620 of glr_parser where appropriate.
621 * src/tables.c (conflict_row, action_row, save_row)
622 (token_actions, token_actions, pack_vector): Ditto.
623
624 2003-04-29 Akim Demaille <akim@epita.fr>
625
626 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
627
628 2003-04-29 Akim Demaille <akim@epita.fr>
629
630 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
631 with %pure-parser and %locations to exercise the patch from Yakov
632 Markovitch below.
633
634 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
635
636 * data/yacc.c: (b4_lex_param): Corrected for the case where
637 %lex-param is provided and %pure-parser isn't.
638
639 2003-04-27 Paul Eggert <eggert@twinsun.com>
640
641 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
642 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
643 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
644 if it is not defined.
645 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
646
647 2003-04-26 Paul Eggert <eggert@twinsun.com>
648
649 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
650 Declare to be of type suitable for the ninf value itself, not of
651 type suitable for the corresponding table, since the latter might
652 be unsigned but the ninf value might be negative. This fixes a
653 bug reported by Alexandre Duret-Lutz in
654 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
655
656 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
657 invokes it. We shouldn't invoke it twice because it will attempt
658 to put error.o in the archive twice. This fixes a glitch reported
659 by Martin Mokrejs in
660 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
661
662 2003-04-21 Paul Eggert <eggert@twinsun.com>
663
664 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
665 to gnulib.
666
667 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
668
669 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
670 Fix obvious typo that results in uncompilable GLR parsers
671 when both %pure-parser and %locations are used. (trivial change)
672
673 2003-04-17 Paul Eggert <eggert@twinsun.com>
674
675 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
676 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
677 Do not insert the expected token via unput, as this runs afoul
678 of a POSIX-compatibility bug in flex 2.5.31.
679 All uses changed to BEGIN the parent state,
680 since we no longer insert the expected token via unput.
681 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
682 that is no longer emitted after the above change.
683
684 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
685 the first one. This change is from Paul Hilfinger, and it fixes
686 regression reported by Werner Lemberg in
687 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
688
689 (resolve_sr_conflict): Don't invoke state_errs_set
690 unless one or more tokens have been explicitly made errors.
691 Otherwise, the above change causes Bison to abort.
692
693 * tests/existing.at (GNU pic Grammar): New test case, taken from
694 Lemberg's email.
695
696 2003-03-31 Akim Demaille <akim@epita.fr>
697
698 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
699
700 2003-03-31 Akim Demaille <akim@epita.fr>
701
702 * src/output.c (prepare_symbols): Avoid trailing spaces in the
703 output.
704
705 2003-03-31 Akim Demaille <akim@epita.fr>
706
707 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
708 From Paul Hilfinger.
709
710 2003-03-29 Akim Demaille <akim@epita.fr>
711
712 * m4/error.m4: Do not put under dynamic conditions some code which
713 expansion is under static control.
714
715 2003-03-29 Akim Demaille <akim@epita.fr>
716
717 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
718
719 2003-03-29 Akim Demaille <akim@epita.fr>
720
721 * doc/bison.texinfo (Strings are Destroyed): New.
722
723 2003-03-13 Paul Eggert <eggert@twinsun.com>
724
725 * .cvsignore: Add configure.lineno.
726 * src/.cvsignore: Add yacc.
727 * tests/.cvsignore: Add testsuite.log.
728 * doc/fdl.texi: Sync with latest FSF version.
729
730 2003-03-12 Paul Eggert <eggert@twinsun.com>
731
732 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
733 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
734 cursor, instead of leaving it undefined. This fixes a bug
735 reported by Tim Van Holder in
736 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
737 * tests/input.at (Torturing the Scanner): Test the scanner on
738 an empty input file, which was Tim Van Holder's test case.
739
740 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
741 <sys/resource.h> can be included, include sys/time.h and
742 sys/times.h first, if available. This works around the SunOS
743 4.1.4 porting bug reported by Bruce Becker in
744 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
745
746 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
747 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
748 AC_HEADER_SYS_WAIT.
749
750 Merge changes from gnulib. This was prompted because the CVS
751 snapshot didn't build on Solaris 7 due to strnlen problems.
752
753 These changes need to be merged back into gnulib:
754 * lib/hash.c: Include <stdbool.h> unconditionally.
755 * m4/onceonly.m4 (m4_quote): New macro.
756 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
757 Quote AC_FOREACH variable-expansions properly.
758 The 2003-01-03 obstack.h change also needs merging.
759 {end of changes requiring merging}
760
761 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
762 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
763 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
764 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
765 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
766 New files, imported from gnulib.
767 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
768 above.
769
770 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
771 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
772 gnulib sources.
773
774 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
775 Add.
776 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
777 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
778 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
779 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
780 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
781 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
782 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
783 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
784 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
785 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
786 (jm_PREREQ_ARGMATCH): Remove.
787 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
788 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
789
790 * src/system.h: Include <stdbool.h> unconditionally.
791
792 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
793 assuming at least C89 in the bitset code for some time now.
794
795 2003-03-03 Akim Demaille <akim@epita.fr>
796
797 * ro.po: New.
798
799 2003-03-02 Akim Demaille <akim@epita.fr>
800
801 * doc/bison.texinfo (Table of Symbols): Reactivate the
802 documentation for %lex-param, and %parse-param.
803
804 2003-03-02 Akim Demaille <akim@epita.fr>
805
806 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
807 generate verbose error messages.
808 Use the number of tokens as an upper bound in yytname, as it
809 cannot be a non terminal.
810
811 2003-03-02 Akim Demaille <akim@epita.fr>
812
813 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
814 message.
815
816 2003-03-02 Akim Demaille <akim@epita.fr>
817
818 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
819 Use them to exercise yycheck overrun.
820 Based on Andrew Suffield's grammar.
821
822 2003-03-02 Akim Demaille <akim@epita.fr>
823
824 Create tests/local.at for Bison generic testing macros.
825
826 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
827 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
828 This new file.
829 * tests/calc.at (AT_CHECK_CALC): Adjust.
830 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
831 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
832 * tests/local.at: here.
833 (AT_COMPILE_CXX): Tags the tests using it as c++.
834 Ignore the test if CXX is not functional.
835
836 2003-03-01 Paul Eggert <eggert@twinsun.com>
837
838 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
839 not loc->end, since loc->end might contain garbage and this leads
840 to undefined behavior on some platforms.
841 (id_loc, token_start): Use (IF_LINTed) initial values that do not
842 depend on *loc, so that the reader doesn't give the the false
843 impression that *loc is initialized.
844 (<INITIAL>"%%"): Do not bother setting code_start, since its value
845 does not survive the return.
846
847 2003-03-01 Akim Demaille <akim@epita.fr>
848
849 * src/scan-gram.l (code_start): Always initialize it when entering
850 into yylex, as SC_EPILOGUE is activated *before* the corresponding
851 yylex invocation. An alternative would be making it static, but
852 then it starts with the second %%'s beginning, instead of its end.
853
854 2003-02-28 Paul Eggert <eggert@twinsun.com>
855
856 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
857 around a UnixWare 7.1.1 porting bug reported by John Hughes in
858 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
859
860 2003-02-26 Paul Eggert <eggert@twinsun.com>
861
862 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
863 Remove Sequent/Pyramid discussion (nobody uses them any more).
864 Merge VMS and MS-DOS discussion; these ports may well be dead
865 but let's keep mentioning them for now. Put <> around email
866 addresses. Add copyright notice.
867
868 2003-02-24 Paul Eggert <eggert@twinsun.com>
869
870 * data/glr.c (yy_reduce_print): yylineno -> yylno,
871 to avoid collision with flex use of yylineno.
872 Problem reported by Bruce Lilly in
873 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
874 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
875 * data/yacc.c (yy_reduce_print): Likewise.
876
877 * config/depcomp: Sync with Automake 1.7.3.
878
879 2003-02-21 Akim Demaille <akim@epita.fr>
880
881 * data/lalr1.cc: Use temporary variables instead of casts to
882 change integer types.
883 Suggested by Paul Eggert.
884
885 2003-02-21 Akim Demaille <akim@epita.fr>
886
887 * doc/bison.texinfo: Use "location" consistently to refer to @n,
888 to avoid confusions with lalr1.cc's notion of Position.
889 Suggested by Paul Eggert.
890
891 2003-02-20 Akim Demaille <akim@epita.fr>
892
893 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
894 before initial_columns.
895 (location.hh): Use consistent variable names when defining the
896 operator<<.
897 Use "last" so that we subtract from Positions, not from unsigned.
898
899 2003-02-20 Akim Demaille <akim@epita.fr>
900
901 * data/lalr1.cc (position.hh): New subfile, including the extended
902 and Doxygen'ed documentation of class Position.
903 (location.hh): Use it.
904 Document a` la Doxygen.
905 With the help of Benoit Perrot.
906
907 2003-02-20 Akim Demaille <akim@epita.fr>
908
909 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
910 AT_YACC_IF.
911 Redefine AT_YYERROR_SEES_LOC_IF using it.
912 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
913 not defined.
914 Don't use the location in yy::Parser::error_ and
915 yy::Parser::print_ when not %locations.
916 Activate more lalr1.cc tests.
917
918 2003-02-19 Akim Demaille <akim@epita.fr>
919
920 * data/lalr1.cc: When displaying a line number, be sure to make it
921 an int.
922
923 2003-02-19 Akim Demaille <akim@epita.fr>
924
925 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
926 Remove, useless.
927 (YYABORT, YYACCEPT, YYERROR): New.
928 * tests/calc.at: Renable the lalr1.cc test.
929
930 2003-02-19 Akim Demaille <akim@epita.fr>
931
932 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
933 error recovery, mixing with/without pops and discarding of the
934 lookahead.
935 Exercise YYERROR.
936 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
937
938 2003-02-17 Paul Eggert <eggert@twinsun.com>
939
940 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
941 * tests/testsuite.at (AT_COMPILE): Use them.
942 This fixes the testsuite problem reported by Robert Lentz in
943 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
944
945 2003-02-12 Paul Eggert <eggert@twinsun.com>
946
947 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
948 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
949 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
950 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
951 Check for malloc failure, for consistency with yacc.c.
952 (yytname_size): Remove, for consistency with yacc.c.
953
954 The bug still remains in data/lalr1.cc, as I didn't have time
955 to fix it there.
956
957 2003-02-06 Akim Demaille <akim@epita.fr>
958
959 * configure.ac (GXX): Rename as...
960 (CXX): this, to keep the original Autoconf semantics.
961 Require 2.57.
962 * data/lalr1.cc: Fix b4_copyright invocations.
963 If YYDEBUG is not defined, don't depend upon name_ being defined.
964 (location.hh): Include string and iostream.
965 (Position::filename): New member.
966 (Position::Position ()): New.
967 (operator<< (Position)): New.
968 (operator- (Position, int)): New.
969 (Location::first, Location::last): Rename as...
970 (Location::begin, Location::end): these, to mock the conventional
971 iterator names.
972 (operator<< (Location)): New.
973 * tests/atlocal.in (CXX): New.
974 * tests/testsuite.at (AT_COMPILE_CXX): New.
975 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
976 locations in a more synthetic way.
977 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
978 lalr1.cc is used.
979 Adjust the C locations to match those from Emacs: first column is
980 column 0.
981 Change all the expected results.
982 Conform to the GCS: simplify the locations when applicable.
983 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
984 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
985 these CPP macros with the m4 macros new defined by...
986 (AT_CHECK_PUSHDEFS): this, i.e.:
987 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
988 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
989 New macros.
990 (AT_CHECK_POPDEFS): Undefine them.
991 (AT_CHECK_CALC_LALR1_CC): New.
992 Use it for the first lalr1.cc test.
993
994 2003-02-04 Akim Demaille <akim@epita.fr>
995
996 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
997 Location as is defined.
998
999 2003-02-04 Akim Demaille <akim@epita.fr>
1000
1001 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
1002 name_ being defined.
1003
1004 2003-02-03 Paul Eggert <eggert@twinsun.com>
1005
1006 * src/gram.h (start_symbol): Remove unused decl.
1007
1008 Use more-consistent naming conventions for local vars.
1009
1010 * src/derives.c (derives_compute): Change type of local var from
1011 int to rule_number.
1012 * src/gram.c (grammar_rules_partial_print): Likewise.
1013 * src/print.c (print_core): Likewise.
1014 * src/reduce.c (reduce_grammar_tables): Likewise.
1015
1016 * src/gram.c (grammar_dump): Change name of item_number *
1017 local var from r to rp.
1018 * src/nullable.c (nullable_compute): Likewise.
1019
1020 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
1021
1022 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
1023 for symbol or symbol_number var.
1024 * src/reader.c (grammar_start_symbol_set): Likewise.
1025 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
1026 Likewise.
1027 * src/state.c (transitions_to): Likewise.
1028 * src/state.h: Likewise.
1029 * src/tables.c (symbol_number_to_vector_number): Likewise.
1030
1031 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
1032 char * var.
1033
1034 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
1035 var.
1036
1037 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
1038 var.
1039
1040 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
1041 Use str, not s, for char * var. Use ch, not c, for character var.
1042 Use size for size var.
1043
1044 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
1045 char * var.
1046 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
1047 uniqstr var.
1048 * src/uniqstr.h: Likewise.
1049
1050 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
1051 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
1052 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
1053 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
1054 param to have same name as that of enum, so that we don't use
1055 "s" to stand for a non-state.
1056
1057 2003-02-02 Akim Demaille <akim@epita.fr>
1058
1059 * src/scan-skel.l: Scan more than one inert character per yylex
1060 invocation.
1061
1062 2003-02-01 Paul Eggert <eggert@twinsun.com>
1063
1064 Version 1.875a.
1065
1066 * po/LINGUAS: Add ms.
1067
1068 2003-01-30 Akim Demaille <akim@epita.fr>
1069
1070 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
1071
1072 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1073
1074 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
1075 of $1.
1076
1077 Changes in response to error report by S. Eken: GLR mode does not
1078 handle negative $ indices or $ indices in embedded rules correctly.
1079 See <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
1080
1081 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
1082 (b4_rhs_location): Ditto.
1083 (yyfill): New function to copy from stack tree into array
1084 incrementally.
1085 (yyuserAction): Modify to allow incremental move of semantic values
1086 to rhs array when in GLR mode.
1087 Define YYFILL to use in user-defined actions to fill semantic array
1088 as needed.
1089 Remove dummy use of yystack, as there is now a guaranteed use.
1090 (yydoAction): Modify to allow incremental move of semantic values
1091 to rhs array when in GLR mode.
1092 (yyresolveAction): Ditto.
1093 (yyglrShiftDefer): Update comment.
1094 (yyresolveStates): Use X == NULL for pointers, not !X.
1095 (yyglrReduce): Ditto.
1096 (yydoAction): Ditto
1097
1098 * tests/glr-regr1.at: Rename to ...
1099 * tests/glr-regression.at: Add new regression test for the problems
1100 described above (adapted from S. Eken).
1101 Update copyright notice.
1102 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
1103 * tests/Makefile.am: Ditto.
1104
1105 2003-01-28 Paul Eggert <eggert@twinsun.com>
1106
1107 * data/lalr1.cc: Do not use @output_header_name@ unless
1108 b4_defines_flag is set. This fixes two bugs reported by
1109 Tim Van Holder in
1110 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
1111 and <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
1112
1113 2003-01-21 Paul Eggert <eggert@twinsun.com>
1114
1115 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
1116 we don't need to worry about yyerrlab1 being reported as an
1117 "unused label" by non-GCC C compilers. The downside is that if
1118 locations are used then a couple of statements are duplicated each
1119 time YYERROR is invoked, but the upside is that the warnings
1120 should vanish.
1121 (yyerrlab1): Move code to YERROR.
1122 (yyerrlab2): Remove. Change uses back to yyerrlab1.
1123 This reverts some of the 2002-12-27 change.
1124
1125 2003-01-17 Paul Eggert <eggert@twinsun.com>
1126
1127 * src/output.c (symbol_printers_output): Fix typo that led
1128 to core dump. Problem reported by Antonio Rus in
1129 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
1130
1131 2003-01-13 Akim Demaille <akim@epita.fr>,
1132 Quoc Peyrot <chojin@lrde.epita.fr>,
1133 Robert Anisko <anisko_r@lrde.epita.fr>
1134
1135 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
1136 when the stacks contain one element, as the loop would otherwise
1137 free the last state, and then use the top state (the one we just
1138 popped). This means that the initial elements will not be freed
1139 explicitly, as is the case in yacc.c; it is not a problem, as
1140 these elements have fake values.
1141
1142 2003-01-11 Paul Eggert <eggert@twinsun.com>
1143
1144 * NEWS: %expect-violations are now just warnings, reverting
1145 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
1146 bootstrapping problem reported by Matthias Klose; see
1147 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
1148 * src/conflicts.c (conflicts_print): Likewise.
1149 * tests/conflicts.at (%expect not enough, %expect too much,
1150 %expect with reduce conflicts): Likewise.
1151 * doc/bison.texinfo (Expect Decl): Document this. Also mention
1152 that the warning is enabled if the number of conflicts changes
1153 (not necessarily increases).
1154
1155 * src/getargs.c (version): Update copyright year.
1156
1157 2003-01-09 Akim Demaille <akim@epita.fr>
1158
1159 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
1160
1161 2003-01-08 Paul Eggert <eggert@twinsun.com>
1162
1163 * Makefile.maint (WGETFLAGS):
1164 New macro, containing "-C off" to disable proxy caches.
1165 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
1166 (rel-check): Use $(WGET) instead of wget.
1167
1168 2003-01-06 Paul Eggert <eggert@twinsun.com>
1169
1170 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
1171 the GLR paper of Scott, Johnstone and Hussain.
1172
1173 2003-01-04 Paul Eggert <eggert@twinsun.com>
1174
1175 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
1176 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
1177 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
1178 (EXTRA_LIBRARIES): New var, for liby.a.
1179 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
1180 (EXTRA_SCRIPTS): New var, for yacc.
1181
1182 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
1183 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
1184 Problem reported by Nelson H. F. Beebe.
1185
1186 2003-01-03 Paul Eggert <eggert@twinsun.com>
1187
1188 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
1189 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1190 when compiling Bison 1.875's `bitset bset = obstack_alloc
1191 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
1192
1193 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
1194 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
1195 grow to a huge size with typical invocation.
1196
1197 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
1198 Use the pattern recommended by Autoconf 2.57, except also protect
1199 against double-definition.
1200 * src/system.h: Likewise.
1201 Portability issues reported by Nelson H. F. Beebe.
1202
1203 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
1204 All uses changed. Provide a definition in both C and C++.
1205 (yytrue, yyfalse): Define even if defined (__cplusplus).
1206
1207 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
1208 Reported by Nelson H. F. Beebe.
1209
1210 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
1211
1212 2003-01-02 Paul Eggert <eggert@twinsun.com>
1213
1214 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
1215 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
1216 Bug reported by Nelson H. F. Beebe.
1217
1218 2003-01-01 Paul Eggert <eggert@twinsun.com>
1219
1220 * Version 1.875.
1221
1222 2002-12-30 Paul Eggert <eggert@twinsun.com>
1223
1224 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
1225 Moved here from...
1226 (<INITIAL>","): Here. This causes stray "," to be treated
1227 more uniformly.
1228
1229 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
1230 last brace in braced code when not in Yacc mode, for compatibility
1231 with Bison 1.35. This resurrects the 2001-12-15 patch to
1232 src/reader.c.
1233
1234 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
1235 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
1236
1237 2002-12-28 Paul Eggert <eggert@twinsun.com>
1238
1239 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
1240 that of SYM's type. This fixes Debian bug 168069, reported by
1241 Thomas Olsson.
1242
1243 2002-12-28 Paul Eggert <eggert@twinsun.com>
1244
1245 Version 1.75f.
1246
1247 Switch back to the Yacc style of conflict reports, undoing some
1248 of the 2002-07-30 change.
1249 * doc/bison.texinfo (Understanding): Use Yacc style for
1250 conflict reports. Also, use new way of locating rules.
1251 * src/conflicts.c (conflict_report):
1252 Renamed from conflict_report_yacc, removing the old
1253 'conflict_report'. Translate the entire conflict report at once,
1254 so that we don't assume that "," has the same interpretation in
1255 all languages.
1256 (conflicts_output): Use Yacc-style conflict report for each state,
1257 instead of our more-complicated style.
1258 (conflicts_print): Use Yacc-style conflict report, except print
1259 the input file name when not emulating Yacc.
1260 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
1261 Conflicted Reduction, %expect not enough, %expect too much,
1262 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
1263 * tests/existing.at (GNU Cim Grammar): Likewise.
1264 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
1265
1266 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
1267 fatal): Don't invoke fflush; it's not needed and it might even be
1268 harmful for stdout, as stdout might not be open.
1269 * src/reduce.c (reduce_print): Likewise.
1270
1271 2002-12-27 Paul Eggert <eggert@twinsun.com>
1272
1273 Fix a bug where error locations were not being recorded correctly.
1274 This problem was originally reported by Paul Hilfinger in
1275 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
1276
1277 * data/yacc.c (yyparse): New local var yylerrsp, to record the
1278 top of the location stack's error locations.
1279 (yyerrlab): Set it. When discarding a token, push its location
1280 onto yylerrsp so that we don't lose track of the error's end.
1281 (yyerrlab1): Now is only the target of YYERROR, so that we can
1282 properly record the location of the action that failed. For GCC
1283 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
1284 GCC warning about yyerrlab1 being unused if YYERROR is unused.
1285 (yyerrlab2): New label, which yyerrlab now falls through to.
1286 Compute the error's location by applying YYLLOC_DEFAULT to
1287 the locations of all the symbols that went into the error.
1288 * doc/bison.texinfo (Location Default Action): Mention that
1289 YYLLOC_DEFAULT is also invoked for syntax errors.
1290 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1291 Error locations include the locations of all the tokens that were
1292 discarded, not just the last token.
1293
1294 2002-12-26 Paul Eggert <eggert@twinsun.com>
1295
1296 * src/files.c: Include quote.h.
1297 (compute_output_file_names): Warn if we detect conflicting
1298 outputs to the same file. This should catch the misunderstanding
1299 exemplified by Debian Bug 165349, reported by Bruce Stephens..
1300
1301 * src/conflicts.c (conflicts_print): If the user specifies
1302 "%expect N", report an error if there are any reduce/reduce
1303 conflicts. This is what the manual says should happen.
1304 This fixes Debian bug 130890, reported by Anthony DeRobertis.
1305 * tests/conflicts.at (%expect with reduce conflicts): New test.
1306
1307 Don't use m4_include on relative file names, as it doesn't work as
1308 desired if there happens to be a file with that name under ".".
1309
1310 * m4sugar/version.m4: Remove; it was included but it wasn't used.
1311 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
1312 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
1313 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
1314 * src/output.c (output_skeleton): Use full path names when
1315 specifying a file to include; don't rely on include path, as
1316 it's unreliable when the working file contains a file with
1317 that name.
1318
1319 2002-12-25 Paul Eggert <eggert@twinsun.com>
1320
1321 Remove obsolete references to bison.simple and bison.hairy.
1322 Problem mentioned by Aubin Mahe in
1323 <http://mail.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
1324 * data/glr.c: Comment fix.
1325 * doc/bison.1: Remove references. Also, mention "yacc".
1326
1327 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
1328 with -g option.
1329
1330 * src/parse-gram.y (declaration): Use enum "report_states" rather
1331 than its numeric value 1.
1332
1333 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
1334 opening a new one. This fixes Debian bug 165349, reported by
1335 Bruce Stephens.
1336
1337 2002-12-24 Paul Eggert <eggert@twinsun.com>
1338
1339 Version 1.75e.
1340
1341 * Makefile.maint (cvs-update): Don't assume that the shell
1342 supports $(...), as Solaris sh doesn't.
1343
1344 * src/parse-gram.y (lloc_default): Remove test for empty
1345 nonterminals at the end, since it didn't change the result.
1346
1347 2002-12-24 Paul Eggert <eggert@twinsun.com>
1348
1349 If the user does not define YYSTYPE as a macro, Bison now declares it
1350 using typedef instead of defining it as a macro. POSIX requires this.
1351 For consistency, YYLTYPE is also declared instead of defined.
1352
1353 %union directives can now have a tag before the `{', e.g., the
1354 directive `%union foo {...}' now generates the C code
1355 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
1356 The default union tag is `YYSTYPE', for compatibility with Solaris 9
1357 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
1358 instead of `yyltype'.
1359
1360 `yystype' and `yyltype' are now obsolescent macros instead of being
1361 typedefs or tags; they are no longer documented and will be
1362 withdrawn in a future release.
1363
1364 * data/glr.c (b4_location_type): Remove.
1365 (YYSTYPE): Renamed from yystype.
1366 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
1367 (struct YYLTYPE): Renamed from struct yyltype.
1368 (YYLTYPE): Renamed from yyltype.
1369 (yyltype, yystype): New (and obsolescent) macros,
1370 for backward compatibility.
1371 * data/yacc.c: Likewise.
1372
1373 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
1374 does not specify a union tag. This is for compatibility with
1375 Solaris 9 yacc.
1376
1377 * src/parse-gram.y (add_param): 2nd arg is now char * not char
1378 const *, since it is now modified by stripping surrounding { }.
1379 (current_braced_code): Remove.
1380 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
1381 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
1382 trailing " {...}". Now of type <chars>.
1383 (grammar_declaration): Adjust to bundled tokens.
1384 (code_content): Remove; stripping is now done by add_param.
1385 (print_token_value): Print contents of bundled tokens.
1386 (token_name): New function.
1387
1388 * src/reader.h (braced_code, current_braced_code): Remove.
1389 (token_name): New decl.
1390
1391 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
1392 token_type, not braced_code code_kind. All uses changed.
1393 (SC_PRE_CODE): New state, for scanning after a keyword that
1394 has (or usually has) an immediately-following braced code.
1395 (token_type): New local var, to keep track of which token type
1396 to return when scanning braced code.
1397 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
1398 <INITIAL>"%parse-param", <INITIAL>"%printer",
1399 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
1400 instead of returning a token type immediately.
1401 (<INITIAL>"{"): Set token type.
1402 (<SC_BRACED_CODE>"}"): Use it.
1403 (handle_action_dollar, handle_action_at): Now returns bool
1404 indicating success. Fail if ! current_rule; this prevents a core dump.
1405 (handle_symbol_code_dollar, handle_symbol_code_at):
1406 Remove; merge body into caller.
1407 (handle_dollar, handle_at): Complain in invalid contexts.
1408
1409 * NEWS, doc/bison.texinfo: Document the above.
1410 * NEWS: Fix years and program names in copyright notice.
1411
1412 2002-12-17 Paul Eggert <eggert@twinsun.com>
1413
1414 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
1415 Reporting, Table of Symbols): Omit mentions of %lex-param and
1416 %parse-param from the documentation for now.
1417
1418 2002-12-15 Paul Eggert <eggert@twinsun.com>
1419
1420 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
1421 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
1422 lookahead symbol, and which sets yychar in parser actions) and it
1423 disagreed with the Bison documentation. Bug
1424 reported by Andrew Walrond.
1425
1426 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
1427 as the caller now does that.
1428 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
1429 (YYEMPTY): Parenthesize right hand side, since others use it.
1430 (yyparse): Don't assume that our generated code is the only code
1431 that sets yychar.
1432
1433 2002-12-13 Paul Eggert <eggert@twinsun.com>
1434
1435 Version 1.75d.
1436
1437 POSIX requires a "yacc" command.
1438 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
1439 (MOSTLYCLEANFILES): Add yacc.
1440 (yacc): New rule.
1441 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
1442 as an alias for bison y.
1443
1444 * po/LINGUAS: Add da.
1445
1446 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
1447 problem with latest <getopt.h>.
1448 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
1449
1450 * doc/fdl.texi: Upgrade to 1.2.
1451 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
1452 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
1453 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
1454 gnulib.
1455 * config/install-sh: Sync with autotools.
1456
1457 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
1458 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
1459 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
1460 locations are requested.
1461 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
1462 locations are requested.
1463
1464 2002-12-12 Paul Eggert <eggert@twinsun.com>
1465
1466 Remove unportable casts and storage allocation tricks.
1467 While we're at it, remove almost all casts, since they
1468 usually aren't needed and are a sign of trouble.
1469
1470 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
1471
1472 * src/derives.c (derives_compute): Do not subtract NTOKENS from
1473 the pointer DSET returned by malloc; this isn't portable.
1474 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
1475 Similarly for DERIVES.
1476 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
1477 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
1478 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
1479
1480 * src/derives.c (derives_compute): Do not bother invoking
1481 int_of_rule_number, since rule numbers are integers.
1482
1483 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
1484 rather than XMALLOC (char, N).
1485
1486 * src/files.c (filename_split): Rewrite to avoid cast.
1487
1488 * src/gram.h (symbol_number_as_item_number,
1489 item_number_as_symbol_number, rule_number_as_item_number,
1490 item_number_as_rule_number):
1491 Now inline functions rather than macros, to avoid casts.
1492 * src/state.h (state_number_as_int): Likewise.
1493 * src/tables.c (state_number_to_vector_number,
1494 symbol_number_to_vector_number): Likewise.
1495
1496 * src/gram.h (int_of_rule_number): Remove; no longer used.
1497
1498 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
1499 since the resulting storage is always stored into.
1500
1501 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
1502 where it's needed.
1503
1504 * src/muscle_tab.c (muscle_m4_output):
1505 Now inline. Return bool, not int.
1506 * src/state.c (state_compare): Likewise.
1507 * src/symtab.c (symbol_check_defined,
1508 symbol_check_alias_consistency, symbol_pack, symbol_translation,
1509 hash_compare_symbol, hash_symbol):
1510 Likewise.
1511 * src/uniqstr.c (uniqstr_print): Likewise.
1512 * src/muscle_tab.c (muscle_m4_output_processor):
1513 New function, to avoid casts.
1514 * src/state.c (state_comparator, stage_hasher): Likewise.
1515 * src/symtab.c (symbol_check_defined_processor,
1516 symbol_check_alias_consistency_processor, symbol_pack_processor,
1517 symbol_translation_processor, hash_symbol_comparator,
1518 hash_symbol_hasher): Likewise.
1519 * src/uniqstr.c (uniqstr_print_processor): Likewise.
1520 * src/muscle_tab.c (muscles_m4_output):
1521 Use new functions instead of casting old functions unportably.
1522 * src/state.c (state_hash_new): Likewise.
1523 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
1524 symbols_token_translations_init):
1525 Likewise.
1526 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
1527
1528 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
1529 var instead of casting to long, to avoid casts.
1530 (prepare_states): Use MALLOC rather than alloca, so that we don't
1531 have to worry about alloca.
1532 * src/state.c (state_hash_lookup): Likewise.
1533
1534 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
1535 local var instead of casting to unsigned char, to avoid casts.
1536
1537 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
1538 STATE_ALLOC): Remove.
1539 (transitions_new, errs_new, reductions_new, state_new): Use malloc
1540 rather than calloc, and use offsetof to avoid allocating slightly
1541 too much storage.
1542 (state_new): Initialize all members.
1543
1544 * src/state.c (state_hash): Use unsigned accumulator, not signed.
1545
1546 * src/symtab.c (symbol_free): Remove; unused.
1547 (symbol_get): Remove cast in lhs of assignment.
1548 (symbols_do): Now static. Accept generic arguments, not
1549 hashing-related ones.
1550
1551 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
1552 (symbol_processor): Remove.
1553 (symbols_do): Remove decl; now static.
1554
1555 * src/system.h (alloca): Remove; decl no longer needed.
1556 (<stddef.h>): Include, for offsetof.
1557 (<inttypes.>, <stdint.h>): Include if available.
1558 (uintptr_t): New type, if system lacks it.
1559 (CALLOC, MALLOC, REALLOC): New macros.
1560 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
1561 new macros.
1562
1563 * src/tables.c (table_size): Now int, to pacify GCC.
1564 (table_grow, table_ninf_remap): Use signed table size.
1565 (save_row): Don't bother initializing locals when not needed.
1566 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
1567 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
1568
1569 * src/vcg.h: Correct misspellings.
1570
1571 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
1572
1573
1574 * src/getargs.c (getargs): Don't assume EOF == -1.
1575
1576 2002-12-09 Paul Eggert <eggert@twinsun.com>
1577
1578 Change identifier spellings to avoid collisions with names
1579 that are reserved by POSIX.
1580
1581 Don't use names ending in _t, since POSIX reserves them.
1582 For consistency, remove _e and _s endings -- they're weren't
1583 needed to remove ambiguity. All uses changed.
1584 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
1585 turn was just renamed from struniq_t.
1586 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
1587 which in turn was just renamed from struniq_processor_t.
1588 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
1589 in turn was renamed from hash_compare_struniq_t.
1590 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
1591 (state_list): Renamed from state_list_t.
1592 * src/assoc.h (assoc): Renamed from assoc_t.
1593 * src/conflicts.c (enum conflict_resolution): Renamed from
1594 enum conflict_resolution_e.
1595 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
1596 (rule_list): Renamed from rule_list_t.
1597 * src/getargs.h (enum trace): Renamed from enum trace_e.
1598 (enum report): Renamed from enum report_e.
1599 * src/gram.h (item_number): Renamed from item_number_t.
1600 (rule_number): Renamed from rule_number_t.
1601 (struct rule_s): Remove the "rule_s" part; not used.
1602 (rule): Renamed from rule_t.
1603 (rule_filter): Renamed from rule_filter_t.
1604 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
1605 (goto_list): Renamed from goto_list_t.
1606 * src/lalr.h (goto_number): Renamed from goto_number_t.
1607 * src/location.h (location): Renamed from location_t.
1608 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
1609 and moved here from:
1610 * src/muscle_tab.h (muscle_entry_t): here.
1611 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
1612 (rule_list): Renamed from rule_list_t.
1613 * src/print_graph.c (static_graph): Renamed from graph.
1614 * src/reader.h (braced_code): Renamed from braced_code_t.
1615 Remove brace_code_e tag.
1616 * src/relation.h (relation_node): Renamed from relation_node_t.
1617 (relation_nodes): Renamed from relation_nodes_t.
1618 (relation): Renamed from relation_t.
1619 * src/state.h (state_number): Renamed from state_number_t.
1620 (struct state): Renamed from struct state_s.
1621 (state): Renamed from state_t.
1622 (transitions): Renamed from transitions_t. Unused (and
1623 misspelled) transtion_s tag removed.
1624 (errs): Renamed from errs_t. Unused errs_s tag removed.
1625 (reductions): Renamed from reductions_t. Unused tag
1626 reductions_s removed.
1627 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
1628 (struct symbol_list): Renamed from struct symbol_list_s.
1629 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
1630 (struct symbol): Renamed from struct symbol_s.
1631 (symbol): Renamed from symbol_t.
1632 * src/tables.c (vector_number): Renamed from vector_number_t.
1633 (action_number): Renamed from action_t.
1634 * src/tables.h (base_number): Renamed from base_t.
1635 * src/vcg.h (enum color): Renamed from enum color_e.
1636 (enum textmode): Renamed from enum textmode_e.
1637 (enum shape): Renamed from enum shape_e.
1638 (struct colorentry): Renamed from struct colorentry_s.
1639 (struct classname): Renamed from struct classname_s.
1640 (struct infoname): Renamed from struct infoname_s.
1641 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
1642 (enum decision): Renamed from enum decision_e.
1643 (enum orientation): Renamed from enum orientation_e.
1644 (enum alignment): Renamed from enum alignment_e.
1645 (enum arrow_mode): Renamed from enum arrow_mode_e.
1646 (enum crossing_type): Renamed from enum crossing_type_e.
1647 (enum view): Renamed from enum view_e.
1648 (struct node): Renamed from struct node_s.
1649 (node): Renamed from node_t.
1650 (enum linestyle): Renamed from enum linestyle_e.
1651 (enum arrowstyle): Renamed from enum arrowstyle_e.
1652 (struct edge): Renamed from struct edge.
1653 (edge): Renamed from edge_t.
1654 (struct graph): Renamed from struct graph_s.
1655 (graph): Renamed from graph_t.
1656 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
1657 Rename value_t -> value.
1658 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
1659 value_t_as_yystype -> value_as_yystype.
1660
1661 Don't include <errno.h> in the mainstream code, since it
1662 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
1663 * lib/get-errno.c, lib/get-errno.h: New files.
1664 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
1665 get-errno.c.
1666 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
1667 * src/output.c (output_skeleton): Likewise.
1668 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
1669 instead of errno.
1670 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
1671 Likewise.
1672 (handle_action_dollar, handle_action_at): Likewise.
1673 * src/system.h: Do not include <errno.h>.
1674 (TAB_EXT): Renamed from EXT_TAB.
1675 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
1676
1677 Avoid str[a-z]*, since <string.h> reserves that name space.
1678 Change all instances of "struniq" in names to "uniqstr", and
1679 likewise for "STRUNIQ" and "UNIQSTR".
1680 * src/uniqstr.c: Renamed from src/struniq.c.
1681 * src/uniqstr.h: Renamed from src/struniq.h.
1682 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
1683 * src/files.c (strsuffix): Remove; unused.
1684 (concat2): Renamed from stringappend. Now static.
1685 * src/files.h (strsuffix, stringappend): Remove; unused.
1686 * src/parse-gram.y (<chars>): Renamed from <string>.
1687 (<uniqstr>): Renamed from <struniq>.
1688 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
1689 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
1690 (struct graph_s.expand): Renamed from struct graph_s.stretch.
1691 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
1692 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
1693 (N_EXPAND): Renamed from N_STRETCH.
1694
1695 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
1696 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
1697 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
1698 Remove; unused.
1699 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
1700 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
1701 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
1702 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
1703 (BASE_MAXIMUM): Renamed from BASE_MAX.
1704 (BASE_MINIMUM): Renamed from BASE_MIN.
1705 (ACTION_MAX): Remove; unused.
1706 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
1707 Unnecessary casts removed from above defines.
1708
1709
1710 Fix misspelling in names.
1711 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
1712 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
1713 G_NODE_ALIGNEMENT.
1714
1715
1716 * lib/timevar.c (timevar_report): Renamed from time_report,
1717 for consistency with other names.
1718 * lib/timevar.h (timevar_report): New decl.
1719 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
1720
1721
1722 Sort include-file uses.
1723
1724 Reorder all include files under src to be in the order "system.h".
1725 then the ../lib include files in angle brackets (alphabetized),
1726 then the . include files in double-quotes (alphabetized). Fix
1727 dependency breakages encountered in this process, as follows:
1728 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
1729 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
1730 * src/state.h: Include "symtab.h".
1731
1732 2002-12-08 Paul Eggert <eggert@twinsun.com>
1733
1734 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
1735 since this causes problems when __file__ contains character
1736 sequences like "@" that are treated specially by src/scan-skel.l.
1737 Instead, just use the file's basename. This fixes the bug
1738 reported by Martin Mokrejs in
1739 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
1740
1741 2002-12-06 Paul Eggert <eggert@twinsun.com>
1742
1743 Add support for rules that do not have trailing semicolons, as
1744 POSIX requires. Improve the quality of locations in Bison
1745 diagnostics.
1746
1747 * src/location.c: Include <quotearg.h>.
1748 (empty_location): Now const.
1749 (location_print): New function. Follow the recommendation of the
1750 GNU Coding Standards for locations that span file boundaries.
1751 * src/location.h: Do not include <quotearg.h>; no longer needed.
1752 (boundary): New type.
1753 (location_t): Use it. This allows locations to span file boundaries.
1754 All member uses changed: file -> start.file or end.file (as needed),
1755 first_line -> start.line, first_column -> start.column,
1756 last_line -> end.line, last_column -> end.column.
1757 (equal_boundaries): New function.
1758 (LOCATION_RESET, LOCATION_STEP): Remove.
1759 (LOCATION_PRINT): Remove. All callers changed to use location_print.
1760 (empty_location): Now const.
1761 (location_print): New decl.
1762 * src/parse-gram.y (lloc_default): New function, which handles
1763 empty locations more accurately.
1764 (YYLLOC_DEFAULT): Use it.
1765 (%token COLON): Remove.
1766 (%token ID_COLON): New token.
1767 (rules): Use it.
1768 (declarations, rules): Remove trailing semicolon.
1769 (declaration, rules_or_grammar_declaration):
1770 Allow empty (";") declaration.
1771 (symbol_def): Remove empty actions; no longer needed.
1772 (rules_or_grammar_declaration): Remove trailing semicolon.
1773 (semi_colon.opt): Remove.
1774 * src/reader.h: Include location.h.
1775 (scanner_cursor): New decl.
1776 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
1777 rolling our own.
1778 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
1779 of *loc.
1780 (STEP): Remove. No longer needed, now that adjust_location does
1781 the work. All uses removed.
1782 (scanner_cursor): New var.
1783 (adjust_location): Renamed from extend_location. It now sets
1784 *loc and adjusts the scanner cursor. All uses changed.
1785 Don't bother testing for CR.
1786 (handle_syncline): Remove location arg; now updates scanner cursor.
1787 All callers changed.
1788 (unexpected_end_of_file): Now accepts start boundary of token or
1789 comment, not location. All callers changed. Update scanner cursor,
1790 not the location.
1791 (SC_AFTER_IDENTIFIER): New state.
1792 (context_state): Renamed from c_context. All uses changed.
1793 (id_loc, code_start, token_start): New local vars.
1794 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
1795 processing of Yacc white space and equivalents here.
1796 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
1797 instead of returning ID immediately, since we need to search for
1798 a subsequent colon.
1799 (<INITIAL>"'", "\""): Save token_start.
1800 (<INITIAL>"%{", "{", "%%"): Save code_start.
1801 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
1802 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
1803 BEGIN context_state at end, not INITIAL.
1804 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
1805 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
1806 Return correct token start.
1807 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
1808 the start of a character, string or multiline comment is found.
1809 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
1810 Reduction): Adjust reported locations to match the more-precise
1811 results now expected.
1812 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
1813 * tests/reduce.at (Useless Rules, Reduced Automaton,
1814 Underivable Rules): Likewise.
1815 * tests/regression.at (Invalid inputs): No longer `expecting ";"
1816 or "|"' now that so many other tokens are allowed by the new grammar.
1817
1818 * src/complain.h (current_file): Remove duplicate decl;
1819 current_file is now owned by files.h.
1820 * src/complain.c, src/scan-gram.l: Include files.h.
1821
1822 2002-12-06 Paul Eggert <eggert@twinsun.com>
1823
1824 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
1825 promotes to int; it might be unsigned int.
1826 * data/yacc.c (yy_reduce_print): Likewise.
1827
1828 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
1829 be #defined in the prologue, not in the Bison declarations.
1830 This fixes Debian Bug 102878, reported by Shaul Karl.
1831
1832 2002-12-02 Paul Eggert <eggert@twinsun.com>
1833
1834 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
1835 * lib/strtoul.c: New file, from gnulib.
1836 This fixes a porting bug reported by Peter Klein in
1837 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
1838
1839 2002-11-30 Paul Eggert <eggert@twinsun.com>
1840
1841 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
1842 and put only a forward declaration in the prologue. This is for
1843 consistency with the other scanner helper functions.
1844
1845 Type clashes now generate warnings, not errors, since it
1846 appears that POSIX may allow some grammars with type clashes.
1847 * src/reader.c (grammar_current_rule_check): Warn about
1848 type clashes instead of complaining.
1849 * tests/input.at (Type Clashes): Expect warnings, not complaints.
1850
1851 Add Yacc library, since POSIX requires it.
1852 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
1853 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
1854 * lib/main.c, lib/yyerror.c: New files.
1855
1856 gram_error can be static; it need not be extern.
1857 * src/reader.h (gram_error): Remove decl.
1858 * src/parse-gram.y (gram_error): Now static. Add static decl.
1859 (print_token_value): Omit parameter names from forward decl,
1860 for consistency.
1861
1862 2002-11-29 Paul Eggert <eggert@twinsun.com>
1863
1864 * doc/bison.texinfo: Emphasize that yylex and yyerror must
1865 be declared before being used. E.g., one should typically
1866 declare them in the prologue. Use GNU coding style in examples.
1867 Put "const" consistently after the type it modifies. Mention
1868 that C99 supports "inline". Mention that yyerror traditionally
1869 returns "int".
1870
1871 %parse-param and %lex-param now take just one argument, the
1872 declaration; the argument name is deduced from the declaration.
1873
1874 * doc/bison.texinfo (Parser Function, Pure Calling, Error
1875 Reporting, Table of Symbols): Document this.
1876 * src/parse-gram.y (add_param): New function.
1877 (COMMA): Remove.
1878 (declaration): Implement new rule for %parse-param and %lex-param.
1879 * src/scan-gram.l: "," now elicits a warning, rather than being
1880 a token; this is more compatible with byacc.
1881 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
1882
1883 2002-11-27 Paul Eggert <eggert@twinsun.com>
1884
1885 Rename identifiers to avoid real and potential collisions.
1886
1887 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
1888 to avoid collision with lex macro described by Bruce Lilly in
1889 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
1890 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
1891 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
1892 * src/parse-gram.y (print_token_value): Renamed from yyprint.
1893 All uses changed.
1894 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
1895 The name "yycontrol" violates the name space rules, and this stuff
1896 wasn't being used anyway.
1897 (input): Remove action; this stuff wasn't being used.
1898 (gram_error): Rename local variable yylloc -> loc.
1899 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
1900 (YY_DECL): Don't use "yy" at start of local variables.
1901 All uses changed, e.g., yylloc -> loc.
1902 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
1903 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
1904 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
1905 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
1906
1907 * src/parse-gram.y (gram_error): loc is now const *.
1908 * src/reader.h (gram_error): Likewise.
1909
1910 2002-11-24 Paul Eggert <eggert@twinsun.com>
1911
1912 Version 1.75c.
1913
1914 * tests/actions.at (Actions after errors): Use an output format
1915 more similar to that of the Printers and Destructors test.
1916 Test the position of the ';' token too.
1917 (Printers and Destructors): Likewise.
1918 (Printers and Destructors: %glr-parser): Remove for now, to avoid
1919 unnecessarily alarming people when the test fails.
1920
1921 * data/yacc.c (yyerrlab1): Move this label down, so that the
1922 parser does not discard the lookahead token if the user code
1923 invokes YYERROR. This change is required for POSIX conformance.
1924
1925 * lib/error.c: Sync with gnulib.
1926
1927 2002-11-22 Paul Eggert <eggert@twinsun.com>
1928
1929 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
1930 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
1931 * lib/xmalloc.c: Likewise.
1932
1933 2002-11-20 Paul Eggert <eggert@twinsun.com>
1934
1935 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
1936
1937 2002-11-20 Paul Eggert <eggert@twinsun.com>
1938
1939 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
1940 should use `if (! x) abort ();' rather than `assert (x);', and
1941 anyway it's one less thing to worry about configuring.
1942
1943 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
1944 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
1945 and replace all instances of assert with abort.
1946 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
1947 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
1948
1949 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
1950 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
1951 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
1952 hash_find_entry, hash_rehash, hash_insert): Likewise.
1953 * src/conflicts.c (resolve_sr_conflict): Likewise.
1954 * src/lalr.c (set_goto_map, map_goto): Likewise.
1955 * src/nullable.c (nullable_compute): Likewise.
1956 * src/output.c (prepare_rules, token_definitions_output): Likewise.
1957 * src/reader.c (packgram, reader): Likewise.
1958 * src/state.c (state_new, state_free, state_transitions_set,
1959 state_reduction_find): Likewise.
1960 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
1961 symbol_pack): Likewise.
1962 * src/tables.c (conflict_row, pack_vector): Likewise.
1963 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
1964 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
1965 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
1966 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
1967
1968 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
1969 (ARGMATCH_CONSTRAINT): New macro.
1970 (ARGMATCH_ASSERT): Use it.
1971
1972 * src/system.h (verify): New macro.
1973 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
1974 rather than assert.
1975 * src/tables.c (tables_generate): Likewise.
1976
1977 * src/struniq.c (struniq_assert): Now returns void, and aborts
1978 if the assertion is false.
1979 (struniq_assert_p): Remove.
1980 * src/struniq.h: Likewise.
1981
1982 2002-11-18 Paul Eggert <eggert@twinsun.com>
1983
1984 * data/glr.c (yygetLRActions): Replace `yyindex' with
1985 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
1986 This fixes the regression with Sun ONE Studio 7 cc that I reported in
1987 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
1988
1989 2002-11-18 Akim Demaille <akim@epita.fr>
1990
1991 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
1992 space.
1993 From Tim Van Holder.
1994
1995 2002-11-17 Paul Eggert <eggert@twinsun.com>
1996
1997 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
1998 to "SyntaxError" for consistency with my 2002-11-15 change.
1999
2000 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
2001 not define to {}, since this breaks the common use of `YYDPRINTF
2002 ((...));' if a single statement is desired (e.g. before `else').
2003 Work around GCC warnings by surrounding corresponding calls with
2004 {} if needed.
2005 (yyhasResolvedValue): Remove unused function.
2006 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
2007 loop body.
2008 (yyreportSyntaxError): Renamed from yyreportParseError.
2009 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
2010 All uses changed.
2011 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
2012 extern when possible. Remove unused initializations.
2013
2014 2002-11-16 Akim Demaille <akim@epita.fr>
2015
2016 Augment the similarity between GLR and LALR traces.
2017
2018 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
2019 (YY_REDUCE_PRINT): New.
2020 (yyparse): Use them.
2021 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
2022 YYDPRINT here.
2023 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
2024 state reached after the reduction/recovery, since...
2025 (yyparse, yyprocessOneStack): Report the state we are entering in.
2026
2027 2002-11-16 Akim Demaille <akim@epita.fr>
2028
2029 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
2030 Add support for --trace=skeleton.
2031 * src/scan-skel.l: %option debug.
2032 Scan strings of non-@ or \n instead of character by character.
2033 (scan_skel): Handle trace_skeleton.
2034 (QPUTS): New.
2035 (@output_parser_name@, @output_header_name@): ``Restore'' their
2036 support (used to be M4 macros).
2037 * data/yacc.c: Quote larger chunks, a la glr.c.
2038 * data/lalr1.cc: Likewise.
2039 The header guards are no longer available, so use some other
2040 string than `YYLSP_NEEDED'.
2041
2042 2002-11-16 Akim Demaille <akim@epita.fr>
2043
2044 Make the ``Printers and Destructors'' test more verbose, taking
2045 `yacc.c''s behavior as (possibly wrong) reference.
2046
2047 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
2048 instead of fprint on stdout.
2049 Set and report the last_line of the symbols.
2050 Consistently display values and locations.
2051
2052 2002-11-16 Paul Eggert <eggert@twinsun.com>
2053
2054 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
2055
2056 2002-11-15 Paul Eggert <eggert@twinsun.com>
2057
2058 * tests/actions.at (Actions after errors): New test case.
2059
2060 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
2061 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
2062 tests/action.at, tests/calc.at, tests/conflicts.at,
2063 tests/cxx-type.at, tests/regression.at:
2064 "parse error" -> "syntax error" for POSIX compatibility.
2065 "parsing stack overflow..." -> "parser stack overflow" so
2066 that code matches Bison documentation.
2067
2068 2002-11-15 Akim Demaille <akim@epita.fr>
2069
2070 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
2071 take two BRACED_CODE, not two string_content.
2072 Free the scanner's obstack when we are done.
2073 (code_content): New.
2074 * tests/calc.at: Adjust.
2075 * doc/bison.texinfo: Adjust.
2076 Also, make sure to include the `,' for these declarations.
2077
2078 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
2079
2080 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
2081 definition; avoids potential autoreconf problems.
2082
2083 2002-11-15 Akim Demaille <akim@epita.fr>
2084
2085 Always check the value returned by yyparse.
2086
2087 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
2088 returned by yyparse.
2089 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
2090 Adjust calls.
2091 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
2092 returned by yyparse.
2093
2094 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2095
2096 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
2097 on input.at test.
2098
2099 2002-11-14 Paul Eggert <eggert@twinsun.com>
2100
2101 * src/output.c (output_skeleton): Call xfopen instead of
2102 duplicating xfopen's body.
2103
2104 Fix bugs reported by Nelson H. F. Beebe in
2105 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
2106
2107 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
2108 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
2109 Group compiler. Instead, use "$CC -E bar.c". Include the .h
2110 file twice in the grammar, as an extra check.
2111
2112 * tests/input.at (Torturing the Scanner): Surround the
2113 backslash-newline tests with "#if 0", to make it less likely that
2114 we'll run into compiler bugs. Bring back solitary \ inside
2115 comment, but add a closing comment to work around HP C bug. Don't
2116 test backslash-newline in C character constant.
2117
2118 2002-11-14 Akim Demaille <akim@epita.fr>
2119
2120 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
2121 status of the compiler.
2122 Calling `exit 1' is no longer needed.
2123 Reported by Nelson H. F. Beebe.
2124
2125 2002-11-14 Akim Demaille <akim@epita.fr>
2126
2127 * tests/atlocal.in (CPPFLAGS): We have config.h.
2128 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
2129 New.
2130 * tests/actions.at, tests/calc.at, tests/conflicts.at,
2131 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
2132 * tests/regression.at, tests/torture.at: Use them for all the
2133 grammars that are to be compiled.
2134 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
2135 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
2136 * doc/bison.texinfo (GLR Parsers): Document `inline'.
2137
2138 2002-11-14 Akim Demaille <akim@epita.fr>
2139
2140 * doc/bison.texinfo: Various formatting changes (alignments in
2141 samples, additional @group/@end group, GCS in samples.
2142 Use @deffn instead of simple @table to define the directives,
2143 macros, variables etc.
2144
2145 2002-11-13 Paul Eggert <eggert@twinsun.com>
2146
2147 Fix some bugs reported by Albert Chin-A-Young in
2148 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
2149
2150 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
2151 -o c"; the HP C compiler chatters during compilation.
2152 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2153 * tests/headers.at (export YYLTYPE): Likewise.
2154
2155 * tests/input.at (Torturing the Scanner): Remove lines containing
2156 solitary backslashes, as they tickle a bug in the HP C compiler.
2157
2158 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
2159 comments, since they're not portable. Use GNU coding style.
2160
2161 2002-11-13 Akim Demaille <akim@epita.fr>
2162
2163 * data/yacc.c: Leave bigger chunks of quoted text.
2164 (YYDSYMPRINTF): New.
2165 Use it to report symbol activities.
2166 * data/glr.c (YYDSYMPRINTF): New.
2167 Use it.
2168
2169 2002-11-12 Paul Eggert <eggert@twinsun.com>
2170
2171 Version 1.75b.
2172
2173 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
2174 (yyglrReduce): Return yyok, not 0.
2175 This should avoid the enumerated-type warnings reported
2176 by Nelson H. F. Beebe in
2177 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
2178
2179 * lib/bbitset.h (BITSET_INLINE): Remove.
2180 * lib/bitset.h [! BITSET_INLINE]: Remove.
2181 (bitset_set, bitset_reset, bitset_test): Rename local vars
2182 to avoid shadowing warnings by GCC.
2183
2184 * data/glr.c (inline): Remove #define. It's the user's
2185 responsibility to #define it away, just like 'const'.
2186 This fixes one of the bugs reported by Nelson H. F. Beebe in
2187 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
2188
2189 * Makefile.maint (po-check): Scan .l and .y files instead of the
2190 .c and the .h files that they generate. This fixes the bug
2191 reported by Tim Van Holder in:
2192 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
2193 Look for N_ as well as for _. Try to avoid matching #define for
2194 N_ and _.
2195 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
2196 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
2197 * src/scan-gram.l: Revamp regular expressions so that " and '
2198 do not confuse xgettext.
2199
2200 * src/struniq.h (struniq_new): Do not declare the return type
2201 to be 'const'; this violates the C standard.
2202 * src/struniq.c (struniq_new): Likewise.
2203
2204 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
2205
2206 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
2207 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
2208 linker.
2209
2210 2002-11-12 Akim Demaille <akim@epita.fr>
2211
2212 * Makefile.maint: Sync with Autoconf:
2213 (local_updates): New.
2214
2215 2002-11-12 Akim Demaille <akim@epita.fr>
2216
2217 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
2218
2219 2002-11-12 Akim Demaille <akim@epita.fr>
2220
2221 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
2222 locations.
2223
2224 2002-11-12 Akim Demaille <akim@epita.fr>
2225
2226 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
2227 not yyvalue.
2228
2229 2002-11-12 Akim Demaille <akim@epita.fr>
2230
2231 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
2232 Use it to test the GLR parser.
2233
2234 2002-11-12 Akim Demaille <akim@epita.fr>
2235
2236 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
2237 defines it.
2238 * data/glr.c (yystos): New.
2239 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
2240 (YYDSYMPRINT): New.
2241 (yyval): Don't define it, it is handled via M4.
2242 (yyrecoverParseError): Free verbosely the discarded symbols.
2243 * data/yacc.c (yysymprint): Remove, rather...
2244 (b4_yysymprint_generate): invoke.
2245 * data/c.m4 (b4_yysymprint_generate): New.
2246 Accept pointers as arguments, as opposed to the version from
2247 yacc.c.
2248 (b4_yydestruct_generate): Likewise.
2249 * tests/cations.at (Printers and Destructors): Use Bison directives
2250 instead of CPP macros.
2251 Don't rely on internal details.
2252
2253 2002-11-12 Akim Demaille <akim@epita.fr>
2254
2255 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
2256 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
2257 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
2258 it against YYEMPTY and so forth), work on yytoken (i.e., set
2259 it to YYEMPTY etc.).
2260 (yydestruct): Replace with a b4_yydestruct_generate invocation.
2261 (b4_symbol_actions): Remove.
2262 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
2263 for 0, end-of-input.
2264
2265 2002-11-12 Akim Demaille <akim@epita.fr>
2266
2267 * doc/bison.texinfo (Destructor Decl): New.
2268
2269 2002-11-12 Akim Demaille <akim@epita.fr>
2270
2271 * src/tables.c (tables_generate): Use free for pointers that
2272 cannot be NULL, not XFREE.
2273 (pack_vector): Use assert, not fatal, for bound violations.
2274 * src/state.c (state_new): Likewise.
2275 * src/reader.c (reader): Likewise.
2276 * src/lalr.c (set_goto_map): Likewise.
2277 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
2278 the file name.
2279
2280 2002-11-12 Akim Demaille <akim@epita.fr>
2281
2282 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
2283 Restore.
2284 * src/scan-gram.l (last_string): Is global to the file, not to
2285 yylex.
2286 * src/parse-gram.y (input): Don't append the epilogue here,
2287 (epilogue.opt): do it here, and free the scanner's obstack.
2288 * src/reader.c (epilogue_set): Rename as...
2289 (epilogue_augment): this.
2290 * data/c.m4 (b4_epilogue): Defaults to empty.
2291
2292 2002-11-12 Akim Demaille <akim@epita.fr>
2293
2294 * src/getargs.c (long_options): Remove duplicates.
2295 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
2296 Remove.
2297 * doc/bison.rnh: Remove.
2298 * doc/bison.texinfo (VMS Invocation): Remove.
2299
2300 2002-11-12 Akim Demaille <akim@epita.fr>
2301
2302 * src/struniq.h, src/struniq.c (struniq_t): Is const.
2303 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
2304
2305 Use struniq for symbols.
2306
2307 * src/symtab.h (symbol_t): The tag member is a struniq.
2308 (symbol_type_set): Adjust.
2309 * src/symtab.c (symbol_new): Takes a struniq.
2310 (symbol_free): Don't free the tag member.
2311 (hash_compare_symbol_t, hash_symbol_t): Rename as...
2312 (hash_compare_symbol, hash_symbol): these.
2313 Use the fact that tags as struniqs.
2314 (symbol_get): Use struniq_new.
2315 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
2316 Returns a strniq.
2317 * src/reader.h (merger_list, grammar_currentmerge_set): The name
2318 and type members are struniqs.
2319 * src/reader.c (get_merge_function)
2320 (grammar_current_rule_merge_set): Adjust.
2321 (TYPE, current_type): Are struniq.
2322
2323 Use struniq for file names.
2324
2325 * src/files.h, src/files.c (infile): Split into...
2326 (grammar_file, current_file): these.
2327 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
2328 * src/reduce.c (reduce_print): Likewise.
2329 * src/getargs.c (getargs): Likewise.
2330 * src/complain.h, src/complain.c: Likewise.
2331 * src/main.c (main): Call struniqs_new early enough to use it for
2332 file names.
2333 Don't free the input file name.
2334
2335 2002-11-12 Akim Demaille <akim@epita.fr>
2336
2337 * src/symtab.c (symbol_free): Remove dead deactivated code:
2338 type_name are properly removed.
2339 Don't use XFREE to free items that cannot be NULL.
2340 * src/struniq.h, src/struniq.c: New.
2341 * src/main.c (main): Initialize/free struniqs.
2342 * src/parse-gram.y (%union): Add astruniq member.
2343 (yyprint): Adjust.
2344 * src/scan-gram.l (<{tag}>): Return a struniq.
2345 Free the obstack bit that used to store it.
2346 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
2347
2348 2002-11-11 Paul Eggert <eggert@twinsun.com>
2349
2350 Revamp to fix many (but not all) of the C- and M4-related quoting
2351 problems. Among other things, this fixes the Bison bug reported
2352 by Jan Hubicka when processing the Bash grammar; see:
2353 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
2354
2355 Use new @ escapes consistently. Represent brackets with @{ and @}
2356 rather than @<:@ and @:>@, since this works a bit better with dumb
2357 editors like vi. Represent @ with @@, since @ is now consistently
2358 an escape. Use @oline@ and @ofile@ rather than __oline__ and
2359 __ofile__, to avoid unexpected expansions. Similarly, use @output
2360 rather than #output.
2361
2362 * data/c.m4 (b4_copyright): Omit file name from comment, since
2363 the file name could contain "*/".
2364 (b4_synclines_flag): Don't quote the 2nd argument; it should already
2365 be quoted. All uses changed.
2366
2367 * data/glr.c: Use new @ escapes consistently.
2368 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
2369 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
2370 Remove, since they couldn't handle arbitrary characters in file
2371 names.
2372 * data/lalr1.cc: Likewise.
2373 * data/yacc.c: Likewise.
2374
2375 * src/files.c (output_infix): Remove; all uses removed.
2376 * src/files.h: Likewise.
2377
2378 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
2379 mishandled funny characters in file names, and anyway it isn't
2380 needed any more.
2381 * data/yacc.c: Likewise.
2382 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
2383
2384 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
2385 * data/yacc.c: Likewise.
2386
2387 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
2388 strings now.
2389 (muscle_init): Quote filename as a C string.
2390 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
2391 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
2392 * src/output.c (escaped_file_name_output): New function.
2393 (prepare_symbols): Quote tokens for M4.
2394 (prepare): Don't insert output_infix, output_prefix,
2395 output_parser_name, output_header_name; this is now down by scan-skel.
2396 Insert skeleton as a C string.
2397
2398 * src/output.c (user_actions_output, symbol_destructors_output,
2399 symbol_printers_output): Quote filenames for C and M4.
2400 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2401
2402 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
2403 escapes other than \\ and \'; this simplifies the code.
2404 (<SC_STRING>): Likewise, for \\ and \".
2405 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
2406 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
2407 Use new escapes @{ and @} for [ and ].
2408
2409 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
2410 them with auto vars.
2411 Switch to new escape scheme, where @ is the escape character uniformly.
2412 Abort if a stray escape character is found. Avoid unbounded input
2413 buffer when parsing non-escaped text.
2414
2415 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
2416 __oline__, #output, $@, and @{ do not have unintended meanings.
2417
2418 2002-11-09 Paul Eggert <eggert@twinsun.com>
2419
2420 Fix the test failure due to GCC warnings described in
2421 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
2422 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
2423 evaluate to 0 if it's impossible for NINF to be in the respective
2424 table.
2425 (yygetLRActions, yyrecoverParseError): Use them.
2426
2427 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
2428 counted in the token inserted at end of file. Now takes
2429 location_t *, not location_t, so that the location can be
2430 adjusted. All uses changed.
2431
2432 * tests/regression.at (Invalid inputs): Adjust wording in
2433 diagnostic to match the new behavior.
2434
2435 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
2436 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
2437 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
2438 abort ();'. This reduces the runtime of the "Many lookaheads"
2439 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
2440 GCC 3.2.
2441
2442 2002-11-07 Paul Eggert <eggert@twinsun.com>
2443
2444 * src/parse-gram.y (CHARACTER): Remove unused token.
2445 All uses removed.
2446
2447 * src/scan-gram.l: Remove stack option. We no longer use the
2448 stack, since the stack was never deeper than 1; instead, use the
2449 new auto var c_context to record the stacked value.
2450
2451 Remove nounput option. At an unexpected end of file, we now unput
2452 the minimal input necessary to end cleanly; this simplifies the
2453 code.
2454
2455 Avoid unbounded token sizes where this is easy.
2456
2457 (unexpected_end_of_file): New function.
2458 Use it to systematize the error message on unexpected EOF.
2459 (last-string): Now auto, not static.
2460 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
2461 (scanner_last_string_free): Remove; not used.
2462 (percent_percent_count): Move decl to just before use.
2463 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
2464 not the (never otherwised-used) CHARACTER.
2465
2466 2002-11-07 Akim Demaille <akim@epita.fr>
2467
2468 Let yyerror always receive the msg as last argument, so that
2469 yyerror can be variadic.
2470
2471 * data/yacc.c (b4_yyerror_args): New.
2472 Use it when calling yyerror.
2473 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
2474 Use it when calling yyerror.
2475 * doc/bison.texinfo (Error Reporting): Adjust.
2476 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
2477 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
2478
2479 2002-11-06 Akim Demaille <akim@epita.fr>
2480
2481 #line should have quoted strings.
2482 Ideally, this should be done by m4_quotearg.
2483
2484 * src/scan-skel.l: Include quotearg.h.
2485 Quote __ofile__.
2486 * src/output.c (symbol_printers_output)
2487 (symbol_destructors_output): Quote the file name.
2488
2489 2002-11-06 Akim Demaille <akim@epita.fr>
2490
2491 * tests/regression.at (Invalid inputs): Adjust to the recent
2492 messages.
2493
2494 2002-11-06 Akim Demaille <akim@epita.fr>
2495
2496 Restore --no-lines.
2497 Reported by Jim Kent.
2498
2499 * data/c.m4 (b4_syncline): New.
2500 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
2501 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
2502 * src/output.c (user_actions_output): Likewise.
2503 (prepare): Define 'b4_synclines_flag'.
2504 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
2505
2506 2002-11-06 Akim Demaille <akim@epita.fr>
2507
2508 * src/main.c (main): Free `infile'.
2509 * src/scan-gram.l (handle_syncline): New.
2510 Recognize `#line'.
2511 * src/output.c (user_actions_output, symbol_destructors_output)
2512 (symbol_printers_output): Use the location's file name, not
2513 infile.
2514 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2515
2516 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2517
2518 * src/tables.c (matching_state): Don't allow states to match if
2519 either has GLR conflict entries.
2520
2521 2002-11-05 Paul Eggert <eggert@twinsun.com>
2522
2523 * src/scan-gram.l: Use more accurate diagnostics, e.g.
2524 "integer out of range" rather than "invalid value".
2525 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
2526 accordingly.
2527
2528 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
2529 Also, remove one static variable in the scanner.
2530
2531 * src/scan-gram.l (braces_level): Now auto, not static.
2532 Initialize to zero if the compiler is being picky.
2533 (INITIAL): Clear braces_level instead of incrementing it.
2534 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
2535 as POSIX 1003.1-2001 requires.
2536 * src/system.h (IF_LINT): New macro, taken from coreutils.
2537 * configure.ac: Define "lint" if --enable-gcc-warnings.
2538
2539 2002-11-05 Akim Demaille <akim@epita.fr>
2540
2541 * src/scan-gram.l: When it starts with `%', complain about the
2542 whole directive, not just that `invalid character: %'.
2543
2544 2002-11-04 Akim Demaille <akim@epita.fr>
2545
2546 * Makefile.maint: Update from Autoconf.
2547 (update, cvs-update, po-update, do-po-update): New.
2548
2549 2002-11-04 Akim Demaille <akim@epita.fr>
2550
2551 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
2552 and yyerror.
2553 Have yyerror `use' its arguments.
2554 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
2555 returns true when location & yacc & pure & parse-param.
2556 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
2557
2558 2002-11-04 Akim Demaille <akim@epita.fr>
2559
2560 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
2561 clashes.
2562 * src/scan-gram.l: Use [\'] instead of ['] to pacify
2563 font-lock-mode.
2564 Use complain_at.
2565 Use quote, not quote_n since LOCATION_PRINT no longer uses the
2566 slot 0.
2567
2568 2002-11-03 Paul Eggert <eggert@twinsun.com>
2569
2570 * src/reader.c (get_merge_function, grammar_current_rule_check):
2571 Use consistent diagnostics for reporting type name clashes.
2572 Quote the types with <>, for consistency with Yacc.
2573 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
2574
2575 2002-11-03 Akim Demaille <akim@epita.fr>
2576
2577 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
2578 New.
2579 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
2580 (b4_parse_param): Remove.
2581 Use b4_identification.
2582 Propagate b4_pure_args where needed to pass them to yyerror.
2583 * data/glr.m4 (b4_parse_param): Remove.
2584 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
2585 (b4_lpure_formals): New.
2586 Use b4_identification.
2587 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
2588 b4_user_formals and b4_user_args.
2589 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
2590 (yyreportAmbiguity): When using a pure parser, also need
2591 the location, and the parse-params.
2592 Adjust callers.
2593 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
2594 When using a pure parser, also need the parse-params.
2595 Adjust callers.
2596 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
2597 (%pure-parser + %parse-param) LALR and GLR parsers.
2598 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
2599 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
2600 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
2601 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
2602 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
2603 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
2604 * doc/bison.texinfo: Untabify the whole file.
2605 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
2606 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
2607 (Error Reporting): Adjust to these new directives.
2608 Document %error-verbose, deprecate YYERROR_VERBOSE.
2609
2610 2002-11-03 Akim Demaille <akim@epita.fr>
2611
2612 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
2613 AT_CHECK_CALC_GLR invocations to use % directives, instead of
2614 command line options.
2615 * tests/cxx-type.at: Formatting changes.
2616
2617 2002-11-03 Paul Eggert <eggert@twinsun.com>
2618
2619 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
2620 to count columns correctly, and to check for invalid inputs.
2621
2622 Use mbsnwidth to count columns correctly. Account for tabs, too.
2623 Include mbswidth.h.
2624 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
2625 (extend_location): New function.
2626 (YY_LINES): Remove.
2627
2628 Handle CRLF in C code rather than in Lex code.
2629 (YY_INPUT): New macro.
2630 (no_cr_read): New function.
2631
2632 Scan UCNs, even though we don't fully handle them yet.
2633 (convert_ucn_to_byte): New function.
2634
2635 Handle backslash-newline correctly in C code.
2636 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
2637 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
2638 all uses changed.
2639 (tag, splice): New EREs. Do not allow NUL or newline in tags.
2640 Use {splice} wherever C allows backslash-newline.
2641 YY_STEP after space, newline, vertical-tab.
2642 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
2643
2644 (letter, id): Don't assume ASCII; e.g., spell out a-z.
2645
2646 ({int}, handle_action_dollar, handle_action_at): Check for integer
2647 overflow.
2648
2649 (YY_STEP): Omit trailing semicolon, so that it's more like C.
2650
2651 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
2652 as well as \000. Check for UCHAR_MAX, not 255.
2653 Allow \x with an arbitrary positive number of digits, as in C.
2654 Check for overflow here.
2655 Allow \? and UCNs, for compatibility with C.
2656
2657 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
2658 with quote slot used by complain_at.
2659
2660 * tests/input.at: Add tests for backslash-newline, m4 quotes
2661 in symbols, long literals, and funny escapes in strings.
2662
2663 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
2664 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
2665 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
2666 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
2667 * m4/mbswidth.m4: New file, from GNU coreutils.
2668
2669 * doc/bison.texinfo (Grammar Outline): Document // comments.
2670 (Symbols): Document that trigraphs have no special meaning in Bison,
2671 nor is backslash-newline allowed.
2672 (Actions): Document that trigraphs have no special meaning.
2673
2674 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
2675 no longer used.
2676
2677 2002-11-02 Paul Eggert <eggert@twinsun.com>
2678
2679 * src/reader.c: Don't include quote.h; not needed.
2680 (get_merge_function): Reword warning to be consistent with
2681 type clash diagnostic in grammar_current_rule_check.
2682
2683 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
2684 bug in trigraph handling.
2685
2686 * src/output.c (prepare_symbols): When printing token names,
2687 escape "[" as "@<:@" and likewise for "]".
2688
2689 * src/system.h (errno): Remove declaration, as we are now
2690 assuming C89 or better, and C89 guarantees errno.
2691
2692 2002-10-30 Paul Eggert <eggert@twinsun.com>
2693
2694 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
2695 Check for close failures.
2696 * src/files.h (xfclose): Return void, not int, since it always
2697 returned zero.
2698 * src/files.c (xfclose): Likewise. Report I/O error if ferror
2699 indicates one.
2700 * src/output.c (output_skeleton): Use xfclose rather than fclose
2701 and ferror. xfclose now checks ferror.
2702
2703 * data/glr.c (YYLEFTMOST_STATE): Remove.
2704 (yyreportTree): Use a stack-based leftmost state. This avoids
2705 our continuing battles with bogus warnings about initializers.
2706
2707 2002-10-30 Akim Demaille <akim@epita.fr>
2708
2709 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
2710 #if.
2711
2712 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2713
2714 * tests/glr-regr1.at: New test for reported regressions.
2715 * tests/testsuite.at: Add glr-regr1.at test.
2716 * tests/Makefile.am: Add glr-regr1.at test.
2717
2718 2002-10-24 Paul Eggert <eggert@twinsun.com>
2719
2720 Version 1.75a.
2721
2722 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
2723 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
2724 we use malloc. Don't assume 'A' through 'Z' are contiguous.
2725 Don't assume strdup exists; POSIX says its an XSI extension.
2726 Check for buffer overflow on input.
2727
2728 2002-10-24 Akim Demaille <akim@epita.fr>
2729
2730 * src/output.c (output_skeleton): Don't disable M4sugar comments
2731 too soon: it results in comments being expanded.
2732 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
2733 first output.
2734
2735 2002-10-24 Akim Demaille <akim@epita.fr>
2736
2737 * data/yacc.c (m4_int_type): New.
2738 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
2739 char' as only yacc.c wants K&R portability.
2740 * data/glr.c (yysigned_char): Remove.
2741 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
2742 Reported by Quoc Peyrot.
2743
2744 2002-10-23 Paul Eggert <eggert@twinsun.com>
2745
2746 * src/main.c (main): With --trace=time, report times even if a
2747 non-fatal error occurs. Formerly, the times were reported in some
2748 such cases but not in others.
2749 * src/reader.c (reader): Just return if a complaint has been issued,
2750 instead of exiting, so that 'main' can report times.
2751
2752 2002-10-22 Akim Demaille <akim@epita.fr>
2753
2754 * src/system.h: Include sys/types.
2755 Reported by Bert Deknuydt.
2756
2757 2002-10-23 Paul Eggert <eggert@twinsun.com>
2758
2759 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
2760 Suggested by Art Haas.
2761
2762 2002-10-22 Paul Eggert <eggert@twinsun.com>
2763
2764 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
2765 decl; not needed any more.
2766 * src/main.c (main): Use return to exit, undoing yesterday's change.
2767 The last OS that we could find where this wouldn't work is
2768 SunOS 3.5, and that's too old to worry about now.
2769
2770 * data/glr.c (struct yyltype): Define members even when not
2771 doing locations. This is more consistent with yacc.c, and it
2772 works around the following bug reports:
2773 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
2774 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
2775
2776 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
2777 @acronym consistently. Standardize on "Yacc" instead of "YACC",
2778 "Algol" instead of "ALGOL". Give a bit more history about BNF.
2779
2780 2002-10-22 Akim Demaille <akim@epita.fr>
2781
2782 * data/README: New.
2783
2784 2002-10-21 Paul Eggert <eggert@twinsun.com>
2785
2786 Be consistent about 'bool'; the old code used an enum in one
2787 module and an int in another, and this violates the C standard.
2788 * m4/stdbool.m4: New file, from coreutils 4.5.3.
2789 * configure.ac (AC_HEADER_STDBOOL): Add.
2790 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
2791 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
2792 * src/symtab.c (hash_compare_symbol_t): Likewise.
2793 * src/system.h (bool, false, true): Use a definition consistent
2794 with ../lib/hash.c. All uses changed.
2795
2796 * src/complain.c (warning_issued): Renamed from warn_message_count,
2797 so that we needn't worry about integer overflow (!).
2798 Now of type bool. All uses changed.
2799 (complaint_issued): Renamed from complain_message_count; likewise.
2800
2801 * src/main.c (main): Use exit to exit with failure.
2802
2803 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
2804 rather than 1 and 0.
2805 * src/main.c (main): Likewise.
2806 * src/getargs.c (getargs): Likewise.
2807 * src/reader.c (reader): Likewise.
2808
2809 * src/getarg.c (getargs): Remove duplicate code for
2810 "Try `bison --help'".
2811
2812 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
2813 What was that "2" for?
2814
2815 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
2816 * src/getargs.c (usage): Likewise.
2817
2818 * src/getargs.c (getargs): When there are too few operands, report
2819 the last one. When there are too many, report the first extra
2820 one. This is how diffutils does it.
2821
2822 2002-10-20 Paul Eggert <eggert@twinsun.com>
2823
2824 Remove K&R vestiges.
2825 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
2826 * src/complain.c (VA_START): Remove. Assume prototypes.
2827 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
2828 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
2829 fatal): Assume prototypes.
2830 * src/complain.h: Assume prototypes.
2831 * src/system.h (PARAMS): Remove.
2832 Include <limits.h> unconditionally, since it's guaranteeed even
2833 for a freestanding C89 compiler.
2834 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
2835 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
2836
2837 2002-10-20 Akim Demaille <akim@epita.fr>
2838
2839 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
2840 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
2841 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
2842 (yyresolveStates, yyresolveAction, yyresolveStack)
2843 (yyprocessOneStack): Use them.
2844 (yy_reduce_print): New.
2845 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
2846
2847 2002-10-20 Akim Demaille <akim@epita.fr>
2848
2849 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
2850 arguments and output `void'.
2851 (b4_c_function): Rename as...
2852 (b4_c_function_def): this.
2853 (b4_c_function_decl, b4_c_ansi_function_def)
2854 (b4_c_ansi_function_decl): New.
2855 Change the interpretation of the arguments: before `int, foo', now
2856 `int foo, foo'.
2857 * data/yacc.c (yyparse): Prototype and define thanks to these.
2858 Adjust b4_c_function_def uses.
2859 * data/glr.c (yyparse): Likewise, but ANSI only.
2860
2861 2002-10-20 Akim Demaille <akim@epita.fr>
2862
2863 * src/output.c (prepare): Move the definition of `tokens_number',
2864 `nterms_number', `undef_token_number', `user_token_number_max'
2865 to...
2866 (prepare_tokens): Here.
2867 (prepare_tokens): Rename as...
2868 (prepare_symbols): this.
2869 (prepare): Move the definition of `rules_number' to...
2870 (prepare_rules): here.
2871 (prepare): Move the definition of `last', `final_state_number',
2872 `states_number' to...
2873 (prepare_states): here.
2874 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
2875
2876 2002-10-20 Akim Demaille <akim@epita.fr>
2877
2878 * src/tables.h, src/tables.c, src/output.c: Comment changes.
2879
2880 2002-10-20 Akim Demaille <akim@epita.fr>
2881
2882 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
2883 * data/c.m4: here.
2884
2885 2002-10-20 Akim Demaille <akim@epita.fr>
2886
2887 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
2888 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
2889 `pair'.
2890 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
2891 `name' to...
2892 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
2893 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
2894 These.
2895
2896 2002-10-19 Paul Eggert <eggert@twinsun.com>
2897
2898 Do not create a temporary file, as that involves security and
2899 cleanup headaches. Instead, use a pair of pipes.
2900 Derived from a suggestion by Florian Krohm.
2901 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
2902 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
2903 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
2904 (BISON_PREREQ_SUBPIPE): Add.
2905 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
2906 Add subpipe.h, subpipe.c.
2907 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
2908 * po/POTFILES.in: Add lib/subpipe.c.
2909 * src/output.c: Include "subpipe.h".
2910 (m4_invoke): Remove decl.
2911 (scan_skel): New decl.
2912 (output_skeleton): Use pipe rather than temporary file for m4 input.
2913 Check that m4sugar.m4 is readable, to avoid deadlock.
2914 Check for pipe I/O error.
2915 * src/scan-skel.l (readpipe): Remove decl.
2916 (scan_skel): New function, to be used in place of m4_invoke.
2917 Read from stream rather than file.
2918
2919 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
2920 float, as this generates a warning on Solaris 8 + GCC 3.2 with
2921 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
2922 this generates a more-accurate value anyway.
2923
2924 * lib/timevar.c (timervar_accumulate): Rename locals to
2925 avoid confusion with similarly-named more-global.
2926 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
2927
2928 * src/output.c (prepare): Use xstrdup to convert char const *
2929 to char *, to avoid GCC warning.
2930
2931 2002-10-19 Akim Demaille <akim@epita.fr>
2932
2933 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
2934 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
2935 Use them to have `calc.y' ready for %pure-parser.
2936 * data/yacc.c (YYLEX): Pass a yylex return type to
2937 b4_c_function_call.
2938
2939 2002-10-19 Akim Demaille <akim@epita.fr>
2940
2941 Prototype support of %lex-param and %parse-param.
2942
2943 * src/parse-gram.y: Add the definition of the %lex-param and
2944 %parse-param tokens, plus their rules.
2945 Drop the `_' version of %glr-parser.
2946 Add the "," token.
2947 * src/scan-gram.l (INITIAL): Scan them.
2948 * src/muscle_tab.c: Comment changes.
2949 (muscle_insert, muscle_find): Rename `pair' as `probe'.
2950 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
2951 (muscle_entry_s): The `value' member is no longer const.
2952 Adjust all dependencies.
2953 * src/muscle_tab.c (muscle_init): Adjust: use
2954 MUSCLE_INSERT_STRING.
2955 Initialize the obstack earlier.
2956 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
2957 (muscle_pair_list_grow): New.
2958 * data/c.m4 (b4_c_function_call, b4_c_args): New.
2959 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
2960 * tests/calc.at: Use %locations, not --locations.
2961 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
2962
2963 2002-10-19 Akim Demaille <akim@epita.fr>
2964
2965 * src/getargs.c (usage): Take status as argument and exit
2966 accordingly.
2967 Report the traditional `Try ... --help' message when status != 0.
2968 (usage, version): Don't take a FILE * as arg, it is pointless.
2969 (getargs): When there is an incorrect number of arguments, make it
2970 an error, and report it GNUlically thanks to `usage ()'.
2971
2972 2002-10-18 Paul Eggert <eggert@twinsun.com>
2973
2974 * data/glr.c (yyreportParseError): Don't assume that sprintf
2975 yields the length of the printed string, as this is not true
2976 on SunOS 4.1.4. Reported by Peter Klein.
2977
2978 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
2979 * tests/conflicts.at (%nonassoc and eof): Likewise.
2980 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
2981
2982 2002-10-17 Akim Demaille <akim@epita.fr>
2983
2984 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
2985 * src/getargs.c (trace_types, trace_args): Adjust.
2986 * src/reader.c (grammar_current_rule_prec_set)
2987 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
2988 Standardize error messages.
2989 And s/@prec/%prec/!
2990 (reader): Use trace_flag to enable scanner/parser debugging,
2991 instead of an adhoc scheme.
2992 * src/scan-gram.l: Remove trailing debugging code.
2993
2994 2002-10-16 Paul Eggert <eggert@twinsun.com>
2995
2996 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
2997 MUSCLE_TAB_H.
2998
2999 * NEWS: Officially drop support for building Bison with K&R C,
3000 since it didn't work anyway and it's not worth worrying about.
3001 * Makefile.maint (wget_files): Remove ansi2knr.c.
3002 (ansi2knr.c-url_prefix): Remove.
3003 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
3004 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3005 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3006
3007 2002-10-15 Paul Eggert <eggert@twinsun.com>
3008
3009 Stop using the "enum_" trick for K&R-style function definitions;
3010 it confused me, and I was the author! Instead, assume that people
3011 who want to use K&R C compilers (when using these modules in GCC,
3012 perhaps?) will run ansi2knr.
3013
3014 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
3015 All uses of "enum_" changed to "enum ".
3016 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3017 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3018
3019 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
3020 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
3021 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
3022 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
3023 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
3024 abitset_not, abitset_ones, abitset_or, abitset_or_and,
3025 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
3026 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
3027 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
3028 Use function prototypes; this removes the need for declaring
3029 static functions simply to provide their prototypes.
3030 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
3031 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
3032 bitset_count_, bitset_create, bitset_dump, bitset_first,
3033 bitset_free, bitset_init, bitset_last, bitset_next,
3034 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
3035 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
3036 bitset_print, bitset_release_memory, bitset_toggle_,
3037 bitset_type_choose, bitset_type_get, bitset_type_name_get,
3038 debug_bitset): Likewise.
3039 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
3040 * lib/bitset_stats.c (bitset_log_histogram_print,
3041 bitset_percent_histogram_print, bitset_stats_and,
3042 bitset_stats_and_cmp, bitset_stats_and_or,
3043 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
3044 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
3045 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
3046 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
3047 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
3048 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
3049 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
3050 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
3051 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
3052 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
3053 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
3054 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
3055 bitset_stats_zero): Likewise.
3056 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3057 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3058 bitsetv_dump, debug_bitsetv): Likewise.
3059 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
3060 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
3061 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
3062 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
3063 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
3064 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
3065 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
3066 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
3067 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
3068 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
3069 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
3070 Likewise.
3071 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
3072 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
3073 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
3074 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
3075 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
3076 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
3077 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
3078 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
3079 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
3080 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
3081 lbitset_xor_cmp, lbitset_zero): Likewise.
3082
3083 2002-10-14 Akim Demaille <akim@epita.fr>
3084
3085 Version 1.75.
3086
3087 2002-10-14 Akim Demaille <akim@epita.fr>
3088
3089 * tests/Makefile.am (maintainer-check-posix): New.
3090
3091 2002-10-14 Akim Demaille <akim@epita.fr>
3092
3093 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
3094 member.
3095
3096 2002-10-14 Akim Demaille <akim@epita.fr>
3097
3098 * src/tables.c (table_ninf_remap): base -> tab.
3099 Reported by Matt Rosing.
3100
3101 2002-10-14 Paul Eggert <eggert@twinsun.com>
3102
3103 * tests/action.at, tests/calc.at, tests/conflicts.at,
3104 tests/cxx-type.at, tests/headers.at, tests/input.at,
3105 tests/regression.at, tests/synclines.at, tests/torture.at:
3106 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
3107 so that the tests still work even if POSIXLY_CORRECT is set.
3108 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
3109
3110 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
3111 for portability to K&R hosts. Fix typo: signed char is guaranteed
3112 only to 127, not to 128.
3113 * data/glr.c (yysigned_char): New type.
3114 * data/yacc.c (yysigned_char): Likewise.
3115 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
3116
3117 2002-10-13 Paul Eggert <eggert@twinsun.com>
3118
3119 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
3120 true due to limited range of data type" warning from GCC.
3121
3122 * data/c.m4 (b4_token_defines): Protect against double-inclusion
3123 by wrapping enum yytokentype's definition inside #ifndef
3124 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
3125
3126 2002-10-13 Akim Demaille <akim@epita.fr>
3127
3128 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
3129 Un yy- yyrhs to avoid the name clash with the global YYRHS.
3130
3131 2002-10-13 Akim Demaille <akim@epita.fr>
3132
3133 * Makefile.maint: Update from Autoconf 2.54.
3134 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
3135
3136 2002-10-13 Akim Demaille <akim@epita.fr>
3137
3138 * src/print.c (print_state): Separate the list of solved conflicts
3139 from the other items.
3140 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
3141
3142 2002-10-13 Akim Demaille <akim@epita.fr>
3143
3144 Let nondeterministic skeletons be usable with deterministic
3145 tables.
3146
3147 With the patch, GAWK compiled by GCC without -O2 passes its test
3148 suite using a GLR parser driven by LALR tables. It fails with -O2
3149 because `struct stat' gives two different answers on my machine:
3150 88 (definition of an auto var) and later 96 (memset on this var).
3151 Hence the stack is badly corrumpted. The headers inclusion is to
3152 blame: if I move the awk.h inclusion before GLR's system header
3153 inclusion, the two struct stat have the same size.
3154
3155 * src/tables.c (pack_table): Always create conflict_table.
3156 (token_actions): Always create conflict_list.
3157 * data/glr.c (YYFLAG): Remove, unused.
3158
3159 2002-10-13 Akim Demaille <akim@epita.fr>
3160
3161 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
3162 (O0FLAGS): New.
3163 (VALGRIND, GXX): New.
3164 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
3165 * tests/bison.in: Run $PREBISON a pre-command.
3166 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
3167 (maintainer-check-g++): New.
3168 * Makefile.am (maintainer-check): New.
3169
3170 2002-10-13 Akim Demaille <akim@epita.fr>
3171
3172 * data/glr.c: Formatting changes.
3173 Tweak some trace messages to match yacc.c's.
3174
3175 2002-10-13 Akim Demaille <akim@epita.fr>
3176
3177 GLR parsers sometimes raise parse errors instead of performing the
3178 default reduction.
3179 Reported by Charles-Henry de Boysson.
3180
3181 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
3182 check the length of the traces when %glr.
3183 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
3184 GLR's traces.
3185 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
3186 Test GLR parsers.
3187 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
3188 (yyltype): Remove the yy prefix from the member names.
3189 (yytable): Complete its comment.
3190 (yygetLRActions): Map error action number from YYTABLE from
3191 YYTABLE_NINF to 0.
3192 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
3193 (which was a bug: it should have been YYTABEL_NINF, and yet it was
3194 not satisfying as we could compare an YYACTION computed from
3195 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
3196 only value for error actions.
3197 (yyreportParseError): In verbose parse error messages, don't issue
3198 `error' in the list of expected tokens.
3199 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
3200 next action to perform to match glr.c's decoding.
3201 (yytable): Complete its comment.
3202
3203 2002-10-13 Paul Eggert <eggert@twinsun.com>
3204
3205 Fix problem reported by Henrik Grubbstroem in
3206 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
3207 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
3208 because the Bison parser reads the second action before reducing
3209 the first one.
3210 * src/scan-gram.l (rule_length): New static var.
3211 Use it to keep track of the rule length in the scanner, since
3212 we can't expect the parser to be in lock-step sync with the scanner.
3213 (handle_action_dollar, handle_action_at): Use this var.
3214 * tests/actions.at (Exotic Dollars): Test for the problem.
3215
3216 2002-10-12 Paul Eggert <eggert@twinsun.com>
3217
3218 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
3219 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
3220 Include <sys/time.h> when checking for clock_t and struct tms.
3221 Use same include order as source.
3222 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
3223 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
3224
3225 * lib/timevar.c: Update copyright date and clarify comments.
3226 (get_time) [IN_GCC]: Keep the GCC version for reference.
3227
3228 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
3229 GCC version as of today, then merge Bison's changes.
3230 Change "GCC" to "Bison" in copyright notice. timevar.def's
3231 author is Akim, so change that too.
3232
3233 * src/reader.c (grammar_current_rule_check):
3234 Don't worry about the default action if $$ is untyped.
3235 Prevents bogus warnings reported by Jim Gifford in
3236 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
3237
3238 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
3239 * data/glr.c, data/lalr1.cc, data/yacc.c:
3240 Output token definitions before the first part of user declarations.
3241 Fixes compatibility problem reported by Jim Gifford for kbd in
3242 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
3243
3244 2002-10-11 Paul Eggert <eggert@twinsun.com>
3245
3246 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
3247 (yyparse): here. This undoes some of the 2002-07-25 change.
3248 Compatibility problem reported by Ralf S. Engelschall with
3249 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
3250
3251 2002-10-11 Akim Demaille <akim@epita.fr>
3252
3253 * tests/regression.at Characters Escapes): New.
3254 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
3255 characters.
3256 Reported by Jan Nieuwenhuizen.
3257
3258 2002-10-11 Akim Demaille <akim@epita.fr>
3259
3260 * po/id.po: New.
3261
3262 2002-10-10 Paul Eggert <eggert@twinsun.com>
3263
3264 Portability fixes for bitsets; this also avoids several GCC
3265 warnings.
3266
3267 * lib/abitset.c: Include <stddef.h>, for offsetof.
3268 * lib/lbitset.c: Likewise.
3269
3270 * lib/abitset.c (abitset_bytes): Return a size that is aligned
3271 properly for vectors of objects. Do not assume that adding a
3272 header size to a multiple of a word size yields a value that is
3273 properly aligned for the whole union.
3274 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3275
3276 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
3277 unique names for structures.
3278 * lib/ebitset.c (ebitset_bytes): Likewise.
3279 * lib/lbitset.c (lbitset_bytes): Likewise.
3280
3281 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
3282 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
3283 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
3284 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
3285 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
3286 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
3287 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
3288 to improve the type-checking that GCC can do.
3289 * lib/bitset.c (bitset_op4_cmp): Likewise.
3290 * lib/bitset_stats.c (bitset_stats_count,
3291 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
3292 bitset_stats_copy, bitset_stats_disjoint_p,
3293 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
3294 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
3295 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
3296 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
3297 bitset_stats_and_or_cmp, bitset_stats_andn_or,
3298 bitset_stats_andn_or_cmp, bitset_stats_or_and,
3299 bitset_stats_or_and_cmp): Likewise.
3300 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
3301 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
3302 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
3303 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
3304
3305 * lib/abitset.h: Include bitset.h, not bbitset.h.
3306 * lib/ebitset.h: Likewise.
3307 * lib/lbitset.h: Likewise.
3308
3309 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
3310 All instances of parameters of type enum bitset_opts are now of
3311 type enum_bitset_opts, to conform to the C Standard, and similarly
3312 for enum_bitset_type.
3313 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3314 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3315
3316 Do not use "struct bitset_struct" to mean different things in
3317 different modules. Not only is this confusing, it violates
3318 the C Standard, which requires that structure types in different
3319 modules must be compatible if one is to be passed to the other.
3320 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
3321 All instances of "struct bitset_struct *" replaced with "bitset".
3322 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
3323 (union bitset_union, struct abitset_struct, struct ebitset_struct,
3324 struct lbitset_struct, struct bitset_stats_struct): New types.
3325 All uses of struct bitset_struct changed to union bitset_union,
3326 etc.
3327 * lib/abitset.c (struct abitset_struct, abitset,
3328 struct bitset_struct): Remove.
3329 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
3330 struct bitset_struct): Remove.
3331 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
3332 bitset_struct): Remove.
3333 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
3334 Likewise.
3335
3336 Do not call a function of type T using a call that assumes the
3337 function is of a different type U. Standard C requires that a
3338 function must be called with a type that is compatible with its
3339 definition.
3340 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3341 New decls.
3342 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3343 New functions.
3344 * lib/ebitset.c (PFV): Remove.
3345 * lib/lbitset.c (PFV): Likewise.
3346 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
3347 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
3348 decls.
3349 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
3350 (ebitset_vtable): Use them.
3351 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
3352 lbitset_xor): New functions.
3353 (lbitset_vtable): Use them.
3354
3355 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
3356 Declare.
3357
3358 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
3359 GCC warning.
3360 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
3361 Use offsetof, for simplicity.
3362
3363 2002-10-06 Paul Eggert <eggert@twinsun.com>
3364
3365 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
3366 the same width as int. This reapplies a hunk of the 2002-08-12 patch
3367 <http://mail.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
3368 which was inadvertently undone by the 2002-09-30 patch.
3369 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
3370 the same width as int.
3371
3372 2002-10-04 Paul Eggert <eggert@twinsun.com>
3373
3374 Version 1.50.
3375
3376 * configure.ac (AC_INIT), NEWS: Increment version number.
3377
3378 * doc/bison.texinfo: Minor spelling, grammar, and white space
3379 fixes.
3380 (Symbols): Mention that any negative value returned from yylex
3381 signifies end-of-input. Warn about negative chars. Mention
3382 the portable Standard C character set.
3383
3384 The GNU coding standard says CFLAGS and YFLAGS are reserved
3385 for the installer to set.
3386 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
3387 * src/Makefile.am (AM_CFLAGS): Likewise.
3388 (AM_YFLAGS): Renamed from YFLAGS.
3389
3390 Fix some MAX and MIN problems.
3391 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
3392 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
3393 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
3394 * src/reader.c (reader): Use it.
3395
3396 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
3397 POSIX 1003.1-2001 has removed fgrep.
3398
3399 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
3400
3401 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
3402 interpreted as signed.
3403 * lib/ebitset.c (ebitset_list): Fix bug.
3404
3405 2002-10-01 Paul Eggert <eggert@twinsun.com>
3406
3407 More fixes for 64-bit hosts and large bitsets.
3408
3409 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
3410 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
3411 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
3412 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
3413 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
3414 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
3415 bitset_count_): Likewise.
3416 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
3417 bitset_first, bitset_last): Likewise.
3418 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
3419 bitset_stats_list_reverse, bitset_stats_size,
3420 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
3421 Likewise.
3422 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3423 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3424 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3425 bitsetv_reflexive_transitive_closure): Likewise.
3426 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
3427 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
3428 Likewise.
3429 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
3430 Likewise.
3431
3432 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
3433 Use size_t, not unsigned int, to count bytes.
3434 * lib/abitset.h (abitset_bytes): Likewise.
3435 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
3436 Likewise.
3437 * lib/bitset.h (bitset_bytes): Likewise.
3438 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
3439 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
3440 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3441 * lib/ebitset.c (ebitset_bytes): Likewise.
3442 * lib/ebitset.h (ebitset_bytes): Likewise.
3443 * lib/lbitset.c (lbitset_bytes): Likewise.
3444 * lib/lbitset.h (lbitset_bytes): Likewise.
3445
3446 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
3447 abitset_subset_p, abitset_disjoint_p, abitset_and,
3448 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
3449 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
3450 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
3451 abitset_or_and, abitset_or_and_cmp):
3452 Use bitset_windex instead of unsigned int.
3453 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3454 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
3455 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
3456 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
3457 Likewise.
3458 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
3459
3460 * lib/bitset.c (bitset_print):
3461 Use proper printf formats for widths of integer types.
3462 * lib/bitset_stats.c (bitset_percent_histogram_print,
3463 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
3464 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3465 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3466 * lib/lbitset.c (lbitset_bytes): Likewise.
3467
3468 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
3469 BITSET_SIZE_MAX): New macros.
3470 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
3471 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
3472 to BITSET_WINDEX_MAX.
3473
3474 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
3475 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
3476 since we now return the bitset_bindex type (not int).
3477
3478 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
3479 when computing sizes.
3480 * lib/ebitset.c (ebitset_elts_grow): Likewise.
3481
3482 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
3483 and avoid cast to unsigned.
3484
3485 2002-09-30 Akim Demaille <akim@epita.fr>
3486
3487 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
3488 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
3489 Updates from Michael Hayes.
3490
3491 2002-09-30 Art Haas <ahaas@neosoft.com>
3492
3493 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
3494 invocations.
3495 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
3496 defined.
3497
3498 2002-09-27 Akim Demaille <akim@epita.fr>
3499
3500 Version 1.49c.
3501
3502 2002-09-27 Akim Demaille <akim@epita.fr>
3503
3504 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
3505 (Because of AC_LIBSOURCE).
3506
3507 2002-09-27 Akim Demaille <akim@epita.fr>
3508
3509 Playing with Autoscan.
3510
3511 * configure.ac: Remove the old LIBOBJ tweaks.
3512 (AC_REPLACE_FUNCS): Add strrchr and strtol.
3513 * lib/strrchr.c: New.
3514 * lib/strtol.c: New, from the Coreutils 4.5.1.
3515
3516 2002-09-27 Akim Demaille <akim@epita.fr>
3517
3518 Playing with Autoscan.
3519
3520 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
3521 * lib/Makefile.am (libbison_a_SOURCES): No longer include
3522 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
3523 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
3524 Coreutils 4.5.1.
3525
3526 2002-09-24 Akim Demaille <akim@epita.fr>
3527
3528 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
3529 (Frequently Asked Questions, Parser Stack Overflow): New.
3530
3531 2002-09-13 Akim Demaille <akim@epita.fr>
3532
3533 Playing with autoscan.
3534
3535 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
3536 * src/files.c (skeleton_find): Remove, unused.
3537 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
3538 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
3539
3540 2002-09-13 Akim Demaille <akim@epita.fr>
3541
3542 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
3543 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
3544
3545 2002-09-13 Akim Demaille <akim@epita.fr>
3546
3547 * configure.ac: Require 2.54.
3548 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
3549 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
3550 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
3551 Remove, provided by Autoconf macros.
3552
3553 2002-09-12 Akim Demaille <akim@epita.fr>
3554
3555 * m4/prereq.m4: Update, from Coreutils 4.5.1.
3556
3557 2002-09-12 Akim Demaille <akim@epita.fr>
3558
3559 * m4/prereq.m4: Update, from Fileutils 4.1.5.
3560 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
3561 Reported by Martin Mokrejs.
3562
3563 2002-09-10 Akim Demaille <akim@epita.fr>
3564
3565 * src/parse-gram.y: Associate a human readable string to each
3566 token type.
3567 * tests/regression.at (Invalid inputs): Adjust.
3568
3569 2002-09-10 Gary V. Vaughan <gary@gnu.org>
3570
3571 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
3572 with an Autoconf-2.5x style configure.ac.
3573
3574 2002-09-06 Paul Eggert <eggert@twinsun.com>
3575
3576 * doc/bison.texinfo (Conditions): Make explicit that the GPL
3577 exception applies only to yacc.c. This is a modification of a
3578 patch originally suggested by Akim Demaille.
3579
3580 2002-09-06 Akim Demaille <akim@epita.fr>
3581
3582 * data/c.m4 (b4_copyright): Move the GPL exception comment from
3583 here to...
3584 * data/yacc.c: here.
3585
3586 * data/lalr1.cc (struct yyltype): Don't define it, since we use
3587 LocationType.
3588 (b4_ltype): Default to yy::Location from location.hh.
3589
3590 2002-09-04 Jim Meyering <jim@meyering.net>
3591
3592 * data/yacc.c: Guard the declaration of yytoknum also with
3593 `#ifdef YYPRINT', so it is declared only when used.
3594
3595 2002-09-04 Akim Demaille <akim@epita.fr>
3596
3597 * configure.in: Rename as...
3598 * configure.ac: this.
3599 Bump to 1.49c.
3600
3601 2002-09-04 Akim Demaille <akim@epita.fr>
3602
3603 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
3604 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
3605 translate maintainer only messages.
3606
3607 2002-08-12 Paul Eggert <eggert@twinsun.com>
3608
3609 Version 1.49b.
3610
3611 * Makefile.am (SUBDIRS): Remove intl.
3612 (DISTCLEANFILES): Remove.
3613 * NEWS: Mention that GNU M4 is now required. Clarify what is
3614 meant by "larger grammars". Mention the pt_BR translation.
3615 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
3616 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
3617 Bump version from 0.11.2 to 0.11.5.
3618 (BISON_PREREQ_STAGE): Remove.
3619 (AM_GNU_GETTEXT): Use external gettext.
3620 (AC_OUTPUT): Remove intl/Makefile.
3621
3622 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
3623
3624 * data/glr.c: Include string.h, for strlen.
3625 (yyreportParseError): Use size_t for yysize.
3626 (yy_yypstack): No longer nested inside yypstates, as nested
3627 functions are not portable. Do not assume size_t is the
3628 same width as int.
3629 (yypstates): Do not assume that ptrdiff_t is the same width
3630 as int, and similarly for yyposn and YYINDEX.
3631
3632 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
3633
3634 * lib/Makefile.am (INCLUDES): Do not include from the intl
3635 directory, which has been removed.
3636 * src/Makefile.am (INCLUDES): Likewise.
3637
3638 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
3639 (bitsets_sources, additional_bitsets_sources, timevars_sources):
3640 New vars.
3641
3642 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
3643 * tests/Makefile.am (EXTRA_DIST): Likewise.
3644
3645 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
3646 Do not assume that bitset_windex is the same width as unsigned.
3647
3648 * lib/abitset.c (abitset_unused_clear): Do not assume that
3649 bitset_word is the same width as int.
3650 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
3651 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
3652 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
3653 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
3654 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
3655
3656 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
3657 portability to one's complement hosts!).
3658 * lib/ebitset.c (ebitset_op1): Likewise.
3659 * lib/lbitset.c (lbitset_op1): Likewise.
3660
3661 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
3662 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
3663 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
3664 Sync with fileutils.
3665 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
3666 lib/gettext.h: Sync with diffutils.
3667
3668 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
3669 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
3670
3671 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
3672 PROTOTYPES to check for prototypes, and "defined __STDC__" to
3673 check for void *.
3674
3675 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
3676 size_t; the old version tried to do this but casted improperly.
3677 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
3678 (bitset_test): Now returns int, not unsigned long.
3679
3680 * lib/bitset_stats.c: Include "gettext.h".
3681 (_): New macro.
3682 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
3683 name locals "index", as it generates unnecessary warnings on some
3684 hosts that have an "index" function.
3685
3686 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
3687 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
3688 they need translation.
3689 * src/LR0.c (state_list_append, new_itemsets, get_state,
3690 append_states, generate_states): Likewise.
3691 * src/assoc.c (assoc_to_string): Likewise.
3692 * src/closure.c (print_closure, set_firsts, closure): Likewise.
3693 * src/gram.c (grammar_dump): Likewise.
3694 * src/injections.c (injections_compute): Likewise.
3695 * src/lalr.c (lookaheads_print): Likewise.
3696 * src/relation.c (relation_transpose): Likewise.
3697 * src/scan-gram.l: Likewise.
3698 * src/tables.c (table_grow, pack_vector): Likewise.
3699
3700 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
3701 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
3702 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
3703 * m4/mbstate_t.m4: Sync with fileutils.
3704 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
3705
3706 * po/LINGUAS: Add pt_BR.
3707 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
3708 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
3709 lib/timevar.c.
3710 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
3711 manual recommends.
3712 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
3713
3714 * src/complain.c (strerror_r): Remove decl; not needed.
3715 (strerror): Use same pattern as ../lib/error.c.
3716
3717 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
3718
3719 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
3720
3721 * src/main.c (main): Cast result of bindtextdomain and textdomain
3722 to void, to avoid a GCC warning when --disable-nls is in effect.
3723
3724 * src/scan-gram.l: Use strings rather than escapes when possible,
3725 to minimize the number of warnings from xgettext.
3726 (handle_action_dollar, handle_action_at): Don't use isdigit,
3727 as it mishandles negative chars and it may not work as expected
3728 outside the C locale.
3729
3730 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
3731 this is a GCC extension and is not portable to other compilers.
3732
3733 * src/system.h (alloca): Use same pattern as ../lib/error.c.
3734 Do not include <ctype.h>; no longer needed.
3735 Do not include <malloc.h>; no longer needed (and generates
3736 warnings on OpenBSD 3.0).
3737
3738 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
3739 it's not portable.
3740
3741 * tests/regression.at: Do not use 'cc -c input.c -o input';
3742 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
3743
3744 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
3745 exit status as failure, not just exit status 1. Sun C exits
3746 with status 2 sometimes.
3747
3748 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
3749 Use it for the two large tests.
3750
3751 2002-08-02 Akim Demaille <akim@epita.fr>
3752
3753 * src/conflicts.c (conflicts_output): Don't output rules never
3754 reduced here, since anyway that computation doesn't work.
3755 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
3756 (rule_useless_p, rule_never_reduced_p): New.
3757 (grammar_rules_partial_print): Use a filter instead of a range.
3758 Display the title only if needed.
3759 (grammar_rules_print): Adjust.
3760 (grammar_rules_never_reduced_report): New.
3761 * src/tables.c (action_row): Move the computation of rules never
3762 reduced to...
3763 (token_actions): here.
3764 * src/main.c (main): Make the parser before making the report, so
3765 that rules never reduced are computed.
3766 Call grammar_rules_never_reduced_report.
3767 * src/print.c (print_results): Report rules never reduced.
3768 * tests/conflicts.at, tests/reduce.at: Adjust.
3769
3770 2002-08-01 Akim Demaille <akim@epita.fr>
3771
3772 Instead of attaching lookaheads and duplicating the rules being
3773 reduced by a state, attach the lookaheads to the reductions.
3774
3775 * src/state.h (state_t): Remove the `lookaheads',
3776 `lookaheads_rule' member.
3777 (reductions_t): Add a `lookaheads' member.
3778 Use a regular array for the `rules'.
3779 * src/state.c (reductions_new): Initialize the lookaheads member
3780 to 0.
3781 (state_rule_lookaheads_print): Adjust.
3782 * src/state.h, src/state.c (state_reductions_find): New.
3783 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
3784 (count_rr_conflicts): Adjust.
3785 * src/lalr.c (LArule): Remove.
3786 (add_lookback_edge): Adjust.
3787 (state_lookaheads_count): New.
3788 (states_lookaheads_initialize): Merge into...
3789 (initialize_LA): this.
3790 (lalr_free): Adjust.
3791 * src/main.c (main): Don't free nullable and derives too early: it
3792 is used by --verbose.
3793 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
3794
3795 2002-08-01 Akim Demaille <akim@epita.fr>
3796
3797 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
3798 `rule_number_t**'.
3799 (set_derives, free_derives): Rename as...
3800 (derives_compute, derives_free): this.
3801 Adjust all dependencies.
3802 * src/nullable.c (set_nullable, free_nullable): Rename as...
3803 (nullable_compute, nullable_free): these.
3804 (rule_list_t): Store rule_t *, not rule_number_t.
3805 * src/state.c (state_rule_lookaheads_print): Directly compare rule
3806 pointers, instead of their numbers.
3807 * src/main.c (main): Call nullable_free, and derives_free earlier,
3808 as they were lo longer used.
3809
3810 2002-08-01 Akim Demaille <akim@epita.fr>
3811
3812 * lib/timevar.c (get_time): Include children time.
3813 * src/lalr.h (LA, LArule): Don't export them: used with the
3814 state_t.
3815 * src/lalr.c (LA, LArule): Static.
3816 * src/lalr.h, src/lalr.c (lalr_free): New.
3817 * src/main.c (main): Call it.
3818 * src/tables.c (pack_vector): Check whether loc is >= to the
3819 table_size, not >.
3820 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
3821 (tables_generate): do it, since that's also it which allocates
3822 them.
3823 Don't free LA and LArule, main does.
3824
3825 2002-07-31 Akim Demaille <akim@epita.fr>
3826
3827 Separate parser tables computation and output.
3828
3829 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
3830 (conflict_list, conflict_list_cnt, table, check, table_ninf)
3831 (yydefgoto, yydefact, high): Move to...
3832 * src/tables.h, src/tables.c: here.
3833 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3834 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3835 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
3836 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
3837 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
3838 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
3839 (action_row, save_row, token_actions, save_column, default_goto)
3840 (goto_actions, sort_actions, matching_state, pack_vector)
3841 (table_ninf_remap, pack_table, prepare_actions): Move to...
3842 * src/tables.c: here.
3843 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
3844 * src/output.c (token_actions, output_base, output_conflicts)
3845 (output_check): Merge into...
3846 (prepare_actions): this.
3847 (actions_output): Rename as...
3848 (user_actions_output): this.
3849 * src/main.c (main): Call tables_generate and tables_free.
3850
3851 2002-07-31 Akim Demaille <akim@epita.fr>
3852
3853 Steal GCC's --time-report support.
3854
3855 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
3856 stolen/adjusted from GCC.
3857 * m4/stage.m4: Remove time related checks.
3858 * m4/timevar.m4: New.
3859 * configure.in: Adjust.
3860 * src/system.h: Adjust to using timevar.h.
3861 * src/getargs.h, src/getargs.c: Support trace_time for
3862 --trace=time.
3863 * src/main.c (stage): Remove.
3864 (main): Replace `stage' invocations with timevar calls.
3865 * src/output.c: Insert pertinent timevar calls.
3866
3867 2002-07-31 Akim Demaille <akim@epita.fr>
3868
3869 Let --trace have arguments.
3870
3871 * src/getargs.h (enum trace_e): New.
3872 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
3873 (long_options, short_options): --trace/-T takes an optional
3874 argument.
3875 Change all the uses of trace_flag to reflect the new flags.
3876 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
3877
3878 Strengthen `stage' portability.
3879
3880 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
3881 * configure.in: Use it.
3882 Don't check for malloc.h and sys/times.h.
3883 * src/system.h: Include them when appropriate.
3884 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
3885 times and struct tms are available.
3886
3887 2002-07-30 Akim Demaille <akim@epita.fr>
3888
3889 In verbose parse error message, don't report `error' as an
3890 expected token.
3891 * tests/actions.at (Printers and Destructors): Adjust.
3892 * tests/calc.at (Calculator $1): Adjust.
3893 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
3894 error message, do not report the parser accepts the error token in
3895 that state.
3896
3897 2002-07-30 Akim Demaille <akim@epita.fr>
3898
3899 Normalize conflict related messages.
3900
3901 * src/complain.h, src/complain.c (warn, complain): New.
3902 * src/conflicts.c (conflicts_print): Use them.
3903 (conflict_report_yacc): New, extracted from...
3904 (conflicts_print): here.
3905 * tests/conflicts.at, tests/existing.at: Adjust.
3906
3907 2002-07-30 Akim Demaille <akim@epita.fr>
3908
3909 Report rules which are never reduced by the parser: those hidden
3910 by conflicts.
3911
3912 * src/LR0.c (save_reductions): Don't make the final state too
3913 different: save its reduction (accept) instead of having a state
3914 without any action (no shift or goto, no reduce).
3915 Note: the final state is now a ``regular'' state, i.e., the
3916 parsers now contain `reduce 0' as default reduction.
3917 Nevertheless, since they decide to `accept' when yystate =
3918 final_state, they still will not reduce rule 0.
3919 * src/print.c (print_actions, print_reduction): Adjust.
3920 * src/output.c (action_row): Track reduced rules.
3921 (token_actions): Report rules never reduced.
3922 * tests/conflicts.at, tests/regression.at: Adjust.
3923
3924 2002-07-30 Akim Demaille <akim@epita.fr>
3925
3926 `stage' was accidently included in a previous patch.
3927 Initiate its autoconfiscation.
3928
3929 * configure.in: Look for malloc.h and sys/times.h.
3930 * src/main.c (stage): Adjust.
3931 Report only when trace_flag.
3932
3933 2002-07-29 Akim Demaille <akim@epita.fr>
3934
3935 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
3936 state_number_t.
3937 (errs_t): symbol_t*, not symbol_number_t.
3938 (reductions_t): rule_t*, not rule_number_t.
3939 (FOR_EACH_SHIFT): New.
3940 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
3941 * src/print.c, src/print_graph.c: Adjust.
3942
3943 2002-07-29 Akim Demaille <akim@epita.fr>
3944
3945 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
3946
3947 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
3948 (endtoken, accept): these.
3949 * src/reader.c (reader): Set endtoken's default tag to "$end".
3950 Set undeftoken's tag to "$undefined" instead of "$undefined.".
3951 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
3952 Adjust.
3953
3954 2002-07-29 Akim Demaille <akim@epita.fr>
3955
3956 * src/reduce.c (reduce_grammar): When the language is empty,
3957 complain about the start symbol, not the axiom.
3958 Use its location.
3959 * tests/reduce.at (Empty Language): New.
3960
3961 2002-07-26 Akim Demaille <akim@epita.fr>
3962
3963 * src/reader.h, src/reader.c (gram_error): ... can't get
3964 yycontrol without making too strong assumptions on the parser
3965 itself.
3966 * src/output.c (prepare_tokens): Use the real 0th value of
3967 token_translations instead of `0'.
3968 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
3969 visible here.
3970 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
3971 for the time being: %locations ought to provide it to yyerror.
3972
3973 2002-07-25 Akim Demaille <akim@epita.fr>
3974
3975 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
3976 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
3977 * tests/regression.at (Web2c Actions): Adjust.
3978
3979 2002-07-25 Akim Demaille <akim@epita.fr>
3980
3981 Stop storing rules from 1 to nrules + 1.
3982
3983 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
3984 * src/nullable.c, src/output.c, src/print.c, src/reader.c
3985 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
3986 Iterate from 0 to nrules.
3987 Use rule_number_as_item_number and item_number_as_rule_number.
3988 Adjust to `derive' now containing possibly 0.
3989 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
3990 Handle the `- 1' part in rule numbers from/to item numbers.
3991 * src/conflicts.c (log_resolution): Fix the message which reversed
3992 shift and reduce.
3993 * src/output.c (action_row): Initialize default_rule to -1.
3994 (token_actions): Adjust.
3995 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
3996 expected output.
3997 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
3998
3999 2002-07-25 Akim Demaille <akim@epita.fr>
4000
4001 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
4002 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
4003 (b4_c_knr_arg_decl): New.
4004 * data/yacc.c: Use it to define yysymprint, yydestruct, and
4005 yyreport_parse_error.
4006
4007 2002-07-25 Akim Demaille <akim@epita.fr>
4008
4009 * data/yacc.c (yyreport_parse_error): New, extracted from...
4010 (yyparse): here.
4011 (yydestruct, yysymprint): Move above yyparse.
4012 Be K&R compliant.
4013
4014 2002-07-25 Akim Demaille <akim@epita.fr>
4015
4016 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
4017 replace...
4018 (b4_sint_type, b4_uint_type): these.
4019 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
4020 * tests/regression.at (Web2c Actions): Adjust.
4021
4022 2002-07-25 Akim Demaille <akim@epita.fr>
4023
4024 * src/gram.h (TIEM_NUMBER_MAX): New.
4025 (item_number_of_rule_number, rule_number_of_item_number): Rename
4026 as...
4027 (rule_number_as_item_number, item_number_as_rule_number): these.
4028 Adjust dependencies.
4029 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
4030 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
4031 (symbol_number_to_vector_number): New.
4032 (order): Of vector_number_t* type.
4033 (base_t, BASE_MAX, BASE_MIN): New.
4034 (froms, tos, width, pos, check): Of base_t type.
4035 (action_number_t, ACTION_MIN, ACTION_MAX): New.
4036 (actrow): Of action_number_t type.
4037 (conflrow): Of unsigned int type.
4038 (table_ninf, base_ninf): New.
4039 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
4040 (muscle_insert_int_table, muscle_insert_base_table)
4041 (muscle_insert_rule_number_table): New.
4042 (prepare_tokens): Output `toknum' as int_table.
4043 (action_row): Returns a rule_number_t.
4044 Use ACTION_MIN, not SHRT_MIN.
4045 (token_actions): yydefact is rule_number_t*.
4046 (table_ninf_remap): New.
4047 (pack_table): Use it for `base' and `table'.
4048 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
4049 replaced with...
4050 (YYPACT_NINF, YYTABLE_NINF): these.
4051 (yypact, yytable): Compute their types instead of hard-coded
4052 `short'.
4053 * tests/regression.at (Web2c Actions): Adjust.
4054
4055 2002-07-19 Akim Demaille <akim@epita.fr>
4056
4057 * src/scan-gram.l (id): Can start with an underscore.
4058
4059 2002-07-16 Akim Demaille <akim@epita.fr>
4060
4061 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
4062 Adjust all former `associativity' dependencies.
4063 * src/symtab.c (symbol_new): Default associativity is `undef', not
4064 `right'.
4065 (symbol_check_alias_consistence): Adjust.
4066
4067 2002-07-09 Akim Demaille <akim@epita.fr>
4068
4069 * doc/bison.texinfo: Properly set the ``header'' part.
4070 Use @dircategory ``GNU programming tools'' as per Texinfo's
4071 documentation.
4072 Use @copying.
4073
4074 2002-07-09 Akim Demaille <akim@epita.fr>
4075
4076 * lib/quotearg.h: Protect against multiple inclusions.
4077 * src/location.h (location_t): Add a `file' member.
4078 (LOCATION_RESET, LOCATION_PRINT): Adjust.
4079 * src/complain.c (warn_at, complain_at, fatal_at): Drop
4080 `error_one_per_line' support.
4081
4082 2002-07-09 Akim Demaille <akim@epita.fr>
4083
4084 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
4085 * src/reader.c (lineno): Remove.
4086 Adjust all dependencies.
4087 (get_merge_function): Take a location and use complain_at.
4088 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
4089 * tests/regression.at (Invalid inputs, Mixing %token styles):
4090 Adjust.
4091
4092 2002-07-09 Akim Demaille <akim@epita.fr>
4093
4094 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
4095 recovery rule, and forbid extensions when --yacc.
4096 (gram_error): Use complain_at.
4097 * src/reader.c (reader): Exit if there were parse errors.
4098
4099 2002-07-09 Akim Demaille <akim@epita.fr>
4100
4101 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
4102 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
4103 Reported by R Blake <blakers@mac.com>.
4104
4105 2002-07-09 Akim Demaille <akim@epita.fr>
4106
4107 * data/yacc.c: Output the copyright notive in the header.
4108
4109 2002-07-03 Akim Demaille <akim@epita.fr>
4110
4111 * src/output.c (froms, tos): Are state_number_t.
4112 (save_column): sp, sp1, and sp2 are state_number_t.
4113 (prepare): Rename `final' as `final_state_number', `nnts' as
4114 `nterms_number', `nrules' as `rules_number', `nstates' as
4115 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
4116 unused.
4117 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
4118 * data/lalr1.cc (nsym_): Remove, unused.
4119
4120 2002-07-03 Akim Demaille <akim@epita.fr>
4121
4122 * src/lalr.h, src/lalr.c (goto_number_t): New.
4123 * src/lalr.c (goto_list_t): New.
4124 Propagate them.
4125 * src/nullable.c (rule_list_t): New.
4126 Propagate.
4127 * src/types.h: Remove.
4128
4129 2002-07-03 Akim Demaille <akim@epita.fr>
4130
4131 * src/closure.c (print_fderives): Use rule_rhs_print.
4132 * src/derives.c (print_derives): Use rule_rhs_print.
4133 (rule_list_t): New, replaces `shorts'.
4134 (set_derives): Add comments.
4135 * tests/sets.at (Nullable, Firsts): Adjust.
4136
4137 2002-07-03 Akim Demaille <akim@epita.fr>
4138
4139 * src/output.c (prepare_actions): Free `tally' and `width'.
4140 (prepare_actions): Allocate and free `order'.
4141 * src/symtab.c (symbols_free): Free `symbols'.
4142 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
4143 * src/output.c (m4_invoke): Move to...
4144 * src/scan-skel.l: here.
4145 (<<EOF>>): Close yyout, and free its name.
4146
4147 2002-07-03 Akim Demaille <akim@epita.fr>
4148
4149 Fix some memory leaks, and fix a bug: state 0 was examined twice.
4150
4151 * src/LR0.c (new_state): Merge into...
4152 (state_list_append): this.
4153 (new_states): Merge into...
4154 (generate_states): here.
4155 (set_states): Don't ensure a proper `errs' state member here, do it...
4156 * src/conflicts.c (conflicts_solve): here.
4157 * src/state.h, src/state.c: Comment changes.
4158 (state_t): Rename member `shifts' as `transitions'.
4159 Adjust all dependencies.
4160 (errs_new): For consistency, also take the values as argument.
4161 (errs_dup): Remove.
4162 (state_errs_set): New.
4163 (state_reductions_set, state_transitions_set): Assert that no
4164 previous value was assigned.
4165 (state_free): New.
4166 (states_free): Use it.
4167 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
4168 temporary storage: use `errs' and `nerrs' as elsewhere.
4169 (set_conflicts): Allocate and free this `errs'.
4170
4171 2002-07-02 Akim Demaille <akim@epita.fr>
4172
4173 * lib/libiberty.h: New.
4174 * lib: Update the bitset implementation from upstream.
4175 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
4176 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
4177 * src/main.c: Adjust bitset stats calls.
4178
4179 2002-07-01 Paul Eggert <eggert@twinsun.com>
4180
4181 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
4182 char, so that negative chars don't collide with $.
4183
4184 2002-06-30 Akim Demaille <akim@epita.fr>
4185
4186 Have the GLR tests be `warning' checked, and fix the warnings.
4187
4188 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
4189 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
4190 (yyremoveDeletes): `yyi' and `yyj' are size_t.
4191 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
4192 (yyaddDeferredAction): static.
4193 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
4194 (yyreportParseError): yyprefix is const.
4195 yytokenp is used only when verbose.
4196 (yy__GNUC__): Replace with __GNUC__.
4197 (yypdumpstack): yyi is size_t.
4198 (yypreference): Un-yy local variables and arguments, to avoid
4199 clashes with `yyr1'. Anyway, we are not in the user name space.
4200 (yytname_size): be an int, as is compared with ints.
4201 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
4202 Use them.
4203 * tests/cxx-gram.at: Use quotation to protect $1.
4204 Use AT_COMPILE to enable warnings hunts.
4205 Prototype yylex and yyerror.
4206 `Use' argc.
4207 Include `string.h', not `strings.h'.
4208 Produce and prototype stmtMerge only when used.
4209 yylex takes a location.
4210
4211 2002-06-30 Akim Demaille <akim@epita.fr>
4212
4213 We spend a lot of time in quotearg, in particular when --verbose.
4214
4215 * src/symtab.c (symbol_get): Store a quoted version of the key.
4216 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
4217 Adjust all callers.
4218
4219 2002-06-30 Akim Demaille <akim@epita.fr>
4220
4221 * src/state.h (reductions_t): Rename member `nreds' as num.
4222 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
4223 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
4224
4225 2002-06-30 Akim Demaille <akim@epita.fr>
4226
4227 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
4228 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
4229 (shifts_to): Rename as...
4230 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
4231 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
4232 (TRANSITION_IS_DISABLED, transitions_to): these.
4233
4234 2002-06-30 Akim Demaille <akim@epita.fr>
4235
4236 * src/print.c (print_shifts, print_gotos): Merge into...
4237 (print_transitions): this.
4238 (print_transitions, print_errs, print_reductions): Align the
4239 lookaheads columns.
4240 (print_core, print_transitions, print_errs, print_state,
4241 print_grammar): Output empty lines separator before, not after.
4242 (state_default_rule_compute): Rename as...
4243 (state_default_rule): this.
4244 * tests/conflicts.at (Defaulted Conflicted Reduction),
4245 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
4246 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
4247
4248 2002-06-30 Akim Demaille <akim@epita.fr>
4249
4250 Display items as we display rules.
4251
4252 * src/gram.h, src/gram.c (rule_lhs_print): New.
4253 * src/gram.c (grammar_rules_partial_print): Use it.
4254 * src/print.c (print_core): Likewise.
4255 * tests/conflicts.at (Defaulted Conflicted Reduction),
4256 (Unresolved SR Conflicts): Adjust.
4257 (Unresolved SR Conflicts): Adjust and rename as...
4258 (Resolved SR Conflicts): this, as was meant.
4259 * tests/regression.at (Web2c Report): Adjust.
4260
4261 2002-06-30 Akim Demaille <akim@epita.fr>
4262
4263 * src/print.c (state_default_rule_compute): New, extracted from...
4264 (print_reductions): here.
4265 Pessimize, but clarify the code.
4266 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
4267
4268 2002-06-30 Akim Demaille <akim@epita.fr>
4269
4270 * src/output.c (action_row): Let default_rule be always a rule
4271 number.
4272
4273 2002-06-30 Akim Demaille <akim@epita.fr>
4274
4275 * src/closure.c (print_firsts, print_fderives, closure):
4276 Use BITSET_EXECUTE.
4277 * src/lalr.c (lookaheads_print): Likewise.
4278 * src/state.c (state_rule_lookaheads_print): Likewise.
4279 * src/print_graph.c (print_core): Likewise.
4280 * src/print.c (print_reductions): Likewise.
4281 * src/output.c (action_row): Likewise.
4282 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
4283
4284 2002-06-30 Akim Demaille <akim@epita.fr>
4285
4286 * src/print_graph.c: Use report_flag.
4287
4288 2002-06-30 Akim Demaille <akim@epita.fr>
4289
4290 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
4291 to...
4292 * src/relation.h, src/relation.c (traverse, relation_digraph)
4293 (relation_print, relation_transpose): New.
4294
4295 2002-06-30 Akim Demaille <akim@epita.fr>
4296
4297 * src/state.h, src/state.c (shifts_to): New.
4298 * src/lalr.c (build_relations): Use it.
4299
4300 2002-06-30 Akim Demaille <akim@epita.fr>
4301
4302 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
4303 (item_number_of_rule_number, rule_number_of_item_number): New.
4304 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
4305 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
4306 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
4307 Propagate their use.
4308 Much remains to be done, in particular wrt `shorts' from types.h.
4309
4310 2002-06-30 Akim Demaille <akim@epita.fr>
4311
4312 * src/symtab.c (symbol_new): Initialize the `printer' member.
4313
4314 2002-06-30 Akim Demaille <akim@epita.fr>
4315
4316 * src/LR0.c (save_reductions): Remove, replaced by...
4317 * src/state.h, src/state.c (state_reductions_set): New.
4318 (reductions, errs): Rename as...
4319 (reductions_t, errs_t): these.
4320 Adjust all dependencies.
4321
4322 2002-06-30 Akim Demaille <akim@epita.fr>
4323
4324 * src/LR0.c (state_list_t, state_list_append): New.
4325 (first_state, last_state): Now symbol_list_t.
4326 (this_state): Remove.
4327 (new_itemsets, append_states, save_reductions): Take a state_t as
4328 argument.
4329 (set_states, generate_states): Adjust.
4330 (save_shifts): Remove, replaced by...
4331 * src/state.h, src/state.c (state_shifts_set): New.
4332 (shifts): Rename as...
4333 (shifts_t): this.
4334 Adjust all dependencies.
4335 * src/state.h (state_t): Remove the `next' member.
4336
4337 2002-06-30 Akim Demaille <akim@epita.fr>
4338
4339 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
4340 escaped in slot 0.
4341
4342 2002-06-30 Akim Demaille <akim@epita.fr>
4343
4344 Use hash.h for the state hash table.
4345
4346 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
4347 (allocate_storage): Use state_hash_new.
4348 (free_storage): Use state_hash_free.
4349 (new_state, get_state): Adjust.
4350 * src/lalr.h, src/lalr.c (states): Move to...
4351 * src/states.h (state_t): Remove the `link' member, no longer
4352 used.
4353 * src/states.h, src/states.c: here.
4354 (state_hash_new, state_hash_free, state_hash_lookup)
4355 (state_hash_insert, states_free): New.
4356 * src/states.c (state_table, state_compare, state_hash): New.
4357 * src/output.c (output_actions): Do not free states now, since we
4358 still need to know the final_state number in `prepare', called
4359 afterwards. Do it...
4360 * src/main.c (main): here: call states_free after `output'.
4361
4362 2002-06-30 Akim Demaille <akim@epita.fr>
4363
4364 * src/state.h, src/state.c (state_new): New, extracted from...
4365 * src/LR0.c (new_state): here.
4366 * src/state.h (STATE_ALLOC): Move to...
4367 * src/state.c: here.
4368 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
4369 * src/state.h, src/state.c: here.
4370
4371 2002-06-30 Akim Demaille <akim@epita.fr>
4372
4373 * src/reader.c (gensym): Rename as...
4374 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
4375 (getsym): Rename as...
4376 (symbol_get): this.
4377
4378 2002-06-30 Akim Demaille <akim@epita.fr>
4379
4380 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
4381 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
4382 * src/output.c, src/print.c, src/print_graph.c: Propagate.
4383 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
4384
4385 2002-06-30 Akim Demaille <akim@epita.fr>
4386
4387 Make the test suite pass with warnings checked.
4388
4389 * tests/actions.at (Printers and Destructors): Improve.
4390 Avoid unsigned vs. signed issues.
4391 * tests/calc.at: Don't exercise the scanner here, do it...
4392 * tests/input.at (Torturing the Scanner): here.
4393
4394 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4395
4396 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
4397 reorganize first lines parallel to yacc.c.
4398
4399 2002-06-28 Akim Demaille <akim@epita.fr>
4400
4401 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
4402 (b4_token_enum, b4_token_defines): New, factored from...
4403 * data/lalr1.cc, data/yacc.c, glr.c: here.
4404
4405 2002-06-28 Akim Demaille <akim@epita.fr>
4406
4407 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
4408 unused variables.
4409 * src/output.c (merger_output): static.
4410
4411 2002-06-28 Akim Demaille <akim@epita.fr>
4412
4413 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
4414 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
4415 pacify GCC.
4416 * src/output.c (save_row): Initialize all the variables to pacify GCC.
4417
4418 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4419
4420 Accumulated changelog for new GLR parsing features.
4421
4422 * src/conflicts.c (count_total_conflicts): Change name to
4423 conflicts_total_count.
4424 * src/conflicts.h: Ditto.
4425 * src/output.c (token_actions): Use the new name.
4426 (output_conflicts): Change conflp => conflict_list_heads, and
4427 confl => conflict_list for better readability.
4428 * data/glr.c: Use the new names.
4429 * NEWS: Add self to GLR announcement.
4430
4431 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
4432
4433 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
4434 Akim Demaille.
4435
4436 * data/bison.glr: Change name to glr.c
4437 * data/glr.c: Renamed from bison.glr.
4438 * data/Makefile.am: Add glr.c
4439
4440 * src/getargs.c:
4441
4442 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
4443 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
4444
4445 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4446
4447 * data/bison.glr: Be sure to restore the
4448 current #line when returning to the skeleton contents after having
4449 exposed the input file's #line.
4450
4451 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4452
4453 * data/bison.glr: Bring up to date with changes to bison.simple.
4454
4455 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4456
4457 * data/bison.glr: Correct definitions that use b4_prefix.
4458 Various reformatting.
4459 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
4460 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
4461 yytokenp argument; now part of stack.
4462 (yychar): Define to behave as documented.
4463 (yyclearin): Ditto.
4464
4465 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4466
4467 * src/reader.h: Add declaration for free_merger_functions.
4468
4469 * src/reader.c (merge_functions): New variable.
4470 (get_merge_function): New function.
4471 (free_merger_functions): New function.
4472 (readgram): Check for %prec that is not followed by a symbol.
4473 Handle %dprec and %merge declarations.
4474 (packgram): Initialize dprec and merger fields in rules array.
4475
4476 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
4477 conflict_list_cnt, conflict_list_free): New variables.
4478 (table_grow): Also grow conflict_table.
4479 (prepare_rules): Output dprec and merger tables.
4480 (conflict_row): New function.
4481 (action_row): Output conflict lists for GLR parser. Don't use
4482 default reduction in conflicted states for GLR parser so that there
4483 are spaces for the conflict lists.
4484 (save_row): Also save conflict information.
4485 (token_actions): Allocate conflict list.
4486 (merger_output): New function.
4487 (pack_vector): Pack conflict table, too.
4488 (output_conflicts): New function to output yyconflp and yyconfl.
4489 (output_check): Allocate conflict_tos.
4490 (output_actions): Output conflict tables, also.
4491 (output_skeleton): Output b4_mergers definition.
4492 (prepare): Output b4_max_rhs_length definition.
4493 Use 'bison.glr' as default skeleton for GLR parsers.
4494
4495 * src/gram.c (glr_parser): New flag.
4496 (grammar_free): Call free_merger_functions.
4497
4498 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
4499 all pairs of conflicting reductions, rather than just all tokens
4500 causing conflicts. Needed to size conflict tables.
4501 (conflicts_output): Modify call to count_rr_conflicts for new
4502 interface.
4503 (conflicts_print): Ditto.
4504 (count_total_conflicts): New function.
4505
4506 * src/reader.h (merger_list): New type.
4507 (merge_functions): New variable.
4508
4509 * src/lex.h (tok_dprec, tok_merge): New token types.
4510
4511 * src/gram.h (rule_s): Add dprec and merger fields.
4512 (glr_parser): New flag.
4513
4514 * src/conflicts.h (count_total_conflicts): New function.
4515
4516 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
4517
4518 * doc/bison.texinfo (Generalized LR Parsing): New section.
4519 (GLR Parsers): New section.
4520 (Language and Grammar): Mention GLR parsing.
4521 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
4522 Correct typo ("tge" -> "the").
4523
4524 * data/bison.glr: New skeleton for GLR parsing.
4525
4526 * tests/cxx-gram.at: New tests for GLR parsing.
4527
4528 * tests/testsuite.at: Include cxx-gram.at.
4529
4530 * tests/Makefile.am: Add cxx-gram.at.
4531
4532 * src/parse-gram.y:
4533
4534 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
4535
4536 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
4537
4538 2002-06-27 Akim Demaille <akim@epita.fr>
4539
4540 * src/options.h, src/options.c: Remove.
4541 * src/getargs.c (short_options, long_options): New.
4542
4543 2002-06-27 Akim Demaille <akim@epita.fr>
4544
4545 * data/bison.simple, data/bison.c++: Rename as...
4546 * data/yacc.c, data/lalr1.cc: these.
4547 * doc/bison.texinfo (Environment Variables): Remove.
4548
4549 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
4550
4551 * src/getargs.c (report_argmatch): Initialize strtok().
4552
4553 2002-06-20 Akim Demaille <akim@epita.fr>
4554
4555 * data/bison.simple (b4_symbol_actions): New, replaces...
4556 (b4_symbol_destructor, b4_symbol_printer): these.
4557 (yysymprint): Be sure to call YYPRINT only for tokens, and using
4558 user token numbers.
4559
4560 2002-06-20 Akim Demaille <akim@epita.fr>
4561
4562 * data/bison.simple (yydestructor): Rename as...
4563 (yydestruct): this.
4564
4565 2002-06-20 Akim Demaille <akim@epita.fr>
4566
4567 * src/symtab.h, src/symtab.c (symbol_type_set)
4568 (symbol_destructor_set, symbol_precedence_set): The location is
4569 the last argument.
4570 Adjust all callers.
4571
4572 2002-06-20 Akim Demaille <akim@epita.fr>
4573
4574 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
4575 internals.
4576 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
4577 Takes a location.
4578 * src/symtab.h, src/symtab.c (symbol_class_set)
4579 (symbol_user_token_number_set): Likewise.
4580 Adjust all callers.
4581 Promote complain_at.
4582 * tests/input.at (Type Clashes): Adjust.
4583
4584 2002-06-20 Akim Demaille <akim@epita.fr>
4585
4586 * data/bison.simple (YYLEX): Fix the declaration when
4587 %pure-parser.
4588
4589 2002-06-20 Akim Demaille <akim@epita.fr>
4590
4591 * data/bison.simple (yysymprint): Don't print the token number,
4592 just its name.
4593 * tests/actions.at (Destructors): Rename as...
4594 (Printers and Destructors): this.
4595 Also exercise %printer.
4596
4597 2002-06-20 Akim Demaille <akim@epita.fr>
4598
4599 * data/bison.simple (YYDSYMPRINT): New.
4600 Use it to remove many of the #if YYDEBUG/if (yydebug).
4601
4602 2002-06-20 Akim Demaille <akim@epita.fr>
4603
4604 * src/symtab.h, src/symtab.c (symbol_t): printer and
4605 printer_location are new members.
4606 (symbol_printer_set): New.
4607 * src/parse-gram.y (PERCENT_PRINTER): New token.
4608 Handle its associated rule.
4609 * src/scan-gram.l: Adjust.
4610 (handle_destructor_at, handle_destructor_dollar): Rename as...
4611 (handle_symbol_code_at, handle_symbol_code_dollar): these.
4612 * src/output.c (symbol_printers_output): New.
4613 (output_skeleton): Call it.
4614 * data/bison.simple (yysymprint): New. Cannot be named yyprint
4615 since there are already many grammar files with a user `yyprint'.
4616 Replace the calls to YYPRINT to calls to yysymprint.
4617 * tests/calc.at: Adjust.
4618 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
4619 taking advantage of parser very internal details (stack size!).
4620
4621 2002-06-20 Akim Demaille <akim@epita.fr>
4622
4623 * src/scan-gram.l: Complete the scanner with the missing patterns
4624 to pacify Flex.
4625 Use `quote' and `symbol_tag_get' where appropriate.
4626
4627 2002-06-19 Akim Demaille <akim@epita.fr>
4628
4629 * tests/actions.at (Destructors): Augment to test locations.
4630 * data/bison.simple (yydestructor): Pass it the current location
4631 if locations are enabled.
4632 Prototype only when __STDC__ or C++.
4633 Change the argument names to move into the yy name space: there is
4634 user code here.
4635
4636 2002-06-19 Akim Demaille <akim@epita.fr>
4637
4638 * data/bison.simple (b4_pure_if): New.
4639 Use it instead of #ifdef YYPURE.
4640
4641 2002-06-19 Akim Demaille <akim@epita.fr>
4642
4643 * data/bison.simple (b4_location_if): New.
4644 Use it instead of #ifdef YYLSP_NEEDED.
4645
4646 2002-06-19 Akim Demaille <akim@epita.fr>
4647
4648 Prepare @$ in %destructor, but currently don't bind it in the
4649 skeleton, as %location use is not cleaned up yet.
4650
4651 * src/scan-gram.l (handle_dollar, handle_destructor_at)
4652 (handle_action_at): New.
4653 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
4654 a braced_code_t and a location as additional arguments.
4655 (handle_destructor_dollar): Instead of requiring `b4_eval', just
4656 unquote one when outputting `b4_dollar_dollar'.
4657 Adjust callers.
4658 * data/bison.simple (b4_eval): Remove.
4659 (b4_symbol_destructor): Adjust.
4660 * tests/input.at (Invalid @n): Adjust.
4661
4662 2002-06-19 Zack Weinberg <zack@codesourcery.com>
4663
4664 * doc/bison.texinfo: Document ability to have multiple
4665 prologue sections.
4666
4667 2002-06-18 Akim Demaille <akim@epita.fr>
4668
4669 * src/files.c (compute_base_names): When computing the output file
4670 names from the input file name, strip the directory part.
4671
4672 2002-06-18 Akim Demaille <akim@epita.fr>
4673
4674 * data/bison.simple.new: Comment changes.
4675 Reported by Andreas Schwab.
4676
4677 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
4678
4679 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
4680 there are no `label `yyoverflowlab' defined but not used' warnings
4681 when yyoverflow is defined.
4682
4683 2002-06-18 Akim Demaille <akim@epita.fr>
4684
4685 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
4686 new member.
4687 (symbol_destructor_set): Adjust.
4688 * src/output.c (symbol_destructors_output): Output the destructor
4689 locations.
4690 Output the symbol name.
4691 * data/bison.simple (b4_symbol_destructor): Adjust.
4692
4693 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
4694 and Akim Demaille <akim@epita.fr>
4695
4696 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
4697 what's left on the stack when the error recovery hits EOF.
4698 * tests/actions.at (Destructors): Complete to exercise this case.
4699
4700 2002-06-17 Akim Demaille <akim@epita.fr>
4701
4702 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
4703 arguments is really empty, not only equal to `[]'.
4704 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
4705 member.
4706 (symbol_destructor_set): New.
4707 * src/output.c (symbol_destructors_output): New.
4708 * src/reader.h (brace_code_t, current_braced_code): New.
4709 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
4710 (handle_dollar): Rename as...
4711 (handle_action_dollar): this.
4712 (handle_destructor_dollar): New.
4713 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
4714 (grammar_declaration): Use it.
4715 * data/bison.simple (yystos): Is always defined.
4716 (yydestructor): New.
4717 * tests/actions.at (Destructors): New.
4718 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
4719
4720 2002-06-17 Akim Demaille <akim@epita.fr>
4721
4722 * src/symlist.h, src/symlist.c (symbol_list_length): New.
4723 * src/scan-gram.l (handle_dollar, handle_at): Compute the
4724 rule_length only when needed.
4725 * src/output.c (actions_output, token_definitions_output): Output
4726 the full M4 block.
4727 * src/symtab.c: Don't access directly to the symbol tag, use
4728 symbol_tag_get.
4729 * src/parse-gram.y: Use symbol_list_free.
4730
4731 2002-06-17 Akim Demaille <akim@epita.fr>
4732
4733 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
4734 (symbol_list_prepend, get_type_name): Move to...
4735 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
4736 (symbol_list_prepend, symbol_list_n_type_name_get): here.
4737 Adjust all callers.
4738 (symbol_list_free): New.
4739 * src/scan-gram.l (handle_dollar): Takes a location.
4740 * tests/input.at (Invalid $n): Adjust.
4741
4742 2002-06-17 Akim Demaille <akim@epita.fr>
4743
4744 * src/reader.h, src/reader.c (symbol_list_new): Export it.
4745 (symbol_list_prepend): New.
4746 * src/parse-gram.y (%union): `list' is a new member.
4747 (symbols.1): New, replaces...
4748 (terms_to_prec.1, nterms_to_type.1): these.
4749 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
4750 Take a location as additional argument.
4751 Adjust all callers.
4752
4753 2002-06-15 Akim Demaille <akim@epita.fr>
4754
4755 * src/parse-gram.y: Move %token in the declaration section so that
4756 we don't depend upon CVS Bison.
4757
4758 2002-06-15 Akim Demaille <akim@epita.fr>
4759
4760 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
4761 * src/print.c (print_core): Use it.
4762
4763 2002-06-15 Akim Demaille <akim@epita.fr>
4764
4765 * src/conflicts.c (log_resolution): Accept the rule involved in
4766 the sr conflicts instead of the lookahead number that points to
4767 that rule.
4768 (flush_reduce): Accept the current lookahead vector as argument,
4769 instead of the index in LA.
4770 (resolve_sr_conflict): Accept the current number of lookahead
4771 bitset to consider for the STATE, instead of the index in LA.
4772 (set_conflicts): Adjust.
4773 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
4774
4775 2002-06-15 Akim Demaille <akim@epita.fr>
4776
4777 * src/state.h (state_t): Replace the `lookaheadsp' member, a
4778 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
4779 Adjust all dependencies.
4780 * src/lalr.c (initialize_lookaheads): Split into...
4781 (states_lookaheads_count, states_lookaheads_initialize): these.
4782 (lalr): Adjust.
4783
4784 2002-06-15 Akim Demaille <akim@epita.fr>
4785
4786 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
4787 out of...
4788 (grammar_rules_print): here.
4789 * src/reduce.c (reduce_output): Use it.
4790 * tests/reduce.at (Useless Rules, Reduced Automaton)
4791 (Underivable Rules): Adjust.
4792
4793 2002-06-15 Akim Demaille <akim@epita.fr>
4794
4795 Copy BYacc's nice way to report the grammar.
4796
4797 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
4798 New.
4799 Don't print the rules' location, it is confusing and useless.
4800 (rule_print): Use grammar_rhs_print.
4801 * src/print.c (print_grammar): Use grammar_rules_print.
4802
4803 2002-06-15 Akim Demaille <akim@epita.fr>
4804
4805 Complete and rationalize `useless thing' warnings.
4806
4807 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
4808 (symbol_tag_print): New.
4809 Use them everywhere in place of accessing directly the tag member.
4810 * src/gram.h, src/gram.c (rule_print): New.
4811 Use it where a rule used to be printed `by hand'.
4812 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
4813 (reduce_grammar_tables): Report the useless rules.
4814 (reduce_print): Useless things are a warning, not an error.
4815 Report it as such.
4816 * tests/reduce.at (Useless Nonterminals, Useless Rules):
4817 (Reduced Automaton, Underivable Rules): Adjust.
4818 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
4819 * tests/conflicts.at (Unresolved SR Conflicts)
4820 (Solved SR Conflicts): Adjust.
4821
4822 2002-06-15 Akim Demaille <akim@epita.fr>
4823
4824 Let symbols have a location.
4825
4826 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
4827 (getsym): Adjust.
4828 Adjust all callers.
4829 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
4830 Use location_t, not int.
4831 * src/symtab.c (symbol_check_defined): Take advantage of the
4832 location.
4833 * tests/regression.at (Invalid inputs): Adjust.
4834
4835 2002-06-15 Akim Demaille <akim@epita.fr>
4836
4837 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
4838 (input): Don't try to initialize yylloc here, do it in the
4839 scanner.
4840 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
4841 * src/gram.h (rule_t): Change line and action_line into location
4842 and action_location, of location_t type.
4843 Adjust all dependencies.
4844 * src/location.h, src/location.c (empty_location): New.
4845 * src/reader.h, src/reader.c (grammar_start_symbol_set)
4846 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
4847 (grammar_current_rule_symbol_append)
4848 (grammar_current_rule_action_append): Expect a location as argument.
4849 * src/reader.c (grammar_midrule_action): Adjust to attach an
4850 action's location as dummy symbol location.
4851 * src/symtab.h, src/symtab.c (startsymbol_location): New.
4852 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
4853 the line numbers.
4854
4855 2002-06-14 Akim Demaille <akim@epita.fr>
4856
4857 Grammar declarations may be found in the grammar section.
4858
4859 * src/parse-gram.y (rules_or_grammar_declaration): New.
4860 (declarations): Each declaration may end with a semicolon, not
4861 just...
4862 (grammar_declaration): `"%union"'.
4863 (grammar): Branch to rules_or_grammar_declaration.
4864
4865 2002-06-14 Akim Demaille <akim@epita.fr>
4866
4867 * src/main.c (main): Invoke scanner_free.
4868
4869 2002-06-14 Akim Demaille <akim@epita.fr>
4870
4871 * src/output.c (m4_invoke): Extracted from...
4872 (output_skeleton): here.
4873 Free tempfile.
4874
4875 2002-06-14 Akim Demaille <akim@epita.fr>
4876
4877 * src/parse-gram.y (directives, directive, gram)
4878 (grammar_directives, precedence_directives, precedence_directive):
4879 Rename as...
4880 (declarations, declaration, grammar, grammar_declaration)
4881 (precedence_declaration, precedence_declarator): these.
4882 (symbol_declaration): New.
4883
4884 2002-06-14 Akim Demaille <akim@epita.fr>
4885
4886 * src/files.c (action_obstack): Remove, unused.
4887 (output_obstack): Remove it, and all its dependencies, as it is no
4888 longer needed.
4889 * src/reader.c (epilogue_set): Build the epilogue in the
4890 muscle_obstack.
4891 * src/output.h, src/output.c (muscle_obstack): Move to...
4892 * src/muscle_tab.h, src/muscle_tab.h: here.
4893 (muscle_init): Initialize muscle_obstack.
4894 (muscle_free): New.
4895 * src/main.c (main): Call it.
4896
4897 2002-06-14 Akim Demaille <akim@epita.fr>
4898
4899 * src/location.h: New, extracted from...
4900 * src/reader.h: here.
4901 * src/Makefile.am (noinst_HEADERS): Merge into
4902 (bison_SOURCES): this.
4903 Add location.h.
4904 * src/parse-gram.y: Use location_t instead of Bison's.
4905 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
4906 Use location_t instead of ints.
4907
4908 2002-06-14 Akim Demaille <akim@epita.fr>
4909
4910 * data/bison.simple, data/bison.c++: Be sure to restore the
4911 current #line when returning to the skeleton contents after having
4912 exposed the input file's #line.
4913
4914 2002-06-12 Akim Demaille <akim@epita.fr>
4915
4916 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
4917 eager.
4918 * tests/actions.at (Exotic Dollars): New.
4919
4920 2002-06-12 Akim Demaille <akim@epita.fr>
4921
4922 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
4923 ['"/] too eagerly.
4924 * tests/input.at (Torturing the Scanner): New.
4925
4926 2002-06-11 Akim Demaille <akim@epita.fr>
4927
4928 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
4929 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
4930 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
4931 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
4932 * src/reader.c (reader): Use it.
4933
4934 2002-06-11 Akim Demaille <akim@epita.fr>
4935
4936 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
4937 Adjust all callers.
4938 (scanner_last_string_free): New.
4939
4940 2002-06-11 Akim Demaille <akim@epita.fr>
4941
4942 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
4943 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
4944 (last_string, YY_OBS_FREE): New.
4945 Use them when returning an ID.
4946
4947 2002-06-11 Akim Demaille <akim@epita.fr>
4948
4949 Have Bison grammars parsed by a Bison grammar.
4950
4951 * src/reader.c, src/reader.h (prologue_augment): New.
4952 * src/reader.c (copy_definition): Remove.
4953
4954 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
4955 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
4956 (grammar_current_rule_prec_set, grammar_current_rule_check)
4957 (grammar_current_rule_symbol_append)
4958 (grammar_current_rule_action_append): Export.
4959 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
4960 (symbol_list_action_append): Remove.
4961 Hook the routines from reader.
4962 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
4963 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
4964
4965 * src/reader.c (read_declarations): Remove, unused.
4966
4967 * src/parse-gram.y: Handle the epilogue.
4968 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
4969 (grammar_start_symbol_set): this.
4970 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
4971 * src/reader.c (readgram): Remove, unused.
4972 (reader): Adjust to insert eoftoken and axiom where appropriate.
4973
4974 * src/reader.c (copy_dollar): Replace with...
4975 * src/scan-gram.h (handle_dollar): this.
4976 * src/parse-gram.y: Remove `%thong'.
4977
4978 * src/reader.c (copy_at): Replace with...
4979 * src/scan-gram.h (handle_at): this.
4980
4981 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
4982 New.
4983
4984 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
4985 time being.
4986
4987 * src/reader.h, src/reader.c (grammar_rule_end): New.
4988
4989 * src/parse.y (current_type, current_class): New.
4990 Implement `%nterm', `%token' support.
4991 Merge `%term' into `%token'.
4992 (string_as_id): New.
4993 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
4994 type name.
4995
4996 * src/parse-gram.y: Be sure to handle properly the beginning of
4997 rules.
4998
4999 * src/parse-gram.y: Handle %type.
5000 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
5001
5002 * src/parse-gram.y: More directives support.
5003 * src/options.c: No longer handle source directives.
5004
5005 * src/parse-gram.y: Fix %output.
5006
5007 * src/parse-gram.y: Handle %union.
5008 Use the prologue locations.
5009 * src/reader.c (parse_union_decl): Remove.
5010
5011 * src/reader.h, src/reader.c (epilogue_set): New.
5012 * src/parse-gram.y: Use it.
5013
5014 * data/bison.simple, data/bison.c++: b4_stype is now either not
5015 defined, then default to int, or to the contents of %union,
5016 without `union' itself.
5017 Adjust.
5018 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
5019
5020 * src/output.c (actions_output): Don't output braces, as they are
5021 already handled by the scanner.
5022
5023 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
5024 characters to themselves.
5025
5026 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
5027 that the epilogue has a proper #line.
5028
5029 * src/parse-gram.y: Handle precedence/associativity.
5030
5031 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
5032 a terminal.
5033 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
5034 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
5035 at all to define terminals that cannot be emitted.
5036
5037 * src/scan-gram.l: Escape M4 characters.
5038
5039 * src/scan-gram.l: Working properly with escapes in user
5040 strings/characters.
5041
5042 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
5043 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
5044 grammar.
5045 Use more modest sizes, as for the time being the parser does not
5046 release memory, and therefore the process swallows a huge amount
5047 of memory.
5048
5049 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
5050 stricter %token grammar.
5051
5052 * src/symtab.h (associativity): Add `undef_assoc'.
5053 (symbol_precedence_set): Do nothing when passed an undef_assoc.
5054 * src/symtab.c (symbol_check_alias_consistence): Adjust.
5055
5056 * tests/regression.at (Invalid %directive): Remove, as it is now
5057 meaningless.
5058 (Invalid inputs): Adjust to the new error messages.
5059 (Token definitions): The new grammar doesn't allow too many
5060 eccentricities.
5061
5062 * src/lex.h, src/lex.c: Remove.
5063 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
5064 (copy_character, copy_string2, copy_string, copy_identifier)
5065 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
5066 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
5067 (parse_action): Remove.
5068 * po/POTFILES.in: Adjust.
5069
5070 2002-06-11 Akim Demaille <akim@epita.fr>
5071
5072 * src/reader.c (parse_action): Don't store directly into the
5073 rule's action member: return the action as a string.
5074 Don't require `rule_length' as an argument: compute it.
5075 (grammar_current_rule_symbol_append)
5076 (grammar_current_rule_action_append): New, eved out from
5077 (readgram): here.
5078 Remove `action_flag', `rulelength', unused now.
5079
5080 2002-06-11 Akim Demaille <akim@epita.fr>
5081
5082 * src/reader.c (grammar_current_rule_prec_set).
5083 (grammar_current_rule_check): New, eved out from...
5084 (readgram): here.
5085 Remove `xaction', `first_rhs': useless.
5086 * tests/input.at (Type clashes): New.
5087 * tests/existing.at (GNU Cim Grammar): Adjust.
5088
5089 2002-06-11 Akim Demaille <akim@epita.fr>
5090
5091 * src/reader.c (grammar_midrule_action): New, Eved out from
5092 (readgram): here.
5093
5094 2002-06-11 Akim Demaille <akim@epita.fr>
5095
5096 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
5097 New.
5098 (readgram): Use them as replacement of inlined code, crule and
5099 crule1.
5100
5101 2002-06-11 Akim Demaille <akim@epita.fr>
5102
5103 * src/reader.c (grammar_end, grammar_symbol_append): New.
5104 (readgram): Use them.
5105 Make the use of `p' as local as possible.
5106
5107 2002-06-10 Akim Demaille <akim@epita.fr>
5108
5109 GCJ's parser requires the tokens to be defined before the prologue.
5110
5111 * data/bison.simple: Output the token definition before the user's
5112 prologue.
5113 * tests/regression.at (Braces parsing, Duplicate string)
5114 (Mixing %token styles): Check the output from bison.
5115 (Early token definitions): New.
5116
5117 2002-06-10 Akim Demaille <akim@epita.fr>
5118
5119 * src/symtab.c (symbol_user_token_number_set): Don't complain when
5120 assigning twice the same user number to a token, so that we can
5121 use it in...
5122 * src/lex.c (lex): here.
5123 Also use `symbol_class_set' instead of hand written code.
5124 * src/reader.c (parse_assoc_decl): Likewise.
5125
5126 2002-06-10 Akim Demaille <akim@epita.fr>
5127
5128 * src/symtab.c, src/symtab.c (symbol_class_set)
5129 (symbol_user_token_number_set): New.
5130 * src/reader.c (parse_token_decl): Use them.
5131 Use a switch instead of ifs.
5132 Use a single argument.
5133
5134 2002-06-10 Akim Demaille <akim@epita.fr>
5135
5136 Remove `%thong' support as it is undocumented, unused, duplicates
5137 `%token's job, and creates useless e-mail traffic with people who
5138 want to know what it is, why it is undocumented, unused, and
5139 duplicates `%token's job.
5140
5141 * src/reader.c (parse_thong_decl): Remove.
5142 * src/options.c (option_table): Remove "thong".
5143 * src/lex.h (tok_thong): Remove.
5144
5145 2002-06-10 Akim Demaille <akim@epita.fr>
5146
5147 * src/symtab.c, src/symtab.c (symbol_type_set)
5148 (symbol_precedence_set): New.
5149 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
5150 (value_components_used): Remove, unused.
5151
5152 2002-06-09 Akim Demaille <akim@epita.fr>
5153
5154 Move symbols handling code out of the reader.
5155
5156 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
5157 (axiom): Move to...
5158 * src/symtab.h, src/symtab.c: here.
5159
5160 * src/gram.c (start_symbol): Remove: use startsymbol->number.
5161 * src/reader.c (startval): Rename as...
5162 * src/symtab.h, src/symtab.c (startsymbol): this.
5163 * src/reader.c: Adjust.
5164
5165 * src/reader.c (symbol_check_defined, symbol_make_alias)
5166 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5167 (token_translations_init)
5168 Move to...
5169 * src/symtab.c: here.
5170 * src/reader.c (packsymbols): Move to...
5171 * src/symtab.h, src/symtab.c (symbols_pack): here.
5172 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
5173 argument.
5174
5175 2002-06-03 Akim Demaille <akim@epita.fr>
5176
5177 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
5178 then statements.
5179
5180 2002-06-03 Akim Demaille <akim@epita.fr>
5181
5182 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
5183 structs with non literals.
5184 * src/scan-skel.l: never-interactive.
5185 * src/conflicts.c (enum conflict_resolution_e): No trailing
5186 comma.
5187 * src/getargs.c (usage): Split long literal strings.
5188 Reported by Hans Aberg.
5189
5190 2002-05-28 Akim Demaille <akim@epita.fr>
5191
5192 * data/bison.c++: Use C++ ostreams.
5193 (cdebug_): New member.
5194
5195 2002-05-28 Akim Demaille <akim@epita.fr>
5196
5197 * src/output.c (output_skeleton): Be sure to allocate enough room
5198 for `/' _and_ for `\0' in full_skeleton.
5199
5200 2002-05-28 Akim Demaille <akim@epita.fr>
5201
5202 * data/bison.c++: Catch up with bison.simple:
5203 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5204 and Paul Eggert <eggert@twinsun.com>: `error' handing.
5205 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
5206 and popping traces.
5207
5208 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5209
5210 * src/output.c (output_skeleton): Put an explicit path in front of
5211 the skeleton file name, rather than relying on the -I directory,
5212 to partially alleviate effects of having a skeleton file lying around
5213 in the current directory.
5214
5215 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5216
5217 * src/conflicts.c (log_resolution): Correct typo:
5218 obstack_printf should be obstack_fgrow1.
5219
5220 2002-05-26 Akim Demaille <akim@epita.fr>
5221
5222 * src/state.h (state_t): `solved_conflicts' is a new member.
5223 * src/LR0.c (new_state): Set it to 0.
5224 * src/conflicts.h, src/conflicts.c (print_conflicts)
5225 (free_conflicts, solve_conflicts): Rename as...
5226 (conflicts_print, conflicts_free, conflicts_solve): these.
5227 Adjust callers.
5228 * src/conflicts.c (enum conflict_resolution_e)
5229 (solved_conflicts_obstack): New, used by...
5230 (log_resolution): this.
5231 Adjust to attach the conflict resolution to each state.
5232 Complete the description with the precedence/associativity
5233 information.
5234 (resolve_sr_conflict): Adjust.
5235 * src/print.c (print_state): Output its solved_conflicts.
5236 * tests/conflicts.at (Unresolved SR Conflicts)
5237 (Solved SR Conflicts): Exercise --report=all.
5238
5239 2002-05-26 Akim Demaille <akim@epita.fr>
5240
5241 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5242 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5243 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
5244 (token_number_t, item_number_as_token_number)
5245 (token_number_as_item_number, muscle_insert_token_number_table):
5246 Rename as...
5247 (symbol_number_t, item_number_as_symbol_number)
5248 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
5249 these, since it is more appropriate.
5250
5251 2002-05-26 Akim Demaille <akim@epita.fr>
5252
5253 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
5254 `Error:' lines.
5255 * data/bison.simple (yystos) [YYDEBUG]: New.
5256 (yyparse) [YYDEBUG]: Display the symbols which are popped during
5257 error recovery.
5258 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
5259
5260 2002-05-25 Akim Demaille <akim@epita.fr>
5261
5262 * doc/bison.texinfo (Debugging): Split into...
5263 (Tracing): this new section, its former contents, and...
5264 (Understanding): this new section.
5265 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
5266 by...
5267 (report_flag): this.
5268 Adjust all dependencies.
5269 (report_args, report_types, report_argmatch): New.
5270 (usage, getargs): Report/support -r, --report.
5271 * src/options.h
5272 (struct option_table_struct): Rename as..,
5273 (struct option_table_s): this.
5274 Rename the `set_flag' member to `flag' to match with getopt_long's
5275 struct.
5276 * src/options.c (option_table): Split verbose into an entry for
5277 %verbose, and another for --verbose.
5278 Support --report/-r, so remove -r from the obsolete --raw.
5279 * src/print.c: Attach full item sets and lookaheads reports to
5280 report_flag instead of trace_flag.
5281 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
5282
5283 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5284 and Paul Eggert <eggert@twinsun.com>
5285
5286 * data/bison.simple (yyparse): Correct error handling to conform to
5287 POSIX and yacc. Specifically, after syntax error is discovered,
5288 do not reduce further before shifting the error token.
5289 Clean up the code a bit by removing the labels yyerrdefault,
5290 yyerrhandle, yyerrpop.
5291 * NEWS: Document the above.
5292
5293 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5294
5295 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
5296 type; it isn't always big enough, since it doesn't necessarily
5297 include non-terminals.
5298 (yytranslate): Expand definition of yy_token_number_type, so that
5299 the latter can be removed.
5300 (yy_token_number_type): Remove, only one use.
5301 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
5302 don't use TokenNumberType as element type.
5303
5304 * tests/regression.at: Modify expected output to agree with change
5305 to yyr1 and yytranslate.
5306
5307 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
5308
5309 * src/reader.c (parse_action): Use copy_character instead of
5310 obstack_1grow.
5311
5312 2002-05-13 Akim Demaille <akim@epita.fr>
5313
5314 * tests/regression.at (Token definitions): Prototype yylex and
5315 yyerror.
5316
5317 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5318
5319 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
5320 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
5321 32-bit arithmetic.
5322 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
5323
5324 2002-05-07 Akim Demaille <akim@epita.fr>
5325
5326 * tests/synclines.at: Be sure to prototype yylex and yyerror to
5327 avoid GCC warnings.
5328
5329 2002-05-07 Akim Demaille <akim@epita.fr>
5330
5331 Kill GCC warnings.
5332
5333 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
5334 over the RHS of each rule.
5335 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
5336 * src/state.h (state_t): Member `nitems' is unsigned short.
5337 * src/LR0.c (get_state): Adjust.
5338 * src/reader.c (packgram): Likewise.
5339 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
5340 `Type'.
5341 (muscle_insert_int_table): Remove, unused.
5342 (prepare_rules): Remove `max'.
5343
5344 2002-05-06 Akim Demaille <akim@epita.fr>
5345
5346 * src/closure.c (print_firsts): Display of the symbol tags.
5347 (bitmatrix_print): Move to...
5348 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
5349 here.
5350 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
5351
5352 2002-05-06 Akim Demaille <akim@epita.fr>
5353
5354 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
5355 hash_do_for_each.
5356
5357 2002-05-06 Akim Demaille <akim@epita.fr>
5358
5359 * src/LR0.c (new_state, get_state): Instead of using the global
5360 `kernel_size' and `kernel_base', have two new arguments:
5361 `core_size' and `core'.
5362 Adjust callers.
5363
5364 2002-05-06 Akim Demaille <akim@epita.fr>
5365
5366 * src/reader.c (packgram): No longer end `ritem' with a 0
5367 sentinel: it is not used.
5368
5369 2002-05-05 Akim Demaille <akim@epita.fr>
5370
5371 New experimental feature: display the lookaheads in the report and
5372 graph.
5373
5374 * src/print (print_core): When --trace-flag, display the rules
5375 lookaheads.
5376 * src/print_graph.c (print_core): Likewise.
5377 Swap the arguments.
5378 Adjust caller.
5379
5380 2002-05-05 Akim Demaille <akim@epita.fr>
5381
5382 * tests/torture.at (Many lookaheads): New test.
5383
5384 2002-05-05 Akim Demaille <akim@epita.fr>
5385
5386 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
5387 (GENERATE_MUSCLE_INSERT_TABLE): this.
5388 (output_int_table, output_unsigned_int_table, output_short_table)
5389 (output_token_number_table, output_item_number_table): Replace with...
5390 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
5391 (muscle_insert_short_table, muscle_insert_token_number_table)
5392 (muscle_insert_item_number_table): these.
5393 Adjust all callers.
5394 (prepare_tokens): Don't free `translations', since...
5395 * src/reader.h, src/reader.c (grammar_free): do it.
5396 Move to...
5397 * src/gram.h, src/gram.c (grammar_free): here.
5398 * data/bison.simple, data/bison.c++: b4_token_number_max is now
5399 b4_translate_max.
5400
5401 2002-05-05 Akim Demaille <akim@epita.fr>
5402
5403 * src/output.c (output_unsigned_int_table): New.
5404 (prepare_rules): `i' is unsigned.
5405 `prhs', `rline', `r2' are unsigned int.
5406 Rename muscle `rhs_number_max' as `rhs_max'.
5407 Output muscles `prhs_max', `rline_max', and `r2_max'.
5408 Free rline and r1.
5409 * data/bison.simple, data/bison.c++: Adjust to use these muscles
5410 to compute types instead of constant types.
5411 * tests/regression.at (Web2c Actions): Adjust.
5412
5413 2002-05-04 Akim Demaille <akim@epita.fr>
5414
5415 * src/symtab.h (SALIAS, SUNDEF): Rename as...
5416 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
5417 Adjust dependencies.
5418 * src/output.c (token_definitions_output): Be sure not to output a
5419 `#define 'a'' when fed with `%token 'a' "a"'.
5420 * tests/regression.at (Token definitions): New.
5421
5422 2002-05-03 Paul Eggert <eggert@twinsun.com>
5423
5424 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
5425 for K&R C.
5426
5427 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
5428
5429 * Makefile.am (SUBDIRS): Remove intl.
5430 (EXTRA_DIST): Add config/config.rpath.
5431
5432 2002-05-03 Akim Demaille <akim@epita.fr>
5433
5434 * data/bison.simple (m4_if): Don't output empty enums.
5435 And actually, output valid enum definitions :(.
5436
5437 2002-05-03 Akim Demaille <akim@epita.fr>
5438
5439 * configure.bat: Remove, completely obsolete.
5440 * Makefile.am (EXTRA_DIST): Adjust.
5441 Don't distribute config.rpath...
5442 * config/Makefile.am (EXTRA_DIST): Do it.
5443
5444 2002-05-03 Akim Demaille <akim@epita.fr>
5445
5446 * configure.in (GETTEXT_VERSION): New.
5447 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
5448
5449 2002-05-03 Akim Demaille <akim@epita.fr>
5450
5451 * data/bison.simple (b4_token_enum): New.
5452 (b4_token_defines): Use it to output tokens both as #define and
5453 enums.
5454 Suggested by Paul Eggert.
5455 * src/output.c (token_definitions_output): Don't output spurious
5456 white spaces.
5457
5458 2002-05-03 Akim Demaille <akim@epita.fr>
5459
5460 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5461
5462 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
5463
5464 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
5465 Update the stack class, give a try to deque as the default container.
5466
5467 2002-05-02 Akim Demaille <akim@epita.fr>
5468
5469 * data/bison.simple (yyparse): Do not implement @$ = @1.
5470 (YYLLOC_DEFAULT): Adjust to do it.
5471 * doc/bison.texinfo (Location Default Action): Fix.
5472
5473 2002-05-02 Akim Demaille <akim@epita.fr>
5474
5475 * src/reader.c (parse_braces): Merge into...
5476 (parse_action): this.
5477
5478 2002-05-02 Akim Demaille <akim@epita.fr>
5479
5480 * configure.in (ALL_LINGUAS): Remove.
5481 * po/LINGUAS, hr.po: New.
5482
5483 2002-05-02 Akim Demaille <akim@epita.fr>
5484
5485 Remove the so called hairy (semantic) parsers.
5486
5487 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
5488 * src/gram.h, src/gram.c (semantic_parser): Remove.
5489 (rule_t): Remove the guard and guard_line members.
5490 * src/lex.h (token_t): remove tok_guard.
5491 * src/options.c (option_table): Remove %guard and %semantic_parser
5492 support.
5493 * src/output.c, src/output.h (guards_output): Remove.
5494 (prepare): Adjust.
5495 (token_definitions_output): Don't output the `T'
5496 tokens (???).
5497 (output_skeleton): Don't output the guards.
5498 * src/files.c, src/files.c (attrsfile): Remove.
5499 * src/reader.c (symbol_list): Remove the guard and guard_line
5500 members.
5501 Adjust dependencies.
5502 (parse_guard): Remove.
5503 * data/bison.hairy: Remove.
5504 * doc/bison.texinfo (Environment Variables): Remove occurrences of
5505 BISON_HAIRY.
5506
5507 2002-05-02 Akim Demaille <akim@epita.fr>
5508
5509 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
5510 (parse_guard): Rename the formal argument `stack_offset' as
5511 `rule_length', which is more readable.
5512 Adjust callers.
5513 (copy_at, copy_dollar): Instead of outputting the hard coded
5514 values of $$, $n and so forth, output invocation to b4_lhs_value,
5515 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
5516 Note: this patch partially drops `semantic-parser' support: it
5517 always does `rule_length - n', where semantic parsers ought to
5518 always use `-n'.
5519 * data/bison.simple, data/bison.c++ (b4_lhs_value)
5520 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
5521
5522 2002-05-02 Akim Demaille <akim@epita.fr>
5523
5524 * configure.in (AC_INIT): Bump to 1.49b.
5525 (AM_INIT_AUTOMAKE): Short invocation.
5526
5527 2002-05-02 Akim Demaille <akim@epita.fr>
5528
5529 Version 1.49a.
5530
5531 2002-05-01 Akim Demaille <akim@epita.fr>
5532
5533 * src/skeleton.h: Remove.
5534
5535 2002-05-01 Akim Demaille <akim@epita.fr>
5536
5537 * src/skeleton.h: Fix the #endif.
5538 Reported by Magnus Fromreide.
5539
5540 2002-04-26 Paul Eggert <eggert@twinsun.com>
5541
5542 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
5543 Define if we define YYSTYPE and YYLTYPE, respectively.
5544 (YYCOPY): Fix [] quoting problem in the non-GCC case.
5545
5546 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
5547
5548 * src/scan-skel.l: Postprocess quadrigraphs.
5549
5550 * src/reader.c (copy_character): New function, used to output
5551 single characters while replacing `[' and `]' with quadrigraphs, to
5552 avoid troubles with M4 quotes.
5553 (copy_comment): Output characters with copy_character.
5554 (read_additionnal_code): Likewise.
5555 (copy_string2): Likewise.
5556 (copy_definition): Likewise.
5557
5558 * tests/calc.at: Exercise M4 quoting.
5559
5560 2002-04-25 Akim Demaille <akim@epita.fr>
5561
5562 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
5563 between `!' and the command.
5564 Reported by Paul Eggert.
5565
5566 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
5567
5568 * tests/calc.at: Exercise prologue splitting.
5569
5570 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
5571 `b4_post_prologue' instead of `b4_prologue'.
5572
5573 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
5574 muscles.
5575 (output): Free pre_prologue_obstack and post_prologue_obstack.
5576 * src/files.h, src/files.c (attrs_obstack): Remove.
5577 (pre_prologue_obstack, post_prologue_obstack): New.
5578 * src/reader.c (copy_definition): Add a parameter to specify the
5579 obstack to fill, instead of using attrs_obstack unconditionally.
5580 (read_declarations): Pass pre_prologue_obstack to copy_definition if
5581 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
5582
5583 2002-04-23 Paul Eggert <eggert@twinsun.com>
5584
5585 * data/bison.simple: Remove unnecessary commentary and white
5586 space differences from 1_29-branch.
5587 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
5588
5589 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
5590 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
5591 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
5592 constructors or destructors.
5593
5594 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
5595
5596 2002-04-23 Akim Demaille <akim@epita.fr>
5597
5598 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
5599 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
5600 location with columns.
5601 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
5602 All reported by Paul Eggert.
5603
5604 2002-04-22 Akim Demaille <akim@epita.fr>
5605
5606 * src/reduce.c (dump_grammar): Move to...
5607 * src/gram.h, src/gram.c (grammar_dump): here.
5608 Be sure to separate long item numbers.
5609 Don't read the members of a rule's prec if its nil.
5610
5611 2002-04-22 Akim Demaille <akim@epita.fr>
5612
5613 * src/output.c (table_size, table_grow): New.
5614 (MAXTABLE): Remove, replace uses with table_size.
5615 (pack_vector): Instead of dying when the table is too big, grow it.
5616
5617 2002-04-22 Akim Demaille <akim@epita.fr>
5618
5619 * data/bison.simple (yyr1): Its type is that of a token number.
5620 * data/bison.c++ (r1_): Likewise.
5621 * tests/regression.at (Web2c Actions): Adjust.
5622
5623 2002-04-22 Akim Demaille <akim@epita.fr>
5624
5625 * src/reader.c (token_translations_init): 256 is now the default
5626 value for the error token, i.e., it will be assigned another
5627 number if the user assigned 256 to one of her tokens.
5628 (reader): Don't force 256 to error.
5629 * doc/bison.texinfo (Symbols): Adjust.
5630 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
5631 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
5632 etc. instead of 10, 20, 30 (which was used to `jump' over error
5633 (256) and undefined (2)).
5634
5635 2002-04-22 Akim Demaille <akim@epita.fr>
5636
5637 Propagate more token_number_t.
5638
5639 * src/gram.h (token_number_as_item_number)
5640 (item_number_as_token_number): New.
5641 * src/output.c (GENERATE_OUTPUT_TABLE): New.
5642 Use it to create output_item_number_table and
5643 output_token_number_table.
5644 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5645 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
5646 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
5647 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
5648
5649 2002-04-22 Akim Demaille <akim@epita.fr>
5650
5651 * src/output.h, src/output.c (get_lines_number): Remove.
5652
5653 2002-04-19 Akim Demaille <akim@epita.fr>
5654
5655 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
5656 as Lex/Flex'.
5657 (Debugging): More details about enabling the debugging features.
5658 (Table of Symbols): Describe $$, $n, @$, and @n.
5659 Suggested by Tim Josling.
5660
5661 2002-04-19 Akim Demaille <akim@epita.fr>
5662
5663 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
5664
5665 2002-04-10 Akim Demaille <akim@epita.fr>
5666
5667 * src/system.h: Rely on HAVE_LIMITS_H.
5668 Suggested by Paul Eggert.
5669
5670 2002-04-09 Akim Demaille <akim@epita.fr>
5671
5672 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
5673 full stderr, and strip it according to the bison options, instead
5674 of composing the error message from different bits.
5675 This makes it easier to check for several error messages.
5676 Adjust all the invocations.
5677 Add an invocation exercising the error token.
5678 Add an invocation demonstrating a stupid error message.
5679 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
5680 Adjust the tests.
5681 Error message are for stderr, not stdout.
5682
5683 2002-04-09 Akim Demaille <akim@epita.fr>
5684
5685 * src/gram.h, src/gram.c (error_token_number): Remove, use
5686 errtoken->number.
5687 * src/reader.c (reader): Don't specify the user token number (2)
5688 for $undefined, as it uselessly prevents using it.
5689 * src/gram.h (token_number_t): Move to...
5690 * src/symtab.h: here.
5691 (state_t.number): Is a token_number_t.
5692 * src/print.c, src/reader.c: Use undeftoken->number instead of
5693 hard coded 2.
5694 (Even though this 2 is not the same as above: the number of the
5695 undeftoken remains being 2, it is its user token number which
5696 might not be 2).
5697 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
5698 `user_token_number_max'.
5699 Output `undef_token_number'.
5700 * data/bison.simple, data/bison.c++: Use them.
5701 Be sure to map invalid yylex return values to
5702 `undef_token_number'. This saves us from gratuitous SEGV.
5703
5704 * tests/conflicts.at (Solved SR Conflicts)
5705 (Unresolved SR Conflicts): Adjust.
5706 * tests/regression.at (Web2c Actions): Adjust.
5707
5708 2002-04-08 Akim Demaille <akim@epita.fr>
5709
5710 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
5711 Adding #line.
5712 Remove the duplicate `typedefs'.
5713 (RhsNumberType): Fix the declaration and various other typos.
5714 Use __ofile__.
5715 * data/bison.simple: Use __ofile__.
5716 * src/scan-skel.l: Handle __ofile__.
5717
5718 2002-04-08 Akim Demaille <akim@epita.fr>
5719
5720 * src/gram.h (item_number_t): New, the type of item numbers in
5721 RITEM. Note that it must be able to code symbol numbers as
5722 positive number, and the negation of rule numbers as negative
5723 numbers.
5724 Adjust all dependencies (pretty many).
5725 * src/reduce.c (rule): Remove this `short *' pointer: use
5726 item_number_t.
5727 * src/system.h (MINSHORT, MAXSHORT): Remove.
5728 Include `limits.h'.
5729 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
5730 (shortcpy): Remove.
5731 (MAXTABLE): Move to...
5732 * src/output.c (MAXTABLE): here.
5733 (prepare_rules): Use output_int_table to output rhs.
5734 * data/bison.simple, data/bison.c++: Adjust.
5735 * tests/torture.at (Big triangle): Move the limit from 254 to
5736 500.
5737 * tests/regression.at (Web2c Actions): Ajust.
5738
5739 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
5740 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
5741 passes, but produces negative #line number, once fixed, GCC is
5742 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
5743 C), it passes.
5744 * src/state.h (state_h): Code input lines on ints, not shorts.
5745
5746 2002-04-08 Akim Demaille <akim@epita.fr>
5747
5748 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
5749 and then the grammar.
5750
5751 2002-04-08 Akim Demaille <akim@epita.fr>
5752
5753 * src/system.h: No longer using strndup.
5754
5755 2002-04-07 Akim Demaille <akim@epita.fr>
5756
5757 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
5758 * src/output.c (output_table_data): Return the longest number.
5759 (prepare_tokens): Output `token_number_max').
5760 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
5761 New.
5762 Use them to define yy_token_number_type/TokenNumberType.
5763 Use this type for yytranslate.
5764 * tests/torture.at (Big triangle): Push the limit from 124 to
5765 253.
5766 * tests/regression.at (Web2c Actions): Adjust.
5767
5768 2002-04-07 Akim Demaille <akim@epita.fr>
5769
5770 * tests/torture.at (Big triangle): New.
5771 (GNU AWK Grammar, GNU Cim Grammar): Move to...
5772 * tests/existing.at: here.
5773
5774 2002-04-07 Akim Demaille <akim@epita.fr>
5775
5776 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
5777 nritems.
5778 Adjust dependencies.
5779
5780 2002-04-07 Akim Demaille <akim@epita.fr>
5781
5782 * src/reader.c: Normalize increments to prefix form.
5783
5784 2002-04-07 Akim Demaille <akim@epita.fr>
5785
5786 * src/reader.c, symtab.c: Remove debugging code.
5787
5788 2002-04-07 Akim Demaille <akim@epita.fr>
5789
5790 Rename all the `bucket's as `symbol_t'.
5791
5792 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
5793 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
5794 * src/symtab.c, src/symtab.h (bucket): Rename as...
5795 (symbol_t): this.
5796 (symbol_list_new, bucket_check_defined, bucket_make_alias)
5797 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
5798 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5799 (buckets_new, buckets_free, buckets_do): Rename as...
5800 (symbol_list_new, symbol_check_defined, symbol_make_alias)
5801 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5802 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
5803 (symbols_new, symbols_free, symbols_do): these.
5804
5805 2002-04-07 Akim Demaille <akim@epita.fr>
5806
5807 Use lib/hash for the symbol table.
5808
5809 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
5810 EOF.
5811 * src/lex.c (lex): Set the `number' member of new terminals.
5812 * src/reader.c (bucket_check_defined, bucket_make_alias)
5813 (bucket_check_alias_consistence, bucket_translation): New.
5814 (reader, grammar_free, readgram, token_translations_init)
5815 (packsymbols): Adjust.
5816 (reader): Number the predefined tokens.
5817 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
5818 for predefined tokens.
5819 * src/symtab.h (bucket): Remove all the hash table related
5820 members.
5821 * src/symtab.c (symtab): Replace by...
5822 (bucket_table): this.
5823 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5824 (buckets_new, buckets_do): New.
5825
5826 2002-04-07 Akim Demaille <akim@epita.fr>
5827
5828 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
5829 (start_symbol, max_user_token_number, semantic_parser)
5830 (error_token_number): Initialize.
5831 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
5832 Initialize.
5833 (reader): Don't.
5834 (errtoken, eoftoken, undeftoken, axiom): Extern.
5835
5836 2002-04-07 Akim Demaille <akim@epita.fr>
5837
5838 * src/gram.h (rule_s): prec and precsym are now pointers
5839 to the bucket giving the priority/associativity.
5840 Member `associativity' removed: useless.
5841 * src/reduce.c, src/conflicts.c: Adjust.
5842
5843 2002-04-07 Akim Demaille <akim@epita.fr>
5844
5845 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
5846 Properly escape the symbols' TAG when outputting them.
5847
5848 2002-04-07 Akim Demaille <akim@epita.fr>
5849
5850 * src/lalr.h (LA): Is a bitsetv, not bitset*.
5851
5852 2002-04-07 Akim Demaille <akim@epita.fr>
5853
5854 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
5855 (LArule): this, which is an array to rule_t*.
5856 * src/print.c, src/conflicts.c: Adjust.
5857
5858 2002-04-07 Akim Demaille <akim@epita.fr>
5859
5860 * src/gram.h (rule_t): Rename `number' as `user_number'.
5861 `number' is a new member.
5862 Adjust dependencies.
5863 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
5864
5865 2002-04-07 Akim Demaille <akim@epita.fr>
5866
5867 As a result of the previous patch, it is no longer needed
5868 to reorder ritem itself.
5869
5870 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
5871
5872 2002-04-07 Akim Demaille <akim@epita.fr>
5873
5874 Be sure never to walk through RITEMS, but use only data related to
5875 the rules themselves. RITEMS should be banished.
5876
5877 * src/output.c (output_token_translations): Rename as...
5878 (prepare_tokens): this.
5879 In addition to `translate', prepare the muscles `tname' and
5880 `toknum', which were handled by...
5881 (output_rule_data): this.
5882 Remove, and move the remainder of its outputs into...
5883 (prepare_rules): this new routines, which also merges content from
5884 (output_gram): this.
5885 (prepare_rules): Be sure never to walk through RITEMS.
5886 (output_stos): Rename as...
5887 (prepare_stos): this.
5888 (output): Always invoke prepare_states, after all, just don't use it
5889 in the output if you don't need it.
5890
5891 2002-04-07 Akim Demaille <akim@epita.fr>
5892
5893 * src/LR0.c (new_state): Display `nstates' as the name of the
5894 newly created state.
5895 Adjust to initialize first_state and last_state if needed.
5896 Be sure to distinguish the initial from the final state.
5897 (new_states): Create the itemset of the initial state, and use
5898 new_state.
5899 * src/closure.c (closure): Now that the initial state has its
5900 items properly set, there is no need for a special case when
5901 creating `ruleset'.
5902
5903 As a result, now the rule 0, reducing to $axiom, is visible in the
5904 outputs. Adjust the test suite.
5905
5906 * tests/conflicts.at (Solved SR Conflicts)
5907 (Unresolved SR Conflicts): Adjust.
5908 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
5909 * tests/conflicts.at (S/R in initial): New.
5910
5911 2002-04-07 Akim Demaille <akim@epita.fr>
5912
5913 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
5914 the RHS of the rules.
5915 * src/output.c (output_gram): Likewise.
5916
5917 2002-04-07 Akim Demaille <akim@epita.fr>
5918
5919 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
5920 bucket.
5921 Adjust all dependencies.
5922 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
5923 `number' of the buckets too.
5924 * src/gram.h: Include `symtab.h'.
5925 (associativity): Move to...
5926 * src/symtab.h: here.
5927 No longer include `gram.h'.
5928
5929 2002-04-07 Akim Demaille <akim@epita.fr>
5930
5931 * src/gram.h, src/gram.c (rules_rhs_length): New.
5932 (ritem_longest_rhs): Use it.
5933 * src/gram.h (rule_t): `number' is a new member.
5934 * src/reader.c (packgram): Set it.
5935 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
5936 the end of `rules', and count them out of `nrules'.
5937 (reduce_output, dump_grammar): Adjust.
5938 * src/print.c (print_grammar): It is no longer needed to check for
5939 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
5940 * tests/reduce.at (Reduced Automaton): New test.
5941
5942 2002-04-07 Akim Demaille <akim@epita.fr>
5943
5944 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
5945 lacking `+ 1' to nrules, Bison reported as useless a token if it
5946 was used solely to set the precedence of the last rule...
5947
5948 2002-04-07 Akim Demaille <akim@epita.fr>
5949
5950 * data/bison.c++, data/bison.simple: Don't output the current file
5951 name in #line, to avoid useless diffs between two identical
5952 outputs under different names.
5953
5954 2002-04-07 Akim Demaille <akim@epita.fr>
5955
5956 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
5957 Normalize loops to using `< nrules + 1', not `<= nrules'.
5958
5959 2002-04-07 Akim Demaille <akim@epita.fr>
5960
5961 * TODO: Update.
5962
5963 2002-04-07 Akim Demaille <akim@epita.fr>
5964
5965 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
5966 bucket.value as bucket.number.
5967
5968 2002-04-07 Akim Demaille <akim@epita.fr>
5969
5970 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
5971 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5972 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
5973 RHS, instead of being an index in RITEMS.
5974
5975 2002-04-04 Paul Eggert <eggert@twinsun.com>
5976
5977 * doc/bison.texinfo: Update copyright date.
5978 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
5979 (Symbols): Warn about running Bison in one character set,
5980 but compiling and/or running in an incompatible one.
5981 Warn about character code 256, too.
5982
5983 2002-04-03 Paul Eggert <eggert@twinsun.com>
5984
5985 * src/bison.data (YYSTACK_ALLOC): Depend on whether
5986 YYERROR_VERBOSE is nonzero, not whether it is defined.
5987
5988 Merge changes from bison-1_29-branch.
5989
5990 2002-03-20 Paul Eggert <eggert@twinsun.com>
5991
5992 Merge fixes from Debian bison_1.34-1.diff.
5993
5994 * configure.in (AC_PREREQ): 2.53.
5995
5996 2002-03-20 Akim Demaille <akim@epita.fr>
5997
5998 * src/conflicts.c (log_resolution): Argument `resolution' is const.
5999
6000 2002-03-19 Paul Eggert <eggert@twinsun.com>
6001
6002 * src/bison.simple (YYCOPY): New macro.
6003 (YYSTACK_RELOCATE): Use it.
6004 Remove Type arg; no longer needed. All callers changed.
6005 (yymemcpy): Remove; no longer needed.
6006
6007 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
6008 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
6009
6010 2002-03-19 Akim Demaille <akim@epita.fr>
6011
6012 Test and fix the #line outputs.
6013
6014 * tests/atlocal.at (GCC): New.
6015 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
6016 (Prologue synch line, ,%union synch line, Postprologue synch line)
6017 (Action synch line, Epilogue synch line): New tests.
6018 * src/reader.c (parse_union_decl): Define the muscle stype_line.
6019 * data/bison.simple, data/bison.c++: Use it.
6020
6021 2002-03-19 Akim Demaille <akim@epita.fr>
6022
6023 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
6024 (Solved SR Conflicts, %expect not enough, %expect right)
6025 (%expect too much): Move to...
6026 * tests/conflicts.at: this new file.
6027
6028 2002-03-19 Akim Demaille <akim@epita.fr>
6029
6030 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
6031 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
6032 that we can move to enums for instance.
6033 * src/output.c (token_definitions_output): Output a list of
6034 `token-name, token-number' instead of the #define.
6035 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
6036
6037 2002-03-14 Akim Demaille <akim@epita.fr>
6038
6039 Use Gettext 0.11.1.
6040
6041 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
6042
6043 * data/bison.c++: Make the user able to add members to the generated
6044 parser by subclassing.
6045
6046 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
6047
6048 * src/reader.c (read_additionnal_code): `c' should be an integer, not
6049 a character.
6050 Reported by Nicolas Tisserand and Nicolas Burrus.
6051
6052 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
6053
6054 * src/reader.c: Warn about lacking semi-colons, do not complain.
6055
6056 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
6057
6058 * data/bison.c++: Remove a debug line.
6059
6060 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
6061
6062 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
6063 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
6064 provide a default implementation.
6065
6066 2002-03-04 Akim Demaille <akim@epita.fr>
6067
6068 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
6069 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
6070 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
6071 * tests/semantic.at (Parsing Guards): Similarly.
6072 * src/reader.at (readgram): Complain if the last rule is not ended
6073 with a semi-colon.
6074
6075 2002-03-04 Akim Demaille <akim@epita.fr>
6076
6077 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
6078 * src/closure.c: here.
6079 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
6080 RTC.
6081 * src/warshall.h, src/warshall.c: Remove.
6082 * tests/sets.at (Broken Closure): Adjust.
6083
6084 2002-03-04 Akim Demaille <akim@epita.fr>
6085
6086 * src/output.c (output_skeleton): tempdir is const.
6087 bytes_read is unused.
6088
6089 2002-03-04 Akim Demaille <akim@epita.fr>
6090
6091 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6092 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
6093 Update.
6094 From Michael Hayes.
6095
6096 2002-03-04 Akim Demaille <akim@epita.fr>
6097
6098 * src/closure.c (closure): `r' is unused.
6099
6100 2002-03-04 Akim Demaille <akim@epita.fr>
6101
6102 * tests/sets.at (Broken Closure): Add the ending `;'.
6103 * src/reader.at (readgram): Complain if a rule is not ended with a
6104 semi-colon.
6105
6106 2002-03-04 Akim Demaille <akim@epita.fr>
6107
6108 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
6109 (count_sr_conflicts): Use bitset_count.
6110 * src/reduce.c (inaccessable_symbols): Ditto.
6111 (bits_size): Remove.
6112 * src/warshall.h, src/warshall.c: Convert to bitsetv.
6113
6114 2002-03-04 Akim Demaille <akim@epita.fr>
6115
6116 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
6117 * src/reduce.c: Remove the `bitset_zero's following the
6118 `bitset_create's, as now it is performed by the latter.
6119
6120 2002-03-04 Akim Demaille <akim@epita.fr>
6121
6122 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
6123 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
6124 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
6125 latest sources from Michael.
6126
6127 2002-03-04 Akim Demaille <akim@epita.fr>
6128
6129 * src/output.c (output): Don't free the grammar.
6130 * src/reader.c (grammar_free): New.
6131 * src/main.c (main): Call it and don't free symtab here.
6132
6133 2002-03-04 Akim Demaille <akim@epita.fr>
6134
6135 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
6136 before returning.
6137 Reported by Benoit Perrot.
6138
6139 2002-03-04 Akim Demaille <akim@epita.fr>
6140
6141 Use bitset operations when possible, not loops over bits.
6142
6143 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
6144 bitset_or.
6145 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
6146 * src/reduce.c (useless_nonterminals): Formatting changes.
6147 * src/warshall.c (TC): Use bitset_or.
6148
6149 2002-03-04 Akim Demaille <akim@epita.fr>
6150
6151 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
6152 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
6153 Ditto.
6154
6155 2002-03-04 Akim Demaille <akim@epita.fr>
6156
6157 * src/lalr.c (F): Now a bitset*.
6158 Adjust all dependencies.
6159
6160 2002-03-04 Akim Demaille <akim@epita.fr>
6161
6162 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
6163 Adjust all dependencies.
6164
6165 2002-03-04 Akim Demaille <akim@epita.fr>
6166
6167 * src/L0.c, src/LR0.h (nstates): Be size_t.
6168 Adjust comparisons (signed vs unsigned).
6169 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
6170 bitset*.
6171 Adjust all dependencies.
6172
6173 2002-03-04 Akim Demaille <akim@epita.fr>
6174
6175 * src/closure.c (firsts): Now, also a bitset.
6176 Adjust all dependencies.
6177 (varsetsize): Remove, now unused.
6178 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
6179
6180 2002-03-04 Akim Demaille <akim@epita.fr>
6181
6182 * src/print.c: Convert to use bitset.h, not hand coded iterations
6183 over ints.
6184
6185 2002-03-04 Akim Demaille <akim@epita.fr>
6186
6187 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
6188
6189 2002-03-04 Akim Demaille <akim@epita.fr>
6190
6191 * src/closure.c (ruleset): Be a bitset.
6192 (rulesetsize): Remove.
6193
6194 2002-03-04 Akim Demaille <akim@epita.fr>
6195
6196 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6197 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
6198 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
6199 * src/closure.c (fderives): Be an array of bitsets.
6200
6201 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
6202
6203 * data/bison.c++: Merge the two generated headers. Insert a copyright
6204 notice in each output file.
6205
6206 2002-02-28 Akim Demaille <akim@epita.fr>
6207
6208 * data/bison.c++: Copy the prologue of bison.simple to fetch
6209 useful M4 definitions, such as b4_header_guard.
6210
6211 2002-02-25 Akim Demaille <akim@epita.fr>
6212
6213 * src/getargs.c (version): Give the name of the authors, and use a
6214 translator friendly scheme for the bgr
6215 copyright notice.
6216
6217 2002-02-25 Akim Demaille <akim@epita.fr>
6218
6219 * src/output.c (header_output): Remove, now handled completely via
6220 M4.
6221
6222 2002-02-25 Akim Demaille <akim@epita.fr>
6223
6224 * m4/m4.m4: New, from CVS Autoconf.
6225 * configure.in: Invoke it.
6226 * src/output.c (output_skeleton): Use its result instead of the
6227 hard coded name.
6228
6229 2002-02-25 Akim Demaille <akim@epita.fr>
6230
6231 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
6232 Fileutils 4.1.5.
6233 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
6234 * src/output.c (output_skeleton): Use mkstemp to create a real
6235 temporary file.
6236 Move the filling of `skeleton' and its muscle to...
6237 (prepare): here.
6238 (output): Move the definition of the prologue muscle to...
6239 (prepare): here.
6240 * src/system.h (DEFAULT_TMPDIR): New.
6241
6242 2002-02-14 Paul Eggert <eggert@twinsun.com>
6243
6244 Remove the support for C++ namespace cleanliness; it was
6245 causing more problems than it was curing, since it didn't work
6246 properly on some nonstandard C++ compilers. This can wait
6247 for a proper C++ parser.
6248
6249 * NEWS: Document this.
6250 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
6251 of C++, as it's treated like C now.
6252 * src/bison.simple (YYSTD): Remove.
6253 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
6254 Treat C++ just like Standard C instead of trying to support
6255 namespace cleanliness.
6256
6257 2002-02-14 Akim Demaille <akim@epita.fr>
6258
6259 * tests/regression.at (else): Adjust to Andreas' change.
6260
6261 2002-02-14 Akim Demaille <akim@epita.fr>
6262
6263 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
6264
6265 2002-02-13 Andreas Schwab <schwab@suse.de>
6266
6267 * src/output.c (output_rule_data): Don't output NULL, it might
6268 not be defined yet.
6269
6270 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
6271
6272 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
6273 (Copyright notice): Update.
6274
6275 2002-02-11 Akim Demaille <akim@epita.fr>
6276
6277 * tests/regression.at (%nonassoc and eof): Don't include
6278 nonportable headers.
6279
6280 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
6281
6282 * data/bison.c++: Correct error recovery. Make the user able to
6283 initialize the starting location.
6284
6285 2002-02-07 Akim Demaille <akim@epita.fr>
6286
6287 * tests/input.at: New.
6288
6289 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6290
6291 * data/bison.c++: Replace some direct m4 expansions by constants. Be
6292 more consistent when naming methods and variables. Put preprocessor
6293 directives around tables only needed for debugging.
6294
6295 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6296
6297 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
6298 C++ parsers.
6299 (yy::b4_name::parse): Use print_.
6300
6301 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6302
6303 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
6304
6305 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6306
6307 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
6308 C++ parsers.
6309 (yy::b4_name::parse): Build verbose error messages, and use error_.
6310
6311 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
6312
6313 * data/bison.c++: Fix m4 quoting in comments.
6314
6315 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
6316
6317 * data/bison.c++: Adjust the parser code. Fix some muscles that were
6318 not expanded by m4.
6319
6320 2002-02-05 Akim Demaille <akim@epita.fr>
6321
6322 * data/bison.c++: Adjust to the M4 back end.
6323 More is certainly needed.
6324
6325 2002-02-05 Akim Demaille <akim@epita.fr>
6326
6327 Give a try to M4 as a back end.
6328
6329 * lib/readpipe.c: New, from wdiff.
6330 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
6331 BISON_HAIRY.
6332 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
6333 specific values. Now it is m4 that performs the lookup.
6334 * src/parse-skel.y: Remove.
6335 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
6336 * src/output.c (actions_output, guards_output)
6337 (token_definitions_output): No longer keeps track of the output
6338 line number, hence remove the second argument.
6339 (guards_output): Check against the guard member of a rule, not the
6340 action member.
6341 Adjust callers.
6342 (output_skeleton): Don't look for the skeleton location, let m4 do
6343 that.
6344 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
6345 file will be used.
6346 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
6347 (prepare): Given that for the time being changesyntax is not
6348 usable in M4, rename the muscles using `-' to `_'.
6349 Define `defines_flag', `output_parser_name' and `output_header_name'.
6350 * src/output.h (actions_output, guards_output)
6351 (token_definitions_output): Adjust prototypes.
6352 * src/scan-skel.l: Instead of scanning the skeletons, it now
6353 processes the output of m4: `__oline__' and `#output'.
6354 * data/bison.simple: Adjust to be used by M4(sugar).
6355 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
6356 to date.
6357 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
6358 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
6359 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
6360 shamelessly stolen from CVS Autoconf.
6361
6362 2002-02-05 Akim Demaille <akim@epita.fr>
6363
6364 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
6365 * configure.in: Check for the declarations of free and malloc.
6366 * src/muscle_tab.c: Adjust.
6367
6368 2002-02-05 Akim Demaille <akim@epita.fr>
6369
6370 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
6371 which have no values.
6372
6373 2002-02-05 Akim Demaille <akim@epita.fr>
6374
6375 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
6376 * data/: here.
6377
6378 2002-01-29 Paul Eggert <eggert@twinsun.com>
6379
6380 * src/bison.simple (YYSIZE_T): Do not define merely because
6381 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
6382 On some platforms, <alloca.h> does not declare YYSTD (size_t).
6383
6384 2002-01-27 Akim Demaille <akim@epita.fr>
6385
6386 Fix `%nonassoc and eof'.
6387
6388 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
6389 which were not properly copied! Replace
6390 memcpy (res->errs, src->errs, src->nerrs);
6391 with
6392 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
6393 !!!
6394 * tests/regression.at (%nonassoc and eof): Adjust to newest
6395 Autotest: `.' is not in the PATH.
6396
6397 2002-01-27 Akim Demaille <akim@epita.fr>
6398
6399 * tests/sets.at (AT_EXTRACT_SETS): New.
6400 (Nullable): Use it.
6401 (Firsts): New.
6402
6403 2002-01-26 Akim Demaille <akim@epita.fr>
6404
6405 * tests/actions.at, tests/calc.at, tests/headers.at,
6406 * tests/torture.at: Adjust to the newest Autotest which no longer
6407 forces `.' in the PATH.
6408
6409 2002-01-25 Akim Demaille <akim@epita.fr>
6410
6411 * tests/regression.at (%nonassoc and eof): New.
6412 Suggested by Robert Anisko.
6413
6414 2002-01-24 Akim Demaille <akim@epita.fr>
6415
6416 Bison dumps core when trying to complain about broken input files.
6417 Reported by Cris van Pelt.
6418
6419 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
6420 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
6421 into...
6422 (Invalid inputs): Strengthen: exercise parse_percent_token.
6423
6424 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
6425
6426 * src/Makefile.am: Add bison.c++.
6427 * src/bison.c++: New skeleton.
6428
6429 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
6430
6431 * po/it.po: New.
6432
6433 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
6434
6435 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
6436
6437 2002-01-20 Marc Autret <marc@gnu.org>
6438
6439 * src/files.c (compute_output_file_names): Fix
6440
6441 2002-01-20 Marc Autret <marc@gnu.org>
6442
6443 * tests/output.at: New test.
6444 * src/files.c (compute_base_names): Don't map extensions when
6445 the YACC flag is set, use defaults.
6446 Reported by Evgeny Stambulchik.
6447
6448 2002-01-20 Marc Autret <marc@gnu.org>
6449
6450 * src/system.h: Need to define __attribute__ away for non-GCC
6451 compilers as well (i.e. the vendor C compiler).
6452 Suggested by Albert Chin-A-Young.
6453
6454 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
6455
6456 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
6457 canonical definition.
6458 * src/system.h: Use the canonical definition for PARAMS (avoids
6459 a conflict with the macro from lib/hash.h).
6460
6461 2002-01-11 Akim Demaille <akim@epita.fr>
6462
6463 * configure.in: Use AC_FUNC_STRNLEN.
6464 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
6465
6466 2002-01-09 Akim Demaille <akim@epita.fr>
6467
6468 * src/files.c, src/files.h (output_infix): New.
6469 (tab_extension): Remove.
6470 (compute_base_names): Compute the former, drop the latter.
6471 * src/output.c (prepare): Insert the muscles `output-infix', and
6472 `output-suffix'.
6473 * src/parse-skel.y (string, string.1): New.
6474 (section.header): Use it.
6475 (section.yacc): Remove.
6476 (prefix): Remove too.
6477 * src/scan-skel.l: Adjust.
6478 * src/bison.simple, src/bison.hairy: Adjust.
6479
6480 2002-01-09 Akim Demaille <akim@epita.fr>
6481
6482 * configure.in (WERROR_CFLAGS): Compute it.
6483 * src/Makefile.am (CFLAGS): Pass it.
6484 * tests/atlocal.in (CFLAGS): Idem.
6485 * src/files.c: Fix a few warnings.
6486 (get_extension_index): Remove, unused.
6487
6488 2002-01-08 Akim Demaille <akim@epita.fr>
6489
6490 * src/getargs.c (AS_FILE_NAME): New.
6491 (getargs): Use it to convert DOSish file names.
6492 * src/files.c (base_name): Rename as full_base_name to avoid
6493 clashes with `base_name ()'.
6494 (filename_split): New.
6495 (compute_base_names): N-th rewrite, using filename_split.
6496
6497 2002-01-08 Akim Demaille <akim@epita.fr>
6498
6499 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
6500 New, stolen from the Fileutils 4.1.
6501 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
6502 * configure.in: Check for the presence of memrchr, and of its
6503 prototype.
6504
6505 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
6506
6507 * lib/hash.h (__P): Added definition for this macro.
6508 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
6509 BUILT_SOURCES, to ensure they are generated first.
6510 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
6511 %error-verbose to allow bootstrapping with bison 1.30x.
6512
6513 2002-01-06 Akim Demaille <akim@epita.fr>
6514
6515 * src/reader.c (parse_braces): Don't fetch the next char, the
6516 convention is to fetch on entry.
6517 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
6518 'switch' without a following semicolon.
6519 * tests/regression.at (braces parsing): New.
6520
6521 2002-01-06 Akim Demaille <akim@epita.fr>
6522
6523 Bison is dead wrong in its RR conflict reports.
6524
6525 * tests/torture.at (GNU Cim Grammar): New.
6526 * src/conflicts.c (count_rr_conflicts): Fix.
6527
6528 2002-01-06 Akim Demaille <akim@epita.fr>
6529
6530 Creating package.m4 from configure.ac causes too many problems.
6531
6532 * tests/Makefile.am (package.m4): Create it by hand,
6533 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
6534
6535 2002-01-06 Akim Demaille <akim@epita.fr>
6536
6537 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
6538 skeleton.h.
6539
6540 2002-01-04 Paul Eggert <eggert@twinsun.com>
6541
6542 * doc/bison.texinfo (Debugging):
6543 Remove YYSTDERR; it's no longer defined or used.
6544 Also, s/cstdio.h/cstdio/.
6545
6546 2002-01-03 Akim Demaille <akim@epita.fr>
6547
6548 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
6549
6550 2002-01-03 Akim Demaille <akim@epita.fr>
6551
6552 * src/parse-skel.y (process_skeleton): Don't bind the parser's
6553 tracing code to --trace, wait for a better --trace option, with
6554 args.
6555
6556 2002-01-03 Akim Demaille <akim@epita.fr>
6557
6558 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
6559 The ISO C++ standard is extremely clear about it: stderr is
6560 considered a macro, not a regular symbol (see table 94 `Header
6561 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
6562 Therefore std:: does not apply to it. It still does with fprintf.
6563 Also, s/cstdio.h/cstdio/.
6564
6565 2002-01-03 Akim Demaille <akim@epita.fr>
6566
6567 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
6568 for non system headers.
6569
6570 2002-01-02 Akim Demaille <akim@epita.fr>
6571
6572 Equip the skeleton chain with location tracking, runtime trace,
6573 pure parser and scanner.
6574
6575 * src/parse-skel.y: Request a pure parser, locations, and prefix
6576 renaming.
6577 (%union): Having several members with the same type does not help
6578 type mismatches, simplify.
6579 (YYPRINT, yyprint): New.
6580 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
6581 (skel_error): this.
6582 Handle locations.
6583 * src/scan-skel.l: Adjust to these changes.
6584 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
6585 (LOCATION_PRINT, skel_control_t): New.
6586
6587 2001-12-30 Akim Demaille <akim@epita.fr>
6588
6589 * src/parse-skel.y: Get rid of the shift/reduce conflict:
6590 replace `gb' with BLANKS.
6591 * src/scan-skel.l: Adjust.
6592
6593 2001-12-30 Akim Demaille <akim@epita.fr>
6594
6595 * src/system.h: We don't need nor want bcopy.
6596 Throw away MS-DOS crap: we don't need getpid.
6597 * configure.in: We don't need strndup. It was even causing
6598 problems: because Flex includes the headers *before* us,
6599 _GNU_SOURCE is not defined by config.h, and therefore strndup was
6600 not visible.
6601 * lib/xstrndup.c: New.
6602 * src/scan-skel.l: Use it.
6603 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
6604 * src/parse-skel.y: Use %directives instead of #defines.
6605
6606 2001-12-30 Akim Demaille <akim@epita.fr>
6607
6608 * src/skeleton.h: New.
6609 * src/output.c (output_parser, output_master_parser): Remove, dead
6610 code.
6611 * src/output.h (get_lines_number, actions_output, guards_output)
6612 (token_definitions_output): Prototype them.
6613 * src/parse-skel.y: Add the license notice.
6614 Include output.h and skeleton.h.
6615 (process_skeleton): Returns void, and takes a single parameter.
6616 * src/scan-skel.l: Add the license notice.
6617 Include skeleton.h.
6618 Don't use %option yylineno: it seems that then Flex imagines
6619 REJECT has been used, and therefore it won't reallocate its
6620 buffers (which makes no other sense to me than a bug). It results
6621 in warnings for `unused: yy_flex_realloc'.
6622
6623 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
6624
6625 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6626 (MUSCLE_INSERT_PREFIX): ...to there.
6627 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6628 (MUSCLE_INSERT_PREFIX): Move from here...
6629
6630 * src/bison.hairy: Add a section directive. Put braces around muscle
6631 names. This parser skeleton is still broken, but Bison should not
6632 choke on a bad muscle 'syntax'.
6633 * src/bison.simple: Add a section directive. Put braces around muscle
6634 names.
6635
6636 * src/files.h (strsuffix, stringappend): Add declarations.
6637 (tab_extension): Add declaration.
6638 (short_base_name): Add declaration.
6639
6640 * src/files.c (strsuffix, stringappend): No longer static. These
6641 functions are used in the skeleton parser.
6642 (tab_extension): New.
6643 (compute_base_names): Use the computations done in this function
6644 to guess if the generated parsers should have '.tab' in their
6645 names.
6646 (short_base_name): No longer static.
6647
6648 * src/output.c (output_skeleton): New.
6649 (output): Disable call to output_master_parser, and give a try to
6650 a new skeleton handling system.
6651 (guards_output, actions_output): No longer static.
6652 (token_definitions_output, get_lines_number): No longer static.
6653
6654 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
6655
6656 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
6657 parse-skel.y.
6658
6659 * src/parse-skel.y: New file.
6660 * src/scan-skel.l: New file.
6661
6662 2001-12-29 Akim Demaille <akim@epita.fr>
6663
6664 %name-prefix is broken.
6665
6666 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
6667 Adjust all dependencies.
6668 * tests/headers.at (export YYLTYPE): Strengthen this test: use
6669 %name-prefix.
6670
6671 Renaming yylval but not yylloc is not consistent. Now we do.
6672
6673 * src/bison.simple: Prefix yylloc if used.
6674 * doc/bison.texinfo (Decl Summary): Document that.
6675
6676 2001-12-29 Akim Demaille <akim@epita.fr>
6677
6678 * doc/bison.texinfo: Promote `%long-directive' over
6679 `%long_directive'.
6680 Remove all references to fixed-output-files, yacc is enough.
6681
6682 2001-12-29 Akim Demaille <akim@epita.fr>
6683
6684 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
6685 user prologue. These are defaults.
6686 * tests/actions.at (Mid-rule actions): Make sure the user can
6687 define YYDEBUG and YYERROR_VERBOSE.
6688
6689 2001-12-29 Akim Demaille <akim@epita.fr>
6690
6691 * src/output.c (header_output): Don't forget to export YYLTYPE and
6692 yylloc.
6693 * tests/headers.at (export YYLTYPE): New, make sure it does.
6694 * tests/regression.at (%union and --defines, Invalid CPP headers):
6695 Move to...
6696 * tests/headers.at: here.
6697
6698 2001-12-29 Akim Demaille <akim@epita.fr>
6699
6700 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
6701
6702 2001-12-29 Akim Demaille <akim@epita.fr>
6703
6704 * tests/actions.at (Mid-rule actions): Output on a single line
6705 instead of several.
6706
6707 2001-12-29 Akim Demaille <akim@epita.fr>
6708
6709 * doc/bison.texinfo: Formatting changes.
6710
6711 2001-12-29 Akim Demaille <akim@epita.fr>
6712
6713 Don't store the token defs in a muscle, just be ready to output it
6714 on command. Now possible via `symbols'. Fixes a memory leak.
6715
6716 * src/output.c (token_definitions_output): New.
6717 (output_parser, header_output): Use it.
6718 * src/reader.c (symbols_save): Remove.
6719
6720 2001-12-29 Akim Demaille <akim@epita.fr>
6721
6722 * src/bison.simple: Do not provide a default for YYSTYPE and
6723 YYLTYPE before the user's prologue. Otherwise it's hardly... a
6724 default.
6725
6726 2001-12-29 Akim Demaille <akim@epita.fr>
6727
6728 Mid-rule actions are simply... ignored!
6729
6730 * src/reader.c (readgram): Be sure to attach mid-rule actions to
6731 the empty-rule associated to the dummy symbol, not to the host
6732 rule.
6733 * tests/actions.at (Mid-rule actions): New.
6734
6735 2001-12-29 Akim Demaille <akim@epita.fr>
6736
6737 Memory leak.
6738
6739 * src/reader.c (reader): Free grammar.
6740
6741 2001-12-29 Akim Demaille <akim@epita.fr>
6742
6743 Memory leak.
6744
6745 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
6746 since it allocates it for each state, although only one is needed.
6747 (allocate_storage): Do it here.
6748
6749 2001-12-29 Akim Demaille <akim@epita.fr>
6750
6751 * src/options.h, src/options.c (create_long_option_table): Rename
6752 as...
6753 (long_option_table_new): this, with a clearer prototype.
6754 (percent_table): Remove, unused,
6755 * src/getargs.c (getargs): Adjust.
6756
6757 2001-12-29 Akim Demaille <akim@epita.fr>
6758
6759 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
6760 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
6761 as states.
6762
6763 2001-12-29 Akim Demaille <akim@epita.fr>
6764
6765 * src/lalr.c (build_relations): Rename `states' as `states1'.
6766 Sorry, I don't understand exactly what it is, no better name...
6767
6768 2001-12-29 Akim Demaille <akim@epita.fr>
6769
6770 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
6771 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
6772 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
6773 as rules.
6774
6775 2001-12-29 Akim Demaille <akim@epita.fr>
6776
6777 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
6778 ago.
6779
6780 2001-12-29 Akim Demaille <akim@epita.fr>
6781
6782 * src/reader.c, src/reader.h (user_toknums): Remove.
6783 Adjust all users to use symbols[i]->user_token_number.
6784
6785 2001-12-29 Akim Demaille <akim@epita.fr>
6786
6787 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
6788 Adjust all users to use symbols[i]->prec or ->assoc.
6789
6790 2001-12-29 Akim Demaille <akim@epita.fr>
6791
6792 * src/reader.c, src/reader.h (tags): Remove.
6793 Adjust all users to use symbols[i]->tag.
6794
6795 2001-12-29 Akim Demaille <akim@epita.fr>
6796
6797 * src/gram.h, src/gram.c (symbols): New, similar to state_table
6798 and rule_table.
6799 * src/reader.c (packsymbols): Fill this table.
6800 Drop sprec.
6801 * src/conflicts.c (resolve_sr_conflict): Adjust.
6802 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
6803 single table.
6804 Use symbols[i]->tag instead of tags[i].
6805
6806 2001-12-29 Akim Demaille <akim@epita.fr>
6807
6808 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
6809 In addition, put a comment in there, to replace...
6810 * tests/regression.at (%union and C comments): Remove.
6811
6812 2001-12-29 Akim Demaille <akim@epita.fr>
6813
6814 * tests/regression.at (Web2c Actions): Blindly move the actual
6815 output as expected output. The contents *seem* right to me, but I
6816 can't pretend reading perfectly parser tables... Nonetheless, all
6817 the other tests pass correctly, the table look OK, even though the
6818 presence of `$axiom' is to be noted: AFAICS it is useless (but
6819 harmless).
6820
6821 2001-12-29 Akim Demaille <akim@epita.fr>
6822
6823 * src/reader.c (readgram): Don't add the rule 0 if there were no
6824 rules read. In other words, add it _after_ having performed
6825 grammar sanity checks.
6826 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
6827
6828 2001-12-29 Akim Demaille <akim@epita.fr>
6829
6830 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
6831 visible, and some states have now a different number.
6832
6833 2001-12-29 Akim Demaille <akim@epita.fr>
6834
6835 * src/reader.c (readgram): Bind the initial rule's lineno to that
6836 of the first rule.
6837 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
6838 (Solved SR Conflicts): Adjust rule 0's line number.
6839
6840 2001-12-29 Akim Demaille <akim@epita.fr>
6841
6842 Fix the `GAWK Grammar' failure.
6843
6844 * src/LR0.c (final_state): Initialize to -1 so that we do compute
6845 the reductions of the first state which was mistakenly confused
6846 with the final state because precisely final_state was initialized
6847 to 0.
6848 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
6849 now noticed by Bison.
6850 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
6851 have a reduction on $default.
6852
6853 2001-12-29 Akim Demaille <akim@epita.fr>
6854
6855 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
6856 rule line numbers.
6857 * src/closure.c (print_closure): Likewise.
6858 * src/derives.c (print_derives): Likewise.
6859 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
6860 now.
6861
6862 2001-12-29 Akim Demaille <akim@epita.fr>
6863
6864 * src/lalr.c (lookaheads_print): New.
6865 (lalr): Call it when --trace-flag.
6866 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
6867 are dumped.
6868
6869 2001-12-29 Akim Demaille <akim@epita.fr>
6870
6871 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
6872 when walking through ritem, even via rule->rhs.
6873 * src/reduce.c (dump_grammar, useful_production, reduce_output)
6874 (useful_production, useless_nonterminals): Likewise.
6875 (reduce_grammar_tables): Likewise, plus update nritems.
6876 * src/nullable.c (set_nullable): Likewise.
6877 * src/lalr.c (build_relations): Likewise.
6878 * tests/sets.at (Nullable): Adjust.
6879 Fortunately, now, the $axiom is no longer nullable.
6880
6881 2001-12-29 Akim Demaille <akim@epita.fr>
6882
6883 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
6884 the 0-sentinel.
6885 * src/gram.c (ritem_longest_rhs): Likewise.
6886 * src/reduce.c (nonterminals_reduce): Likewise.
6887 * src/print_graph.c (print_graph): Likewise.
6888 * src/output.c (output_rule_data): Likewise.
6889 * src/nullable.c (set_nullable): Likewise.
6890
6891 2001-12-29 Akim Demaille <akim@epita.fr>
6892
6893 * src/output.c: Comment changes.
6894
6895 2001-12-27 Paul Eggert <eggert@twinsun.com>
6896
6897 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
6898 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
6899 Sparc, as they were causing more porting problems than the
6900 (minor) performance improvement was worth.
6901
6902 Also, catch up with 1.31's YYSTD.
6903
6904 2001-12-27 Akim Demaille <akim@epita.fr>
6905
6906 * src/output.c (output_gram): Rely on nritems, not the
6907 0-sentinel. See below.
6908 Use -1 as separator, not 0.
6909 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
6910 Rely on -1 as separator in yyrhs, instead of 0.
6911 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
6912 twice `Now at end of input', therefore there are two lines less to
6913 expect.
6914
6915 2001-12-27 Akim Demaille <akim@epita.fr>
6916
6917 * tests/regression.at (Unresolved SR Conflicts):
6918 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
6919 below.
6920
6921 2001-12-27 Akim Demaille <akim@epita.fr>
6922
6923 * src/LR0.c (new_state): Recognize the final state by the fact it
6924 is reached by eoftoken.
6925 (insert_start_shifting_state, insert_eof_shifting_state)
6926 (insert_accepting_state, augment_automaton): Remove, since now
6927 these states are automatically computed from the initial state.
6928 (generate_states): Adjust.
6929 * src/print.c: When reporting a rule number to the user, substract
6930 1, so that the axiom rule is rule 0, and the first user rule is 1.
6931 * src/reduce.c: Likewise.
6932 * src/print_graph.c (print_core): For the time being, just as for
6933 the report, depend upon --trace-flags to dump the full set of
6934 items.
6935 * src/reader.c (readgram): Once the grammar read, insert the rule
6936 0: `$axiom: START-SYMBOL $'.
6937 * tests/set.at: Adjust: rule 0 is now displayed, and since the
6938 number of the states has changed (the final state is no longer
6939 necessarily the last), catch up.
6940
6941 2001-12-27 Akim Demaille <akim@epita.fr>
6942
6943 Try to make the use of the eoftoken valid. Given that its value
6944 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
6945 is used instead of > 0 where appropriate, (ii), depend upon nritems
6946 instead of the 0-sentinel.
6947
6948 * src/gram.h, src/gram.c (nritems): New.
6949 Expected to be duplication of nitems, but for the time being...
6950 * src/reader.c (packgram): Assert nritems and nitems are equal.
6951 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
6952 * src/closure.c (print_closure, print_fderives): Likewise.
6953 * src/gram.c (ritem_print): Likewise.
6954 * src/print.c (print_core, print_grammar): Likewise.
6955 * src/print_graph.c: Likewise.
6956
6957 2001-12-27 Akim Demaille <akim@epita.fr>
6958
6959 * src/main.c (main): If there are complains after grammar
6960 reductions, then output the report anyway if requested, then die.
6961 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
6962 * src/reader.c (eoftoken): New.
6963 (parse_token_decl): If the token being defined has value `0', it
6964 is the eoftoken.
6965 (packsymbols): No longer hack `tags' to insert `$' by hand.
6966 Be sure to preserve the value of the eoftoken.
6967 (reader): Make sure eoftoken is defined.
6968 Initialize nsyms to 0: now eoftoken is created just like the others.
6969 * src/print.c (print_grammar): Don't special case the eof token.
6970 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
6971 lie anyway, albeit pleasant.
6972 * tests/calc.at: Exercise error messages with eoftoken.
6973 Change the grammar so that empty input is invalid.
6974 Adjust expectations.
6975 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
6976
6977 2001-12-27 Akim Demaille <akim@epita.fr>
6978
6979 * configure.in: Check the protos of strchr ans strspn.
6980 Replace strchr if needed.
6981 * src/system.h: Provide the protos of strchr, strspn and memchr if
6982 missing.
6983 * lib/strchr.c: New.
6984 * src/reader.c (symbols_save): Use strchr.
6985
6986 2001-12-27 Akim Demaille <akim@epita.fr>
6987
6988 * src/print.c, src/print_graph.c (escape): New.
6989 Use it to quote the TAGS outputs.
6990 * src/print_graph.c (print_state): Now errors are in red, and
6991 reductions in green.
6992 Prefer high to wide: output the state number on a line of its own.
6993
6994 2001-12-27 Akim Demaille <akim@epita.fr>
6995
6996 * src/state.h, src/state.c (reductions_new): New.
6997 * src/LR0.c (set_state_table): Let all the states have a
6998 `reductions', even if reduced to 0.
6999 (save_reductions): Adjust.
7000 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
7001 * src/print.c (print_reductions, print_actions): Adjust.
7002 * src/output.c (action_row): Adjust.
7003
7004 2001-12-27 Akim Demaille <akim@epita.fr>
7005
7006 * src/state.h, src/state.c (errs_new, errs_dup): New.
7007 * src/LR0.c (set_state_table): Let all the states have an errs,
7008 even if reduced to 0.
7009 * src/print.c (print_errs, print_reductions): Adjust.
7010 * src/output.c (output_actions, action_row): Adjust.
7011 * src/conflicts.c (resolve_sr_conflict): Adjust.
7012
7013 2001-12-27 Akim Demaille <akim@epita.fr>
7014
7015 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
7016
7017 2001-12-27 Akim Demaille <akim@epita.fr>
7018
7019 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
7020 * src/print.c: here.
7021 (lookaheadset, shiftset): New, used as additional storage by
7022 print_reductions.
7023 (print_results): Adjust.
7024 (print_shifts, print_gotos, print_errs): New, extracted from...
7025 (print_actions): here.
7026 * src/print_graph.c (print_actions): Remove dead code.
7027
7028 2001-12-27 Akim Demaille <akim@epita.fr>
7029
7030 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
7031 `$n' and `@n'.
7032
7033 2001-12-27 Akim Demaille <akim@epita.fr>
7034
7035 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
7036 (build_relations): Adjust.
7037
7038 2001-12-27 Akim Demaille <akim@epita.fr>
7039
7040 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
7041 duplication.
7042
7043 2001-12-27 Akim Demaille <akim@epita.fr>
7044
7045 * src/reader.c (packgram): Catch nitems overflows.
7046
7047 2001-12-27 Akim Demaille <akim@epita.fr>
7048
7049 * src/files.c, src/files.h (guard_obstack): Remove.
7050 * src/output.c (output): Adjust.
7051 * src/reader.c (parse_braces): New, factoring...
7052 (copy_action, copy_guard): these two which are renamed as...
7053 (parse_action, parse_guard): these.
7054 As a voluntary consequence, using braces around guards is now
7055 mandatory.
7056
7057 2001-12-27 Akim Demaille <akim@epita.fr>
7058
7059 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
7060 * src/reader.c (symbol_list): `guard' and `guard_line' are new
7061 members.
7062 (symbol_list_new): Adjust.
7063 (copy_action): action_line is the first line, not the last.
7064 (copy_guard): Just as for actions, store the `action' only, not
7065 the switch/case/break flesh.
7066 Don't parse the user action that might follow the guard, let...
7067 (readgram): do it, i.e., now, there can be an action after a
7068 guard.
7069 In other words the guard is just explicitly optional.
7070 (packgram): Adjust.
7071 * src/output.c (guards_output): New.
7072 (output_parser): Call it when needed.
7073 (output): Also free the guard and attrs obstacks.
7074 * src/files.c, src/files.h (obstack_save): Remove.
7075 (output_files): Remove.
7076 As a result, if one needs the former `.act' file, using an
7077 appropriate skeleton which requires actions and guards is now
7078 required.
7079 * src/main.c (main): Adjust.
7080 * tests/semantic.at: New.
7081 * tests/regression.at: Use `input.y' as input file name.
7082 Avoid 8+3 problems by requiring input.c when the test needs the
7083 parser.
7084
7085 2001-12-27 Akim Demaille <akim@epita.fr>
7086
7087 * src/reader.c (symbol_list_new): Be sure to initialize all the
7088 fields.
7089
7090 2001-12-27 Akim Demaille <akim@epita.fr>
7091
7092 All the hacks using a final pseudo state are now useless.
7093
7094 * src/LR0.c (set_state_table): state_table holds exactly nstates.
7095 * src/lalr.c (nLA): New.
7096 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
7097 instead of lookaheadsp from the pseudo state (nstate + 1).
7098
7099 2001-12-27 Akim Demaille <akim@epita.fr>
7100
7101 * src/output.c (action_row, token_actions): Use a state_t instead
7102 of a integer, and nlookaheads instead of the following state's
7103 lookaheadsp.
7104
7105 2001-12-27 Akim Demaille <akim@epita.fr>
7106
7107 * src/conflicts.c (log_resolution, flush_shift)
7108 (resolve_sr_conflict, set_conflicts, solve_conflicts)
7109 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
7110 (conflicts_print, print_reductions): Use a state_t instead of an
7111 integer when referring to a state.
7112 As much as possible, depend upon nlookaheads, instead of the
7113 `lookaheadsp' member of the following state (since lookaheads of
7114 successive states are successive, the difference between state n + 1
7115 and n served as the number of lookaheads for state n).
7116 * src/lalr.c (add_lookback_edge): Likewise.
7117 * src/print.c (print_core, print_actions, print_state)
7118 (print_results): Likewise.
7119 * src/print_graph.c (print_core, print_actions, print_state)
7120 (print_graph): Likewise.
7121 * src/conflicts.h: Adjust.
7122
7123 2001-12-27 Akim Demaille <akim@epita.fr>
7124
7125 * src/bison.hairy: Formatting/comment changes.
7126 ANSIfy.
7127 Remove `register' indications.
7128 Add plenty of `static'.
7129
7130 2001-12-27 Akim Demaille <akim@epita.fr>
7131
7132 * src/output.c (prepare): Drop the muscle `ntbase' which
7133 duplicates ntokens.
7134 * src/bison.simple: Formatting/comment changes.
7135 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
7136 is an undocumented synonym.
7137
7138 2001-12-22 Akim Demaille <akim@epita.fr>
7139
7140 * src/output.c (output_table_data): Change the prototype to use
7141 `int' for array ranges: some invocations do pass an int, not a
7142 short.
7143 Reported by Wayne Green.
7144
7145 2001-12-22 Akim Demaille <akim@epita.fr>
7146
7147 Some actions of web2c.y are improperly triggered.
7148 Reported by Mike Castle.
7149
7150 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
7151 * tests/regression.at (Web2c): Rename as...
7152 (Web2c Report): this.
7153 (Web2c Actions): New.
7154
7155 2001-12-22 Akim Demaille <akim@epita.fr>
7156
7157 Reductions in web2c.y are improperly reported.
7158 Reported by Mike Castle.
7159
7160 * src/conflicts.c (print_reductions): Fix.
7161 * tests/regression.at (Web2c): New.
7162
7163 2001-12-18 Akim Demaille <akim@epita.fr>
7164
7165 Some host fail on `assert (!"foo")', which expands to
7166 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
7167 Reported by Nelson Beebee.
7168
7169 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
7170 `#define it_succeeded 0' and `assert (it_succeeded)'.
7171
7172 2001-12-17 Marc Autret <autret_m@epita.fr>
7173
7174 * src/bison.simple: Don't hard code the skeleton line and filename.
7175 * src/output.c (output_parser): Rename 'line' as 'output_line'.
7176 New line counter 'skeleton_line' (skeleton-line muscle).
7177
7178 2001-12-17 Paul Eggert <eggert@twinsun.com>
7179
7180 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
7181 YYDEBUG must be defined to a nonzero value.
7182
7183 * src/bison.simple (yytname): Do not assume that the user defines
7184 YYDEBUG to a properly parenthesized expression.
7185
7186 2001-12-17 Akim Demaille <akim@epita.fr>
7187
7188 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
7189 nlookaheads is a new member.
7190 Adjust all users.
7191 * src/lalr.h (nlookaheads): Remove this orphan declaration.
7192 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
7193 state.
7194
7195 2001-12-17 Akim Demaille <akim@epita.fr>
7196
7197 * src/files.h, src/files.c (open_files, close_files): Remove.
7198 * src/main.c (main): Don't open/close files, nor invoke lex_free,
7199 let...
7200 * src/reader.c (reader): Do it.
7201
7202 2001-12-17 Akim Demaille <akim@epita.fr>
7203
7204 * src/conflicts.c (print_reductions): Formatting changes.
7205
7206 2001-12-17 Akim Demaille <akim@epita.fr>
7207
7208 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
7209 (flush_reduce): New.
7210 (resolve_sr_conflict): Adjust.
7211
7212 2001-12-17 Akim Demaille <akim@epita.fr>
7213
7214 * src/output.c (output_obstack): Be static and rename as...
7215 (format_obstack): this, to avoid any confusion with files.c's
7216 output_obstack.
7217 * src/reader.h (muscle_obstack): Move to...
7218 * src/output.h: here, since it's defined in output.c.
7219
7220 2001-12-17 Akim Demaille <akim@epita.fr>
7221
7222 * src/output.c (action_row, save_column, default_goto)
7223 (sort_actions, matching_state, pack_vector): Better variable
7224 locality.
7225
7226 2001-12-17 Akim Demaille <akim@epita.fr>
7227
7228 * src/output.c: Various formatting changes.
7229
7230 2001-12-17 Akim Demaille <akim@epita.fr>
7231
7232 * src/files.c (output_files): Free the output_obstack.
7233 * src/main.c (main): Call print and print_graph conditionally.
7234 * src/print.c (print): Work unconditionally.
7235 * src/print_graph.c (print_graph): Work unconditionally.
7236 * src/conflicts.c (log_resolution): Output only if verbose_flag.
7237
7238 2001-12-16 Marc Autret <autret_m@epita.fr>
7239
7240 * src/output.c (actions_output): Fix. When we use %no-lines,
7241 there is one less line per action.
7242
7243 2001-12-16 Marc Autret <autret_m@epita.fr>
7244
7245 * src/bison.simple: Remove a useless #line directive.
7246 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
7247 * src/output.c (get_lines_number): New.
7248 (output_parser): Adjust, now takes care about the lines of a
7249 output muscles.
7250 Fix line numbering.
7251 (actions_output): Computes the number of lines taken by actions.
7252 (output_master_parser): Insert new skeleton which is the name of
7253 the output parser file name.
7254
7255 2001-12-15 Marc Autret <autret_m@epita.fr>
7256
7257 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
7258
7259 2001-12-15 Marc Autret <autret_m@epita.fr>
7260
7261 * src/output.c (output_gram): Keep track of the hairy one.
7262
7263 2001-12-15 Akim Demaille <akim@epita.fr>
7264
7265 Make `make distcheck' work.
7266
7267 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
7268 system.h which uses libgettext.h.
7269
7270 2001-12-15 Akim Demaille <akim@epita.fr>
7271
7272 * src/nullable.c (set_nullable): Useless rules must be skipped,
7273 otherwise, since we range over their symbols, we might look at a
7274 nonterminal which no longer ``exists'', i.e., it is not counted in
7275 `nvars', hence we overflow our arrays.
7276
7277 2001-12-15 Akim Demaille <akim@epita.fr>
7278
7279 The header can also be produced directly, without any obstack!
7280 Yahoo!
7281
7282 * src/files.c, src/files.h (defines_obstack): Remove.
7283 (compute_header_macro): Global.
7284 (defines_obstack_save): Remove.
7285 * src/reader.c (parse_union_decl): No longer output to
7286 defines_obstack: its content can be found in the `stype' muscle
7287 anyway.
7288 (output_token_translations): Merge into...
7289 (symbols_output): this.
7290 Rename as...
7291 (symbols_save): this.
7292 (reader): Adjust.
7293 * src/output.c (header_output): New.
7294 (output): Call it.
7295
7296 2001-12-15 Akim Demaille <akim@epita.fr>
7297
7298 * src/reader.c (parse_union_decl): Instead of handling two obstack
7299 simultaneously, use one to define the `stype' muscle, and use the
7300 value of the latter to fill defines_obstack.
7301 (copy_comment): Remove.
7302 (copy_comment2): Work for a single obstack.
7303 Rename as...
7304 (copy_comment): this.
7305
7306 2001-12-15 Akim Demaille <akim@epita.fr>
7307
7308 * src/lex.c, src/lex.h (xgetc): No longer static.
7309 * src/reader.c (parse_union_decl): Revamp.
7310
7311 2001-12-15 Akim Demaille <akim@epita.fr>
7312
7313 Still making progress in separating Bison into (i) input, (ii)
7314 process, (iii) output: now we can directly output the parser file
7315 without using table_obstack at all.
7316
7317 * src/files.c, src/files.h (table_obstack): Bye bye.
7318 (parser_file_name): New.
7319 * src/files.c (compute_output_file_names): Compute it.
7320 * src/output.c (actions_output, output_parser)
7321 (output_master_parser): To a file instead of an obstack.
7322
7323 2001-12-15 Akim Demaille <akim@epita.fr>
7324
7325 Attach actions to rules, instead of pre-outputting them to
7326 actions_obstack.
7327
7328 * src/gram.h (rule_t): action and action_line are new members.
7329 * src/reader.c (symbol_list): Likewise.
7330 (copy_action): Save the actions within the rule.
7331 (packgram): Save them in rule_table.
7332 * src/output.c (actions_output): New.
7333 (output_parser): Use it on `%%actions'.
7334 (output_rule_data): Don't free rule_table.
7335 (output): Do it.
7336 (prepare): Don't save the `action' muscle.
7337 * src/bison.simple: s/%%action/%%actions/.
7338
7339 2001-12-15 Akim Demaille <akim@epita.fr>
7340
7341 * src/reader.c (copy_action): When --yacc, don't append a `;'
7342 to the user action: let it fail if lacking.
7343 Suggested by Arnold Robbins and Tom Tromey.
7344
7345 2001-12-14 Akim Demaille <akim@epita.fr>
7346
7347 * src/lex.c (literalchar): Simply return the char you decoded, non
7348 longer mess around with obstacks and int pointers.
7349 Adjust all callers.
7350
7351 2001-12-14 Akim Demaille <akim@epita.fr>
7352
7353 * src/lex.c (literalchar): Don't escape the special characters,
7354 just decode them, and keep them as char (before, eol was output as
7355 the 2 char string `\n' etc.).
7356 * src/output.c (output_rule_data): Use quotearg to output the
7357 token strings.
7358
7359 2001-12-13 Paul Eggert <eggert@twinsun.com>
7360
7361 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
7362 Do not infringe on the global user namespace when using C++.
7363 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
7364 All uses of `fprintf' and `stderr' changed.
7365
7366 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
7367
7368 2001-12-13 Akim Demaille <akim@epita.fr>
7369
7370 The computation of nullable is broken: it doesn't handle empty
7371 RHS's properly.
7372
7373 * tests/torture.at (GNU AWK Grammar): New.
7374 * tests/sets.at (Nullable): New.
7375 * src/nullable.c (set_nullable): Instead of blindly looping over
7376 `ritems', loop over the rules, and then over their rhs's.
7377
7378 Work around Autotest bugs.
7379
7380 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
7381 frame, because Autotest understand lines starting with a `+' as
7382 traces from the shell. Then, they are not processed properly.
7383 Admittedly an Autotest bug, but we don't have time to wait for
7384 Autotest to catch up.
7385 * tests/regression.at (Broken Closure): Adjust to the new table
7386 frames.
7387 Move to...
7388 * tests/sets.at: here.
7389
7390 2001-12-13 Akim Demaille <akim@epita.fr>
7391
7392 * src/closure.c (closure): Use nrules instead of playing tricks
7393 with BITS_PER_WORD.
7394
7395 2001-12-13 Akim Demaille <akim@epita.fr>
7396
7397 * src/print.c (print_actions): Output the handling of `$' as the
7398 traces do: shifting the token EOF. Before EOF was treated as a
7399 nonterminal.
7400 * tests/regression.at: Adjust some tests.
7401 * src/print_graph.c (print_core): Complete the set of items via
7402 closure. The next-to-final and final states are still unsatisfying,
7403 but that's to be addressed elsewhere.
7404 No longer output the rule numbers, but do output the state number.
7405 A single loop for the shifts + gotos is enough, but picked a
7406 distinct color for each.
7407 (print_graph): Initialize and finalize closure.
7408
7409 2001-12-13 Akim Demaille <akim@epita.fr>
7410
7411 * src/reader.c (readgram): Remove dead code, an strip useless
7412 braces.
7413 (get_type): Remove, unused.
7414
7415 2001-12-12 Akim Demaille <akim@epita.fr>
7416
7417 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
7418 on that of lib/error.c.
7419
7420 2001-12-12 Akim Demaille <akim@epita.fr>
7421
7422 Some hosts don't like `/' in includes.
7423
7424 * src/system.h: Include libgettext.h without qualifying the path.
7425 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
7426 $(top_srcdir).
7427
7428 2001-12-11 Marc Autret <autret_m@epita.fr>
7429
7430 * src/output.c (output_parser): Remove useless muscle.
7431
7432 2001-12-11 Marc Autret <autret_m@epita.fr>
7433
7434 * src/bison.simple: Remove #line just before %%epilogue. It
7435 is now handled in ...
7436 * src/reader.c (read_additionnal_code): Add the output of a
7437 #line for the epilogue.
7438
7439 2001-12-10 Marc Autret <autret_m@epita.fr>
7440
7441 * src/reader.c (copy_definition): Re-use CPP-outed code which
7442 replace precedent remove.
7443 * src/bison.simple: Remove #line before %%prologue because
7444 %%input-line is wrong at this time.
7445
7446 2001-12-10 Marc Autret <autret_m@epita.fr>
7447
7448 * src/reader.c (symbols_output): Clean up.
7449 * src/output.c (output_gram, output): Clean up.
7450
7451 2001-12-10 Akim Demaille <akim@epita.fr>
7452
7453 * src/lalr.c (initialize_lookaheads): New. Extracted from...
7454 * src/LR0.c (set_state_table): here.
7455 * src/lalr.c (lalr): Call it.
7456
7457 2001-12-10 Akim Demaille <akim@epita.fr>
7458
7459 * src/state.h (shifts): Remove the `number' member: shifts are
7460 attached to state, hence no longer need to be labelled with a
7461 state number.
7462
7463 2001-12-10 Akim Demaille <akim@epita.fr>
7464
7465 Now that states have a complete set of members, the linked list of
7466 shifts is useless: just fill directly the state's shifts member.
7467
7468 * src/state.h (shifts): Remove the `next' member.
7469 * src/LR0.c (first_state, last_state): Remove.
7470 Adjust the callers.
7471 (augment_automaton): Don't look for the shifts that must be added
7472 a shift on EOF: it is those of the state we looked for! But now,
7473 since shifts are attached, it is no longer needed to looking
7474 merely by its id: its number.
7475
7476 2001-12-10 Akim Demaille <akim@epita.fr>
7477
7478 * src/LR0.c (augment_automaton): Better variable locality.
7479 Remove an impossible branch: if there is a state corresponding to
7480 the start symbol being shifted, then there is shift for the start
7481 symbol from the initial state.
7482
7483 2001-12-10 Akim Demaille <akim@epita.fr>
7484
7485 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
7486 only when appropriate: when insert_start_shifting_state' is not
7487 invoked.
7488 * tests/regression.at (Rule Line Numbers): Adjust.
7489
7490 2001-12-10 Akim Demaille <akim@epita.fr>
7491
7492 * src/LR0.c (augment_automaton): Now that all states have shifts,
7493 merge the two cases addition shifts to the initial state.
7494
7495 2001-12-10 Akim Demaille <akim@epita.fr>
7496
7497 * src/lalr.c (set_state_table): Move to...
7498 * src/LR0.c: here.
7499 * src/lalr.c (lalr): Don't call it...
7500 * src/LR0.c (generate_states): do it.
7501 * src/LR0.h (first_state): Remove, only the table is used.
7502
7503 2001-12-10 Akim Demaille <akim@epita.fr>
7504
7505 * src/LR0.h (first_shift, first_reduction): Remove.
7506 * src/lalr.c: Don't use first_shift: find shifts through the
7507 states.
7508
7509 2001-12-10 Akim Demaille <akim@epita.fr>
7510
7511 * src/LR0.c: Attach shifts to states as soon as they are
7512 computed.
7513 * src/lalr.c (set_state_table): Instead of assigning shifts to
7514 state, just assert that the mapping was properly done.
7515
7516 2001-12-10 Akim Demaille <akim@epita.fr>
7517
7518 * src/LR0.c (insert_start_shift): Rename as...
7519 (insert_start_shifting_state): this.
7520 (insert_eof_shifting_state, insert_accepting_state): New.
7521 (augment_automaton): Adjust.
7522 Better locality of the variables.
7523 When looking if the start_symbol is shifted from the initial
7524 state, using `while (... symbol != start_symbol ...)' sounds
7525 better than `while (... symbol < start_symbol ...)': If fail
7526 to see how the order between symbols could be relevant!
7527
7528 2001-12-10 Akim Demaille <akim@epita.fr>
7529
7530 * src/getargs.h: Don't declare `spec_name_prefix' and
7531 `spec_file_prefix', declared by src/files.h.
7532 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
7533 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
7534 * src/output.c (prepare): Adjust.
7535 * src/reader.c (symbols_output): Likewise.
7536 * src/vmsgetargs.c: Vaguely adjust, but who cares?
7537
7538 2001-12-10 Akim Demaille <akim@epita.fr>
7539
7540 * src/muscle_tab.c (muscle_init): NULL is a better default than
7541 `"0"'.
7542
7543 2001-12-10 Akim Demaille <akim@epita.fr>
7544
7545 * src/reader.c (reader): Calling symbols_output once is enough.
7546
7547 2001-12-10 Akim Demaille <akim@epita.fr>
7548
7549 Now that states have a complete set of members, the linked list of
7550 reductions is useless: just fill directly the state's reductions
7551 member.
7552
7553 * src/state.h (struct reductions): Remove member `number' and
7554 `next'.
7555 * src/LR0.c (first_reduction, last_reduction): Remove.
7556 (save_reductions): Don't link the new reductions, store them in
7557 this_state.
7558 * src/lalr.c (set_state_table): No need to attach reductions to
7559 states, it's already done.
7560 * src/output.c (output_actions): No longer free the shifts, then
7561 the reductions, then the states: free all the states and their
7562 members.
7563
7564 2001-12-10 Akim Demaille <akim@epita.fr>
7565
7566 * src/options.c (OPTN, DRTV, BOTH): New.
7567 (option_table): Use them.
7568
7569 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
7570 the job of system.h.
7571 * src/options.c: Don't include stdio.h and xalloc.h for the same
7572 reasons.
7573
7574 2001-12-10 Akim Demaille <akim@epita.fr>
7575
7576 * src/output.c (output, prepare): Make sure the values of the
7577 muscles `action' and `prologue' are 0-terminated.
7578
7579 2001-12-10 Akim Demaille <akim@epita.fr>
7580
7581 Clean up GCC warnings.
7582
7583 * src/reader.c (copy_action): `buf' is not used.
7584 (parse_skel_decl): Be static.
7585 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
7586 * src/options.h (create_long_option_table): Have a real prototype.
7587 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
7588 (hash_delete_at): Return const void *.
7589 Adjust casts to preserve the const.
7590
7591 2001-12-10 Akim Demaille <akim@epita.fr>
7592
7593 * configure.in: Require 2.52g.
7594 M4 is not needed, but AUTOM4TE is.
7595 * m4/m4.m4: Remove.
7596 * tests/Makefile.am: Adjust.
7597
7598 2001-12-10 Akim Demaille <akim@epita.fr>
7599
7600 One structure for states is enough, even though theoretically
7601 there are LR(0) states and LALR(1) states.
7602
7603 * src/lalr.h (state_t): Remove.
7604 (state_table): Be state_t **, not state_t *.
7605 * src/state.h (core, CORE_ALLOC): Rename as...
7606 (state_t, STATE_ALLOC): this.
7607 Add the LALR(1) members: shifts, reductions, errs.
7608 * src/LR0.c (state_table): Rename as...
7609 (state_hash): this, to avoid name clashes with the global
7610 `state_table'.
7611 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
7612 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
7613
7614 2001-12-10 Akim Demaille <akim@epita.fr>
7615
7616 Bison dumps core on bash.y.
7617 Reported by Pascal Bart.
7618
7619 * src/warshall.c (bitmatrix_print): New.
7620 (TC): Use it.
7621 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
7622 j must be the outer loop.
7623 * tests/regression.at (Broken Closure): New.
7624
7625 2001-12-05 Akim Demaille <akim@epita.fr>
7626
7627 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
7628 its argument.
7629 Reported by Peter Hamorsky.
7630
7631 2001-12-05 Akim Demaille <akim@epita.fr>
7632
7633 * src/conflicts.c (err_table): Remove.
7634 (resolve_sr_conflict): Adjust.
7635 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
7636 Rename as...
7637 (state_t.reductions, state_t.shifts): this.
7638
7639 2001-12-05 Akim Demaille <akim@epita.fr>
7640
7641 * src/reduce.c (reduce_grammar_tables): No longer disable the
7642 removal of useless rules via CPP but via `if (0)', so that the
7643 compiler still check the code is valid.
7644 For instance, it should have noticed `rline' no longer exists: use
7645 the `line' member of rule_t.
7646 * src/gram.c (dummy, rline): Remove, unused.
7647
7648 2001-12-05 Akim Demaille <akim@epita.fr>
7649
7650 * src/output.c (pack_vector): Use assert, not berror.
7651 * src/main.c (berror): Remove, unused.
7652
7653 2001-12-05 Akim Demaille <akim@epita.fr>
7654
7655 New experimental feature: if --verbose --trace output all the
7656 items of a state, not only its kernel.
7657
7658 * src/print.c (print_core): If `trace_flag', then invoke closure
7659 before outputting the items of the state (print_core is no longer
7660 a correct name them).
7661 (print_results): Invoke new_closure/free_closure if needed.
7662
7663 2001-12-05 Akim Demaille <akim@epita.fr>
7664
7665 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
7666 * src/closure.c, src/closure.h (itemsetsize): Rename as...
7667 (nitemset): for consistency with the rest of the project.
7668
7669 2001-12-05 Akim Demaille <akim@epita.fr>
7670
7671 * src/closure.c (print_closure): Improve.
7672 (closure): Use it for printing input and output.
7673
7674 2001-12-05 Akim Demaille <akim@epita.fr>
7675
7676 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
7677 indexed by nonterminals.
7678
7679 2001-12-05 Akim Demaille <akim@epita.fr>
7680
7681 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
7682 what it was!).
7683 * src/warshall.h: Remove accidental duplication of the content.
7684
7685 2001-12-05 Akim Demaille <akim@epita.fr>
7686
7687 * src/closure.c (set_fderives): De-obfuscate.
7688
7689 2001-12-05 Akim Demaille <akim@epita.fr>
7690
7691 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
7692
7693 2001-12-05 Akim Demaille <akim@epita.fr>
7694
7695 * src/closure.c (set_firsts): De-obfuscate.
7696
7697 2001-12-05 Akim Demaille <akim@epita.fr>
7698
7699 * src/output.c (action_row): De-obfuscate
7700 using the good o' techniques: arrays not pointers, variable
7701 locality, BITISSET, RESETBIT etc.
7702
7703 2001-12-05 Akim Demaille <akim@epita.fr>
7704
7705 Pessimize the code to simplify it: from now on, all the states
7706 have a valid SHIFTS, which NSHIFTS is possibly 0.
7707
7708 * src/LR0.c (shifts_new): Be global and move to..
7709 * src/state.c, src/state.h: here.
7710 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
7711 * src/print_graph: Adjust.
7712
7713 2001-12-05 Akim Demaille <akim@epita.fr>
7714
7715 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
7716 * src/conflicts.c: Use it.
7717 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
7718 incorrectly ``simplified''.
7719
7720 2001-12-05 Akim Demaille <akim@epita.fr>
7721
7722 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
7723 using the good o' techniques: arrays not pointers, variable
7724 locality, BITISSET, RESETBIT etc.
7725
7726 2001-12-05 Akim Demaille <akim@epita.fr>
7727
7728 * src/state.h (SHIFT_SYMBOL): New.
7729 * src/conflicts.c: Use it to deobfuscate.
7730
7731 2001-12-05 Akim Demaille <akim@epita.fr>
7732
7733 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
7734 (print_reductions): De-obfuscate using the good o' techniques:
7735 arrays not pointers, variable locality, BITISSET.
7736
7737 2001-12-05 Akim Demaille <akim@epita.fr>
7738
7739 * src/conflicts.c (print_reductions): Arrays, not pointers.
7740 Use BITISSET.
7741
7742 2001-12-05 Akim Demaille <akim@epita.fr>
7743
7744 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7745
7746 2001-12-05 Akim Demaille <akim@epita.fr>
7747
7748 * src/conflicts.c (print_reductions): Improve variable locality.
7749
7750 2001-12-05 Akim Demaille <akim@epita.fr>
7751
7752 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7753
7754 2001-12-05 Akim Demaille <akim@epita.fr>
7755
7756 * src/conflicts.c (print_reductions): Improve variable locality.
7757
7758 2001-12-05 Akim Demaille <akim@epita.fr>
7759
7760 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
7761 * src/lalr.c: Use them.
7762
7763 2001-12-05 Akim Demaille <akim@epita.fr>
7764
7765 * src/LR0.c (augment_automaton): Formatting changes.
7766 Better variable locality.
7767
7768 2001-12-05 Akim Demaille <akim@epita.fr>
7769
7770 * src/lalr.c (matrix_print): New.
7771 (transpose): Use it.
7772 Use arrays instead of pointers.
7773
7774 2001-12-05 Akim Demaille <akim@epita.fr>
7775
7776 * src/lalr.c (maxrhs): Move to...
7777 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
7778 * src/lalr.c (build_relations): Adjust.
7779
7780 2001-12-05 Akim Demaille <akim@epita.fr>
7781
7782 * src/lalr.c (transpose): Free the memory allocated to the
7783 argument, as it is replaced by the results by the unique caller.
7784 (build_relations): Merely invoke transpose: it handles the memory
7785 deallocation.
7786 Improve variable locality.
7787 Avoid variables used as mere abbreviations.
7788 (compute_lookaheads): Use arrays instead of pointers.
7789
7790 2001-12-05 Akim Demaille <akim@epita.fr>
7791
7792 * src/lalr.c (initialize_F): Improve variable locality.
7793 Avoid variables used as mere abbreviations.
7794
7795 2001-12-05 Akim Demaille <akim@epita.fr>
7796
7797 * src/derives.c (print_derives): Display the ruleno.
7798 * src/lalr.c (initialize_F, transpose): Better variable locality
7799 to improve readability.
7800 Avoid variables used as mere abbreviations.
7801
7802 2001-12-05 Akim Demaille <akim@epita.fr>
7803
7804 * src/lalr.c (traverse): Use arrays instead of pointers.
7805
7806 2001-12-05 Akim Demaille <akim@epita.fr>
7807
7808 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
7809 the handling of squeue.
7810 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7811
7812 2001-12-05 Akim Demaille <akim@epita.fr>
7813
7814 Because useless nonterminals are now kept alive (instead of being
7815 `destroyed'), we now sometimes examine them, and store information
7816 related to them. Hence we need to know their number, and adjust
7817 memory allocations.
7818
7819 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
7820 static.
7821 * src/LR0.c (allocate_itemsets): The memory allocated to
7822 `symbol_count' was used for two different purpose: once to count
7823 the number of occurrences of each symbol, and later reassigned to
7824 `shift_symbol', containing the symbol that can be shifted from a
7825 given state.
7826 Deobfuscate, i.e., allocate, use and free `symbol_count' here
7827 only, and...
7828 (new_itemsets): Allocate `shift_symbol' here.
7829 (allocate_itemsets): symbol_count includes useless nonterminals.
7830 Make room for them.
7831 (free_storage): Use `free', not `XFREE', for pointers that cannot
7832 be null.
7833
7834 2001-12-05 Akim Demaille <akim@epita.fr>
7835
7836 * src/nullable.c (set_nullable): Deobfuscate the handling of
7837 ritem.
7838 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7839
7840 2001-12-05 Akim Demaille <akim@epita.fr>
7841
7842 * src/gram.c, src/gram.h (ritem_print): New.
7843 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
7844 (This useless function was defined only to work around VMS linkers
7845 that can't handle compilation units with variables only).
7846 * src/reduce.c (dump_grammar): Use it to trace the construction of
7847 ritem.
7848
7849 2001-12-04 Paul Eggert <eggert@twinsun.com>
7850
7851 * src/bison.simple (union yyalloc): Change member names
7852 to be the same as the stack names.
7853 (yyparse): yyptr is now union yyalloc *, not char *.
7854 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
7855 and may generate better code on some machines.
7856 (yystpcpy): Use prototype if __STDC__ is defined, not just
7857 if __cplusplus is defined.
7858
7859 2001-11-30 Akim Demaille <akim@epita.fr>
7860
7861 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
7862 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
7863 Gettext doesn't compile cleanly, and dies with -Werror.
7864 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
7865 Include WARNING_CFLAGS here.
7866 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
7867 before being defined.
7868
7869 2001-11-27 Paul Eggert <eggert@twinsun.com>
7870
7871 * lib/quotearg.h (quotearg_n, quotearg_n_style):
7872 First arg is int, not unsigned.
7873 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
7874 (SIZE_MAX, UINT_MAX): New macros.
7875 (quotearg_n_options): Abort if N is negative.
7876 Avoid overflow check on hosts where size_t is 64 bits and int
7877 is 32 bits, as overflow is impossible there.
7878 Fix off-by-one typo that caused unnecessary reallocation.
7879
7880 2001-11-29 Paul Eggert <eggert@twinsun.com>
7881
7882 Name space cleanup in generated parser.
7883
7884 * doc/bison.texinfo (Bison Parser): Discuss system headers
7885 and their effect on the user name space.
7886
7887 * src/bison.simple:
7888 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
7889 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
7890 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
7891
7892 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
7893 on user names when possible.
7894
7895 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
7896 Simplify test for whather <alloca.h> exists.
7897
7898 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
7899
7900 (<stdio.h>): Include if YYDEBUG.
7901
7902 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
7903 ! defined (yyoverflow) && ! defined (yymemcpy).
7904
7905 (yymemcpy, yyparse): Rename local variables as needed so that
7906 they all begin with 'yy'.
7907
7908 (yystrlen, yystpcpy): New functions.
7909
7910 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
7911 All uses changed.
7912
7913 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
7914 instead of relying on string.h functions. Use YYSTACK_ALLOC
7915 and YYSTACK_FREE instead of malloc and free.
7916
7917 2001-11-30 Akim Demaille <akim@epita.fr>
7918
7919 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
7920 before their first uses.
7921 (YYBISON, YYPURE): Move to the top of the output.
7922
7923 2001-11-30 Akim Demaille <akim@epita.fr>
7924
7925 * tests/reduce.at (Useless Nonterminals): Fix.
7926
7927 2001-11-30 Akim Demaille <akim@epita.fr>
7928
7929 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
7930 if body instead of `;' to pacify GCC's warnings.
7931
7932 2001-11-30 Akim Demaille <akim@epita.fr>
7933
7934 Instead of mapping the LHS of unused rules to -1, keep the LHS
7935 valid, but flag the rules as invalid.
7936
7937 * src/gram.h (rule_t): `useful' is a new member.
7938 * src/print.c (print_grammar): Adjust.
7939 * src/derives.c (set_derives): Likewise.
7940 * src/reader.c (packgram, reduce_output): Likewise.
7941 * src/reduce.c (reduce_grammar_tables): Likewise.
7942 * tests/reduce.at (Underivable Rules, Useless Rules): New.
7943
7944 2001-11-30 Akim Demaille <akim@epita.fr>
7945
7946 * src/reduce.c (reduce_output): Formatting changes.
7947 * src/print.c (print_results, print_grammar): Likewise.
7948 * tests/regression.at (Rule Line Numbers)
7949 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
7950
7951 2001-11-30 Akim Demaille <akim@epita.fr>
7952
7953 * src/reduce.c (nonterminals_reduce): Instead of throwing away
7954 useless nonterminals, move them at the end of the symbol arrays.
7955 (reduce_output): Adjust.
7956 * tests/reduce.at (Useless Nonterminals): Adjust.
7957
7958 2001-11-30 Akim Demaille <akim@epita.fr>
7959
7960 * src/reduce.c: Various comment/formatting changes.
7961 (nonterminals_reduce): New, extracted from...
7962 (reduce_grammar_tables): here.
7963 (reduce_grammar): Call nonterminals_reduce.
7964
7965 2001-11-29 Paul Eggert <eggert@twinsun.com>
7966
7967 * src/bison.simple (YYSTACK_REALLOC): Remove.
7968 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
7969 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
7970 New macros.
7971 (union yyalloc): New type.
7972 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
7973 an arbitrary restriction on hosts where size_t is wider than int.
7974
7975 (yyparse): Don't dump core if alloca or malloc fails; instead, report
7976 a parser stack overflow. Allocate just one block of memory for all
7977 three stacks, instead of allocating three blocks; this typically is
7978 faster and reduces fragmentation.
7979
7980 Do not limit the number of items in the stack to a value that fits
7981 in 'int', as this is an arbitrary limit on hosts with 64-bit
7982 size_t and 32-bit int.
7983
7984 2001-11-29 Marc Autret <autret_m@epita.fr>
7985
7986 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
7987 of defining YYERROR_VERBOSE.
7988 [AT_DATA]: $4 is now out of C declarations in the prologue.
7989
7990 2001-11-28 Marc Autret <autret_m@epita.fr>
7991
7992 * src/reader.c (parse_dquoted_param): New.
7993 (parse_skel_decl): Use it.
7994 * src/lex.h: Add its prototype.
7995 * src/lex.c (literalchar): Become not static.
7996
7997 2001-11-28 Marc Autret <autret_m@epita.fr>
7998
7999 * src/output.h: And put its extern declaration here.
8000 * src/output.c (error_verbose): Define here.
8001 (prepare): Echo name modification.
8002 * src/getargs.h: Clean its extern declaration.
8003 * src/getargs.c (error_verbose_flag): Remove.
8004 (getargs): Remove case 'e'.
8005 * src/options.c (option_table): 'error-verbose' is now seen as simple
8006 percent option.
8007 Include output.h.
8008
8009 * src/reader.c (read_declarations): Remove case tok_include.
8010 (parse_include_decl): Remove.
8011 * src/lex.h (token_t): Remove tok_include.
8012 * src/options.c (option_table): 'include' is now a simple command line
8013 option.
8014
8015 2001-11-28 Marc Autret <autret_m@epita.fr>
8016
8017 * src/bison.simple: Adjust muscle names.
8018 * src/muscle_tab.c (muscle_init): Also rename the muscles.
8019 * src/output.c (prepare): s/_/-/ for the muscles names.
8020 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
8021
8022 2001-11-28 Marc Autret <autret_m@epita.fr>
8023
8024 * src/bison.simple: Fix debug.
8025 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
8026
8027 2001-11-28 Akim Demaille <akim@epita.fr>
8028
8029 * src/LR0.c (shifts_new): New.
8030 (save_shifts, insert_start_shift, augment_automaton): Use it.
8031
8032 2001-11-28 Akim Demaille <akim@epita.fr>
8033
8034 * src/closure.c (closure): `b' and `ruleno' denote the same value:
8035 keep ruleno only.
8036
8037 2001-11-28 Akim Demaille <akim@epita.fr>
8038
8039 * src/closure.c (closure): Instead of looping over word in array
8040 then bits in words, loop over bits in array.
8041
8042 2001-11-28 Akim Demaille <akim@epita.fr>
8043
8044 * src/closure.c (closure): No longer optimize the special case
8045 where all the bits of `ruleset[r]' are set to 0, to make the code
8046 clearer.
8047
8048 2001-11-28 Akim Demaille <akim@epita.fr>
8049
8050 * src/closure.c (closure): `r' and `c' are new variables, used to
8051 de-obfuscate accesses to RULESET and CORE.
8052
8053 2001-11-28 Akim Demaille <akim@epita.fr>
8054
8055 * src/reduce.c (reduce_print): Use ngettext.
8056 (dump_grammar): Improve the trace accuracy.
8057
8058 2001-11-28 Akim Demaille <akim@epita.fr>
8059
8060 * src/reduce.c (dump_grammar): Don't translate trace messages.
8061
8062 2001-11-28 Akim Demaille <akim@epita.fr>
8063
8064 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
8065 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
8066 as all tags are free'ed afterwards.
8067 From Enrico Scholz.
8068
8069 2001-11-27 Paul Eggert <eggert@twinsun.com>
8070
8071 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
8072 use alloca when we didn't want to, and vice versa.
8073
8074 2001-11-27 Marc Autret <autret_m@epita.fr>
8075
8076 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
8077 initialization.
8078 * src/output.c (prepare): Remove its update.
8079
8080 2001-11-27 Marc Autret <autret_m@epita.fr>
8081
8082 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
8083 Use %error-verbose.
8084
8085 2001-11-27 Marc Autret <autret_m@epita.fr>
8086
8087 * src/bison.simple: Remove YYERROR_VERBOSE using.
8088 Use %%error_verbose.
8089 (yyparse): Likewise.
8090 * src/output.c (prepare): Give its final value.
8091 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
8092 * src/getargs.h: Add its extern declaration.
8093 * src/getargs.c (error_verbose_flag): New int.
8094 (getargs): Update to catch new case.
8095 * src/options.c (option_table): 'error-verbose' is a new option.
8096 (shortopts): Update.
8097
8098 2001-11-27 Akim Demaille <akim@epita.fr>
8099
8100 * src/system.h: Use intl/libgettext.h.
8101 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
8102
8103 2001-11-27 Akim Demaille <akim@epita.fr>
8104
8105 * tests/torture.at (Exploding the Stack Size with Malloc):
8106 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
8107
8108 2001-11-27 Akim Demaille <akim@epita.fr>
8109
8110 * src/files.c: Include error.h.
8111 Reported by Hans Aberg.
8112
8113 2001-11-26 Marc Autret <autret_m@epita.fr>
8114
8115 * src/reader.c (parse_include_decl): New, not yet implemented.
8116 (read_declarations): Add case tok_include.
8117 * src/getargs.h (include): Add its extern definition.
8118 * src/getargs.c (include): New const char *.
8119 (getargs): Add case '-I'.
8120 * src/options.c (option_table): Add include as command line and
8121 percent option.
8122 * src/lex.h (token_t): Add tok_include.
8123
8124 2001-11-26 Akim Demaille <akim@epita.fr>
8125
8126 * src/reader.c (readgram): Make sure rules for mid-rule actions
8127 have a lineno equal to that of their host rule.
8128 Reported by Hans Aberg.
8129 * tests/regression.at (Rule Line Numbers): New.
8130
8131 2001-11-26 Akim Demaille <akim@epita.fr>
8132
8133 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
8134 size_ts.
8135
8136 2001-11-26 Akim Demaille <akim@epita.fr>
8137
8138 * src/complain.c, src/complain.h (error): Remove, provided by
8139 lib/error.[ch].
8140
8141 2001-11-26 Akim Demaille <akim@epita.fr>
8142
8143 * src/reader.c (read_declarations): Don't abort on tok_illegal,
8144 issue an error message.
8145 * tests/regression.at (Invalid %directive): New.
8146 Reported by Hans Aberg.
8147
8148 2001-11-26 Akim Demaille <akim@epita.fr>
8149
8150 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
8151 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
8152
8153 2001-11-26 Akim Demaille <akim@epita.fr>
8154
8155 * src/conflicts.c (conflicts_print): Don't complain at all when
8156 there are no reduce/reduce conflicts, and as many shift/reduce
8157 conflicts as expected.
8158 * tests/regression.at (%expect right): Adjust.
8159
8160 2001-11-23 Akim Demaille <akim@epita.fr>
8161
8162 * lib/alloca.c: Update, from fileutils.
8163
8164 2001-11-23 Akim Demaille <akim@epita.fr>
8165
8166 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
8167
8168 2001-11-23 Akim Demaille <akim@epita.fr>
8169
8170 * src/system.h: Include alloca.h.
8171 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
8172
8173 2001-11-23 Akim Demaille <akim@epita.fr>
8174
8175 * src/print_graph.c (print_actions): Remove `rule', unused.
8176 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
8177 pacify GCC's signed < unsigned warnings.
8178 * src/closure.c (itemsetsize): Likewise.
8179 * src/reader.c (symbol_list_new): Static.
8180
8181 2001-11-23 Akim Demaille <akim@epita.fr>
8182
8183 Attaching lineno to buckets is stupid, since only one copy of each
8184 symbol is kept, only the line of the first occurrence is kept too.
8185
8186 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
8187 * src/reader.c (rline_allocated): Remove, unused.
8188 (symbol_list): Have a `line' member.
8189 (symbol_list_new): New.
8190 (readgram): Use it.
8191 * src/print.c (print_grammar): Output the rule line numbers.
8192 * tests/regression.at (Solved SR Conflicts)
8193 (Unresolved SR Conflicts): Adjust.
8194 Reported by Hans Aberg.
8195
8196 2001-11-22 Marc Autret <autret_m@epita.fr>
8197
8198 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
8199
8200 2001-11-22 Marc Autret <autret_m@epita.fr>
8201
8202 * src/muscle_tab.c (muscle_init): Remove initialization of
8203 skeleton muscle.
8204 * src/output.c (output_master_parser): Do it here.
8205
8206 2001-11-20 Akim Demaille <akim@epita.fr>
8207
8208 * po/sv.po: New.
8209 * configure.in (ALL_LINGUAS): Adjust.
8210 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
8211 longer contains strings to translate.
8212
8213 2001-11-19 Akim Demaille <akim@epita.fr>
8214
8215 * src/conflicts.c (conflicts_print): Add a missing \n.
8216
8217 2001-11-19 Akim Demaille <akim@epita.fr>
8218
8219 * src/nullable.c (nullable_print): New.
8220 (set_nullable): Call it when tracing.
8221 Better locality of variables.
8222
8223 2001-11-19 Akim Demaille <akim@epita.fr>
8224
8225 * src/print.c (print_actions): Better locality of variables.
8226
8227 2001-11-19 Akim Demaille <akim@epita.fr>
8228
8229 * src/derives.c (print_derives): Fix and enrich.
8230 * src/closure.c (print_fderives): Likewise.
8231
8232 2001-11-19 Akim Demaille <akim@epita.fr>
8233
8234 * src/closure.c (itemsetend): Remove, replaced with...
8235 (itemsetsize): new.
8236
8237 2001-11-19 Akim Demaille <akim@epita.fr>
8238
8239 * src/LR0.c (kernel_end): Remove, replaced with...
8240 (kernel_size): new.
8241
8242 2001-11-19 Akim Demaille <akim@epita.fr>
8243
8244 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
8245 to clarify.
8246
8247 2001-11-19 Akim Demaille <akim@epita.fr>
8248
8249 * src/closure.c (closure): Use arrays instead of pointers to clarify.
8250
8251 2001-11-19 Akim Demaille <akim@epita.fr>
8252
8253 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
8254 trace messages.
8255 * src/LR0.c: Likewise.
8256 (allocate_itemsets): Use arrays instead of pointers to clarify.
8257
8258 2001-11-19 Akim Demaille <akim@epita.fr>
8259
8260 * src/getargs.c (statistics_flag): Replace with...
8261 (trace_flag): New.
8262 (longopts): Accept --trace instead of --statistics.
8263 * src/getargs.h, src/options.c: Adjust.
8264 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
8265 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
8266
8267 2001-11-19 Akim Demaille <akim@epita.fr>
8268
8269 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
8270 pointers to clarify the code.
8271 (save_reductions, save_shifts): Factor common parts of alternatives.
8272
8273 2001-11-19 Akim Demaille <akim@epita.fr>
8274
8275 * src/LR0.c (new_state, get_state): Complete TRACE code.
8276 * src/closure.c: Include `reader.h' to get `tags', needed by the
8277 trace code.
8278 Rename the conditional DEBUG as TRACE.
8279 Output consistently TRACEs to stderr, not stdout.
8280 * src/derives.c: Likewise.
8281 * src/reduce.c: (inaccessable_symbols): Using if is better style
8282 than goto.
8283 Use `#if TRACE' instead of `#if 0' for tracing code.
8284
8285 2001-11-19 Akim Demaille <akim@epita.fr>
8286
8287 * src/system.h (LIST_FREE, shortcpy): New.
8288 * src/LR0.c: Use them.
8289 * src/output.c (free_itemsets, free_reductions, free_shifts):
8290 Remove, replaced by LIST_FREE.
8291
8292 2001-11-19 Akim Demaille <akim@epita.fr>
8293
8294 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
8295 (REDUCTIONS_ALLOC): New.
8296 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
8297 allocation.
8298
8299 2001-11-19 Akim Demaille <akim@epita.fr>
8300
8301 * src/LR0.c (new_state): Complete trace code.
8302 * src/nullable.c (set_nullable): Don't translate traces.
8303
8304 2001-11-19 Akim Demaille <akim@epita.fr>
8305
8306 * src/print_graph.c (print_core): Better locality of variables.
8307 * src/print.c (print_core): Likewise.
8308
8309 2001-11-19 Akim Demaille <akim@epita.fr>
8310
8311 * src/vcg.c: You do the output, so you are responsible of the
8312 handling of VCG syntax, in particular: use quotearg.
8313 * src/print_graph.c: Don't.
8314 (print_actions): Don't output the actions as part of the nodes,
8315 since that's the job of the edges.
8316 (print_state): Don't output by hand: fill the node description,
8317 and ask for its output.
8318
8319 2001-11-19 Akim Demaille <akim@epita.fr>
8320
8321 * src/bison.simple (yyparse): When verbosely reporting an error,
8322 no longer put additional quotes around token names.
8323 * tests/calc.at: Adjust.
8324
8325 2001-11-19 Akim Demaille <akim@epita.fr>
8326
8327 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
8328 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
8329 * src/output.c: Adjust.
8330
8331 2001-11-19 Akim Demaille <akim@epita.fr>
8332
8333 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
8334 (rule_t): this.
8335 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
8336
8337 2001-11-19 Akim Demaille <akim@epita.fr>
8338
8339 * src/gram.h (rule_t): New.
8340 (rule_table): New.
8341 (rrhs, rlhs): Remove, part of state_t.
8342 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
8343 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8344 * src/reader.c, src/reduce.c: Adjust.
8345
8346 2001-11-19 Akim Demaille <akim@epita.fr>
8347
8348 * src/reader.c (symbols_output): New, extracted from...
8349 (packsymbols): Here.
8350 (reader): Call it.
8351
8352 2001-11-19 Akim Demaille <akim@epita.fr>
8353
8354 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
8355 (maxrhs): this new function.
8356
8357 2001-11-19 Akim Demaille <akim@epita.fr>
8358
8359 * src/lalr.c (F): New macro to access the variable F.
8360 Adjust.
8361
8362 2001-11-19 Akim Demaille <akim@epita.fr>
8363
8364 * src/lalr.h (LA): New macro to access the variable LA.
8365 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8366 * src/lalr.c: Adjust.
8367
8368 2001-11-19 Akim Demaille <akim@epita.fr>
8369
8370 * src/lalr.c (initialize_LA): Only initialize LA. Let...
8371 (set_state_table): handle the `lookaheads' members.
8372
8373 2001-11-19 Akim Demaille <akim@epita.fr>
8374
8375 * src/lalr.h (lookaheads): Removed array, whose contents is now
8376 a member of...
8377 (state_t): this structure.
8378 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8379 Adjust.
8380
8381 2001-11-19 Akim Demaille <akim@epita.fr>
8382
8383 * src/lalr.h (consistent): Removed array, whose contents is now
8384 a member of...
8385 (state_t): this structure.
8386 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8387 Adjust.
8388
8389 2001-11-19 Akim Demaille <akim@epita.fr>
8390
8391 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
8392 contents are now members of...
8393 (state_t): this structure.
8394 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8395 Adjust.
8396
8397 2001-11-19 Akim Demaille <akim@epita.fr>
8398
8399 * src/lalr.h (state_t): New.
8400 (state_table): Be a state_t * instead of a core **.
8401 (accessing_symbol): Remove, part of state_t.
8402 * src/lalr.c: Adjust.
8403 (set_accessing_symbol): Merge into...
8404 (set_state_table): this.
8405 * src/print_graph.c, src/conflicts.c: Adjust.
8406
8407 2001-11-14 Akim Demaille <akim@epita.fr>
8408
8409 * tests/calc.at, tests/output.at, tests/regression.at,
8410 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
8411 now the tests are run in private dirs, therefore AC_CLEANUP and
8412 family can be simplified to 0-ary.
8413 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
8414 use abs. path to find config.h.
8415 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
8416 stderr, there can be way too much random noise.
8417 Instead pass -Werror to GCC and rely on the exit status.
8418 Reported by Wolfram Wagner.
8419
8420 2001-11-14 Akim Demaille <akim@epita.fr>
8421
8422 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
8423 defined only if yyoverflow is defined, to avoid `warning: unused
8424 variable `yyvs1''.
8425 Reported by The Test Suite.
8426
8427 2001-11-14 Akim Demaille <akim@epita.fr>
8428
8429 * src/print.c: Include reduce.h.
8430 Reported by Hans Aberg.
8431
8432 2001-11-14 Akim Demaille <akim@epita.fr>
8433
8434 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
8435 Revert a previous patch: these are really const.
8436 * src/conflicts.c (conflict_report): Additional useless pair of
8437 braces to pacify GCC's warnings for `if () if () {} else {}'.
8438 * src/lex.c (parse_percent_token): Replace equal_offset with
8439 arg_offset.
8440 arg is const.
8441 Be sure to strdup `arg' when used, since there is no reason for
8442 token_buffer not to change.
8443
8444 2001-11-14 Akim Demaille <akim@epita.fr>
8445
8446 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
8447 definition.
8448 * src/main.c (main): Use them.
8449 Suggested by Hans Aberg.
8450
8451 2001-11-12 Akim Demaille <akim@epita.fr>
8452
8453 * src/system.h (ngettext): Now that we use ngettext, be sure to
8454 provide a default definition when NLS are not used.
8455
8456 2001-11-12 Akim Demaille <akim@epita.fr>
8457
8458 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
8459 Use @kbd to denote user input.
8460 (Language and Grammar): ANSIfy the example.
8461 Adjust its layout for info/notinfo.
8462 (Location Tracking Calc): Output error messages to stderr.
8463 Output locations in a more GNUtically correct way.
8464 Fix a couple of Englishos.
8465 Adjust @group/@end group pairs.
8466
8467 2001-11-12 Akim Demaille <akim@epita.fr>
8468
8469 %expect was not functioning at all.
8470
8471 * src/conflicts.c (expected_conflicts): Set to -1.
8472 (conflict_report): Use ngettext.
8473 (conflicts_print): Check %expect and make its violation an error.
8474 * doc/bison.texinfo (Expect Decl): Adjust.
8475 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
8476 * tests/regression.at (%expect not enough, %expect right)
8477 (%expect too much): New.
8478
8479 2001-11-12 Akim Demaille <akim@epita.fr>
8480
8481 * tests/regression.at (Conflicts): Rename as...
8482 (Unresolved SR Conflicts): this.
8483 (Solved SR Conflicts): New.
8484
8485 2001-11-12 Akim Demaille <akim@epita.fr>
8486
8487 * src/reduce.c (print_results): Rename as...
8488 (reduce_output): This.
8489 Output to OUT, passed as argument, instead of output_obstack.
8490 (dump_grammar): Likewise.
8491 (reduce_free): New.
8492 Also free V1.
8493 (reduce_grammar): No longer call reduce_output, since...
8494 * src/print.c (print_results): do it.
8495 * src/main.c (main): Call reduce_free;
8496
8497 2001-11-12 Akim Demaille <akim@epita.fr>
8498
8499 * src/conflicts.c (print_reductions): Accept OUT as argument.
8500 Output to it, not to output_obstack.
8501 * src/print.c (print_actions): Adjust.
8502
8503 2001-11-12 Akim Demaille <akim@epita.fr>
8504
8505 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
8506 the result instead of using...
8507 (src_total, rrc_total, src_count, rrc_count): Remove.
8508 (any_conflicts): Remove.
8509 (print_conflicts): Split into...
8510 (conflicts_print, conflicts_output): New.
8511 * src/conflicts.h: Adjust.
8512 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
8513 * src/print.c (print_grammar): Issue `\n' between two rules.
8514 * tests/regression.at (Conflicts): New.
8515 Reported by Tom Lane.
8516
8517 2001-11-12 Akim Demaille <akim@epita.fr>
8518
8519 * tests/regression.at (Invalid input): Remove, duplicate with
8520 ``Invalid input: 1''.
8521
8522 2001-11-12 Akim Demaille <akim@epita.fr>
8523
8524 * tests/torture.at (AT_DATA_STACK_TORTURE)
8525 (Exploding the Stack Size with Alloca)
8526 (Exploding the Stack Size with Malloc): New.
8527
8528 2001-11-12 Akim Demaille <akim@epita.fr>
8529
8530 * src/bison.simple (YYSTACK_REALLOC): New.
8531 (yyparse) [!yyoverflow]: Use it and free the old stack.
8532 Reported by Per Allansson.
8533
8534 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
8535
8536 * src/bison.simple: Define type yystype instead of YYSTYPE, and
8537 define CPP macro, which substitute YYSTYPE by yystype.
8538 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
8539 with yyltype/YYLTYPE. This allows inclusion of the generated
8540 header within the parser if the compiler, such as GGC, accepts
8541 multiple equivalent #defines.
8542 From Akim.
8543
8544 2001-11-05 Akim Demaille <akim@epita.fr>
8545
8546 * src/reader.c (symbols_output): New, extracted from...
8547 (packsymbols): here.
8548 (reader): Adjust.
8549
8550 2001-11-05 Akim Demaille <akim@epita.fr>
8551
8552 * src/lex.c (parse_percent_token): s/quotearg/quote/.
8553
8554 2001-11-05 Akim Demaille <akim@epita.fr>
8555
8556 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
8557 pattern.
8558
8559 2001-11-05 Akim Demaille <akim@epita.fr>
8560
8561 * src/options.h (struct option_table_struct): set_flags is void*.
8562 * src/options.c (longopts): Support `--output' and `%output'.
8563 (usage): Adjust.
8564 * src/lex.h (tok_setopt): Remove, replaced with...
8565 (tok_intopt, tok_stropt): these new guys.
8566 * src/lex.c (getopt.h): Not needed.
8567 (token_buffer, unlexed_token_buffer): Not const.
8568 (percent_table): Promote `-' over `_' in directive names.
8569 Active `%name-prefix', `file-prefix', and `output'.
8570 (parse_percent_token): Accept possible arguments to directives.
8571 Promote `-' over `_' in directive names.
8572
8573 2001-11-04 Akim Demaille <akim@epita.fr>
8574
8575 * doc/bison.texinfo (Decl Summary): Split the list into
8576 `directives for grammars' and `directives for bison'.
8577 Sort'em.
8578 Add description of `%name-prefix', `file-prefix', and `output'.
8579 Promote `-' over `_' in directive names.
8580 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
8581 Simplify the description of `--name-prefix'.
8582 Promote `-' over `_' in directive names.
8583 Promote `--output' over `--output-file'.
8584 Fix the description of `--defines'.
8585 * tests/output.at: Exercise %file-prefix and %output.
8586
8587 2001-11-02 Akim Demaille <akim@epita.fr>
8588
8589 * doc/refcard.tex: Update.
8590
8591 2001-11-02 Akim Demaille <akim@epita.fr>
8592
8593 * src/symtab.h (SUNDEF): New.
8594 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
8595 stand for `uninitialized', instead of 0.
8596 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
8597 * src/lex.c (lex): Adjust.
8598
8599 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
8600 Number it 0.
8601 Let yylex return it instead of a plain 0.
8602 Reported by Dick Streefland.
8603
8604 2001-11-02 Akim Demaille <akim@epita.fr>
8605
8606 * tests/regression.at (Mixing %token styles): New test.
8607
8608 2001-11-02 Akim Demaille <akim@epita.fr>
8609
8610 * src/reader.c (parse_thong_decl): Formatting changes.
8611 (token_translations_init): New, extracted from...
8612 (packsymbols): Here.
8613 Adjust.
8614
8615 2001-11-01 Akim Demaille <akim@epita.fr>
8616
8617 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
8618 Check that `9foo.y' produces correct cpp guards.
8619 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
8620 guards.
8621 Reported by Wwp.
8622
8623 2001-11-01 Akim Demaille <akim@epita.fr>
8624
8625 * tests/regression.at (Invalid input: 2): New.
8626 * src/lex.c (unlexed_token_buffer): New.
8627 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
8628 too.
8629 Reported by Wwp.
8630
8631 2001-11-01 Akim Demaille <akim@epita.fr>
8632
8633 * tests/calc.at: Catch up with 1.30.
8634 * configure.in: Bump to 1.49a.
8635 Adjust to newer Autotest.
8636
8637 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
8638
8639 * src/conflicts.c: Move global variables rrc_total and src_total ...
8640 (print_conflicts): here.
8641 * src/output.c (output): Free global variable user_toknums.
8642 * src/lex.c (token_obstack): Become static.
8643
8644 2001-10-18 Akim Demaille <akim@epita.fr>
8645
8646 * tests/atlocal.in (GCC): Add.
8647 * tests/calc.at: s/m4_match/m4_bmatch/.
8648 s/m4_patsubst/m4_bpatsubst/.
8649 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
8650 * configure.in: AC_SUBST(GCC).
8651
8652 2001-10-14 Marc Autret <autret_m@epita.fr>
8653
8654 * src/options.c (create_long_option_table): Fix.
8655
8656 2001-10-10 Akim Demaille <akim@epita.fr>
8657
8658 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
8659
8660 2001-10-04 Akim Demaille <akim@epita.fr>
8661
8662 * src/reader.c (parse_union_decl): Push the caracters in
8663 union_obstack, not attrs_obstack.
8664
8665 2001-10-04 Akim Demaille <akim@epita.fr>
8666
8667 Merge in the branch 1.29.
8668
8669 * src/reader.c (packsymbols): Use a temporary obstack for
8670 `%%tokendef', since output_stack is already used elsewhere.
8671
8672 2001-10-02 Akim Demaille <akim@epita.fr>
8673
8674 Bump 1.29d.
8675
8676 2001-10-02 Akim Demaille <akim@epita.fr>
8677
8678 Version 1.29c.
8679
8680 2001-10-02 Akim Demaille <akim@epita.fr>
8681
8682 * tests/regression.at (Invalid CPP headers): New.
8683 From Alexander Belopolsky.
8684 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
8685
8686 2001-10-02 Akim Demaille <akim@epita.fr>
8687
8688 * tests/regression.at (Invalid input): New.
8689 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
8690 Reported by Shura.
8691
8692 2001-10-02 Akim Demaille <akim@epita.fr>
8693
8694 * tests/calc.at: Now that --debug works, the tests must be adjusted.
8695
8696 2001-10-02 Akim Demaille <akim@epita.fr>
8697
8698 * src/output.c (output_parser): Assert `skeleton'.
8699 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
8700 systems.
8701 From Shura.
8702
8703 2001-10-01 Marc Autret <autret_m@epita.fr>
8704
8705 * src/lex.h: Echo modifications.
8706 * src/lex.c (unlex): Parameter is now token_t.
8707 From Hans Aberg.
8708
8709 2001-10-01 Marc Autret <autret_m@epita.fr>
8710
8711 * src/main.c: Include lex.h.
8712 From Hans Aberg.
8713
8714 2001-09-29 Akim Demaille <akim@epita.fr>
8715
8716 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
8717
8718 2001-09-28 Akim Demaille <akim@epita.fr>
8719
8720 * tests/testsuite.at: Update to newer Autotest.
8721 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
8722
8723 2001-09-27 Akim Demaille <akim@epita.fr>
8724
8725 Position independent wrapper.
8726
8727 * tests/bison: Remove.
8728 * tests/bison.in: New.
8729 * configure.in: Adjust.
8730
8731 2001-09-27 Paul Eggert <eggert@twinsun.com>
8732
8733 Port quotearg fixes from tar 1.13.24.
8734
8735 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8736 tm to be declared.
8737 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8738 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8739
8740 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
8741 * m4/mbrtowc.m4: New file.
8742 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
8743 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
8744
8745 2001-09-27 Akim Demaille <akim@epita.fr>
8746
8747 Bump to 1.29c.
8748
8749 2001-09-27 Akim Demaille <akim@epita.fr>
8750
8751 Version 1.29b.
8752
8753 2001-09-25 Akim Demaille <akim@epita.fr>
8754
8755 * src/system.h: Include `xalloc.h'.
8756 Remove it from the C files.
8757 * src/files.c (output_files): Free the obstacks.
8758 * src/lex.c (init_lex): Rename as...
8759 (lex_init): this.
8760 (lex_free): New.
8761 * src/main.c (main): Use it.
8762
8763 2001-09-24 Marc Autret <autret_m@epita.fr>
8764
8765 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
8766 to output informations in fout (FILE*).
8767 (open_graph, close_graph): Likewise.
8768 (output_graph, output_edge, output_node): Likewise.
8769 * src/vcg.h: Update function prototypes.
8770 * src/print_graph.c (print_graph): Open output graph file.
8771 (print_actions): Adjust.
8772 * src/files.h: Remove extern declaration.
8773 * src/files.c: Remove graph_obstack declaration.
8774 (open_files): Remove graph_obstack initialization.
8775 (output_files): Remove graph_obstack saving.
8776
8777 2001-09-24 Marc Autret <autret_m@epita.fr>
8778
8779 * src/files.c (compute_output_file_names): Fix.
8780
8781 2001-09-24 Marc Autret <autret_m@epita.fr>,
8782 Akim Demaille <akim@epita.fr>
8783
8784 * src/reader.c (reader): Remove call to free_symtab ().
8785 * src/main.c (main): Call it here.
8786 Include symtab.h.
8787 * src/conflicts.c (initialize_conflicts): Rename as...
8788 (solve_conflicts): this.
8789 * src/print.c (print_core, print_actions, print_state)
8790 (print_grammar): Dump to a file instead a `output_obstack'.
8791 (print_results): Dump `output_obstack', and then proceed with the
8792 FILE *.
8793 * src/files.c (compute_output_file_names, close_files): New.
8794 (output_files): Adjust.
8795 * src/main.c (main): Adjust.
8796
8797 2001-09-23 Marc Autret <autret_m@epita.fr>
8798
8799 * src/files.c (compute_header_macro): Computes header macro name
8800 from spec_defines_file when given.
8801
8802 2001-09-23 Marc Autret <autret_m@epita.fr>
8803
8804 * src/files.c (output_files): Add default extensions.
8805
8806 2001-09-22 Akim Demaille <akim@epita.fr>
8807
8808 * src/conflicts.c (finalize_conflicts): Rename as...
8809 (free_conflicts): this.
8810
8811 2001-09-22 Akim Demaille <akim@epita.fr>
8812
8813 * src/gram.c (gram_free): Rename back as...
8814 (dummy): this.
8815 (output_token_translations): Free `token_translations'.
8816 * src/symtab.c (free_symtab): Free the tag field.
8817
8818 2001-09-22 Akim Demaille <akim@epita.fr>
8819
8820 Remove `translations' as it is always set to true.
8821
8822 * src/gram.h: Adjust.
8823 * src/reader.c (packsymbols, parse_token_decl): Adjust
8824 * src/print.c (print_grammar): Adjust.
8825 * src/output.c (output_token_translations): Adjust.
8826 * src/lex.c (lex): Adjust.
8827 * src/gram.c: Be sure the set pointers to NULL.
8828 (dummy): Rename as...
8829 (gram_free): this.
8830
8831 2001-09-22 Akim Demaille <akim@epita.fr>
8832
8833 * configure.in: Invoke AM_LIB_DMALLOC.
8834 * src/system.h: Use dmalloc.
8835 * src/LR0.c: Be sure to have pointers initialized to NULL.
8836 (allocate_itemsets): Allocate kernel_items only if needed.
8837
8838 2001-09-22 Akim Demaille <akim@epita.fr>
8839
8840 * configure.in: Bump to 1.29b.
8841 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
8842 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
8843 need xmalloc.c in calc.y.
8844 From Pascal Bart.
8845
8846 2001-09-21 Akim Demaille <akim@epita.fr>
8847
8848 Version 1.29a.
8849 * Makefile.maint, config/config.guess, config/config.sub,
8850 * config/missing: Update from masters.
8851 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
8852 upon package.m4.
8853 * configure.in (ALL_LINGUAS): Add `tr'.
8854
8855 2001-09-21 Akim Demaille <akim@epita.fr>
8856
8857 * tests/Makefile.am (package.m4): Move to...
8858 ($(srcdir)/$(TESTSUITE)): here.
8859
8860 2001-09-20 Akim Demaille <akim@epita.fr>
8861
8862 * src/complain.c: No longer try to be standalone: use system.h.
8863 Don't assume __STDC__ is defined to 1. Just test if it is defined.
8864 * src/complain.h: Likewise.
8865 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
8866 Remove the unused variable `n'.
8867 From Albert Chin-A-Young.
8868
8869 2001-09-18 Marc Autret <autret_m@epita.fr>
8870
8871 * doc/bison.1: Update.
8872 * doc/bison.texinfo (Bison Options): Update --defines and --graph
8873 descriptions.
8874 (Option Cross Key): Update.
8875 Add --graph.
8876
8877 2001-09-18 Marc Autret <autret_m@epita.fr>
8878
8879 * tests/regression.at: New test (comment in %union).
8880
8881 2001-09-18 Marc Autret <autret_m@epita.fr>
8882
8883 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
8884 do that.
8885 Reported by Keith Browne.
8886
8887 2001-09-18 Marc Autret <autret_m@epita.fr>
8888
8889 * tests/output.at: Add tests for --defines and --graph.
8890
8891 2001-09-18 Marc Autret <autret_m@epita.fr>
8892
8893 * tests/output.at: Removes tests of %{header,src}_extension features.
8894
8895 2001-09-18 Akim Demaille <akim@epita.fr>
8896
8897 * tests/Makefile.am (package.m4): New.
8898 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
8899 (_AT_CHECK_CALC_ERROR): Likewise.
8900 Factor the `, ' part of verbose error messages.
8901
8902 2001-09-18 Marc Autret <autret_m@epita.fr>
8903
8904 * src/getargs.c (longopts): Declare --defines and --graph as options
8905 with optional arguments.
8906 * src/files.h: Add extern declarations.
8907 * src/files.c (spec_graph_file, spec_defines_file): New.
8908 (output_files): Update.
8909 Remove CPP-outed code.
8910
8911 2001-09-18 Marc Autret <autret_m@epita.fr>
8912
8913 Turn off %{source,header}_extension feature.
8914
8915 * src/files.c (compute_exts_from_gf): Update.
8916 (compute_exts_from_src): Update.
8917 (output_files): CPP-out useless code.
8918 * src/files.h: Remove {header,source}_extension extern declarations.
8919 * src/reader.c (parse_dquoted_param): CPP-out.
8920 (parse_header_extension_decl): Remove.
8921 (parse_source_extension_decl): Remove.
8922 (read_declarations): Remove cases tok_{hdrext,srcext}.
8923 * src/lex.c (percent_table): Remove {header,source}_extension entries.
8924 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
8925
8926 2001-09-10 Akim Demaille <akim@epita.fr>
8927
8928 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
8929 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
8930 (AT_CHECK_OUTPUT): this.
8931 Merely check ls' exit status, its output is useless.
8932
8933 2001-09-10 Akim Demaille <akim@epita.fr>
8934
8935 * tests/calc.at: Use m4_match.
8936 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
8937
8938 2001-09-10 Marc Autret <autret_m@epita.fr>,
8939 Akim Demaille <akim@epita.fr>
8940
8941 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
8942 enum color_e.
8943 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
8944 to `normal'.
8945 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
8946 * src/lex.h: Adjust prototype.
8947 (token_t): Add `tok_undef'.
8948 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
8949 (parse_percent_token): Now returns token_t.
8950 Add default statement in switch.
8951 (lex): Separate `c' as an input variable, from the token_t result
8952 part.
8953 (unlexed): Is a token_t.
8954
8955 2001-09-10 Akim Demaille <akim@epita.fr>
8956
8957 * configure.in: Bump to 1.29a.
8958
8959 2001-09-07 Akim Demaille <akim@epita.fr>
8960
8961 Version 1.29.
8962
8963 2001-08-30 Akim Demaille <akim@epita.fr>
8964
8965 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
8966 * m4/atconfig.m4: Remove.
8967 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
8968 * tests/bison: New.
8969 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
8970 m4_if, m4_patsubst, and m4_regexp.
8971 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
8972 `input' file instead of echo.
8973
8974 2001-08-29 Akim Demaille <akim@epita.fr>
8975
8976 Bump to 1.28e.
8977
8978 2001-08-29 Akim Demaille <akim@epita.fr>
8979
8980 Version 1.28d.
8981
8982 2001-08-29 Paul Eggert <eggert@twinsun.com>
8983
8984 * src/bison.simple (yyparse): Don't take the address of an
8985 item before the start of an array, as that doesn't conform to
8986 the C Standard.
8987
8988 2001-08-29 Robert Anisko <anisko_r@epita.fr>
8989
8990 * doc/bison.texinfo (Location Tracking Calc): New node.
8991
8992 2001-08-29 Paul Eggert <eggert@twinsun.com>
8993
8994 * src/output.c (output): Do not define const, as this now
8995 causes more problems than it cures.
8996
8997 2001-08-29 Akim Demaille <akim@epita.fr>
8998
8999 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
9000 the nodes.
9001 Be sure to tag the `detailmenu'.
9002
9003 2001-08-29 Akim Demaille <akim@epita.fr>
9004
9005 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
9006 download in a tmp dir.
9007
9008 2001-08-28 Marc Autret <autret_m@epita.fr>
9009
9010 * config/depcomp: New file.
9011
9012 2001-08-28 Marc Autret <autret_m@epita.fr>
9013
9014 * doc/bison.1 (mandoc): Adjust.
9015 From Juan Manuel Guerrero.
9016
9017 2001-08-28 Marc Autret <autret_m@epita.fr>
9018
9019 * src/print_graph.c (print_state): Fix.
9020
9021 2001-08-27 Marc Autret <autret_m@epita.fr>
9022
9023 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
9024 char * members.
9025 Echo modifications to the functions prototypes.
9026 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
9027
9028 2001-08-27 Marc Autret <autret_m@epita.fr>
9029
9030 * src/vcg.c: Include `xalloc.h'.
9031 (add_colorentry): New.
9032 (add_classname): New.
9033 (add_infoname): New.
9034 * src/vcg.h: Add new prototypes.
9035
9036 2001-08-27 Akim Demaille <akim@epita.fr>
9037
9038 * Makefile.maint: Sync. again with CVS Autoconf.
9039
9040 2001-08-27 Akim Demaille <akim@epita.fr>
9041
9042 * Makefile.maint: Formatting changes.
9043 (po-update, cvs-update, update): New targets.
9044 (AMTAR): Remove.
9045
9046 2001-08-27 Akim Demaille <akim@epita.fr>
9047
9048 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9049 * Makefile.maint: Sync. with CVS Autoconf.
9050
9051 2001-08-27 Marc Autret <autret_m@epita.fr>
9052
9053 * src/vcg.h (struct infoname_s): New.
9054 (struct colorentry_s): New.
9055 (graph_s): New fields {vertical,horizontal}_order in structure.
9056 Add `infoname' field.
9057 Add `colorentry' field;
9058 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
9059 (G_HORIZONTAL_ORDER): New.
9060 (G_INFONAME): New.
9061 (G_COLORENTRY): New.
9062 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
9063 Add output of `infoname'.
9064 Add output of `colorentry'.
9065
9066 2001-08-27 Marc Autret <autret_m@epita.fr>
9067
9068 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
9069 This one shadowed a global parameter.
9070
9071 2001-08-24 Marc Autret <autret_m@epita.fr>
9072
9073 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
9074 instead of `unsigned'.
9075 (print_state): Do not call obstack_object_size () in obstack_grow ()
9076 to avoid macro variables shadowing.
9077
9078 2001-08-23 Marc Autret <autret_m@epita.fr>
9079
9080 * src/lex.c (percent_table): Typo: s/naem/name/.
9081 Add graph option.
9082 Normalize new options declarations.
9083
9084 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
9085
9086 * tests/suite.at: Exercise %header_extension and %source_extension.
9087
9088 2001-08-16 Marc Autret <autret_m@epita.fr>
9089
9090 * src/reader.c (parse_dquoted_param): New.
9091 (parse_header_extension_decl): Use it.
9092 (parse_source_extension_decl): Likewise.
9093
9094 2001-08-16 Marc Autret <autret_m@epita.fr>
9095
9096 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
9097 (get_xxxx_str): Use assert () instead of complain ().
9098 Remove return invokations in default cases.
9099 (get_decision_str): Modify default behaviour. Remove second argument.
9100 Echo modifications on calls.
9101 (output_graph): Fix.
9102
9103 2001-08-16 Marc Autret <autret_m@epita.fr>
9104
9105 * src/getargs.c (usage): Update with ``-g, --graph''.
9106
9107 2001-08-16 Marc Autret <autret_m@epita.fr>
9108
9109 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
9110 (Option Cross Key): Likewise.
9111 * doc/bison.1: Update.
9112
9113 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
9114
9115 * src/output.c (output_master_parser): Don't finish action_obstack.
9116 (output_parser): Don't care about the muscle action, here.
9117 (prepare): Copy the action_obstack in the action muscle.
9118 (output): Free action_obstack.
9119
9120 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
9121
9122 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
9123 will contain `%union' declaration.
9124 (parse_union_decl): Delete #line directive output.
9125 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
9126 informations about %union.
9127 (parse_union_decl): Copy the union_obstack in the muscle stype.
9128 * src/bison.simple: Add new #line directive.
9129 Add typdef %%stype YYSTYPE.
9130
9131 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
9132
9133 * src/bison.simple: Add new `#line' directive.
9134
9135 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
9136
9137 * src/bison.simple: New `#line' directive.
9138 * src/output.c (output_parser): Support new dynamic muscle input_line.
9139
9140 2001-09-22 Marc Autret <autret_m@epita.fr>
9141
9142 * src/output.c (output_master_parser): New.
9143 (output_parser): Be more re-entrant.
9144
9145 2001-09-21 Marc Autret <autret_m@epita.fr>
9146
9147 * src/reader.c (copy_definition, parse_union_decl): Update and use
9148 `linef' muscle.
9149 (copy_action): Likewise.
9150 Use obstack_1grow ().
9151 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
9152
9153 2001-09-21 Marc Autret <autret_m@epita.fr>
9154
9155 * src/options.c (option_table): Adjust.
9156 * src/lex.c (parse_percent_token): Fix.
9157
9158 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
9159
9160 * src/options.c (symtab.h): Include it, need by lex.h.
9161
9162 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
9163
9164 * src/lex.c (parse_percent_token): Change type of variable `tx', which
9165 is now an option_table_struct*.
9166 (option_strcmp): New function option_strcmp.
9167 (parse_percent_token): Call option_strcmp.
9168 * src/getargs.c (xalloc.h, options.h): Include it.
9169 (getargs): Call create_long_option_table.
9170 (getargs): Free longopts at the end of the function.
9171 (shortopts): Move in options.c.
9172 * src/options.c (create_long_option_table): New function. Convert
9173 information from option_table to option structure.
9174 * src/reader.c (options.h): Include it.
9175
9176 * src/Makefile.am: Adjust.
9177 * src/options.c (option_table): Create from longopts and percent_table.
9178 * src/getargs.c (longopts): Delete.
9179 * src/lex.c (struct percent_table_struct): Delete.
9180 (percent_table): Delete.
9181 (options.h): Include it.
9182 * src/options.c: Create.
9183 * src/options.h: Create.
9184 Declare enum opt_access_e.
9185 Define struct option_table_struct.
9186
9187 2001-09-20 Marc Autret <autret_m@epita.fr>
9188
9189 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
9190 sections of Bison.
9191
9192 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
9193
9194 * src/bison.simple: s/%%filename/%%skeleton.
9195 * src/muscle_tab.c (getargs.h): Include it.
9196 (muscle_init): Insert new muscle skeleton.
9197
9198 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
9199
9200 * src/output.c (output_parser): Delete unused variable actions_dumped.
9201
9202 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
9203
9204 * src/output.c (output): Delete call to reader_output_yylsp.
9205 * src/reader.c (reader): Likewise.
9206 * src/reader.h: Delete declaration of reader_output_yylsp.
9207
9208 2001-09-02 Marc Autret <autret_m@epita.fr>
9209
9210 * src/reader.c: Include muscle_tab.h.
9211 (parse_union_decl): Update.
9212 (parse_macro_decl): Rename parse_muscle_decl.
9213 Update to use renamed functions and variable.
9214 (read_declarations, copy_action, read_additionnal_code, : Updated
9215 with correct variables and functions names.
9216 (packsymbols, reader): Likewise.
9217
9218 * src/reader.h (muscle_obstack): Extern declaration update.
9219
9220 * src/output.c: Include muscle_tab.h
9221 In all functions using macro_insert, change by using muscle_insert ().
9222 (macro_obstack): Rename muscle_obstack.
9223 Echo modifications in the whole file.
9224 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
9225 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
9226 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
9227
9228 * src/muscle_tab.h: Update double inclusion macros.
9229 (macro_entry_s): Rename muscle_entry_s.
9230 Update prototypes.
9231
9232 * src/muscle_tab.c: Include muscle_tab.h.
9233 Rename macro_tabble to muscle_table.
9234 (mhash1, mhash2, mcmp): Use muscle_entry.
9235 (macro_init): Rename muscle_init. Update.
9236 (macro_insert): Rename muscle_insert. Update.
9237 (macro_find): Rename muscle_find. Update.
9238
9239 * src/main.c: Include muscle_tab.h.
9240 (main): Call muscle_init ().
9241 * src/Makefile.am (bison_SOURCES): Echo modifications.
9242
9243 2001-09-02 Marc Autret <autret_m@epita.fr>
9244
9245 Now the files macro_tab.[ch] are named muscle_tab.[ch].
9246
9247 * src/muscle_tab.c, src/muscle_tab.h: Add files.
9248
9249 2001-09-02 Marc Autret <autret_m@epita.fr>
9250
9251 * src/macrotab.c, src/macrotab.h: Remove.
9252
9253 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
9254
9255 * src/reader.c (copy_guard): Use muscle to specify the `#line'
9256 filename.
9257
9258 2001-09-01 Marc Autret <autret_m@epita.fr>
9259
9260 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
9261 to an explicit value to activate the feature. We do it here.
9262
9263 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9264
9265 * src/output.c (prepare): Delete the `filename' muscule insertion.
9266 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
9267 (parse_union_decl): Likewise.
9268 * src/macrotab.c (macro_init): Initialize filename by infile.
9269
9270 2001-08-31 Marc Autret <autret_m@epita.fr>
9271
9272 * src/bison.simple (YYLSP_NEEDED): New definition.
9273 * src/output.c (prepare): Add macro insertion of `locations_flag'
9274
9275 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9276
9277 * src/output.c (prepare): Delete insertion of previous muscles,
9278 and insert the `prefix' muscles.
9279 * src/macrotab.c (macro_init): Likewise.
9280 (macro_init): Initialization prefix directive by `yy'.
9281 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
9282 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
9283 yylval, yydebug, yyerror, yynerrs and yyparse.
9284 New directive `#define' to substitute yydebug, ... with option
9285 name_prefix.
9286
9287 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9288
9289 * src/main.c (main): Standardize.
9290 * src/output.c (output_table_data, output_parser): Likewise.
9291 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
9292
9293 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
9294
9295 * src/reader.c (read_additionnal_code): Rename %%user_code to
9296 %%epilogue.
9297 * src/output.c (output): Rename %%declarations to %%prologue.
9298 * src/bison.simple: Echo modifications.
9299
9300 2001-08-31 Marc Autret <autret_m@epita.fr>
9301
9302 * src/reader.c (readgram): CleanUp.
9303 (output_token_defines): Likewise.
9304 (packsymbols): Likewise.
9305 (reader): Likewise.
9306 * src/output.c (output): CPP-out useless code.
9307
9308 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9309
9310 * src/reader.c (reader): Delete obsolete call to function
9311 output_trailers and output_headers.
9312 * src/output.h: Remove obsolete functions prototypes of output_headers
9313 and output_trailers.
9314
9315 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
9316
9317 * src/main.c: Include macrotab.h.
9318 * src/macrotab.h (macro_entry_s): Constify fields.
9319 Adjust functions prototypes.
9320 * src/macrotab.c (macro_insert): Constify key and value.
9321 (macro_find): Constify key.
9322 (macro_insert): Include 'xalloc.h'
9323 (macro_insert): Use XMALLOC.
9324 (macro_find): Constify return value.
9325 * src/output.c (output_table_data): Rename table to table_data.
9326 (output_parser): Constify macro_key, macro_value.
9327
9328 2001-08-30 Marc Autret <autret_m@epita.fr>
9329
9330 * src/reader.c (parse_skel_decl): New.
9331 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
9332 * src/lex.h (token_t): New token `tok_skel'.
9333 * src/lex.c (percent_table): Add skeleton option entry.
9334 Standardize.
9335
9336 2001-08-29 Marc Autret <autret_m@epita.fr>
9337
9338 * src/bison.simple: Add %%user_code directive at the end.
9339 * src/reader.c (read_additionnal_code): New.
9340 (reader): Use it.
9341 * src/output.c (output_program): Remove.
9342 (output): Update.
9343
9344 2001-08-28 Marc Autret <autret_m@epita.fr>
9345
9346 * src/output.c (output_actions): Clean up.
9347 (output_gram): CPP-out useless code.
9348 * src/reader.c (reader): Clean up, CPP-out useless code.
9349
9350 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
9351
9352 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
9353 directive.
9354 * src/bison.simple: Add `%%definitions'.
9355
9356 2001-08-28 Marc Autret <autret_m@epita.fr>
9357
9358 * config/depcomp: New file.
9359
9360 2001-08-27 Paul Eggert <eggert@twinsun.com>
9361
9362 * src/bison.simple (yyparse): Don't take the address of an
9363 item before the start of an array, as that doesn't conform to
9364 the C Standard.
9365
9366 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
9367
9368 * src/output.c (output): Remove the initialization of the macro
9369 obstack. It was done too late here.
9370
9371 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
9372 completely wrong.
9373 (reader): Initialize the macro obstack here, since we need it to grow
9374 '%define' directives.
9375
9376 * src/reader.h: Declare the macro obstack as extern.
9377
9378 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
9379
9380 * src/output.c (output_parser): Fix. Store single '%' characters in
9381 the output obstack instead of throwing them away.
9382
9383 2001-08-27 Akim Demaille <akim@epita.fr>
9384
9385 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9386
9387 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9388
9389 * lib/Makefile.am: Adjust.
9390
9391 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9392
9393 * src/bison.simple: Update and add '%%' directives.
9394
9395 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9396
9397 * src/reader.c (reader): Remove calls to 'output_headers' and
9398 'output_trailers'. Remove some C output.
9399 (readgram): Disable a piece of code that was writing a default
9400 definition for 'YYSTYPE'.
9401 (reader_output_yylsp): Remove.
9402 (packsymbols): Output token defintions to a macro.
9403 (copy_definition): Disable C output.
9404
9405 * src/reader.c (parse_macro_decl): New function used to parse macro
9406 declarations.
9407 (copy_string2): Put the body of copy_string into this new function.
9408 Add a parameter to let the caller choose whether he wants to copy the
9409 string delimiters or not.
9410 (copy_string): Be a simple call to copy_string2 with the last argument
9411 bound to true.
9412 (read_declarations): Add case for macro definition.
9413 (copy_identifier): New.
9414 (parse_macro_decl): Read macro identifiers using copy_identifier
9415 rather than lex.
9416
9417 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9418
9419 * src/output.c (prepare): Add prefixed names.
9420 (output_parser): Output semantic actions.
9421 (output_parser): Fix bug on '%%line' directives.
9422
9423 * src/output.c (output_headers): Remove. The C code printed by this
9424 function should now be in the skeletons.
9425 (output_trailers): Remove.
9426 (output): Disable call to 'reader_output_yylsp'.
9427 (output_rule_data): Do not output tables to the table obstack.
9428
9429 * src/output.c: Remove some C dedicated output.
9430 Improve the use of macro and output obstacks.
9431 (output_defines): Remove.
9432
9433 * src/output.c (output_token_translations): Associate 'translate'
9434 table with a macro. No output to the table obstack.
9435 (output_gram): Same for 'rhs' and 'prhs'.
9436 (output_stos): Same for 'stos'.
9437 (output_rule_data): Same for 'r1' and 'r2'.
9438 (token_actions): Same for 'defact'.
9439 (goto_actions): Same for 'defgoto'.
9440 (output_base): Same for 'pact' and 'pgoto'.
9441 (output_table): Same for 'table'.
9442 (output_check): Same for 'check'.
9443
9444 * src/output.c (output_table_data): New function.
9445 (output_short_table): Remove.
9446 (output_short_or_char_table): Remove.
9447
9448 * src/output.c (output_parser): Replace most of the skeleton copy code
9449 with something new. Skeletons are now processed character by character
9450 rather than line by line, and Bison looks for '%%' macros. This is the
9451 first step in making Bison's output process (a lot) more flexible.
9452 (output_parser): Use the macro table.
9453
9454 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9455
9456 * src/main.c (main): Initialize the macro table.
9457
9458 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9459
9460 * src/lex.c (percent_table): Add tok_define.
9461 * src/lex.h: Add tok_define.
9462
9463 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9464
9465 * src/macrotab.c: New file.
9466 * src/macrotab.h: New file.
9467 * src/Makefile.am: Update.
9468
9469 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9470
9471 * lib/hash.c: New file.
9472 * lib/hash.h: New file.
9473 * lib/Makefile.am: Update.
9474
9475 2001-08-15 Akim Demaille <akim@epita.fr>
9476
9477 Version 1.28c.
9478
9479 2001-08-15 Marc Autret <autret_m@epita.fr>
9480
9481 * src/reader.c (readgram): Indent output macro YYSTYPE.
9482 (packsymbols): Likewise.
9483 (output_token_defines): Likewise.
9484 * src/files.c: Standardize.
9485 (compute_header_macro): New.
9486 (defines_obstack_save): New. Use compute_header_macro.
9487 (output_files): Update. Use defines_obstack_save.
9488
9489 2001-08-15 Akim Demaille <akim@epita.fr>
9490
9491 * doc/bison.texinfo (Table of Symbols): Document
9492 YYSTACK_USE_ALLOCA.
9493
9494 2001-08-15 Akim Demaille <akim@epita.fr>
9495
9496 * missing: Update from CVS Automake.
9497 * config/config.guess, config/config.sub, config/texinfo.tex:
9498 Update from gnu.org.
9499
9500 2001-08-15 Akim Demaille <akim@epita.fr>
9501
9502 * Makefile.maint: Sync with CVS Autoconf.
9503
9504 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
9505
9506 * doc/bison.texinfo: Include GNU Free Documentation License from
9507 `fdl.texi'.
9508 * doc/fdl.texi: Add to package.
9509
9510 2001-08-14 Marc Autret <autret_m@epita.fr>
9511
9512 Turn on %{source,header}_extension features.
9513
9514 * src/lex.c (percent_table): Un-CPP out header_extension and
9515 source_extension.
9516 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
9517 (compute_exts_from_src): Remove conditions. It restores priorities
9518 between options.
9519
9520 2001-08-14 Marc Autret <autret_m@epita.fr>
9521
9522 * src/files.c (compute_base_names): Add extensions computing when
9523 `--file-prefix' used.
9524 Standardize function calls.
9525
9526 2001-08-13 Marc Autret <autret_m@epita.fr>
9527
9528 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
9529 defining it (defined but null disables alloca).
9530
9531 2001-08-13 Marc Autret <autret_m@epita.fr>
9532
9533 * src/bison.simple (_yy_memcpy): CPP reformat.
9534
9535 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
9536
9537 * tests/atconfig.in (CPPFLAGS): Fix.
9538
9539 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
9540
9541 * doc/bison.texinfo: Include GNU General Public License from
9542 `gpl.texi'.
9543 * doc/gpl.texi: Add to package.
9544
9545 2001-08-10 Marc Autret <autret_m@epita.fr>
9546
9547 * src/print_graph.h: Fix.
9548 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
9549
9550 2001-08-10 Akim Demaille <akim@epita.fr>
9551
9552 * src/system.h: Provide default declarations for stpcpy, strndup,
9553 and strnlen.
9554
9555 2001-08-10 Robert Anisko <anisko_r@epita.fr>
9556
9557 * doc/bison.texinfo (Locations): Update @$ stuff.
9558
9559 2001-08-09 Robert Anisko <anisko_r@epita.fr>
9560
9561 * src/bison.simple (YYLLOC_DEFAULT): Update.
9562 (yyparse): Adjust.
9563
9564 2001-08-08 Marc Autret <autret_m@epita.fr>
9565
9566 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
9567 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
9568 Reported by Fabrice Bauzac.
9569
9570 2001-08-08 Marc Autret <autret_m@epita.fr>
9571
9572 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
9573 * src/vcg.c (output_node): Fix.
9574 * src/vcg.h: Cleanup.
9575 * src/print_graph.c: Add comments.
9576 (node_output_size): New global variable. Simplify the formatting of
9577 the VCG graph output.
9578 (print_actions): Unused code is now used. It notifies the final state
9579 and no action states in the VCG graph. It also give the reduce actions.
9580 The `shift and goto' edges are red and the `go to state' edges are
9581 blue.
9582 Get the current node name and node_obstack by argument.
9583 (node_obstack): New variable.
9584 (print_state): Manage node_obstack.
9585 (print_core): Use node_obstack given by argument.
9586 A node is not only computed here but in print_actions also.
9587 (print_graph): CPP out useless code instead of commenting it.
9588
9589 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
9590
9591 * tests/atconfig.in (CPPFLAGS): Fix.
9592
9593 2001-08-07 Akim Demaille <akim@epita.fr>
9594
9595 * src/print_graph.c (quote): New.
9596 (print_core): Use it.
9597
9598 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
9599
9600 * src/vcg.c (complain.h): Include it.
9601 Unepitaize `return' invocations.
9602 [NDEBUG] (main): Remove.
9603 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
9604 * src/files.c (open_files): Initialize graph_obstack.
9605 * src/print_graph.c (print_actions): CPP out useless code.
9606 (print_core): Don't output the last `\n' in labels.
9607 Use `quote'.
9608 * src/files.c (output_files): Output the VCG file.
9609 * src/main.c (main): Invoke print_graph ();
9610
9611 2001-08-06 Marc Autret <autret_m@epita.fr>
9612
9613 Automaton VCG graph output.
9614 Using option ``-g'' or long option ``--graph'', you can generate
9615 a gram_filename.vcg file containing a VCG description of the LALR (1)
9616 automaton of your grammar.
9617
9618 * src/main.c: Call to print_graph() function.
9619 * src/getargs.h: Update.
9620 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
9621 (graph_flag): New flag.
9622 (longopts): Update.
9623 (getargs): Add case `g'.
9624 * src/files.c (graph_obstack): New obstack struct.
9625 (open_files): Initialize new obstack.
9626 (output_files): Saves graph_obstack if required.
9627 * src/files.h (graph_obstack): New extern declaration.
9628 * src/Makefile.am: Add new source files.
9629
9630 2001-08-06 Marc Autret <autret_m@epita.fr>
9631
9632 * src/print_graph.c, src/print_graph.h (graph): New.
9633 * src/vcg.h: New file.
9634 * src/vcg.c: New file, VCG graph handling.
9635
9636 2001-08-06 Marc Autret <autret_m@epita.fr>
9637
9638 Add of %source_extension and %header_extension which specify
9639 the source or/and the header output file extension.
9640
9641 * src/files.c (compute_base_names): Remove initialisation of
9642 src_extension and header_extension.
9643 (compute_exts_from_gf): Update.
9644 (compute_exts_from_src): Update.
9645 (output_files): Update.
9646 * src/reader.c (parse_header_extension_decl): New.
9647 (parse_source_extension_decl): New.
9648 (read_declarations): New case statements for the new tokens.
9649 * src/lex.c (percent_table): Add entries for %source_extension
9650 and %header_extension.
9651 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
9652
9653 2001-08-06 Marc Autret <autret_m@epita.fr>
9654
9655 * configure.in: Bump to 1.28c.
9656 * doc/bison.texinfo: Texinfo thingies.
9657
9658 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
9659
9660 * tests/atconfig.in (CPPFLAGS): Add.
9661 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
9662
9663 2001-08-03 Akim Demaille <akim@epita.fr>
9664
9665 Version 1.28b.
9666
9667 2001-08-03 Akim Demaille <akim@epita.fr>
9668
9669 * tests/Makefile.am (check-local): Ship testsuite.
9670 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
9671 Include `string.h'.
9672
9673 2001-08-03 Akim Demaille <akim@epita.fr>
9674
9675 * configure.in: Try using -Wformat when compiling.
9676
9677 2001-08-03 Akim Demaille <akim@epita.fr>
9678
9679 * configure.in: Bump to 1.28b.
9680
9681 2001-08-03 Akim Demaille <akim@epita.fr>
9682
9683 * src/complain.c: Adjust strerror_r portability issues.
9684
9685 2001-08-03 Akim Demaille <akim@epita.fr>
9686
9687 Version 1.28a.
9688
9689 2001-08-03 Akim Demaille <akim@epita.fr>
9690
9691 * src/getargs.c, src/getarg.h (skeleton)): Constify.
9692 * src/lex.c (literalchar): Avoid name clashes on `buf'.
9693 * src/getargs.c: Include complain.h.
9694 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
9695 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
9696
9697 2001-08-03 Akim Demaille <akim@epita.fr>
9698
9699 * src/reader.c (readgram): Display hidden chars in error messages.
9700
9701 2001-08-03 Akim Demaille <akim@epita.fr>
9702
9703 Update to gettext 0.10.39.
9704
9705 2001-08-03 Akim Demaille <akim@epita.fr>
9706
9707 * lib/strspn.c: New.
9708
9709 2001-08-01 Marc Autret <autret_m@epita.fr>
9710
9711 * doc/bison.texinfo: Update.
9712 * doc/bison.1 (mandoc): Update.
9713 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
9714 * src/files.c: Support output files extensions computing.
9715 (src_extension): New static variable.
9716 (header_extension): New static variable.
9717 (tr): New function.
9718 (get_extension_index): New function, gets the index of an extension
9719 filename in a string.
9720 (compute_exts_from_gf): New function, computes extensions from the
9721 grammar file extension.
9722 (compute_exts_from_src): New functions, computes extensions from the
9723 C source file extension, file given by ``-o'' option.
9724 (compute_base_names): Update.
9725 (output_files): Update.
9726
9727 2001-08-01 Robert Anisko <anisko_r@epita.fr>
9728
9729 * doc/bison.texi: Document @$.
9730 (Locations): New section.
9731
9732 2001-07-18 Akim Demaille <akim@epita.fr>
9733
9734 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
9735 * config/prev-version.txt, config/move-if-change: New.
9736 * Makefile.am: Adjust.
9737
9738 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
9739
9740 * src/bison.simple (yyparse): Suppress warning `comparaison
9741 between signed and unsigned'.
9742
9743 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
9744
9745 * src/getargs.h (raw_flag): Remove.
9746 * src/getargs.c: Die on `-r'/`--raw'.
9747 * src/lex.c (parse_percent_token): Die on `%raw'.
9748 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
9749 * tests/calc.at: Suppress test with option `--raw'.
9750
9751 2001-07-14 Akim Demaille <akim@epita.fr>
9752
9753 * config/: New.
9754 * configure.in: Require Autoconf 2.50.
9755 Update to gettext 0.10.38.
9756
9757 2001-03-16 Akim Demaille <akim@epita.fr>
9758
9759 * doc/bison.texinfo: ANSIfy the examples.
9760
9761 2001-03-16 Akim Demaille <akim@epita.fr>
9762
9763 * getargs.c (skeleton): New variable.
9764 (longopts): --skeleton is a new option.
9765 (shortopts, getargs): -S is a new option.
9766 * getargs.h: Declare skeleton.
9767 * output.c (output_parser): Use it.
9768
9769 2001-03-16 Akim Demaille <akim@epita.fr>
9770
9771 * m4/strerror_r.m4: New.
9772 * m4/error.m4: Run AC_FUNC_STRERROR_R.
9773 * lib/error.h, lib/error.c: Update.
9774
9775 2001-03-16 Akim Demaille <akim@epita.fr>
9776
9777 * src/getargs.c (longopts): Clean up.
9778
9779 2001-02-21 Akim Demaille <akim@epita.fr>
9780
9781 * src/reader.c (gensym): `gensym_count' is your own.
9782 Use a static buf to create the symbol name, as token_buffer is no
9783 longer a buffer.
9784
9785 2001-02-08 Akim Demaille <akim@epita.fr>
9786
9787 * src/conflicts.c (conflict_report): Be sure not to append to res
9788 between two calls, which could happen if both first sprintf were
9789 skipped, but not the first cp += strlen.
9790
9791 2001-02-08 Akim Demaille <akim@epita.fr>
9792
9793 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
9794 New, from fileutils 4.0.37.
9795 * configure.in: Require Autoconf 2.49c. I took some time before
9796 making this decision. This is the only way out for portability
9797 issues in Bison, it would mean way too much duplicate effort to
9798 import in Bison features implemented in 2.49c since 2.13.
9799 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
9800
9801 2001-02-02 Akim Demaille <akim@epita.fr>
9802
9803 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
9804 * lib/xalloc.h, lib/xmalloc.c: Update.
9805
9806 2001-01-19 Akim Demaille <akim@epita.fr>
9807
9808 Get rid of the ad hoc handling of token_buffer in the scanner: use
9809 the obstacks.
9810
9811 * src/lex.c (token_obstack): New.
9812 (init_lex): Initialize it. No longer call...
9813 (grow_token_buffer): this. Remove it.
9814 Adjust all the places which used it to use the obstack.
9815
9816 2001-01-19 Akim Demaille <akim@epita.fr>
9817
9818 * src/lex.h: Rename all the tokens:
9819 s/\bENDFILE\b/tok_eof/g;
9820 s/\bIDENTIFIER\b/tok_identifier/g;
9821 etc.
9822 Let them be enums, not #define, to ease debugging.
9823 Adjust all the code.
9824
9825 2001-01-18 Akim Demaille <akim@epita.fr>
9826
9827 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
9828 * src/lex.c (maxtoken, grow_token_buffer): Static.
9829
9830 2001-01-18 Akim Demaille <akim@epita.fr>
9831
9832 Since we now use obstacks, more % directives can be enabled.
9833
9834 * src/lex.c (percent_table): Also accept `%yacc',
9835 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
9836 `%debug'.
9837 Handle the actions for `%semantic_parser' and `%pure_parser' here,
9838 instead of returning a token.
9839 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
9840 * src/reader.c (read_declarations): Adjust.
9841 * src/files.c (open_files): Don't call `compute_base_names', don't
9842 compute `attrsfile' since they depend upon data which might be
9843 *in* the input file now.
9844 (output_files): Do it here.
9845 * src/output.c (output_headers): Document the fact that this patch
9846 introduces a guaranteed SEGV for semantic parsers.
9847 * doc/bison.texinfo: Document them.
9848 * tests/suite.at: Exercise these %options.
9849
9850 2000-12-20 Akim Demaille <akim@epita.fr>
9851
9852 Also handle the output file (--verbose) with obstacks.
9853
9854 * files.c (foutput): Remove.
9855 (output_obstack): New.
9856 Adjust all dependencies.
9857 * src/conflicts.c: Return a string.
9858 * src/system.h (obstack_grow_string): Rename as...
9859 (obstack_sgrow): this. Be ready to work with non literals.
9860 (obstack_fgrow4): New.
9861
9862 2000-12-20 Akim Demaille <akim@epita.fr>
9863
9864 * src/files.c (open_files): Fix the computation of short_base_name
9865 in the case of `-o foo.tab.c'.
9866
9867 2000-12-20 Akim Demaille <akim@epita.fr>
9868
9869 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
9870 (copy_dollar): Now that everything uses obstacks, get rid of the
9871 FILE * parameters.
9872
9873 2000-12-20 Akim Demaille <akim@epita.fr>
9874
9875 * src/files.c (open_files): Actually the `.output' file is based
9876 on the short_base_name, not base_name.
9877 * tests/suite.at (Checking output file names): Adjust.
9878
9879 2000-12-20 Akim Demaille <akim@epita.fr>
9880
9881 * src/bison.s1: Remove, we now use directly...
9882 * src/bison.simple: this.
9883 * src/Makefile.am: Use pkgdata instead of data.
9884
9885 2000-12-20 Akim Demaille <akim@epita.fr>
9886
9887 * src/files.c (guard_obstack): New.
9888 (open_files): Initialize it.
9889 (output_files): Dump it...
9890 * src/files.h: Export it.
9891 * src/reader.c (copy_guard): Use it.
9892
9893 2000-12-19 Akim Demaille <akim@epita.fr>
9894
9895 * src/files.c (outfile, defsfile, actfile): Removed as global
9896 vars.
9897 (open_files): Don't compute them.
9898 (output_files): Adjust.
9899 (base_name, short_base_name): Be global.
9900 Adjust dependencies.
9901
9902 2000-12-19 Akim Demaille <akim@epita.fr>
9903
9904 * src/files.c (strsuffix): New.
9905 (stringappend): Be just like strcat but allocate.
9906 (base_names): Eve out from open_files.
9907 Try to simplify the rather hairy computation of base_name and
9908 short_base_name.
9909 (open_files): Use it.
9910 * tests/suite.at (Checking output file names): New test.
9911
9912 2000-12-19 Akim Demaille <akim@epita.fr>
9913
9914 * src/system.h (obstack_grow_literal_string): Rename as...
9915 (obstack_grow_string): this.
9916 * src/output.c (output_parser): Recognize `%% actions' instead of
9917 `$'.
9918 * src/bison.s1: s/$/%% actions/.
9919 * src/bison.hairy: Likewise.
9920
9921 2000-12-19 Akim Demaille <akim@epita.fr>
9922
9923 * src/output.c (output_parser): Compute the `#line' lines when
9924 there are.
9925 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
9926 Suggested by Hans Aberg.
9927
9928 2000-12-19 Akim Demaille <akim@epita.fr>
9929
9930 Let the handling of the skeleton files be local to the procedures
9931 that use it.
9932
9933 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
9934 longer static.
9935 (fparser, open_extra_files): Remove.
9936 (open_files, output_files): Don't take care of fparser.
9937 * src/files.h: Adjust.
9938 * src/output.c (output_parser): Open and close the file to the
9939 skeleton.
9940 * src/reader.c (read_declarations): When %semantic_parser, open
9941 fguard.
9942
9943 2000-12-19 Akim Demaille <akim@epita.fr>
9944
9945 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
9946 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
9947
9948 2000-12-19 Akim Demaille <akim@epita.fr>
9949
9950 * src/files.c (open_files): Yipee! We no longer need all the code
9951 looking for `/tmp' since we have no tmp file.
9952
9953 2000-12-19 Akim Demaille <akim@epita.fr>
9954
9955 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
9956 New macros.
9957 * src/files.c (open_files): Less dependency on MSDOS etc.
9958
9959 2000-12-14 Akim Demaille <akim@epita.fr>
9960
9961 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
9962 Provide a default definition.
9963 Use it when executing the default @ action.
9964 * src/reader.c (reader_output_yylsp): No longer include
9965 `timestamp' and `text' in the default YYLTYPE.
9966
9967 2000-12-12 Akim Demaille <akim@epita.fr>
9968
9969 * src/reader.c (copy_definition, parse_union_decl, copy_action)
9970 (copy_guard): Quote the file names.
9971 Reported by Laurent Mascherpa.
9972
9973 2000-12-12 Akim Demaille <akim@epita.fr>
9974
9975 * src/output.c (output_headers, output_program, output): Be sure
9976 to escape special characters when outputting filenames.
9977 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
9978 (output_headers): Don't depend on them, Use ACTSTR.
9979
9980 2000-11-17 Akim Demaille <akim@epita.fr>
9981
9982 * lib/obstack.h: Formatting changes.
9983 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
9984 prevents type checking.
9985 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9986 cast the value to (void *): assigning a `foo *' to a `void *'
9987 variable is valid.
9988 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9989 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
9990 append characters.
9991
9992 2000-11-17 Akim Demaille <akim@epita.fr>
9993
9994 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
9995 as...
9996 (suite.m4, regression.m4, calc.m4): these.
9997 * tests/atgeneral.m4: Update from CVS Autoconf.
9998
9999 2000-11-17 Akim Demaille <akim@epita.fr>
10000
10001 * tests/regression.m4 (%union and --defines): New test,
10002 demonstrating a current bug in the obstack implementation.
10003
10004 2000-11-17 Akim Demaille <akim@epita.fr>
10005
10006 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
10007 macros.
10008 Use them to declare the variables which are global or local to
10009 `yyparse'.
10010
10011 2000-11-17 Akim Demaille <akim@epita.fr>
10012
10013 * acconfig.h: Remove, no longer used.
10014
10015 2000-11-07 Akim Demaille <akim@epita.fr>
10016
10017 * src: s/Copyright (C)/Copyright/g.
10018
10019 2000-11-07 Akim Demaille <akim@epita.fr>
10020
10021 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
10022 defining.
10023 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
10024
10025 2000-11-07 Akim Demaille <akim@epita.fr>
10026
10027 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
10028 Merge in a single CPP if/else.
10029
10030 2000-11-07 Akim Demaille <akim@epita.fr>
10031
10032 * src/output.c (output): Remove useless variables.
10033 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
10034 argument `data' for consistency with the prototypes.
10035 Qualify it `const'.
10036 (obstack_copy, obstack_copy0): Rename the second argument as
10037 `address' for consistency. Qualify it `const'.
10038 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
10039 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
10040 `const' their input argument (`data' or `address').
10041 Adjust the corresponding macros to include `const' in casts.
10042
10043 2000-11-03 Akim Demaille <akim@epita.fr>
10044
10045 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
10046 s/PFILE1/BISON_HAIRY/.
10047 Adjust dependencies.
10048
10049 2000-11-03 Akim Demaille <akim@epita.fr>
10050
10051 For some reason, this was not applied.
10052
10053 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
10054 `unlink': it's no longer used.
10055
10056 2000-11-03 Akim Demaille <akim@epita.fr>
10057
10058 * src/files.c (skeleton_find): New function, eved out of...
10059 (open_files, open_extra_files): here.
10060
10061 2000-11-03 Akim Demaille <akim@epita.fr>
10062
10063 Don't use `atexit'.
10064
10065 * src/files.c (obstack_save): New function.
10066 (done): Rename as...
10067 (output_files): this.
10068 Use `obstack_save'.
10069 * src/main.c (main): Don't use `atexit' to register `done', since
10070 it no longer has to remove tmp files, just call `output_files'
10071 when there are no errors.
10072
10073 2000-11-02 Akim Demaille <akim@epita.fr>
10074
10075 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
10076 `unlink': it's no longer used.
10077 * src/files.h: Formatting changes.
10078
10079 2000-11-02 Akim Demaille <akim@epita.fr>
10080
10081 Remove the last uses of mktemp and unlink/delete.
10082
10083 * src/files.c (fdefines, ftable): Removed.
10084 (defines_ostack, table_obstack): New.
10085 Adjust dependencies of the former into uses of the latter.
10086 * src/output.c (output_short_or_char_table, output_short_table):
10087 Convert to using obstacks.
10088 * src/reader.c (copy_comment2): Accept one FILE * and two
10089 obstacks.
10090 (output_token_defines, reader_output_yylsp): Use obstacks.
10091 * src/system.h (obstack_fgrow3): New.
10092
10093 2000-11-01 Akim Demaille <akim@epita.fr>
10094
10095 Change each use of `fattrs' into a use of `attrs_obstack'.
10096
10097 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
10098 * src/files.c (fattrs): Remove.
10099 (attrs_obstack): New.
10100 Adjust all dependencies.
10101 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
10102
10103 2000-11-01 Akim Demaille <akim@epita.fr>
10104
10105 Introduce obstacks.
10106 Change each use of `faction' into a use of `action_obstack'.
10107
10108 * lib/obstack.h, lib/obstack.c: New files.
10109 * src/files.c (faction): Remove.
10110 (action_obstack): New.
10111 Adjust all dependencies.
10112
10113 2000-10-20 Akim Demaille <akim@epita.fr>
10114
10115 * lib/quote.h (PARAMS): New macro. Use it.
10116
10117 2000-10-16 Akim Demaille <akim@epita.fr>
10118
10119 * src/output.c (output_short_or_char_table): New function.
10120 (output_short_table, output_token_translations): Use it.
10121 (goto_actions): Use output_short_table.
10122
10123 2000-10-16 Akim Demaille <akim@epita.fr>
10124
10125 * src/symtab.c (bucket_new): New function.
10126 (getsym): Use it.
10127
10128 * src/output.c (output_short_table): New argument to display the
10129 comment associated with the table.
10130 Adjust dependencies.
10131 (output_gram): Use it.
10132 (output_rule_data): Nicer output layout for YYTNAME.
10133
10134 2000-10-16 Akim Demaille <akim@epita.fr>
10135
10136 * src/lex.c (read_typename): New function.
10137 (lex): Use it.
10138 * src/reader.c (copy_dollar): Likewise.
10139
10140 2000-10-16 Akim Demaille <akim@epita.fr>
10141
10142 * src/reader.c (copy_comment2): Expect the input stream to be on
10143 the `/' which is suspected to open a comment, instead of being
10144 called after `//' or `/*' was read.
10145 (copy_comment, copy_definition, parse_union_decl, copy_action)
10146 (copy_guard): Adjust.
10147
10148 2000-10-16 Akim Demaille <akim@epita.fr>
10149
10150 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
10151 `read_signed_integer'.
10152
10153 2000-10-16 Akim Demaille <akim@epita.fr>
10154
10155 * src/reader.c (copy_dollar): New function.
10156 (copy_guard, copy_action): Use it.
10157
10158 2000-10-16 Akim Demaille <akim@epita.fr>
10159
10160 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
10161 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
10162 New files, from Fileutils 4.0.27.
10163 * src/main.c (printable_version): Remove.
10164 * src/lex.c, src/reader.c: Use `quote'.
10165
10166 2000-10-04 Akim Demaille <akim@epita.fr>
10167
10168 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
10169
10170 2000-10-04 Akim Demaille <akim@epita.fr>
10171
10172 * doc/bison.texinfo: Various typos spotted by Neil Booth.
10173
10174 2000-10-04 Akim Demaille <akim@epita.fr>
10175
10176 When a literal string is used to define two different tokens,
10177 `bison -v' segfaults.
10178 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
10179
10180 * tests/regression.m4: New file.
10181 Include the core of the sample provided by Piotr Gackiewicz.
10182 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
10183 properly.
10184
10185 2000-10-04 Akim Demaille <akim@epita.fr>
10186
10187 * src/reader.c (parse_expect_decl): Keep `count' within the size
10188 of `buffer'.
10189 From Neil Booth.
10190
10191 2000-10-02 Paul Eggert <eggert@twinsun.com>
10192
10193 * bison.s1 (yyparse): Assign the default value
10194 unconditionally, to avoid a GCC warning and make the parser a
10195 tad smaller.
10196
10197 2000-10-02 Akim Demaille <akim@epita.fr>
10198
10199 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
10200 options.
10201
10202 2000-10-02 Akim Demaille <akim@epita.fr>
10203
10204 * src/derives.c, src/print.c, src/reduce.c: To ease the
10205 translation, move some `\n' out of the translated strings.
10206
10207 2000-10-02 Akim Demaille <akim@epita.fr>
10208
10209 The location tracking mechanism is precious for parse error
10210 messages. Nevertheless, it is enabled only when `@n' is used in
10211 the grammar, which is a different issue (you can use it in error
10212 message, but not in the grammar per se). Therefore, there should
10213 be another means to enable it.
10214
10215 * src/getargs.c (getargs): Support `--locations'.
10216 (usage): Report it.
10217 * src/getargs.h (locationsflag): Export it.
10218 * src/lex.c (percent_table): Support `%locations'.
10219 * src/reader.c (yylsp_needed): Remove this variable, now replaced
10220 with `locationsflag'.
10221 * doc/bison.texinfo: Document `--locations' and `%locations'.
10222 Sort the options.
10223 * tests/calc.m4: Test it.
10224
10225 For regularity of the names, replace each
10226 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
10227 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
10228 In addition replace each `flag' with `_flag'.
10229
10230 2000-10-02 Akim Demaille <akim@epita.fr>
10231
10232 Also test parse error messages, including with YYERROR_VERBOSE.
10233
10234 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
10235 associative).
10236 Use it to check the computations.
10237 Use it to check `nonassoc' is honored.
10238 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
10239 `--yyerror-verbose'.
10240 (_AT_CHECK_CALC): Adjust to this option.
10241 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
10242
10243 2000-10-02 Akim Demaille <akim@epita.fr>
10244
10245 Test also `--verbose', `--defines' and `--name-prefix'. Testing
10246 the latter demonstrates a flaw in the handling of non debugging
10247 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
10248 was used in order to simplify:
10249
10250 #if YYDEBUG
10251 if (yydebug)
10252 {
10253 ...
10254 }
10255 #endif
10256
10257 into
10258
10259 if (yydebug)
10260 {
10261 ...
10262 }
10263
10264 unfortunately this leads to a CPP conflict when
10265 `--name-prefix=foo' is used since it produces `#define yydebug
10266 foodebug'.
10267
10268 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
10269 (YYDPRINTF): New macro.
10270 Spread its use.
10271 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
10272 the bison options.
10273 Also test `--verbose', `--defines' and `--name-prefix'.
10274
10275 2000-10-02 Akim Demaille <akim@epita.fr>
10276
10277 Improve the readability of the produced parsers.
10278
10279 * src/bison.s1: Formatting changes.
10280 Improve the comment related to the `$' mark.
10281 (yydefault): Don't fall through to `yyresume': `goto' there.
10282 * src/output.c (output_parser): When the `$' is met, skip the end
10283 of its line.
10284 New variable, `number_of_dollar_signs', to check there's exactly
10285 one `$' in the parser skeleton.
10286
10287 2000-10-02 Akim Demaille <akim@epita.fr>
10288
10289 * lib/xstrdup.c: New file, from the fileutils.
10290 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
10291 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
10292 instead of strlen + xmalloc + strcpy.
10293 * src/symtab.c (copys): Remove, use xstrdup instead.
10294
10295 2000-10-02 Akim Demaille <akim@epita.fr>
10296
10297 * src/gram.h (associativity): New enum type which replaces the
10298 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
10299 `right_assoc', `left_assoc' and `non_assoc'.
10300 Adjust all dependencies.
10301 * src/reader.c: Formatting changes.
10302 (LTYPESTR): Don't define it, use it as a literal in
10303 `reader_output_yylsp'.
10304 * src/symtab.h (symbol_class): New enum type which replaces the
10305 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
10306 `sunknown', `stoken and `snterm'.
10307
10308 2000-10-02 Akim Demaille <akim@epita.fr>
10309
10310 * src/getargs.c (fixed_outfiles): Rename as...
10311 (yaccflag): for consistency and accuracy.
10312 Adjust dependencies.
10313
10314 2000-10-02 Akim Demaille <akim@epita.fr>
10315
10316 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
10317 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
10318 difficult and introduced a lot of core dump. It turns out that
10319 Bison used an implementation of `xmalloc' based on `calloc', and
10320 at various places it does depend upon the initialization to 0. I
10321 have not tried to isolate the pertinent places, and all the former
10322 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
10323 someone should address this issue.
10324
10325 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
10326 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
10327 files.
10328 Adjust dependencies.
10329 * src/warshall.h: New file.
10330 Propagate.
10331
10332 2000-10-02 Akim Demaille <akim@epita.fr>
10333
10334 Various anti-`extern in *.c' changes.
10335
10336 * src/system.h: Include `assert.h'.
10337
10338 2000-10-02 Akim Demaille <akim@epita.fr>
10339
10340 * src/state.h (nstates, final_state, first_state, first_shift)
10341 (first_reduction): Move their exportation from here...
10342 * src/LR0.h: to here.
10343 Adjust dependencies.
10344 * src/getargs.c (statisticsflag): New variable.
10345 Add support for `--statistics'.
10346 Adjust dependencies.
10347
10348 Remove a lot of now useless `extern' statements in most files.
10349
10350 2000-10-02 Akim Demaille <akim@epita.fr>
10351
10352 * src/LR0.h: New file.
10353 Propagate its use.
10354
10355 2000-10-02 Akim Demaille <akim@epita.fr>
10356
10357 * src/print.h: New file.
10358 Propagate its use.
10359 * src/print.c: Formatting and ordering changes.
10360 (verbose, terse): Replace with...
10361 (print_results): this new function.
10362 Adjust dependencies.
10363
10364 2000-10-02 Akim Demaille <akim@epita.fr>
10365
10366 * src/conflicts.c (conflict_report): New function.
10367 (conflict_log, verbose_conflict_log): Replace with...
10368 (print_conflicts): this function.
10369 Adjust dependencies.
10370 * src/conflicts.h: New file.
10371 Propagate its inclusion.
10372
10373 2000-10-02 Akim Demaille <akim@epita.fr>
10374
10375 * src/nullable.h: New file.
10376 Propagate its inclusion.
10377 * src/nullable.c: Formatting changes.
10378
10379 2000-10-02 Akim Demaille <akim@epita.fr>
10380
10381 * src/reduce.h: New file.
10382 Propagate its inclusion.
10383 * src/reduce.c: Topological sort and other formatting changes.
10384 (bool, TRUE, FALSE): Move their definition to...
10385 * src/system.h: here.
10386
10387 2000-10-02 Akim Demaille <akim@epita.fr>
10388
10389 * src/files.c: Formatting changes.
10390 (tryopen, tryclose, openfiles): Rename as...
10391 (xfopen, xfclose, open_files): this.
10392 (stringappend): static.
10393 * src/files.h: Complete the list of exported symbols.
10394 Propagate its use.
10395
10396 2000-10-02 Akim Demaille <akim@epita.fr>
10397
10398 * src/reader.h: New file.
10399 Propagate its use instead of tedious list of `extern' and
10400 prototypes.
10401 * src/reader.c: Formatting changes, topological sort,
10402 s/register//.
10403
10404 2000-10-02 Akim Demaille <akim@epita.fr>
10405
10406 * src/lex.h: Prototype `lex.c' exported functions.
10407 * src/reader.c: Adjust.
10408 * src/lex.c: Formatting changes.
10409 (safegetc): Rename as...
10410 (xgetc): this.
10411
10412 2000-10-02 Akim Demaille <akim@epita.fr>
10413
10414 * src/lalr.h: New file.
10415 Propagate its inclusion instead of prototypes and `extern'.
10416 * src/lalr.c: Formatting changes, topological sorting etc.
10417
10418 2000-10-02 Akim Demaille <akim@epita.fr>
10419
10420 * src/output.c (token_actions): Introduce a temporary array,
10421 YYDEFACT, that makes it possible for this function to use
10422 output_short_table.
10423
10424 2000-10-02 Akim Demaille <akim@epita.fr>
10425
10426 `user_toknums' is output as a `short[]' in `output.c', while it is
10427 defined as a `int[]' in `reader.c'. For consistency with the
10428 other output tables, `user_toknums' is now defined as a table of
10429 shorts.
10430
10431 * src/reader.c (user_toknums): Be a short table instead of an int
10432 table.
10433 Adjust dependencies.
10434
10435 Factor the short table outputs.
10436
10437 * src/output.c (output_short_table): New function.
10438 * src/output.c (output_gram, output_stos, output_rule_data)
10439 (output_base, output_table, output_check): Use it.
10440
10441 2000-10-02 Akim Demaille <akim@epita.fr>
10442
10443 * src/output.c (output): Topological sort of the functions, in
10444 order to get rid of the `static' prototypes.
10445 No longer use `register'.
10446 * src/output.h: New file.
10447 Propagate its inclusion in files explicitly prototyping functions
10448 from output.c.
10449
10450 2000-09-21 Akim Demaille <akim@epita.fr>
10451
10452 * src/atgeneral.m4: Update from Autoconf.
10453
10454 2000-09-21 Akim Demaille <akim@epita.fr>
10455
10456 * src/closure.h: New file.
10457 * src/closure.c: Formatting changes, topological sort over the
10458 functions, use of closure.h.
10459 (initialize_closure, finalize_closure): Rename as...
10460 (new_closure, free_closure): these. Adjust dependencies.
10461 * src/LR0.c: Formatting changes, topological sort, use of
10462 cloture.h.
10463 (initialize_states): Rename as...
10464 (new_states): this.
10465 * src/Makefile.am (noinst_HEADERS): Adjust.
10466
10467 2000-09-20 Akim Demaille <akim@epita.fr>
10468
10469 * src/acconfig.h: Don't protect config.h against multiple
10470 inclusion.
10471 Don't define PARAMS.
10472 * src/system.h: Define PARAMS.
10473 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
10474 purpose of config.h. system.h must not try to fix wrong
10475 definitions in config.h.
10476
10477 2000-09-20 Akim Demaille <akim@epita.fr>
10478
10479 * src/derives.h: New file.
10480 * src/main.c, src/derives.h: Use it.
10481 Formatting changes.
10482 * src/Makefile.am (noinst_HEADERS): Adjust.
10483
10484 2000-09-20 Akim Demaille <akim@epita.fr>
10485
10486 * tests/atgeneral.m4: Update from Autoconf.
10487 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
10488 (AT_CHECK_CALC): New macros.
10489 Use these macros to test bison with options `', `--raw',
10490 `--debug', `--yacc', `--yacc --debug'.
10491
10492 2000-09-19 Akim Demaille <akim@epita.fr>
10493
10494 * src/output.c: Formatting changes.
10495 * src/machine.h: Remove, leaving its contents in...
10496 * src/system.h: here.
10497 Include stdio.h.
10498 Adjust all dependencies on stdio.h and machine.h.
10499 * src/getargs.h: New file.
10500 Let all `extern' declarations about getargs.c be replaced with
10501 inclusion of `getargs.h'.
10502 * src/Makefile.am (noinst_HEADERS): Adjust.
10503
10504 * tests/calc.m4 (yyin): Be initialized in main, not on the global
10505 scope.
10506 (yyerror): Returns void, not int.
10507 * doc/bison.texinfo: Formatting changes.
10508
10509 2000-09-19 Akim Demaille <akim@epita.fr>
10510
10511 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
10512 portable.
10513
10514 2000-09-18 Akim Demaille <akim@epita.fr>
10515
10516 * configure.in: Append WARNING_CFLAGS to CFLAGS.
10517 * src/Makefile.am (INCLUDES): Don't.
10518 Be ready to fetch headers in lib/.
10519
10520 2000-09-18 Akim Demaille <akim@epita.fr>
10521
10522 * doc/bison.texinfo: Update the copyright.
10523 ANSIfy and GNUify the examples.
10524 Remove the old menu.
10525
10526 2000-09-18 Akim Demaille <akim@epita.fr>
10527
10528 First set of tests: use the `calc' example from the documentation.
10529
10530 * src/bison.s1 (yyparse): Condition the code using `yytname' which
10531 is defined only when YYDEBUG is.
10532 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
10533 * src/files.c (tryopen, tryclose): Formatting changes.
10534 Move to the top and be static.
10535 * src/reader.c (read_signed_integer): Likewise.
10536 * tests/calc.m4: New file.
10537 * Makefile.am, suite.m4: Adjust.
10538 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
10539
10540 2000-09-18 Akim Demaille <akim@epita.fr>
10541
10542 Add support for an Autotest test suite for Bison.
10543
10544 * m4/m4.m4, m4/atconfig.m4: New files.
10545 * m4/Makefile.am (EXTRA_DIST): Adjust.
10546 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
10547 files.
10548 * src/getargs.c: Display a more standard --version message.
10549 * src/reader.c (reader): Formatting changes.
10550 No longer depend upon VERSION_STRING.
10551 * configure.in: No longer use `dnl'.
10552 Set up the test suite and the new directory `tests/.
10553 (VERSION_STRING): Remove.
10554
10555 2000-04-14 Akim Demaille <akim@epita.fr>
10556
10557 * src/reader.c (copy_comment2): New function, same as former
10558 `copy_comment', but outputs into two FILE *.
10559 (copy_comment): Use it.
10560 (parse_union_decl): Use it.
10561 (get_type, parse_start_decl): Use the same `invalid' message.
10562 (parse_start_decl, parse_union_decl): Use the same `multiple'
10563 message.
10564 (parse_union_decl, copy_guard, copy_action): Use the same
10565 `unmatched' message.
10566 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
10567
10568 2000-03-31 Akim Demaille <akim@epita.fr>
10569
10570 * src/files.c (tryopen, tryclose): Move to the top.
10571 Be static.
10572
10573 2000-03-31 Akim Demaille <akim@epita.fr>
10574
10575 * src/main.c (main): Don't call `done', exit does it.
10576
10577 2000-03-31 Akim Demaille <akim@epita.fr>
10578
10579 * allocate.c: s/return (foo)/return foo/.
10580 * lalr.c: Likewise.
10581 * LR0.c: Likewise.
10582 * output.c: Likewise.
10583 * reader.c: Likewise.
10584 * symtab.c: Likewise.
10585 * vmsgetargs.c: Likewise.
10586
10587 2000-03-31 Akim Demaille <akim@epita.fr>
10588
10589 Clean up the error reporting functions.
10590
10591 * src/report.c: New file.
10592 * src/report.h: Likewise.
10593 * src/Makefile.am: Adjust.
10594 * m4/error.m4: New file.
10595 * m4/Makefile.am: Adjust.
10596 * configure.in (jm_PREREQ_ERROR): Call it.
10597 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
10598 Remove.
10599 (fatal, fatals): Remove. All callers use complain.c::fatal.
10600 (warn, warni, warns, warnss, warnss): Remove. All callers use
10601 complain.c::complain.
10602 (toomany): Remove, use fatal instead.
10603 * src/files.c (done): No argument, use complain_message_count.
10604 * src/main.c (main): Register `done' to `atexit'.
10605
10606 * src/getargs.c (usage): More `fputs', less `fprintf'.
10607
10608 2000-03-28 Akim Demaille <akim@epita.fr>
10609
10610 * lib/: New directory.
10611 * Makefile.am (SUBDIRS): Adjust.
10612 * configure.in: Adjust.
10613 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
10614 useless.
10615 * src/alloca.c: Moved to lib/.
10616 * src/getopt.c: Likewise.
10617 * src/getopt1.c: Likewise.
10618 * src/getopt.h: Likewise.
10619 * src/ansi2knr.c: Likewise.
10620 * src/ansi2knr.1: Likewise.
10621 * src/Makefile.am: Adjust.
10622 * lib/Makefile.am: New file.
10623
10624 2000-03-28 Akim Demaille <akim@epita.fr>
10625
10626 * src/getargs.c (usage): Refresh the help message.
10627
10628 2000-03-17 Akim Demaille <akim@epita.fr>
10629
10630 * src/getopt1.c: Updated from textutils 2.0e
10631 * src/getopt.c: Likewise.
10632 * src/getopt.h: Likewise.
10633
10634 2000-03-17 Akim Demaille <akim@epita.fr>
10635
10636 * src/Makefile.am (bison.simple): Fix the awk program: quote only
10637 the file name, not the whole `#line LINE FILE'.
10638
10639 2000-03-17 Akim Demaille <akim@epita.fr>
10640
10641 On syntax errors, report the token on which we choked.
10642
10643 * src/bison.s1 (yyparse): In the label yyerrlab, when
10644 YYERROR_VERBOSE, add yychar in msg.
10645
10646 2000-03-17 Akim Demaille <akim@epita.fr>
10647
10648 * src/reader.c (copy_at): New function.
10649 (copy_guard): Use it.
10650 (copy_action): Use it.
10651
10652 2000-03-17 Akim Demaille <akim@epita.fr>
10653
10654 Be kind to translators, save some useless translations.
10655
10656 * src/main.c (banner): New function.
10657 (fatal_banner): Use it.
10658 (warn_banner): Use it.
10659
10660 2000-03-17 Akim Demaille <akim@epita.fr>
10661
10662 * src/reader.c (copy_definition): Use copy_string and
10663 copy_comment. Removed now unused `match', `ended',
10664 `cplus_comment'.
10665 (copy_comment, copy_string): Moved, to be visible from
10666 copy_definition.
10667
10668 2000-03-17 Akim Demaille <akim@epita.fr>
10669
10670 * src/reader.c (copy_string): Declare `static inline'. No
10671 problems with inline, since it is checked by configure.
10672 (copy_comment): Likewise.
10673
10674 2000-03-17 Akim Demaille <akim@epita.fr>
10675
10676 * src/reader.c (packsymbols): Formatting changes.
10677
10678 2000-03-17 Akim Demaille <akim@epita.fr>
10679
10680 * src/reader.c (copy_comment): New function, factored out from:
10681 (copy_action): Use it. Removed now unused `match', `ended',
10682 `cplus_comment'.
10683 (copy_guard): Likewise.
10684
10685 2000-03-17 Akim Demaille <akim@epita.fr>
10686
10687 * src/reader.c (copy_string): New function, factored out from:
10688 (copy_action): Use it.
10689 (copy_guard): Likewise.
10690
10691 2000-03-17 Akim Demaille <akim@epita.fr>
10692
10693 Change the handling of @s so that they behave exactly like $s.
10694 There is now a pseudo variable @$ (readble and writable), location
10695 of the lhs of the rule (by default ranging from the location of
10696 the first symbol of the rhs, to the location of the last symbol,
10697 or, if the rhs is empty, YYLLOC).
10698
10699 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
10700 yyval.
10701 (yyparse): When providing a default semantic action, provide a
10702 default location action.
10703 (after the $): No longer change `*YYLSP', just stack YYLOC the
10704 same way you stack YYVAL.
10705 * src/reader.c (read_declarations): Use warns.
10706 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
10707 (copy_action, case '@'): Likewise.
10708 Use a standard error message, to save useless work from
10709 translators.
10710
10711 2000-03-17 Akim Demaille <akim@epita.fr>
10712
10713 * src/bison.s1: Formatting and cosmetics changes.
10714 * src/reader.c: Likewise.
10715 Update the Copyright notice.
10716
10717 2000-03-17 Akim Demaille <akim@epita.fr>
10718
10719 * src/bison.s1 (#line): All set to `#line' only, since the
10720 Makefile now handles them.
10721
10722 2000-03-16 Akim Demaille <akim@epita.fr>
10723
10724 * src/output.c (output_rule_data): Output the documentation of
10725 some of the tables.
10726 (Copyright notice): Update.
10727 Formatting changes.
10728
10729 2000-03-16 Akim Demaille <akim@epita.fr>
10730
10731 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
10732 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
10733 One `#if YYDEBUG' remains, since it uses variables which are
10734 defined only if `YYDEBUG != 0'.
10735
10736 2000-03-16 Akim Demaille <akim@epita.fr>
10737
10738 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
10739 and related variables so that the similarities are highlighted.
10740
10741 2000-03-16 Akim Demaille <akim@epita.fr>
10742
10743 * src/bison.s1: Properly indent CPP directives.
10744
10745 2000-03-16 Akim Demaille <akim@epita.fr>
10746
10747 * src/bison.s1: Properly indent the `alloca' CPP section.
10748
10749 2000-03-16 Akim Demaille <akim@epita.fr>
10750
10751 Do not hard code values of directories in `configure.in'.
10752 Update the `configure' tool chain.
10753
10754 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
10755 src/makefile.am.
10756 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
10757 (AC_OUTPUT): Add m4/Makefile.
10758 Bump to bison 1.28a, 1.29 has never been released.
10759 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
10760 handled via src/Makefile.am.
10761 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
10762 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
10763 autoheader.
10764 * Makefile.am (SUBDIRS): Add m4.
10765 (ACLOCAL_AM_FLAGS): New variable.
10766 (AUTOMAKE_OPTIONS): Add check-news.
10767 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
10768 the proper line number and file name.
10769 (DEFS): Propagate the location of bison library files and of the
10770 locale files.
10771 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
10772 builddir.
10773 * acinclude.m4: Remove, replaced by the directory m4.
10774 * m4/Makefile.am (EXTRA_DIST): New variable.
10775 * m4/gettext.m4: New file, from the fileutils.
10776 * m4/lcmessage.m4: Likewise
10777 * m4/progtest.m4: Likewise.
10778 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
10779
10780 2000-03-10 Akim Demaille <akim@epita.fr>
10781
10782 * src/closure.c:
10783 Formatting changes of various comments.
10784 Respect the GNU coding standards at various places.
10785 Don't use `_()' when no translation is needed.
10786
10787 1999-12-13 Jesse Thilo <jthilo@gnu.org>
10788
10789 * src/files.c:
10790 OS/2 honors TMPDIR environment variable.
10791
10792 1999-12-13 Jesse Thilo <jthilo@gnu.org>
10793
10794 * doc/bison.texinfo: Tweaked spelling and grammar.
10795 Updated ISBN.
10796 Removed reference to price of printed copy.
10797 Mention BISON_SIMPLE and BISON_HAIRY.
10798
10799 1999-12-13 Jesse Thilo <jthilo@gnu.org>
10800
10801 * configure.in, NEWS:
10802 Bison 1.29 released.
10803
10804 1999-10-27 Jesse Thilo <jthilo@gnu.org>
10805
10806 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
10807 Added reference card.
10808
10809 1999-07-26 Jesse Thilo <jthilo@gnu.org>
10810
10811 * po/ru.po: Added Russian translation.
10812
10813 1999-07-26 Jesse Thilo <jthilo@gnu.org>
10814
10815 * configure.in: Added Russian translation.
10816
10817 1999-07-06 Jesse Thilo <jthilo@gnu.org>
10818
10819 * configure.in, NEWS, README:
10820 Released version 1.28.
10821
10822 1999-06-14 Jesse Thilo <jthilo@gnu.org>
10823
10824 * src/system.h:
10825 Squashed redefinition warning on some systems.
10826
10827 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
10828 Have configure build version string instead of relying on ANSI string
10829 concatentation.
10830
10831 1999-06-14 Jesse Thilo <jthilo@gnu.org>
10832
10833 * po/POTFILES.in: Got rid of version.c.
10834
10835 1999-06-14 Jesse Thilo <jthilo@gnu.org>
10836
10837 * acconfig.h, configure.in:
10838 Have configure build version string instead of relying on ANSI string
10839 concatentation.
10840
10841 1999-06-08 Jesse Thilo <jthilo@gnu.org>
10842
10843 * doc/bison.1:
10844 Dropped mention of `+' for long-named options.
10845
10846 1999-05-30 Jesse Thilo <jthilo@gnu.org>
10847
10848 * src/files.c: Added <unistd.h> for unlink().
10849
10850 * src/Makefile.am, src/system.h:
10851 I18n fixes.
10852
10853 1999-05-30 Jesse Thilo <jthilo@gnu.org>
10854
10855 * README: Added a FAQ list.
10856
10857 * configure.in, acconfig.h:
10858 I18n fixes.
10859
10860 1999-05-30 Jesse Thilo <jthilo@gnu.org>
10861
10862 * doc/FAQ, doc/Makefile.am:
10863 Added a FAQ list.
10864
10865 1999-05-19 Jesse Thilo <jthilo@gnu.org>
10866
10867 * src/alloc.h, src/symtab.h, src/version.c:
10868 Protected inclusion of "config.h" with HAVE_CONFIG_H.
10869
10870 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10871
10872 * src/.cvsignore, src/Makefile.am:
10873 Reorganized: sources in `src', documentation in `doc'.
10874
10875 * src/lex.c (literalchar):
10876 fixed the code for escaping double quotes (thanks
10877 Jonathan Czisny.)
10878
10879 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10880
10881 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
10882 Adjusted paths to reflect directory reorganization.
10883
10884 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10885
10886 * doc/.cvsignore, doc/Makefile.am:
10887 Reorganized: sources in `src', documentation in `doc'.
10888
10889 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10890
10891 * configure.in:
10892 Updated AC_INIT file to reflect directory reorganization.
10893
10894 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
10895 Reorganized: sources in `src', documentation in `doc'.
10896
10897 1999-04-13 Jesse Thilo <jthilo@gnu.org>
10898
10899 * src/allocate.c:
10900 Don't declare calloc() and realloc() if not necessary.
10901
10902 1999-04-13 Jesse Thilo <jthilo@gnu.org>
10903
10904 * configure.in, acconfig.h, acinclude.m4:
10905 Don't declare calloc() and realloc() if not necessary.
10906
10907 1999-03-23 Jesse Thilo <jthilo@gnu.org>
10908
10909 * po/.cvsignore: Added i18n support.
10910
10911 1999-03-23 Jesse Thilo <jthilo@gnu.org>
10912
10913 * acconfig.h, configure.in, Makefile.am:
10914 Added i18n support.
10915
10916 1999-03-22 Jesse Thilo <jthilo@gnu.org>
10917
10918 * src/bison.s1: Fixed #line numbers.
10919
10920 1999-03-15 Jesse Thilo <jthilo@gnu.org>
10921
10922 * po/es.po, po/fr.po, po/nl.po, po/de.po:
10923 Added PO files from Translation Project.
10924
10925 1999-03-03 Jesse Thilo <jthilo@gnu.org>
10926
10927 * Makefile.am:
10928 Added support for non-ANSI compilers (ansi2knr).
10929
10930 1999-02-16 Jesse Thilo <jthilo@gnu.org>
10931
10932 * configure.in: Bumped version number to 1.27.
10933
10934 * Makefile.am:
10935 Added `bison.simple' to list of files removed by `make distclean'.
10936
10937 1999-02-12 Jesse Thilo <jthilo@gnu.org>
10938
10939 * src/files.c, src/files.h:
10940 Defined locations of parser files in config.h instead of Makefile.
10941
10942 1999-02-12 Jesse Thilo <jthilo@gnu.org>
10943
10944 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
10945 Defined locations of parser files in config.h instead of Makefile.
10946
10947 1999-02-09 Jesse Thilo <jthilo@gnu.org>
10948
10949 * Makefile.am:
10950 Removed inappropriate use of $< macro.
10951
10952 1999-02-05 Jesse Thilo <jthilo@gnu.org>
10953
10954 * po/Makefile.in.in, po/POTFILES.in:
10955 Add `po' directory skeleton.
10956
10957 1999-01-27 Jesse Thilo <jthilo@gnu.org>
10958
10959 * README: Document help-bison list.
10960
10961 * configure.in: Add check for mkstemp().
10962
10963 1999-01-20 Jesse Thilo <jthilo@gnu.org>
10964
10965 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
10966 Hush a few compiler warnings.
10967
10968 * src/files.c:
10969 Add tryclose(), which verifies that fclose was successful.
10970 Hush a couple of compiler warnings.
10971
10972 1999-01-20 Jesse Thilo <jthilo@gnu.org>
10973
10974 * Makefile.am, OChangeLog:
10975 ChangeLog is now automatically generated. Include the old version as
10976 OChangeLog.
10977
10978 1999-01-14 Jesse Thilo <jthilo@gnu.org>
10979
10980 * 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:
10981 Update FSF address.
10982
10983 1999-01-14 Jesse Thilo <jthilo@gnu.org>
10984
10985 * doc/bison.texinfo: Fix formatting glitch.
10986
10987 * doc/bison.texinfo: Update FSF address.
10988
10989 1999-01-14 Jesse Thilo <jthilo@gnu.org>
10990
10991 * acconfig.h: Update FSF address.
10992
10993 1999-01-08 Jesse Thilo <jthilo@gnu.org>
10994
10995 * src/system.h:
10996 Don't define PACKAGE here, since config.h defines it.
10997
10998 1998-12-30 Jesse Thilo <jthilo@gnu.org>
10999
11000 * src/reader.c: Update copyright date.
11001
11002 * src/main.c:
11003 Ditch sprintf to statically-sized buffers in fatal/warn functions in
11004 favor of output directly to stderr (avoids buffer overruns).
11005
11006 * src/reader.c: Some checks for premature EOF.
11007
11008 * 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:
11009 Use prototypes if the compiler understands them.
11010
11011 * src/files.c: Honor TMPDIR on Unix hosts.
11012 Use prototypes if the compiler understands them.
11013
11014 * src/reader.c:
11015 Fix a couple of buffer overrun bugs.
11016 Use prototypes if the compiler understands them.
11017
11018 * src/system.h: Include unistd.h and ctype.h.
11019 Use #ifdef instead of #if for NLS symbols.
11020
11021 1998-12-30 Jesse Thilo <jthilo@gnu.org>
11022
11023 * doc/bison.texinfo:
11024 Delete comment "consider using @set for edition number, etc..." since
11025 we now are doing so.
11026
11027 1998-12-30 Jesse Thilo <jthilo@gnu.org>
11028
11029 * configure.in:
11030 Use prototypes if the compiler understands them.
11031
11032 * NEWS: Document 1.26 highlights.
11033
11034 * Makefile.am: Require Automake 1.3 or later.
11035
11036 * acconfig.h:
11037 Use prototypes if the compiler understands them.
11038
11039 1998-12-29 Jesse Thilo <jthilo@gnu.org>
11040
11041 * src/version.c:
11042 Use VERSION symbol from automake for version number.
11043
11044 1998-12-29 Jesse Thilo <jthilo@gnu.org>
11045
11046 * acconfig.h, configure.in, version.cin:
11047 Use VERSION symbol from automake for version number.
11048
11049 1998-11-28 Jesse Thilo <jthilo@gnu.org>
11050
11051 * Makefile.am:
11052 Distribute original version of simple parser (bison.s1), not built
11053 version (bison.simple).
11054
11055 1998-11-28 Jesse Thilo <jthilo@gnu.org>
11056
11057 * doc/bison.texinfo: Add info dir entry.
11058
11059 * doc/bison.texinfo:
11060 Let automake put version number into documentation.
11061
11062 1998-11-26 Jesse Thilo <jthilo@gnu.org>
11063
11064 * src/bison.cld, src/build.com, src/vmshlp.mar:
11065 Add non-RCS files from /gd/gnu/bison.
11066
11067 1998-11-26 Jesse Thilo <jthilo@gnu.org>
11068
11069 * doc/bison.1:
11070 Document the BISON_HAIRY and BISON_SIMPLE variables.
11071
11072 1998-11-25 Jesse Thilo <jthilo@gnu.org>
11073
11074 * src/version.c: Build version.c automatically.
11075
11076 * src/reader.c:
11077 Fix token numbering (used to start at 258, not 257).
11078
11079 * src/system.h: Include config.h.
11080
11081 * src/getargs.c: Update bug report address.
11082
11083 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
11084 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
11085
11086 1998-11-25 Jesse Thilo <jthilo@gnu.org>
11087
11088 * Makefile.am:
11089 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
11090
11091 * configure.in, version.cin:
11092 Build version.c automatically.
11093
11094 * AUTHORS: Add AUTHORS file.
11095
11096 * README: Update bug report address.
11097
11098 * bison.simple:
11099 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
11100
11101 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
11102 Add automake stuff.
11103
11104 1998-11-25 Jesse Thilo <jthilo@gnu.org>
11105
11106 * doc/bison.texinfo: Clean up some formatting.
11107
11108 1998-05-05 Richard Stallman <rms@gnu.org>
11109
11110 * doc/bison.texinfo:
11111 Explain better why to make a pure parser.
11112
11113 1998-01-05 Richard Stallman <rms@gnu.org>
11114
11115 * src/files.c (openfiles):
11116 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
11117 find a temporary directory, if possible. Do not unlink files while
11118 they are open.
11119
11120 1997-08-25 Richard Stallman <rms@gnu.org>
11121
11122 * src/reader.c (stack_offset;):
11123 Change some warni to warns.
11124
11125 * src/lex.c (literalchar): Use warns, not warni.
11126
11127 1997-06-28 Richard Stallman <rms@gnu.org>
11128
11129 * src/bison.s1: Add a Bison version comment.
11130
11131 * src/main.c (fatal, warn, berror):
11132 Use program_name.
11133
11134 1997-06-28 Richard Stallman <rms@gnu.org>
11135
11136 * Makefile.in (bison_version): New variable.
11137 (dist): Use that variable.
11138 (bison.s1): Substitute the Bison version into bison.simple.
11139
11140 * bison.simple: Add a Bison version comment.
11141
11142 1997-06-18 Richard Stallman <rms@gnu.org>
11143
11144 * src/main.c (fatal, warn, berror):
11145 Make error messages standard.
11146 (toomany): Improve error message text.
11147
11148 * 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:
11149 new.h renamed to alloc.h.
11150
11151 1997-06-18 Richard Stallman <rms@gnu.org>
11152
11153 * Makefile.in: new.h renamed to alloc.h.
11154
11155 1997-05-24 Richard Stallman <rms@gnu.org>
11156
11157 * src/lex.c (literalchar):
11158 Fix the code for escaping \, " and '.
11159
11160 (lex): Avoid trouble when there are many chars
11161 to discard in a char literal with just several chars in it.
11162
11163 1997-05-17 Richard Stallman <rms@gnu.org>
11164
11165 * src/bison.s1:
11166 Use malloc, if using alloca is troublesome.
11167 (YYSTACK_USE_ALLOCA): New flag macro.
11168 Define it for some systems and compilers.
11169 (YYSTACK_ALLOC): New macro.
11170 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11171 If it was malloc'd, free it.
11172
11173 1997-05-17 Richard Stallman <rms@gnu.org>
11174
11175 * bison.simple:
11176 Use malloc, if using alloca is troublesome.
11177 (YYSTACK_USE_ALLOCA): New flag macro.
11178 Define it for some systems and compilers.
11179 (YYSTACK_ALLOC): New macro.
11180 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11181 If it was malloc'd, free it.
11182
11183 1997-04-23 Richard Stallman <rms@gnu.org>
11184
11185 * src/bison.s1:
11186 (alloca) [__hpux]: Always define as __builtin_alloca.
11187
11188 1997-04-23 Richard Stallman <rms@gnu.org>
11189
11190 * bison.simple:
11191 (alloca) [__hpux]: Always define as __builtin_alloca.
11192
11193 1997-04-22 Richard Stallman <rms@gnu.org>
11194
11195 * src/bison.s1:
11196 [__hpux]: Include alloca.h (right for HPUX 10)
11197 instead of declaring alloca (right for HPUX 9).
11198
11199 * src/bison.s1 (__yy_memcpy):
11200 Declare arg `count' as unsigned int.
11201 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11202
11203 1997-04-22 Richard Stallman <rms@gnu.org>
11204
11205 * bison.simple:
11206 [__hpux]: Include alloca.h (right for HPUX 10)
11207 instead of declaring alloca (right for HPUX 9).
11208
11209 * bison.simple (__yy_memcpy):
11210 Declare arg `count' as unsigned int.
11211 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11212
11213 1997-01-03 Richard Stallman <rms@gnu.org>
11214
11215 * src/allocate.c: [__STDC__ or _MSC_VER]:
11216 Declare calloc and realloc to return void *.
11217
11218 1997-01-02 Richard Stallman <rms@gnu.org>
11219
11220 * src/system.h:
11221 [_MSC_VER]: Include stdlib.h and process.h.
11222 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
11223
11224 * src/main.c (main): Return FAILURE as a value.
11225 (printable_version): Declare arg as int, not char.
11226
11227 1997-01-02 Richard Stallman <rms@gnu.org>
11228
11229 * Makefile.in (dist):
11230 Explicitly check for symlinks, and copy them.
11231
11232 1996-12-19 Richard Stallman <rms@gnu.org>
11233
11234 * src/files.c:
11235 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
11236
11237 1996-12-18 Paul Eggert <eggert@gnu.org>
11238
11239 * src/bison.s1 (yyparse):
11240 If __GNUC__ and YYPARSE_PARAM are both defined,
11241 declare yyparse to have a void * argument.
11242
11243 1996-12-18 Paul Eggert <eggert@gnu.org>
11244
11245 * bison.simple (yyparse):
11246 If __GNUC__ and YYPARSE_PARAM are both defined,
11247 declare yyparse to have a void * argument.
11248
11249 1996-12-17 Richard Stallman <rms@gnu.org>
11250
11251 * src/reduce.c (nbits): Add some casts.
11252
11253 1996-08-12 Richard Stallman <rms@gnu.org>
11254
11255 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
11256
11257 1996-08-12 Richard Stallman <rms@gnu.org>
11258
11259 * bison.simple: Test _MSDOS as well as _MSDOS_.
11260
11261 1996-07-31 Richard Stallman <rms@gnu.org>
11262
11263 * src/bison.s1:
11264 [__sun && __i386]: Include alloca.h.
11265
11266 1996-07-31 Richard Stallman <rms@gnu.org>
11267
11268 * bison.simple:
11269 [__sun && __i386]: Include alloca.h.
11270
11271 1996-07-30 Richard Stallman <rms@gnu.org>
11272
11273 * src/bison.s1: Comment change.
11274
11275 * src/bison.s1: Test _MSDOS_, not MSDOS.
11276
11277 1996-07-30 Richard Stallman <rms@gnu.org>
11278
11279 * bison.simple: Comment change.
11280
11281 * bison.simple: Test _MSDOS_, not MSDOS.
11282
11283 1996-06-01 Richard Stallman <rms@gnu.org>
11284
11285 * 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:
11286 Insert `_' macro around many string constants.
11287
11288 * src/main.c:
11289 Insert `_' macro around many string constants.
11290
11291 (main): Call setlocale, bindtextdomain and textdomain.
11292
11293 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
11294 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
11295 [ENABLE_NLS]: Include libintl.h.
11296 [ENABLE_NLS] (gettext): Define.
11297 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
11298 (N_, PACKAGE, LOCALEDIR): New macros.
11299
11300 1996-06-01 Richard Stallman <rms@gnu.org>
11301
11302 * POTFILES.in: New file.
11303
11304 * Makefile.in (allocate.o):
11305 Define target explicitly.
11306
11307 * Makefile.in (CFLAGS): Set to @CFLAGS@.
11308 (LDFLAGS): Set to @LDFLAGS@.
11309 (configure): Run autoconf only if preceding `cd' succeeds.
11310 (bison.s1): Redirect output to temporary file then move the
11311 temporary to the target, rather than redirecting directly to bison.s1.
11312 (clean): Remove config.status and config.log.
11313 (distclean): Don't remove config.status here.
11314
11315 1996-05-12 Richard Stallman <rms@gnu.org>
11316
11317 * src/bison.s1:
11318 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11319
11320 1996-05-12 Richard Stallman <rms@gnu.org>
11321
11322 * bison.simple:
11323 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11324
11325 1996-05-11 Richard Stallman <rms@gnu.org>
11326
11327 * src/bison.s1 (__yy_memcpy):
11328 Really reorder the args, as was supposedly done on Feb 14 1995.
11329 (yyparse): Calls changed accordingly.
11330
11331 1996-05-11 Richard Stallman <rms@gnu.org>
11332
11333 * Makefile.in (dist): Don't use $(srcdir).
11334
11335 * bison.simple (__yy_memcpy):
11336 Really reorder the args, as was supposedly done on Feb 14 1995.
11337 (yyparse): Calls changed accordingly.
11338
11339 1996-01-27 Richard Stallman <rms@gnu.org>
11340
11341 * src/output.c (output_rule_data):
11342 Test YYERROR_VERBOSE in the conditional
11343 around the definition of ttyname.
11344
11345 1995-12-29 Richard Stallman <rms@gnu.org>
11346
11347 * src/bison.s1:
11348 Fix line numbers in #line commands.
11349
11350 1995-12-29 Richard Stallman <rms@gnu.org>
11351
11352 * bison.simple:
11353 Fix line numbers in #line commands.
11354
11355 1995-12-27 Richard Stallman <rms@gnu.org>
11356
11357 * src/bison.s1 (YYPARSE_PARAM_DECL):
11358 In C++, make it always null.
11359 (YYPARSE_PARAM_ARG): New macro.
11360 (yyparse): Use YYPARSE_PARAM_ARG.
11361
11362 1995-12-27 Richard Stallman <rms@gnu.org>
11363
11364 * bison.simple (YYPARSE_PARAM_DECL):
11365 In C++, make it always null.
11366 (YYPARSE_PARAM_ARG): New macro.
11367 (yyparse): Use YYPARSE_PARAM_ARG.
11368
11369 1995-11-29 Richard Stallman <rms@gnu.org>
11370
11371 * doc/bison.texinfo:
11372 Describe literal string tokens, %raw, %no_lines, %token_table.
11373
11374 1995-11-29 Daniel Hagerty <hag@gnu.org>
11375
11376 * doc/bison.texinfo: Fixed update date
11377
11378 1995-10-16 Richard Stallman <rms@gnu.org>
11379
11380 * src/version.c: Version 1.25.
11381
11382 1995-10-16 Richard Stallman <rms@gnu.org>
11383
11384 * NEWS: *** empty log message ***
11385
11386 1995-10-16 Richard Stallman <rms@gnu.org>
11387
11388 * doc/bison.1, doc/bison.rnh:
11389 Add new options.
11390
11391 1995-10-15 Richard Stallman <rms@gnu.org>
11392
11393 * src/vmsgetargs.c, src/getargs.c:
11394 Added -n, -k, and -raw switches.
11395 (noparserflag, toknumflag, rawtoknumflag): New variables.
11396
11397 * src/symtab.h (SALIAS):
11398 New #define for adding aliases to %token.
11399 (struct bucket): Added `alias' field.
11400
11401 * src/reduce.c (reduce_grammar):
11402 Revise error message.
11403 (print_notices): Remove final `.' from error message.
11404
11405 * src/reader.c (reader_output_yylsp):
11406 New function.
11407 (readgram): Use `#if 0' around code that accepted %command
11408 inside grammar rules: The documentation doesn't allow it,
11409 and it will fail since the %command processors scan for the next %.
11410 (parse_token_decl): Extended the %token
11411 declaration to allow a multi-character symbol as an alias.
11412 (parse_thong_decl): New function.
11413 (read_declarations): Added %thong declarations.
11414 (read_declarations): Handle NOOP to deal with allowing
11415 % declarations as another means to specify the flags.
11416 (readgram): Allow %prec prior to semantics embedded in a rule.
11417 (skip_to_char, read_declarations, copy_definition)
11418 (parse_token_decl, parse_start_decl, parse_type_decl)
11419 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
11420 (get_type_name, copy_guard, copy_action, readgram)
11421 (get_type, packsymbols): Revised most error messages.
11422 Changed `fatal' to `warnxxx' to avoid aborting for error.
11423 Revised and use multiple warnxxx functions to avoid using VARARGS1.
11424 (read_declarations): Improve the error message for
11425 an invalid character. Do not abort.
11426 (read_declarations, copy_guard, copy_action): Use
11427 printable_version to avoid unprintable characters in printed output.
11428 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
11429 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
11430 Allow the type of a non-terminal can be given
11431 more than once, as long as all specifications give the same type.
11432
11433 * src/output.c:
11434 (output_headers, output_trailers, output, output_gram)
11435 (output_rule_data): Implement noparserflag variable.
11436 Implement toknumflag variable.
11437 (output): Call reader_output_yylsp to output LTYPESTR.
11438
11439 * src/main.c (main):
11440 If reader sees an error, don't process the grammar.
11441 (fatals): Updated to not use VARARGS1.
11442 (printable_version, int_to_string, warn, warni, warns, warnss)
11443 (warnsss): New error reporting functions. Avoid abort for error.
11444
11445 * src/lex.h:
11446 Added THONG and NOOP for alias processing.
11447 Added SETOPT for the new code that allows setting options with %flags.
11448
11449 * src/lex.c:
11450 Include getopt.h. Add some extern decls.
11451 (safegetc): New function to deal with EOF gracefully.
11452 (literalchar); new function to deal with reading \ escapes.
11453 (lex): Use literalchar.
11454 (lex): Implemented "..." tokens.
11455 (literalchar, lex, parse_percent_token): Made tokenbuffer
11456 always contain the token. This includes growing the token
11457 buffer while reading an integer.
11458 (parse_percent_token): Replaced if-else statement with percent_table.
11459 (parse_percent_token): Added % declarations as another
11460 way to specify the flags -n, -l, and -r. Also added hooks for
11461 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
11462 major changes to files.c.
11463 (lex) Retain in the incoming stream a character following
11464 an incorrect '/'.
11465 (skip_white_space, lex): Revised most error messages
11466 and changed fatal to warn to avoid aborting.
11467 (percent_table): Added %thong declarations.
11468
11469 * src/gram.h: Comment changes.
11470
11471 * src/files.c (openfiles, open_extra_files, done):
11472 Add faction flag
11473 and actfile file. Handle noparserflag. Both for -n switch.
11474
11475 * src/conflicts.c (resolve_sr_conflict):
11476 Remove use of alloca.
11477
11478 1995-06-01 Jim Meyering <meyering@gnu.org>
11479
11480 * doc/bison.texinfo: *** empty log message ***
11481
11482 1995-05-06 Richard Stallman <rms@gnu.org>
11483
11484 * src/bison.s1: Comment change.
11485
11486 1995-05-06 Richard Stallman <rms@gnu.org>
11487
11488 * bison.simple: Comment change.
11489
11490 1995-05-03 Richard Stallman <rms@gnu.org>
11491
11492 * src/version.c: Version now 1.24.
11493
11494 * src/bison.s1: Change distribution terms.
11495
11496 * src/version.c: Version now 1.23.
11497
11498 1995-05-03 Richard Stallman <rms@gnu.org>
11499
11500 * doc/bison.texinfo:
11501 Rewrite "Conditions for Using Bison".
11502 Update version to 1.24.
11503
11504 1995-05-03 Richard Stallman <rms@gnu.org>
11505
11506 * bison.simple: Change distribution terms.
11507
11508 1995-02-23 Richard Stallman <rms@gnu.org>
11509
11510 * src/files.c: Test __VMS_POSIX as well as VMS.
11511
11512 1995-02-14 Jim Meyering <meyering@gnu.org>
11513
11514 * src/bison.s1 (__yy_memcpy):
11515 Renamed from __yy_bcopy to avoid
11516 confusion. Reverse FROM and TO arguments to be consistent with
11517 those of memcpy.
11518
11519 1995-02-14 Jim Meyering <meyering@gnu.org>
11520
11521 * bison.simple (__yy_memcpy):
11522 Renamed from __yy_bcopy to avoid
11523 confusion. Reverse FROM and TO arguments to be consistent with
11524 those of memcpy.
11525
11526 1994-11-10 David J. MacKenzie <djm@gnu.org>
11527
11528 * NEWS: reformat
11529
11530 * NEWS: New file.
11531
11532 * Makefile.in (DISTFILES): Include NEWS.
11533
11534 * Makefile.in (DISTFILES):
11535 Include install-sh, not install.sh.
11536
11537 * configure.in: Update to Autoconf v2 macro names.
11538
11539 1994-10-05 David J. MacKenzie <djm@gnu.org>
11540
11541 * Makefile.in: fix typo
11542
11543 * Makefile.in (prefix, exec_prefix):
11544 Let configure set them.
11545
11546 1994-09-28 David J. MacKenzie <djm@gnu.org>
11547
11548 * Makefile.in: Set datadir to $(prefix)/share.
11549
11550 1994-09-15 Richard Stallman <rms@gnu.org>
11551
11552 * src/bison.s1:
11553 Update copyright notice and GPL version.
11554
11555 1994-09-15 Richard Stallman <rms@gnu.org>
11556
11557 * bison.simple:
11558 Update copyright notice and GPL version.
11559
11560 1994-07-12 Richard Stallman <rms@gnu.org>
11561
11562 * src/reduce.c, src/reader.c:
11563 entered into RCS
11564
11565 1994-05-05 David J. MacKenzie <djm@gnu.org>
11566
11567 * Makefile.in: entered into RCS
11568
11569 1994-03-26 Richard Stallman <rms@gnu.org>
11570
11571 * src/bison.s1: entered into RCS
11572
11573 1994-03-26 Richard Stallman <rms@gnu.org>
11574
11575 * bison.simple: entered into RCS
11576
11577 1994-03-25 Richard Stallman <rms@gnu.org>
11578
11579 * src/main.c: entered into RCS
11580
11581 1994-03-24 Richard Stallman <rms@gnu.org>
11582
11583 * src/conflicts.c: entered into RCS
11584
11585 1994-01-02 Richard Stallman <rms@gnu.org>
11586
11587 * Makefile.in: *** empty log message ***
11588
11589 1993-11-21 Richard Stallman <rms@gnu.org>
11590
11591 * src/bison.s1: *** empty log message ***
11592
11593 1993-11-21 Richard Stallman <rms@gnu.org>
11594
11595 * doc/bison.texinfo: entered into RCS
11596
11597 * doc/bison.texinfo: *** empty log message ***
11598
11599 1993-11-21 Richard Stallman <rms@gnu.org>
11600
11601 * bison.simple: *** empty log message ***
11602
11603 1993-10-25 David J. MacKenzie <djm@gnu.org>
11604
11605 * doc/bison.texinfo: *** empty log message ***
11606
11607 1993-10-19 Richard Stallman <rms@gnu.org>
11608
11609 * src/bison.s1: *** empty log message ***
11610
11611 1993-10-19 Richard Stallman <rms@gnu.org>
11612
11613 * bison.simple: *** empty log message ***
11614
11615 1993-10-14 Richard Stallman <rms@gnu.org>
11616
11617 * src/bison.s1: *** empty log message ***
11618
11619 1993-10-14 Richard Stallman <rms@gnu.org>
11620
11621 * bison.simple: *** empty log message ***
11622
11623 1993-09-14 David J. MacKenzie <djm@gnu.org>
11624
11625 * doc/bison.texinfo: *** empty log message ***
11626
11627 1993-09-13 Noah Friedman <friedman@gnu.org>
11628
11629 * Makefile.in: *** empty log message ***
11630
11631 1993-09-10 Richard Stallman <rms@gnu.org>
11632
11633 * src/conflicts.c: *** empty log message ***
11634
11635 * src/system.h: entered into RCS
11636
11637 1993-09-10 Richard Stallman <rms@gnu.org>
11638
11639 * doc/bison.1: entered into RCS
11640
11641 1993-09-06 Noah Friedman <friedman@gnu.org>
11642
11643 * src/version.c: entered into RCS
11644
11645 1993-09-06 Noah Friedman <friedman@gnu.org>
11646
11647 * Makefile.in: *** empty log message ***
11648
11649 1993-07-30 David J. MacKenzie <djm@gnu.org>
11650
11651 * Makefile.in: *** empty log message ***
11652
11653 1993-07-24 Richard Stallman <rms@gnu.org>
11654
11655 * src/bison.s1: *** empty log message ***
11656
11657 1993-07-24 Richard Stallman <rms@gnu.org>
11658
11659 * bison.simple: *** empty log message ***
11660
11661 1993-07-08 David J. MacKenzie <djm@gnu.org>
11662
11663 * Makefile.in: *** empty log message ***
11664
11665 1993-07-04 Richard Stallman <rms@gnu.org>
11666
11667 * src/bison.s1: *** empty log message ***
11668
11669 1993-07-04 Richard Stallman <rms@gnu.org>
11670
11671 * bison.simple: *** empty log message ***
11672
11673 1993-06-26 David J. MacKenzie <djm@gnu.org>
11674
11675 * src/getargs.c: entered into RCS
11676
11677 1993-06-26 David J. MacKenzie <djm@gnu.org>
11678
11679 * doc/bison.texinfo: *** empty log message ***
11680
11681 * doc/bison.1: New file.
11682
11683 1993-06-25 Richard Stallman <rms@gnu.org>
11684
11685 * src/getargs.c: New file.
11686
11687 1993-06-16 Richard Stallman <rms@gnu.org>
11688
11689 * src/bison.s1: *** empty log message ***
11690
11691 1993-06-16 Richard Stallman <rms@gnu.org>
11692
11693 * bison.simple: *** empty log message ***
11694
11695 1993-06-03 Richard Stallman <rms@gnu.org>
11696
11697 * src/bison.s1: New file.
11698
11699 1993-06-03 Richard Stallman <rms@gnu.org>
11700
11701 * doc/bison.texinfo: *** empty log message ***
11702
11703 1993-06-03 Richard Stallman <rms@gnu.org>
11704
11705 * bison.simple: New file.
11706
11707 1993-05-19 Richard Stallman <rms@gnu.org>
11708
11709 * doc/bison.texinfo: New file.
11710
11711 1993-05-07 Noah Friedman <friedman@gnu.org>
11712
11713 * Makefile.in: *** empty log message ***
11714
11715 1993-04-28 Noah Friedman <friedman@gnu.org>
11716
11717 * src/reader.c: *** empty log message ***
11718
11719 1993-04-23 Noah Friedman <friedman@gnu.org>
11720
11721 * src/alloc.h: entered into RCS
11722
11723 1993-04-20 David J. MacKenzie <djm@gnu.org>
11724
11725 * src/version.c: *** empty log message ***
11726
11727 * src/files.c, src/allocate.c:
11728 entered into RCS
11729
11730 * src/reader.c: *** empty log message ***
11731
11732 * src/lex.c: entered into RCS
11733
11734 * src/conflicts.c: New file.
11735
11736 * src/symtab.c: entered into RCS
11737
11738 * src/alloc.h: New file.
11739
11740 * src/LR0.c: entered into RCS
11741
11742 1993-04-18 Noah Friedman <friedman@gnu.org>
11743
11744 * src/reader.c: New file.
11745
11746 * src/version.c: *** empty log message ***
11747
11748 1993-04-18 Noah Friedman <friedman@gnu.org>
11749
11750 * Makefile.in: *** empty log message ***
11751
11752 1993-04-17 Noah Friedman <friedman@gnu.org>
11753
11754 * Makefile.in: *** empty log message ***
11755
11756 1993-04-15 Richard Stallman <rms@gnu.org>
11757
11758 * src/main.c, src/files.c:
11759 New file.
11760
11761 1993-04-15 Noah Friedman <friedman@gnu.org>
11762
11763 * configure.in: entered into RCS
11764
11765 * configure.in: *** empty log message ***
11766
11767 * configure.in: New file.
11768
11769 1993-04-14 Richard Stallman <rms@gnu.org>
11770
11771 * Makefile.in: New file.
11772
11773 1993-04-13 Richard Stallman <rms@gnu.org>
11774
11775 * src/version.c: New file.
11776
11777 1993-03-25 Richard Stallman <rms@gnu.org>
11778
11779 * src/output.c: entered into RCS
11780
11781 1992-09-25 Richard Stallman <rms@gnu.org>
11782
11783 * configure.bat: entered into RCS
11784
11785 1992-06-22 Richard Stallman <rms@gnu.org>
11786
11787 * src/vmsgetargs.c: entered into RCS
11788
11789 1992-06-22 Richard Stallman <rms@gnu.org>
11790
11791 * doc/bison.rnh: entered into RCS
11792
11793 1992-04-20 David J. MacKenzie <djm@gnu.org>
11794
11795 * README: entered into RCS
11796
11797 1992-01-22 Richard Stallman <rms@gnu.org>
11798
11799 * src/machine.h: entered into RCS
11800
11801 1991-12-21 Richard Stallman <rms@gnu.org>
11802
11803 * src/lalr.c, src/closure.c:
11804 entered into RCS
11805
11806 1991-12-20 Richard Stallman <rms@gnu.org>
11807
11808 * src/state.h: entered into RCS
11809
11810 1991-12-18 Richard Stallman <rms@gnu.org>
11811
11812 * src/print.c, src/nullable.c, src/derives.c:
11813 entered into RCS
11814
11815 1991-11-03 David J. MacKenzie <djm@gnu.org>
11816
11817 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
11818 entered into RCS
11819
11820 1988-09-09 Richard Stallman <rms@gnu.org>
11821
11822 * src/bison.hairy: entered into RCS
11823
11824 1987-12-16 Richard Stallman <rms@gnu.org>
11825
11826 * REFERENCES: entered into RCS
11827
11828 -----
11829
11830 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
11831 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
11832
11833 This file is part of Bison, the GNU Compiler Compiler.
11834
11835 Bison is free software; you can redistribute it and/or modify
11836 it under the terms of the GNU General Public License as published by
11837 the Free Software Foundation; either version 2, or (at your option)
11838 any later version.
11839
11840 Bison is distributed in the hope that it will be useful,
11841 but WITHOUT ANY WARRANTY; without even the implied warranty of
11842 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11843 GNU General Public License for more details.
11844
11845 You should have received a copy of the GNU General Public License
11846 along with Bison; see the file COPYING. If not, write to
11847 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
11848 Boston, MA 02111-1307, USA.