]> git.saurik.com Git - bison.git/blame - ChangeLog
* data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
[bison.git] / ChangeLog
CommitLineData
62b6aef9
AD
12003-08-27 Akim Demaille <akim@epita.fr>
2
3 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
4 GCC warnings.
5
89e1cc61
AD
62003-08-26 Akim Demaille <akim@epita.fr>
7
8 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
9 "<\#" to avoid magic from Gnus when posting parts of this script.
10
a08460b0
AD
112003-08-26 Akim Demaille <akim@epita.fr>
12
13 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
14 (Parser::parse): here.
15 Adjust: nerrs and errstatus is now replaced by...
16 (Parser::nerrs_, Parser::errstatus_): New.
17
603f1cfd
AD
182003-08-25 Akim Demaille <akim@epita.fr>
19
20 * config/announce-gen, Makefile.cfg: New.
21 * Makefile.am: Adjust.
22 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
23 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
24
cd3684cf
AD
252003-08-25 Akim Demaille <akim@epita.fr>
26
27 When reducing initial empty rules, Bison parser read an initial
28 location that is not defined. This results in garbage, and that
29 affects Bison's own parser. Therefore we need (i) to extend Bison
30 to support a means to initialize this location, and (ii) to use
31 this CVS Bison to fix CVS Bison's parser.
32
33 * src/reader.h, reader.c (epilogue_augment): Remove, replace
34 with...
35 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
36 * src/parse-gram.y: Adjust.
37 (%initial-action): New.
38 (%error-verbose): Since we require CVS Bison, there is no reason
39 not to use it.
40 * src/scan-gram.l: Adjust.
41 * src/Makefile.am (YACC): New, to make sure we use our own parser.
42 * data/yacc.c (yyparse): Use b4_initial_action.
43
4e03e201
AD
442003-08-25 Akim Demaille <akim@epita.fr>
45
46 * doc/bison.texinfo: Don't promote stdout for error messages.
47
8c182d05
AD
482003-08-25 Akim Demaille <akim@epita.fr>
49
50 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
51 From Alexandre Duret-Lutz.
52
25f66e1a
AD
532003-08-25 Akim Demaille <akim@epita.fr>
54
55 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
56 Use them.
57
5348bfbe
AD
582003-08-25 Akim Demaille <akim@epita.fr>
59
60 * data/lalr1.cc (Parser::reduce_print_): New.
61 Use it.
62
47301314
AD
632003-08-25 Akim Demaille <akim@epita.fr>
64
65 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
66 error recovery loops. This patch is based on
67 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
68 Also, augment the similarity between lalr1.cc and yacc.c.
69 Note: the locations of error recovery rules are not correct yet.
70
71 * data/lalr1.cc: Comment changes to augment the similarity between
72 lalr1.cc and yacc.c.
73 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
74 (yyerrlab1): Remove, but where it used to be (now the bottom part of
75 yyerrlab), when hitting EOF, pop the whole stack here instead of
76 merely falling thru the default error handling mechanism.
77 (yyerrorlab): New label, with the old contents of YYERROR,
78 plus the following change: pop the stack of rhs corresponding
79 to the production that invoked YYERROR. That is how Yacc
80 behaves (required by POSIX).
81 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
82 fail.
83
1f7a61ff
AD
842003-08-25 Akim Demaille <akim@epita.fr>
85
86 Tune local.at so that people can "autom4te -l autotest calc.at -o
87 calc" for instance, to extract a sub test suite.
88
89 * tests/testsuite.at: Move the initialization, Autotest version
90 requirement, and AT_TESTED invocation into...
91 * tests/local.at: here.
92 * tests/testsuite.at: Include it for compatibility with Autoconf
93 2.57.
94 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
95 be ignore.
96
327b5b56
PE
972003-08-04 Paul Eggert <eggert@twinsun.com>
98
99 Rework code slightly to avoid gcc -Wtraditional warnings.
100 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
101 The returned value is now stored in *YY0. All callers changed.
102 * src/output.c (merge_output): Adjust to the above change.
103
0051e3ed
PE
1042003-07-26 Paul Eggert <eggert@twinsun.com>
105
106 * data/glr.c (YYASSERT): New macro.
107 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
108 yyresolveStates, yyprocessOneStack):
109 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
110 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 111
137437c6
PE
1122003-07-25 Paul Eggert <eggert@twinsun.com>
113
5b620e06
PE
114 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
115 for portability to K&R C (after ansi2knr, presumably). See
116 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
117 by Frank Heckenbach, though I have omitted the structure-initialization
118 part of his glr-knr.diff patch since I recall that the Portable
119 C Compiler didn't require that change.
120
137437c6
PE
121 Let the user specify how to allocate and free memory.
122 Derived from a suggestion by Frank Heckenbach in
123 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
124 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
125 All uses of free, malloc, realloc changed to use these macros,
126 and unnecessary casts removed.
127 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
128
ddb85ca5
PE
1292003-07-06 Matthias Mann <MatthiasMann@gmx.de>
130
131 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
132 use s.empty() rather than s == "" to test for empty string; see
133 <http://mail.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
134 (trivial change)
135
39910e09
AD
1362003-06-25 Akim Demaille <akim@epita.fr>
137
138 * config/depcomp, config/install-sh: Update from masters.
139
0ae99356
PE
1402003-06-20 Paul Eggert <eggert@twinsun.com>
141
142 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
143 and return properly parenthesized result.
144 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
145 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
146 Remove unnecessary parentheses from uses.
147 * doc/bison.texinfo (Location Default Action): Describe the
148 conventions for parentheses.
149
cd05d13c
PE
1502003-06-19 Paul Eggert <eggert@twinsun.com>
151
81fd08ca
PE
152 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
153 yyreportTree): Do not assume that size_t is the same width as int,
154 when printing sizes. Print sizes using an unsigned format.
155 Problem reported by Frank Heckenbach in
156 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 157
cd05d13c
PE
158 Port to Forte Developer 7 C compiler.
159 * data/glr.c (struct YYLTYPE): If locations are not being used,
160 declare a single dummy member, as empty structs do not conform
161 to the C standard.
162 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
163 the Forte Developer 7 C compiler complains that end-of-loop
164 code is not reached.
165
4dcf140b
PE
1662003-06-17 Paul Eggert <eggert@twinsun.com>
167
168 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
169 avoid warnings from picky compilers about redefinition of PARAMS.
170
8dd76bee
PE
1712003-06-17 Paul Eggert <eggert@twinsun.com>
172
173 Version 1.875b.
174
175 * NEWS: Document 1.875b.
176
177 * lib/bbitset.h: Do not include config.h; that's the includer's job.
178 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
179 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
180 Don't use 'index' in comments, as it's a builtin fn on some hosts.
181 * lib/bitset_stats.c: Include gettext.h unconditionally, as
182 per recent gettext manual's suggestion.
183 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
184 Use prototypes, not old-style definitions.
185 * lib/lbitset.c (lbitset_unused_clear): Likewise.
186 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
187 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
188 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
189 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
190 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
191 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
192 vbitset_or_and_cmp, vbitset_copy): Likewise.
193
194 * lib/libiberty.h: Do not include config.h; that's the includer's job.
195 Do not include <stdlib.h>.
196 (PARAMS): Define unconditionally for C89.
197 (ATTRIBUTE_NORETURN): Remove.
198 (ATTRIBUTE_UNUSED): Define unconditionally.
199
200 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
201 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
202 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
203 * lib/vbitset.c, lib/vbitset.h: New files.
204 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
205 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
206 from libbitset.
207
208 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
209 `How Can I Reset @code{yyparse}', since texinfo does not allow
210 arbitrary @ in node names.
211
212 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
213 shouldn't be needed according to the gettext 0.12.1 documentation
214 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 215 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 216 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 217 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 218
8dd76bee
PE
219 * lib/.cvsignore: Add stdbool.h.
220 * m4/.cvsignore: Add nls.m4, po.m4.
221
222 Upgrade to CVS gnulib.
223 * stdbool_.h: File renamed from stdbool.h.in.
224 * configure.ac (AM_STDBOOL_H): Invoke this instead of
225 AC_HEADER_STDBOOL.
226 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
227 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
228 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
229 (MOSTLYCLEANFILES): New var.
230 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
231 (stdbool.h): New rule.
232 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
233 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
234 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
235 m4/quote.m4: Upgrade to today's gnulib.
236
237 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
238 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
239 the tests right now.
240 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
241 yyerror are declared before use; C99 requires this.
242
25005f6a
PH
2432003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
244
245 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
246 first.
247 (yyrecoverSyntaxError): Correct the logic for setting and testing
248 yyerrState.
249 Correct comment on handling EOF.
250 Allow states with only a default reduction, rather than failing
8dd76bee 251 (I can't quite reconstruct why these were not allowed before).
25005f6a 252
137437c6 253 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 254 buffer overruns, corrupting state.
8dd76bee
PE
255
256 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
257 definition.
258 * src/reader.h (max_left_semantic_context): New variable declaration.
259 * src/scan-gram.l (max_left_semantic_context): Define.
260 (handle_action_dollar): Update max_left_semantic_context.
261 * data/glr.c (YYMAXLEFT): New definition.
262 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
263 (yyresolveAction): Ditto.
264
265 Fixes to problems with location handling in GLR parsers reported by
266 Frank Heckenbach (2003/06/05).
267
268 * data/glr.c (YYLTYPE): Make trivial if locations not used.
269 (YYRHSLOC): Add parentheses, and define only if locations used.
270 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
271 locations not used.
272 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
273 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 274
25005f6a
PH
275 * tests/cxx-type.at: Exercise location information; update tests
276 to differentiate output with and without locations.
8dd76bee 277 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
278 because default YYLTYPE not yet defined.
279 Change semantic actions to compute strings, rather than printing
280 them directly (to test proper passing of semantics values). Change
281 output to prefix notation and update test data and expected results.
282 (yylex): Track locations.
283 (stmtMerge): Return value rather than printing, and include arguments
284 in value.
8dd76bee 285
711f40b7
PE
2862003-06-03 Paul Eggert <eggert@twinsun.com>
287
288 Avoid warnings generated by GCC 2.95.4 when Bison is
289 configured with --enable-gcc-warnings.
290 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
291 yy::]b4_parser_class_name[::translate_,
292 yy::Stack::operator[] (unsigned),
293 yy::Stack::operator[] (unsigned) const,
294 yy::Slice::operator[] (unsigned),
295 yy::Slice::operator[] (unsigned) const):
296 Rename local vars to avoid warnings.
297 * tests/glr-regression.at (Improper handling of embedded actions
298 and $-N in GLR parsers): Remove unused local variable from yylex.
299 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
300 (void) as arg when not pure, since we now assume C89 when building
301 Bison. Pacify GCC by using parameter.
302
ac695f7d
PE
3032003-06-02 Paul Eggert <eggert@twinsun.com>
304
305 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
306 yy::Location::lines, yy::Location::columns): Rename arguments
307 to avoid shadowing; this removes a warning generated by GCC 3.3.
308
26ec81e0
PE
3092003-06-01 Paul Eggert <eggert@twinsun.com>
310
311 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
312 to g++, as GCC 3.3 complains if you do it.
313 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
314 everything that WARNING_CFLAGS has, except omit warnings
315 not suitable for C++.
316 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
317 * tests/atlocal.in (CXXFLAGS): New var.
318 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
319
320 Fix a GLR parser bug I reported in February; see
321 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
322 The problem was that GLR parsers did not conform to the C standard,
323 because actions like { $1 = $2 + $3; } expanded to expressions
324 that invoked YYFILL in separate subexpressions, and YYFILL assigned
325 to a local variable. The C standard says that expressions
326 like (var = f ()) + (var = f ()) have undefined behavior.
327 Another problem was that GCC sometimes issues warnings that
328 yyfill and its parameters are unused.
329
330 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
331 as possibly unused.
332 (yyfill): New function.
333 (YYFILL): Use it.
334 (yyuserAction): Change type of yynormal to bool, so that it matches
335 the new yyfill signature. Mark it as possibly unused.
336
337
338 Follow up on a bug I reported in February, where a Bison-generated
339 parser can loop. Provide a test case and a fix for yacc.c. I
340 don't have a fix for lalr1.cc or for glr.c, unfortunately.
341 The original bug report is in:
342 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
343
344 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
345 macro's size was becoming unwieldy.
346 (yyerrlab): Do not discard an empty lookahead symbol, as this
347 might destroy garbage.
348 (yyerrorlab): New label, with the old contents of YYERROR,
349 plus the following change: pop the stack of rhs corresponding
350 to the production that invoked YYERROR. That is how Yacc
351 behaves, and POSIX requires this behavior.
352 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
353 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
354 Define 'alarm' to do nothing if unistd.h is not available.
355 Add a new rule "exp: '-' error;" to test the above change to
356 data/yacc.c. Use 'alarm' to abort any test taking longer than
357 10 seconds, as it's probably looping.
358 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
359 Also, the new yacc.c generates two fewer diagnostics for an
360 existing test.
361
d0829076
PE
3622003-05-24 Paul Eggert <eggert@twinsun.com>
363
c6ae27df
PE
364 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
365 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
366 This fixes a problem reported by John Bowman when the Compaq/HP
367 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
368 -ansi -Wall -gall).
369 * data/yacc.c (union yyalloc): Likewise.
370 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 371
d0829076
PE
372 Switch from 'int' to 'bool' where that makes sense.
373
374 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
375 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
376 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
377 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
378 Return or accept bool, not int. All callers changed.
379 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
380 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
381 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
382 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
383 bitset_or_and_cmp_): Likewise.
384 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
385 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
386 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
387 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
388 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
389 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
390 bitset_stats_or_and_cmp): Likewise.
391 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
392 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
393 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
394 ebitset_xor_cmp): Likewise.
395 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
396 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
397 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
398 lbitset_xor_cmp): Likewise.
399 * lib/bbitset.h: Include <stdbool.h>.
400 (struct bitset_vtable): The following members now return bool, not
401 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
402 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
403 or_and_cmp).
404 * src/conflicts.c (count_rr_conflicts): Likewise.
405 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
406 All uses changed.
407 * lib/ebitset.c (ebitset_obstack_init): Likewise.
408 * lib/lbitset.c (lbitset_obstack_init): Likewise.
409 * src/getargs.c (debug_flag, defines_flag, locations_flag,
410 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
411 graph_flag): Likewise.
412 * src/getargs.h (debug_flag, defines_flag, locations_flag,
413 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
414 graph_flag): Likewise.
415 * src/output.c (error_verbose): Likewise.
416 * src/output.h (error_verbose): Likewise.
417 * src/reader.c (start_flag, typed): Likewise.
418 * src/reader.h (typed): Likewise.
419 * src/getargs.c (LOCATIONS_OPTION): New constant.
420 (long_options, getargs): Use it.
421 * src/lalr.c (build_relations): Use bool, not int.
422 * src/nullable.c (nullable_compute): Likewise.
423 * src/print.c (print_reductions): Likewise.
424 * src/tables.c (action_row, pack_vector): Likewise.
425 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
426 * src/output.c (prepare): Use it.
427 * src/output.c (token_definitions_output,
428 symbol_destructors_output, symbol_destructors_output): Use string,
429 not boolean integer, to keep track of whether to output separator.
430 * src/print_graph.c (print_core): Likewise.
431 * src/state.c (state_rule_lookaheads_print): Likewise.
432
433 * config/install-sh: Sync from automake 1.7.5.
434
6b2584b7
PE
4352003-05-14 Paul Eggert <eggert@twinsun.com>
436
437 * src/parse-gram.y (rules_or_grammar_declaration): Require a
438 semicolon after a grammar declaration, in the interest of possible
439 future changes to the Bison input language.
440 Do not allow a stray semicolon at the start of the grammar.
441 (rhses.1): Allow one or more semicolons after any rule, including
442 just before "|" as required by POSIX.
443 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
444 grammar.
445
caf37a36
ADL
4462003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
447
448 %parse-param support for lalr1.cc.
449
450 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
451 b4_cc_constructor_calls, b4_cc_constructor_call,
452 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
453 definitions.
454 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
455 parse-param arguments.
456 (yy::b4_parser_class_name): Declare instance variables to
457 hold parse-param arguments.
458 * tests/calc.at: s/value/semantic_value/ because value clashes
459 with a member of yy::b4_parser_class_name. Adjust C++ code
460 to handle %parse-param. Enable %parse-param test in C++.
461
3ab37077
PE
4622003-05-12 Paul Eggert <eggert@twinsun.com>
463
464 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
465 English a bit. Fix fclose typo. Change "const char" to "char
466 const", and use ANSI C rather than K&R for "main". Suggest
467 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
468 and suggest yy_switch_to_buffer.
469
4702003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
471
472 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
473 C89. This avoids a diagnostic on compilers that define __STDC__
474 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
475 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
476
e743727f
PE
4772003-05-03 Paul Eggert <eggert@twinsun.com>
478
479 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
480 Do not overrun array bounds.
481 This should fix a bug reported today by Olatunji Oluwabukunmi in
482 <http://mail.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
483
916708d5
AD
4842003-04-29 Akim Demaille <akim@epita.fr>
485
486 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
487 * src/getargs.c, src/getargs.h: here, as bool, not int.
488 (nondeterministic_parser): New.
489 * src/parse-gram.y, src/scan-gram.l: Support
490 %nondeterministic-parser.
491 * src/output.c (prepare): Use nondeterministic_parser instead
492 of glr_parser where appropriate.
493 * src/tables.c (conflict_row, action_row, save_row)
494 (token_actions, token_actions, pack_vector): Ditto.
495
a06ea4aa
AD
4962003-04-29 Akim Demaille <akim@epita.fr>
497
498 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
499
211074ca
AD
5002003-04-29 Akim Demaille <akim@epita.fr>
501
502 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
503 with %pure-parser and %locations to exercise the patch from Yakov
504 Markovitch below.
505
6175ffe3
PE
5062003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
507
508 * data/yacc.c: (b4_lex_param): Corrected for the case where
509 %lex-param is provided and %pure-parser isn't.
510
b1e95857
PE
5112003-04-27 Paul Eggert <eggert@twinsun.com>
512
513 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
514 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
515 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
516 if it is not defined.
517 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
518
acda9df6
PE
5192003-04-26 Paul Eggert <eggert@twinsun.com>
520
3470c57b
PE
521 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
522 Declare to be of type suitable for the ninf value itself, not of
523 type suitable for the corresponding table, since the latter might
524 be unsigned but the ninf value might be negative. This fixes a
525 bug reported by Alexandre Duret-Lutz in
526 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
527
acda9df6
PE
528 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
529 invokes it. We shouldn't invoke it twice because it will attempt
530 to put error.o in the archive twice. This fixes a glitch reported
531 by Martin Mokrejs in
532 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
533
b5250f26
PE
5342003-04-21 Paul Eggert <eggert@twinsun.com>
535
536 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
537 to gnulib.
538
089ac0f1
PE
5392003-04-21 Yakov Markovitch <Markovitch@iso.ru>
540
541 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
542 Fix obvious typo that results in uncompilable GLR parsers
543 when both %pure-parser and %locations are used. (trivial change)
544
5ededac6
PE
5452003-04-17 Paul Eggert <eggert@twinsun.com>
546
1b8f2fff
PE
547 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
548 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
549 Do not insert the expected token via unput, as this runs afoul
550 of a POSIX-compatibility bug in flex 2.5.31.
551 All uses changed to BEGIN the parent state,
552 since we no longer insert the expected token via unput.
553 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
554 that is no longer emitted after the above change.
555
5ededac6
PE
556 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
557 the first one. This change is from Paul Hilfinger, and it fixes
558 regression reported by Werner Lemberg in
559 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
560
561 (resolve_sr_conflict): Don't invoke state_errs_set
562 unless one or more tokens have been explicitly made errors.
563 Otherwise, the above change causes Bison to abort.
564
565 * tests/existing.at (GNU pic Grammar): New test case, taken from
566 Lemberg's email.
567
b8be9132
AD
5682003-03-31 Akim Demaille <akim@epita.fr>
569
570 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
571
d423d460
AD
5722003-03-31 Akim Demaille <akim@epita.fr>
573
574 * src/output.c (prepare_symbols): Avoid trailing spaces in the
575 output.
576
c7e441b4
AD
5772003-03-31 Akim Demaille <akim@epita.fr>
578
579 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
580 From Paul Hilfinger.
581
231897ad
AD
5822003-03-29 Akim Demaille <akim@epita.fr>
583
584 * m4/error.m4: Do not put under dynamic conditions some code which
585 expansion is under static control.
586
5b066063
AD
5872003-03-29 Akim Demaille <akim@epita.fr>
588
589 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
590
22a74fec
AD
5912003-03-29 Akim Demaille <akim@epita.fr>
592
593 * doc/bison.texinfo (Strings are Destroyed): New.
594
0eee27e7
PE
5952003-03-13 Paul Eggert <eggert@twinsun.com>
596
597 * .cvsignore: Add configure.lineno.
598 * src/.cvsignore: Add yacc.
599 * tests/.cvsignore: Add testsuite.log.
600 * doc/fdl.texi: Sync with latest FSF version.
601
f61aad93
PE
6022003-03-12 Paul Eggert <eggert@twinsun.com>
603
537636c7
PE
604 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
605 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
606 cursor, instead of leaving it undefined. This fixes a bug
607 reported by Tim Van Holder in
608 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
609 * tests/input.at (Torturing the Scanner): Test the scanner on
610 an empty input file, which was Tim Van Holder's test case.
611
612 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
613 <sys/resource.h> can be included, include sys/time.h and
614 sys/times.h first, if available. This works around the SunOS
615 4.1.4 porting bug reported by Bruce Becker in
616 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
617
618 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
619 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
620 AC_HEADER_SYS_WAIT.
621
f61aad93
PE
622 Merge changes from gnulib. This was prompted because the CVS
623 snapshot didn't build on Solaris 7 due to strnlen problems.
624
625 These changes need to be merged back into gnulib:
626 * lib/hash.c: Include <stdbool.h> unconditionally.
627 * m4/onceonly.m4 (m4_quote): New macro.
628 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
629 Quote AC_FOREACH variable-expansions properly.
630 The 2003-01-03 obstack.h change also needs merging.
631 {end of changes requiring merging}
5b066063 632
f61aad93
PE
633 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
634 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
635 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
636 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
637 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
638 New files, imported from gnulib.
639 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
640 above.
641
642 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
643 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
644 gnulib sources.
645
646 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
647 Add.
648 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
649 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
650 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
651 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
652 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
653 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
654 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
655 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
656 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
657 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
658 (jm_PREREQ_ARGMATCH): Remove.
659 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
660 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
661
662 * src/system.h: Include <stdbool.h> unconditionally.
663
664 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
665 assuming at least C89 in the bitset code for some time now.
666
d2ffe116
AD
6672003-03-03 Akim Demaille <akim@epita.fr>
668
669 * ro.po: New.
670
052826fd
AD
6712003-03-02 Akim Demaille <akim@epita.fr>
672
673 * doc/bison.texinfo (Table of Symbols): Reactivate the
674 documentation for %lex-param, and %parse-param.
675
c4749565
AD
6762003-03-02 Akim Demaille <akim@epita.fr>
677
678 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
679 generate verbose error messages.
680 Use the number of tokens as an upper bound in yytname, as it
681 cannot be a non terminal.
682
d5286af1
AD
6832003-03-02 Akim Demaille <akim@epita.fr>
684
685 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
686 message.
687
22e304a6
AD
6882003-03-02 Akim Demaille <akim@epita.fr>
689
22e304a6
AD
690 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
691 Use them to exercise yycheck overrun.
692 Based on Andrew Suffield's grammar.
693
67a25fed
AD
6942003-03-02 Akim Demaille <akim@epita.fr>
695
696 Create tests/local.at for Bison generic testing macros.
697
698 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
699 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
700 This new file.
701 * tests/calc.at (AT_CHECK_CALC): Adjust.
702 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
703 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
704 * tests/local.at: here.
705 (AT_COMPILE_CXX): Tags the tests using it as c++.
706 Ignore the test if CXX is not functional.
707
9c2b381f
PE
7082003-03-01 Paul Eggert <eggert@twinsun.com>
709
710 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
711 not loc->end, since loc->end might contain garbage and this leads
712 to undefined behavior on some platforms.
713 (id_loc, token_start): Use (IF_LINTed) initial values that do not
714 depend on *loc, so that the reader doesn't give the the false
715 impression that *loc is initialized.
716 (<INITIAL>"%%"): Do not bother setting code_start, since its value
717 does not survive the return.
718
0433ba88
AD
7192003-03-01 Akim Demaille <akim@epita.fr>
720
721 * src/scan-gram.l (code_start): Always initialize it when entering
722 into yylex, as SC_EPILOGUE is activated *before* the corresponding
723 yylex invocation. An alternative would be making it static, but
724 then it starts with the second %%'s beginning, instead of its end.
725
b305ea69
PE
7262003-02-28 Paul Eggert <eggert@twinsun.com>
727
728 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
729 around a UnixWare 7.1.1 porting bug reported by John Hughes in
730 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
731
c3d25e01
PE
7322003-02-26 Paul Eggert <eggert@twinsun.com>
733
734 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
735 Remove Sequent/Pyramid discussion (nobody uses them any more).
736 Merge VMS and MS-DOS discussion; these ports may well be dead
737 but let's keep mentioning them for now. Put <> around email
738 addresses. Add copyright notice.
739
c267ffbc
PE
7402003-02-24 Paul Eggert <eggert@twinsun.com>
741
742 * data/glr.c (yy_reduce_print): yylineno -> yylno,
743 to avoid collision with flex use of yylineno.
744 Problem reported by Bruce Lilly in
745 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
746 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
747 * data/yacc.c (yy_reduce_print): Likewise.
748
749 * config/depcomp: Sync with Automake 1.7.3.
750
f939fc12
AD
7512003-02-21 Akim Demaille <akim@epita.fr>
752
753 * data/lalr1.cc: Use temporary variables instead of casts to
754 change integer types.
755 Suggested by Paul Eggert.
756
95923bd6
AD
7572003-02-21 Akim Demaille <akim@epita.fr>
758
759 * doc/bison.texinfo: Use "location" consistently to refer to @n,
760 to avoid confusions with lalr1.cc's notion of Position.
761 Suggested by Paul Eggert.
762
2cdc240e
AD
7632003-02-20 Akim Demaille <akim@epita.fr>
764
765 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
766 before initial_columns.
767 (location.hh): Use consistent variable names when defining the
768 operator<<.
769 Use "last" so that we subtract from Positions, not from unsigned.
770
5d003116
AD
7712003-02-20 Akim Demaille <akim@epita.fr>
772
773 * data/lalr1.cc (position.hh): New subfile, including the extended
774 and Doxygen'ed documentation of class Position.
775 (location.hh): Use it.
776 Document a` la Doxygen.
ba1ecc07 777 With the help of Benoit Perrot.
5d003116 778
d02b25f9
AD
7792003-02-20 Akim Demaille <akim@epita.fr>
780
781 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
782 AT_YACC_IF.
783 Redefine AT_YYERROR_SEES_LOC_IF using it.
784 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
785 not defined.
786 Don't use the location in yy::Parser::error_ and
787 yy::Parser::print_ when not %locations.
788 Activate more lalr1.cc tests.
789
0d1c3a04
AD
7902003-02-19 Akim Demaille <akim@epita.fr>
791
792 * data/lalr1.cc: When displaying a line number, be sure to make it
793 an int.
794
60a777aa
AD
7952003-02-19 Akim Demaille <akim@epita.fr>
796
797 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
798 Remove, useless.
799 (YYABORT, YYACCEPT, YYERROR): New.
800 * tests/calc.at: Renable the lalr1.cc test.
801
0b86fc41
AD
8022003-02-19 Akim Demaille <akim@epita.fr>
803
804 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
805 error recovery, mixing with/without pops and discarding of the
806 lookahead.
807 Exercise YYERROR.
808 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
809
da99a5dc
PE
8102003-02-17 Paul Eggert <eggert@twinsun.com>
811
812 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
813 * tests/testsuite.at (AT_COMPILE): Use them.
814 This fixes the testsuite problem reported by Robert Lentz in
815 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
816
93b8c255
PE
8172003-02-12 Paul Eggert <eggert@twinsun.com>
818
819 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
820 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
821 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
822 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
823 Check for malloc failure, for consistency with yacc.c.
824 (yytname_size): Remove, for consistency with yacc.c.
825
826 The bug still remains in data/lalr1.cc, as I didn't have time
827 to fix it there.
828
7548fed2
AD
8292003-02-06 Akim Demaille <akim@epita.fr>
830
831 * configure.ac (GXX): Rename as...
832 (CXX): this, to keep the original Autoconf semantics.
833 Require 2.57.
834 * data/lalr1.cc: Fix b4_copyright invocations.
835 If YYDEBUG is not defined, don't depend upon name_ being defined.
836 (location.hh): Include string and iostream.
837 (Position::filename): New member.
838 (Position::Position ()): New.
839 (operator<< (Position)): New.
840 (operator- (Position, int)): New.
841 (Location::first, Location::last): Rename as...
842 (Location::begin, Location::end): these, to mock the conventional
843 iterator names.
844 (operator<< (Location)): New.
845 * tests/atlocal.in (CXX): New.
846 * tests/testsuite.at (AT_COMPILE_CXX): New.
847 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
848 locations in a more synthetic way.
849 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
850 lalr1.cc is used.
851 Adjust the C locations to match those from Emacs: first column is
852 column 0.
853 Change all the expected results.
854 Conform to the GCS: simplify the locations when applicable.
855 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
856 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
857 these CPP macros with the m4 macros new defined by...
858 (AT_CHECK_PUSHDEFS): this, i.e.:
859 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 860 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
861 New macros.
862 (AT_CHECK_POPDEFS): Undefine them.
863 (AT_CHECK_CALC_LALR1_CC): New.
864 Use it for the first lalr1.cc test.
865
43a176ef
AD
8662003-02-04 Akim Demaille <akim@epita.fr>
867
868 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
869 Location as is defined.
870
fc049e9c
AD
8712003-02-04 Akim Demaille <akim@epita.fr>
872
873 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
874 name_ being defined.
875
a737b216
PE
8762003-02-03 Paul Eggert <eggert@twinsun.com>
877
878 * src/gram.h (start_symbol): Remove unused decl.
879
880 Use more-consistent naming conventions for local vars.
881
882 * src/derives.c (derives_compute): Change type of local var from
883 int to rule_number.
884 * src/gram.c (grammar_rules_partial_print): Likewise.
885 * src/print.c (print_core): Likewise.
886 * src/reduce.c (reduce_grammar_tables): Likewise.
887
888 * src/gram.c (grammar_dump): Change name of item_number *
889 local var from r to rp.
890 * src/nullable.c (nullable_compute): Likewise.
891
892 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
893
894 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
895 for symbol or symbol_number var.
896 * src/reader.c (grammar_start_symbol_set): Likewise.
897 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
898 Likewise.
899 * src/state.c (transitions_to): Likewise.
900 * src/state.h: Likewise.
901 * src/tables.c (symbol_number_to_vector_number): Likewise.
902
903 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
904 char * var.
905
906 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
907 var.
908
909 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
910 var.
911
912 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
913 Use str, not s, for char * var. Use ch, not c, for character var.
914 Use size for size var.
915
916 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
917 char * var.
918 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
919 uniqstr var.
920 * src/uniqstr.h: Likewise.
921
922 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
923 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
924 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
925 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
926 param to have same name as that of enum, so that we don't use
927 "s" to stand for a non-state.
928
68e93ad5
AD
9292003-02-02 Akim Demaille <akim@epita.fr>
930
931 * src/scan-skel.l: Scan more than one inert character per yylex
932 invocation.
933
92898986
PE
9342003-02-01 Paul Eggert <eggert@twinsun.com>
935
936 Version 1.875a.
937
1d9d5d71
PE
938 * po/LINGUAS: Add ms.
939
0435d061
AD
9402003-01-30 Akim Demaille <akim@epita.fr>
941
942 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
943
6029a57f
PH
9442003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
945
946 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
947 of $1.
0435d061
AD
948
949 Changes in response to error report by S. Eken: GLR mode does not
6029a57f
PH
950 handle negative $ indices or $ indices in embedded rules correctly.
951 See <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 952
6029a57f
PH
953 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
954 (b4_rhs_location): Ditto.
0435d061 955 (yyfill): New function to copy from stack tree into array
6029a57f 956 incrementally.
0435d061
AD
957 (yyuserAction): Modify to allow incremental move of semantic values
958 to rhs array when in GLR mode.
959 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
960 as needed.
961 Remove dummy use of yystack, as there is now a guaranteed use.
962 (yydoAction): Modify to allow incremental move of semantic values
963 to rhs array when in GLR mode.
964 (yyresolveAction): Ditto.
965 (yyglrShiftDefer): Update comment.
0435d061 966 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
967 (yyglrReduce): Ditto.
968 (yydoAction): Ditto
0435d061 969
6029a57f
PH
970 * tests/glr-regr1.at: Rename to ...
971 * tests/glr-regression.at: Add new regression test for the problems
972 described above (adapted from S. Eken).
973 Update copyright notice.
974 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
975 * tests/Makefile.am: Ditto.
976
6cee6297
PE
9772003-01-28 Paul Eggert <eggert@twinsun.com>
978
979 * data/lalr1.cc: Do not use @output_header_name@ unless
980 b4_defines_flag is set. This fixes two bugs reported by
981 Tim Van Holder in
982 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
983 and <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
984
b2a836b5
PE
9852003-01-21 Paul Eggert <eggert@twinsun.com>
986
987 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
988 we don't need to worry about yyerrlab1 being reported as an
989 "unused label" by non-GCC C compilers. The downside is that if
990 locations are used then a couple of statements are duplicated each
991 time YYERROR is invoked, but the upside is that the warnings
992 should vanish.
993 (yyerrlab1): Move code to YERROR.
994 (yyerrlab2): Remove. Change uses back to yyerrlab1.
995 This reverts some of the 2002-12-27 change.
996
4196b931
PE
9972003-01-17 Paul Eggert <eggert@twinsun.com>
998
999 * src/output.c (symbol_printers_output): Fix typo that led
1000 to core dump. Problem reported by Antonio Rus in
1001 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
1002
3ae831b4
AD
10032003-01-13 Akim Demaille <akim@epita.fr>,
1004 Quoc Peyrot <chojin@lrde.epita.fr>,
1005 Robert Anisko <anisko_r@lrde.epita.fr>
1006
1007 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
1008 when the stacks contain one element, as the loop would otherwise
1009 free the last state, and then use the top state (the one we just
1010 popped). This means that the initial elements will not be freed
1011 explicitly, as is the case in yacc.c; it is not a problem, as
1012 these elements have fake values.
1013
e3aa65c5
PE
10142003-01-11 Paul Eggert <eggert@twinsun.com>
1015
1016 * NEWS: %expect-violations are now just warnings, reverting
1017 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
1018 bootstrapping problem reported by Matthias Klose; see
1019 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
1020 * src/conflicts.c (conflicts_print): Likewise.
1021 * tests/conflicts.at (%expect not enough, %expect too much,
1022 %expect with reduce conflicts): Likewise.
1023 * doc/bison.texinfo (Expect Decl): Document this. Also mention
1024 that the warning is enabled if the number of conflicts changes
1025 (not necessarily increases).
1026
1027 * src/getargs.c (version): Update copyright year.
1028
f0057011
AD
10292003-01-09 Akim Demaille <akim@epita.fr>
1030
1031 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
1032
1ee6d2a0
PE
10332003-01-08 Paul Eggert <eggert@twinsun.com>
1034
1035 * Makefile.maint (WGETFLAGS):
1036 New macro, containing "-C off" to disable proxy caches.
1037 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
1038 (rel-check): Use $(WGET) instead of wget.
1039
d4fd77c4
PE
10402003-01-06 Paul Eggert <eggert@twinsun.com>
1041
1042 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
1043 the GLR paper of Scott, Johnstone and Hussain.
1044
464c6927
PE
10452003-01-04 Paul Eggert <eggert@twinsun.com>
1046
d600ee67
PE
1047 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
1048 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
1049 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
1050 (EXTRA_LIBRARIES): New var, for liby.a.
1051 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
1052 (EXTRA_SCRIPTS): New var, for yacc.
1053
464c6927
PE
1054 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
1055 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
1056 Problem reported by Nelson H. F. Beebe.
1057
10582003-01-03 Paul Eggert <eggert@twinsun.com>
1059
1060 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
1061 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1062 when compiling Bison 1.875's `bitset bset = obstack_alloc
1063 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
1064
1065 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
1066 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
1067 grow to a huge size with typical invocation.
d600ee67 1068
464c6927
PE
1069 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
1070 Use the pattern recommended by Autoconf 2.57, except also protect
1071 against double-definition.
1072 * src/system.h: Likewise.
1073 Portability issues reported by Nelson H. F. Beebe.
d600ee67 1074
464c6927
PE
1075 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
1076 All uses changed. Provide a definition in both C and C++.
1077 (yytrue, yyfalse): Define even if defined (__cplusplus).
1078
1079 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
1080 Reported by Nelson H. F. Beebe.
d600ee67 1081
464c6927
PE
1082 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
1083
0f42c7d5
PE
10842003-01-02 Paul Eggert <eggert@twinsun.com>
1085
1086 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
1087 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
1088 Bug reported by Nelson H. F. Beebe.
1089
dc546b0f
PE
10902003-01-01 Paul Eggert <eggert@twinsun.com>
1091
1092 * Version 1.875.
1093
2c09b6a7
PE
10942002-12-30 Paul Eggert <eggert@twinsun.com>
1095
1096 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
1097 Moved here from...
1098 (<INITIAL>","): Here. This causes stray "," to be treated
1099 more uniformly.
1100
dc546b0f 1101 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
1102 last brace in braced code when not in Yacc mode, for compatibility
1103 with Bison 1.35. This resurrects the 2001-12-15 patch to
1104 src/reader.c.
1105
1106 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
1107 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
1108
535c0f63
PE
11092002-12-28 Paul Eggert <eggert@twinsun.com>
1110
1111 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
1112 that of SYM's type. This fixes Debian bug 168069, reported by
1113 Thomas Olsson.
d600ee67 1114
963fcc17
PE
11152002-12-28 Paul Eggert <eggert@twinsun.com>
1116
1117 Version 1.75f.
1118
1119 Switch back to the Yacc style of conflict reports, undoing some
1120 of the 2002-07-30 change.
1121 * doc/bison.texinfo (Understanding): Use Yacc style for
1122 conflict reports. Also, use new way of locating rules.
1123 * src/conflicts.c (conflict_report):
1124 Renamed from conflict_report_yacc, removing the old
1125 'conflict_report'. Translate the entire conflict report at once,
1126 so that we don't assume that "," has the same interpretation in
1127 all languages.
1128 (conflicts_output): Use Yacc-style conflict report for each state,
1129 instead of our more-complicated style.
1130 (conflicts_print): Use Yacc-style conflict report, except print
1131 the input file name when not emulating Yacc.
1132 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
1133 Conflicted Reduction, %expect not enough, %expect too much,
1134 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
1135 * tests/existing.at (GNU Cim Grammar): Likewise.
1136 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
1137
1138 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
1139 fatal): Don't invoke fflush; it's not needed and it might even be
1140 harmful for stdout, as stdout might not be open.
1141 * src/reduce.c (reduce_print): Likewise.
1142
b1efe548
PE
11432002-12-27 Paul Eggert <eggert@twinsun.com>
1144
1145 Fix a bug where error locations were not being recorded correctly.
1146 This problem was originally reported by Paul Hilfinger in
e3aa65c5 1147 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
1148
1149 * data/yacc.c (yyparse): New local var yylerrsp, to record the
1150 top of the location stack's error locations.
1151 (yyerrlab): Set it. When discarding a token, push its location
1152 onto yylerrsp so that we don't lose track of the error's end.
1153 (yyerrlab1): Now is only the target of YYERROR, so that we can
1154 properly record the location of the action that failed. For GCC
1155 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
1156 GCC warning about yyerrlab1 being unused if YYERROR is unused.
1157 (yyerrlab2): New label, which yyerrlab now falls through to.
1158 Compute the error's location by applying YYLLOC_DEFAULT to
1159 the locations of all the symbols that went into the error.
1160 * doc/bison.texinfo (Location Default Action): Mention that
1161 YYLLOC_DEFAULT is also invoked for syntax errors.
1162 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1163 Error locations include the locations of all the tokens that were
1164 discarded, not just the last token.
d600ee67 1165
983c5c2c
PE
11662002-12-26 Paul Eggert <eggert@twinsun.com>
1167
b1efe548
PE
1168 * src/files.c: Include quote.h.
1169 (compute_output_file_names): Warn if we detect conflicting
1170 outputs to the same file. This should catch the misunderstanding
1171 exemplified by Debian Bug 165349, reported by Bruce Stephens..
1172
1173 * src/conflicts.c (conflicts_print): If the user specifies
1174 "%expect N", report an error if there are any reduce/reduce
1175 conflicts. This is what the manual says should happen.
1176 This fixes Debian bug 130890, reported by Anthony DeRobertis.
1177 * tests/conflicts.at (%expect with reduce conflicts): New test.
1178
983c5c2c
PE
1179 Don't use m4_include on relative file names, as it doesn't work as
1180 desired if there happens to be a file with that name under ".".
d600ee67 1181
983c5c2c
PE
1182 * m4sugar/version.m4: Remove; it was included but it wasn't used.
1183 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
1184 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
1185 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
1186 * src/output.c (output_skeleton): Use full path names when
1187 specifying a file to include; don't rely on include path, as
1188 it's unreliable when the working file contains a file with
1189 that name.
d600ee67 1190
983c5c2c
PE
11912002-12-25 Paul Eggert <eggert@twinsun.com>
1192
1193 Remove obsolete references to bison.simple and bison.hairy.
1194 Problem mentioned by Aubin Mahe in
e3aa65c5 1195 <http://mail.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
1196 * data/glr.c: Comment fix.
1197 * doc/bison.1: Remove references. Also, mention "yacc".
1198
1199 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
1200 with -g option.
1201
1202 * src/parse-gram.y (declaration): Use enum "report_states" rather
1203 than its numeric value 1.
1204
1205 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
1206 opening a new one. This fixes Debian bug 165349, reported by
1207 Bruce Stephens.
1208
23f2d9dc
PE
12092002-12-24 Paul Eggert <eggert@twinsun.com>
1210
1211 Version 1.75e.
1212
1213 * Makefile.maint (cvs-update): Don't assume that the shell
1214 supports $(...), as Solaris sh doesn't.
1215
1216 * src/parse-gram.y (lloc_default): Remove test for empty
1217 nonterminals at the end, since it didn't change the result.
1218
12192002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
1220
1221 If the user does not define YYSTYPE as a macro, Bison now declares it
1222 using typedef instead of defining it as a macro. POSIX requires this.
1223 For consistency, YYLTYPE is also declared instead of defined.
1224
1225 %union directives can now have a tag before the `{', e.g., the
1226 directive `%union foo {...}' now generates the C code
1227 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
1228 The default union tag is `YYSTYPE', for compatibility with Solaris 9
1229 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
1230 instead of `yyltype'.
1231
1232 `yystype' and `yyltype' are now obsolescent macros instead of being
1233 typedefs or tags; they are no longer documented and will be
1234 withdrawn in a future release.
1235
1236 * data/glr.c (b4_location_type): Remove.
1237 (YYSTYPE): Renamed from yystype.
1238 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
1239 (struct YYLTYPE): Renamed from struct yyltype.
1240 (YYLTYPE): Renamed from yyltype.
1241 (yyltype, yystype): New (and obsolescent) macros,
1242 for backward compatibility.
1243 * data/yacc.c: Likewise.
1244
1245 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
1246 does not specify a union tag. This is for compatibility with
1247 Solaris 9 yacc.
1248
1249 * src/parse-gram.y (add_param): 2nd arg is now char * not char
1250 const *, since it is now modified by stripping surrounding { }.
1251 (current_braced_code): Remove.
1252 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
1253 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
1254 trailing " {...}". Now of type <chars>.
1255 (grammar_declaration): Adjust to bundled tokens.
1256 (code_content): Remove; stripping is now done by add_param.
1257 (print_token_value): Print contents of bundled tokens.
1258 (token_name): New function.
1259
1260 * src/reader.h (braced_code, current_braced_code): Remove.
1261 (token_name): New decl.
1262
1263 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
1264 token_type, not braced_code code_kind. All uses changed.
1265 (SC_PRE_CODE): New state, for scanning after a keyword that
1266 has (or usually has) an immediately-following braced code.
1267 (token_type): New local var, to keep track of which token type
1268 to return when scanning braced code.
1269 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 1270 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
1271 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
1272 instead of returning a token type immediately.
1273 (<INITIAL>"{"): Set token type.
1274 (<SC_BRACED_CODE>"}"): Use it.
1275 (handle_action_dollar, handle_action_at): Now returns bool
1276 indicating success. Fail if ! current_rule; this prevents a core dump.
1277 (handle_symbol_code_dollar, handle_symbol_code_at):
1278 Remove; merge body into caller.
1279 (handle_dollar, handle_at): Complain in invalid contexts.
1280
1281 * NEWS, doc/bison.texinfo: Document the above.
1282 * NEWS: Fix years and program names in copyright notice.
1283
879ca4f8
PE
12842002-12-17 Paul Eggert <eggert@twinsun.com>
1285
1286 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
1287 Reporting, Table of Symbols): Omit mentions of %lex-param and
1288 %parse-param from the documentation for now.
1289
1c5fe69d
PE
12902002-12-15 Paul Eggert <eggert@twinsun.com>
1291
1292 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
1293 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
1294 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
1295 disagreed with the Bison documentation. Bug
1296 reported by Andrew Walrond.
d600ee67 1297
1c5fe69d
PE
1298 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
1299 as the caller now does that.
1300 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
1301 (YYEMPTY): Parenthesize right hand side, since others use it.
1302 (yyparse): Don't assume that our generated code is the only code
1303 that sets yychar.
1304
d1de5372
PE
13052002-12-13 Paul Eggert <eggert@twinsun.com>
1306
1307 Version 1.75d.
1308
1309 POSIX requires a "yacc" command.
1310 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
1311 (MOSTLYCLEANFILES): Add yacc.
1312 (yacc): New rule.
1c5fe69d 1313 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
1314 as an alias for bison y.
1315
1316 * po/LINGUAS: Add da.
d600ee67 1317
d1de5372
PE
1318 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
1319 problem with latest <getopt.h>.
1320 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
1321
1322 * doc/fdl.texi: Upgrade to 1.2.
1323 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
1324 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
1325 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
1326 gnulib.
1327 * config/install-sh: Sync with autotools.
1328
1329 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
e3aa65c5 1330 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
1331 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
1332 locations are requested.
1333 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
1334 locations are requested.
1335
d0f3fe23
PE
13362002-12-12 Paul Eggert <eggert@twinsun.com>
1337
1338 Remove unportable casts and storage allocation tricks.
1339 While we're at it, remove almost all casts, since they
1340 usually aren't needed and are a sign of trouble.
1341
1342 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
1343
1344 * src/derives.c (derives_compute): Do not subtract NTOKENS from
1345 the pointer DSET returned by malloc; this isn't portable.
1346 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
1347 Similarly for DERIVES.
1348 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
1349 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
1350 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
1351
1352 * src/derives.c (derives_compute): Do not bother invoking
1353 int_of_rule_number, since rule numbers are integers.
1354
1355 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
1356 rather than XMALLOC (char, N).
1357
1358 * src/files.c (filename_split): Rewrite to avoid cast.
1359
1360 * src/gram.h (symbol_number_as_item_number,
1361 item_number_as_symbol_number, rule_number_as_item_number,
1362 item_number_as_rule_number):
1363 Now inline functions rather than macros, to avoid casts.
1364 * src/state.h (state_number_as_int): Likewise.
1365 * src/tables.c (state_number_to_vector_number,
1366 symbol_number_to_vector_number): Likewise.
1367
1368 * src/gram.h (int_of_rule_number): Remove; no longer used.
1369
1370 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
1371 since the resulting storage is always stored into.
1372
1373 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
1374 where it's needed.
1375
1376 * src/muscle_tab.c (muscle_m4_output):
1377 Now inline. Return bool, not int.
1378 * src/state.c (state_compare): Likewise.
1379 * src/symtab.c (symbol_check_defined,
1380 symbol_check_alias_consistency, symbol_pack, symbol_translation,
1381 hash_compare_symbol, hash_symbol):
1382 Likewise.
1383 * src/uniqstr.c (uniqstr_print): Likewise.
1384 * src/muscle_tab.c (muscle_m4_output_processor):
1385 New function, to avoid casts.
1386 * src/state.c (state_comparator, stage_hasher): Likewise.
1387 * src/symtab.c (symbol_check_defined_processor,
1388 symbol_check_alias_consistency_processor, symbol_pack_processor,
1389 symbol_translation_processor, hash_symbol_comparator,
1390 hash_symbol_hasher): Likewise.
1391 * src/uniqstr.c (uniqstr_print_processor): Likewise.
1392 * src/muscle_tab.c (muscles_m4_output):
1393 Use new functions instead of casting old functions unportably.
1394 * src/state.c (state_hash_new): Likewise.
1395 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
1396 symbols_token_translations_init):
1397 Likewise.
1398 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
1399
1400 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
1401 var instead of casting to long, to avoid casts.
1402 (prepare_states): Use MALLOC rather than alloca, so that we don't
1403 have to worry about alloca.
1404 * src/state.c (state_hash_lookup): Likewise.
1405
1406 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
1407 local var instead of casting to unsigned char, to avoid casts.
1408
1409 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
1410 STATE_ALLOC): Remove.
1411 (transitions_new, errs_new, reductions_new, state_new): Use malloc
1412 rather than calloc, and use offsetof to avoid allocating slightly
1413 too much storage.
1414 (state_new): Initialize all members.
1415
1416 * src/state.c (state_hash): Use unsigned accumulator, not signed.
1417
1418 * src/symtab.c (symbol_free): Remove; unused.
1419 (symbol_get): Remove cast in lhs of assignment.
1420 (symbols_do): Now static. Accept generic arguments, not
1421 hashing-related ones.
1422
1423 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
1424 (symbol_processor): Remove.
1425 (symbols_do): Remove decl; now static.
1426
1427 * src/system.h (alloca): Remove; decl no longer needed.
1428 (<stddef.h>): Include, for offsetof.
1429 (<inttypes.>, <stdint.h>): Include if available.
1430 (uintptr_t): New type, if system lacks it.
1431 (CALLOC, MALLOC, REALLOC): New macros.
1432 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
1433 new macros.
1434
1435 * src/tables.c (table_size): Now int, to pacify GCC.
1436 (table_grow, table_ninf_remap): Use signed table size.
1437 (save_row): Don't bother initializing locals when not needed.
1438 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
1439 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
1440
1441 * src/vcg.h: Correct misspellings.
1442
1443 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
1444
1445
1446 * src/getargs.c (getargs): Don't assume EOF == -1.
1447
26b4a969
PE
14482002-12-09 Paul Eggert <eggert@twinsun.com>
1449
1450 Change identifier spellings to avoid collisions with names
1451 that are reserved by POSIX.
1452
1453 Don't use names ending in _t, since POSIX reserves them.
1454 For consistency, remove _e and _s endings -- they're weren't
1455 needed to remove ambiguity. All uses changed.
1456 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
1457 turn was just renamed from struniq_t.
1458 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
1459 which in turn was just renamed from struniq_processor_t.
1460 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
1461 in turn was renamed from hash_compare_struniq_t.
1462 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
1463 (state_list): Renamed from state_list_t.
1464 * src/assoc.h (assoc): Renamed from assoc_t.
1465 * src/conflicts.c (enum conflict_resolution): Renamed from
1466 enum conflict_resolution_e.
1467 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
1468 (rule_list): Renamed from rule_list_t.
1469 * src/getargs.h (enum trace): Renamed from enum trace_e.
1470 (enum report): Renamed from enum report_e.
1471 * src/gram.h (item_number): Renamed from item_number_t.
1472 (rule_number): Renamed from rule_number_t.
1473 (struct rule_s): Remove the "rule_s" part; not used.
1474 (rule): Renamed from rule_t.
1475 (rule_filter): Renamed from rule_filter_t.
1476 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
1477 (goto_list): Renamed from goto_list_t.
1478 * src/lalr.h (goto_number): Renamed from goto_number_t.
1479 * src/location.h (location): Renamed from location_t.
1480 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
1481 and moved here from:
1482 * src/muscle_tab.h (muscle_entry_t): here.
1483 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
1484 (rule_list): Renamed from rule_list_t.
1485 * src/print_graph.c (static_graph): Renamed from graph.
1486 * src/reader.h (braced_code): Renamed from braced_code_t.
1487 Remove brace_code_e tag.
1488 * src/relation.h (relation_node): Renamed from relation_node_t.
1489 (relation_nodes): Renamed from relation_nodes_t.
1490 (relation): Renamed from relation_t.
1491 * src/state.h (state_number): Renamed from state_number_t.
1492 (struct state): Renamed from struct state_s.
1493 (state): Renamed from state_t.
1494 (transitions): Renamed from transitions_t. Unused (and
1495 misspelled) transtion_s tag removed.
1496 (errs): Renamed from errs_t. Unused errs_s tag removed.
1497 (reductions): Renamed from reductions_t. Unused tag
1498 reductions_s removed.
1499 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
1500 (struct symbol_list): Renamed from struct symbol_list_s.
1501 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
1502 (struct symbol): Renamed from struct symbol_s.
1503 (symbol): Renamed from symbol_t.
1504 * src/tables.c (vector_number): Renamed from vector_number_t.
1505 (action_number): Renamed from action_t.
1506 * src/tables.h (base_number): Renamed from base_t.
1507 * src/vcg.h (enum color): Renamed from enum color_e.
1508 (enum textmode): Renamed from enum textmode_e.
1509 (enum shape): Renamed from enum shape_e.
1510 (struct colorentry): Renamed from struct colorentry_s.
1511 (struct classname): Renamed from struct classname_s.
1512 (struct infoname): Renamed from struct infoname_s.
1513 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
1514 (enum decision): Renamed from enum decision_e.
1515 (enum orientation): Renamed from enum orientation_e.
1516 (enum alignment): Renamed from enum alignment_e.
1517 (enum arrow_mode): Renamed from enum arrow_mode_e.
1518 (enum crossing_type): Renamed from enum crossing_type_e.
1519 (enum view): Renamed from enum view_e.
1520 (struct node): Renamed from struct node_s.
1521 (node): Renamed from node_t.
1522 (enum linestyle): Renamed from enum linestyle_e.
1523 (enum arrowstyle): Renamed from enum arrowstyle_e.
1524 (struct edge): Renamed from struct edge.
1525 (edge): Renamed from edge_t.
1526 (struct graph): Renamed from struct graph_s.
1527 (graph): Renamed from graph_t.
1528 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
1529 Rename value_t -> value.
1530 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
1531 value_t_as_yystype -> value_as_yystype.
1532
1533 Don't include <errno.h> in the mainstream code, since it
1534 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
1535 * lib/get-errno.c, lib/get-errno.h: New files.
1536 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
1537 get-errno.c.
1538 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
1539 * src/output.c (output_skeleton): Likewise.
1540 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
1541 instead of errno.
1542 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
1543 Likewise.
1544 (handle_action_dollar, handle_action_at): Likewise.
1545 * src/system.h: Do not include <errno.h>.
1546 (TAB_EXT): Renamed from EXT_TAB.
1547 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
1548
1549 Avoid str[a-z]*, since <string.h> reserves that name space.
1550 Change all instances of "struniq" in names to "uniqstr", and
1551 likewise for "STRUNIQ" and "UNIQSTR".
1552 * src/uniqstr.c: Renamed from src/struniq.c.
1553 * src/uniqstr.h: Renamed from src/struniq.h.
1554 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
1555 * src/files.c (strsuffix): Remove; unused.
1556 (concat2): Renamed from stringappend. Now static.
1557 * src/files.h (strsuffix, stringappend): Remove; unused.
1558 * src/parse-gram.y (<chars>): Renamed from <string>.
1559 (<uniqstr>): Renamed from <struniq>.
1560 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
1561 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
1562 (struct graph_s.expand): Renamed from struct graph_s.stretch.
1563 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
1564 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
1565 (N_EXPAND): Renamed from N_STRETCH.
1566
1567 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
1568 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
1569 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
1570 Remove; unused.
1571 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
1572 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
1573 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
1574 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
1575 (BASE_MAXIMUM): Renamed from BASE_MAX.
1576 (BASE_MINIMUM): Renamed from BASE_MIN.
1577 (ACTION_MAX): Remove; unused.
1578 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
1579 Unnecessary casts removed from above defines.
1580
1581
1582 Fix misspelling in names.
1583 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
1584 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
1585 G_NODE_ALIGNEMENT.
1586
1587
1588 * lib/timevar.c (timevar_report): Renamed from time_report,
1589 for consistency with other names.
1590 * lib/timevar.h (timevar_report): New decl.
1591 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
1592
1593
1594 Sort include-file uses.
1595
1596 Reorder all include files under src to be in the order "system.h".
1597 then the ../lib include files in angle brackets (alphabetized),
1598 then the . include files in double-quotes (alphabetized). Fix
1599 dependency breakages encountered in this process, as follows:
1600 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
1601 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
1602 * src/state.h: Include "symtab.h".
1603
996b1c7e
PE
16042002-12-08 Paul Eggert <eggert@twinsun.com>
1605
1606 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
1607 since this causes problems when __file__ contains character
1608 sequences like "@" that are treated specially by src/scan-skel.l.
1609 Instead, just use the file's basename. This fixes the bug
1610 reported by Martin Mokrejs in
e3aa65c5 1611 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 1612
e19c4e5d
PE
16132002-12-06 Paul Eggert <eggert@twinsun.com>
1614
1615 Add support for rules that do not have trailing semicolons, as
1616 POSIX requires. Improve the quality of locations in Bison
1617 diagnostics.
26b4a969 1618
e19c4e5d
PE
1619 * src/location.c: Include <quotearg.h>.
1620 (empty_location): Now const.
1621 (location_print): New function. Follow the recommendation of the
1622 GNU Coding Standards for locations that span file boundaries.
1623 * src/location.h: Do not include <quotearg.h>; no longer needed.
1624 (boundary): New type.
1625 (location_t): Use it. This allows locations to span file boundaries.
1626 All member uses changed: file -> start.file or end.file (as needed),
1627 first_line -> start.line, first_column -> start.column,
1628 last_line -> end.line, last_column -> end.column.
1629 (equal_boundaries): New function.
1630 (LOCATION_RESET, LOCATION_STEP): Remove.
1631 (LOCATION_PRINT): Remove. All callers changed to use location_print.
1632 (empty_location): Now const.
1633 (location_print): New decl.
1634 * src/parse-gram.y (lloc_default): New function, which handles
1635 empty locations more accurately.
1636 (YYLLOC_DEFAULT): Use it.
1637 (%token COLON): Remove.
1638 (%token ID_COLON): New token.
26b4a969 1639 (rules): Use it.
e19c4e5d
PE
1640 (declarations, rules): Remove trailing semicolon.
1641 (declaration, rules_or_grammar_declaration):
1642 Allow empty (";") declaration.
1643 (symbol_def): Remove empty actions; no longer needed.
1644 (rules_or_grammar_declaration): Remove trailing semicolon.
1645 (semi_colon.opt): Remove.
1646 * src/reader.h: Include location.h.
1647 (scanner_cursor): New decl.
1648 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
1649 rolling our own.
1650 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
1651 of *loc.
1652 (STEP): Remove. No longer needed, now that adjust_location does
1653 the work. All uses removed.
1654 (scanner_cursor): New var.
1655 (adjust_location): Renamed from extend_location. It now sets
1656 *loc and adjusts the scanner cursor. All uses changed.
1657 Don't bother testing for CR.
1658 (handle_syncline): Remove location arg; now updates scanner cursor.
1659 All callers changed.
1660 (unexpected_end_of_file): Now accepts start boundary of token or
1661 comment, not location. All callers changed. Update scanner cursor,
1662 not the location.
1663 (SC_AFTER_IDENTIFIER): New state.
1664 (context_state): Renamed from c_context. All uses changed.
1665 (id_loc, code_start, token_start): New local vars.
1666 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
1667 processing of Yacc white space and equivalents here.
1668 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
1669 instead of returning ID immediately, since we need to search for
1670 a subsequent colon.
1671 (<INITIAL>"'", "\""): Save token_start.
1672 (<INITIAL>"%{", "{", "%%"): Save code_start.
1673 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
1674 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
1675 BEGIN context_state at end, not INITIAL.
1676 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
1677 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
1678 Return correct token start.
1679 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
1680 the start of a character, string or multiline comment is found.
1681 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
1682 Reduction): Adjust reported locations to match the more-precise
1683 results now expected.
1684 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
1685 * tests/reduce.at (Useless Rules, Reduced Automaton,
1686 Underivable Rules): Likewise.
1687 * tests/regression.at (Invalid inputs): No longer `expecting ";"
1688 or "|"' now that so many other tokens are allowed by the new grammar.
1689
1690 * src/complain.h (current_file): Remove duplicate decl;
1691 current_file is now owned by files.h.
1692 * src/complain.c, src/scan-gram.l: Include files.h.
1693
16942002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 1695
e19c4e5d
PE
1696 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
1697 promotes to int; it might be unsigned int.
1698 * data/yacc.c (yy_reduce_print): Likewise.
1699
1700 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
1701 be #defined in the prologue, not in the Bison declarations.
1702 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 1703
b64755e3
PE
17042002-12-02 Paul Eggert <eggert@twinsun.com>
1705
1706 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
1707 * lib/strtoul.c: New file, from gnulib.
1708 This fixes a porting bug reported by Peter Klein in
e3aa65c5 1709 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 1710
6e746484
PE
17112002-11-30 Paul Eggert <eggert@twinsun.com>
1712
b64755e3
PE
1713 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
1714 and put only a forward declaration in the prologue. This is for
1715 consistency with the other scanner helper functions.
1716
6ba55592
PE
1717 Type clashes now generate warnings, not errors, since it
1718 appears that POSIX may allow some grammars with type clashes.
1719 * src/reader.c (grammar_current_rule_check): Warn about
1720 type clashes instead of complaining.
1721 * tests/input.at (Type Clashes): Expect warnings, not complaints.
1722
6e746484
PE
1723 Add Yacc library, since POSIX requires it.
1724 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
1725 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
1726 * lib/main.c, lib/yyerror.c: New files.
1727
1728 gram_error can be static; it need not be extern.
1729 * src/reader.h (gram_error): Remove decl.
1730 * src/parse-gram.y (gram_error): Now static. Add static decl.
1731 (print_token_value): Omit parameter names from forward decl,
1732 for consistency.
1733
88510f9c
PE
17342002-11-29 Paul Eggert <eggert@twinsun.com>
1735
6e746484
PE
1736 * doc/bison.texinfo: Emphasize that yylex and yyerror must
1737 be declared before being used. E.g., one should typically
1738 declare them in the prologue. Use GNU coding style in examples.
1739 Put "const" consistently after the type it modifies. Mention
1740 that C99 supports "inline". Mention that yyerror traditionally
1741 returns "int".
1742
88510f9c
PE
1743 %parse-param and %lex-param now take just one argument, the
1744 declaration; the argument name is deduced from the declaration.
1745
1746 * doc/bison.texinfo (Parser Function, Pure Calling, Error
1747 Reporting, Table of Symbols): Document this.
1748 * src/parse-gram.y (add_param): New function.
1749 (COMMA): Remove.
1750 (declaration): Implement new rule for %parse-param and %lex-param.
1751 * src/scan-gram.l: "," now elicits a warning, rather than being
1752 a token; this is more compatible with byacc.
1753 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
1754
bb92250c
PE
17552002-11-27 Paul Eggert <eggert@twinsun.com>
1756
1757 Rename identifiers to avoid real and potential collisions.
1758
1759 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
1760 to avoid collision with lex macro described by Bruce Lilly in
e3aa65c5 1761 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
1762 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
1763 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
1764 * src/parse-gram.y (print_token_value): Renamed from yyprint.
1765 All uses changed.
1766 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
1767 The name "yycontrol" violates the name space rules, and this stuff
1768 wasn't being used anyway.
1769 (input): Remove action; this stuff wasn't being used.
1770 (gram_error): Rename local variable yylloc -> loc.
1771 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
1772 (YY_DECL): Don't use "yy" at start of local variables.
1773 All uses changed, e.g., yylloc -> loc.
1774 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
1775 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
1776 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
1777 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
1778
1779 * src/parse-gram.y (gram_error): loc is now const *.
1780 * src/reader.h (gram_error): Likewise.
1781
3af4feb2
PE
17822002-11-24 Paul Eggert <eggert@twinsun.com>
1783
1784 Version 1.75c.
1785
1786 * tests/actions.at (Actions after errors): Use an output format
1787 more similar to that of the Printers and Destructors test.
1788 Test the position of the ';' token too.
1789 (Printers and Destructors): Likewise.
1790 (Printers and Destructors: %glr-parser): Remove for now, to avoid
1791 unnecessarily alarming people when the test fails.
1792
1793 * data/yacc.c (yyerrlab1): Move this label down, so that the
1794 parser does not discard the lookahead token if the user code
1795 invokes YYERROR. This change is required for POSIX conformance.
1796
1797 * lib/error.c: Sync with gnulib.
1798
17992002-11-22 Paul Eggert <eggert@twinsun.com>
1800
1801 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
1802 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
1803 * lib/xmalloc.c: Likewise.
26b4a969 1804
58004308
PE
18052002-11-20 Paul Eggert <eggert@twinsun.com>
1806
1807 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
1808
18092002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 1810
58004308
PE
1811 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
1812 should use `if (! x) abort ();' rather than `assert (x);', and
1813 anyway it's one less thing to worry about configuring.
1814
1815 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
1816 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
1817 and replace all instances of assert with abort.
1818 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
1819 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
1820
1821 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
1822 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
1823 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
1824 hash_find_entry, hash_rehash, hash_insert): Likewise.
1825 * src/conflicts.c (resolve_sr_conflict): Likewise.
1826 * src/lalr.c (set_goto_map, map_goto): Likewise.
1827 * src/nullable.c (nullable_compute): Likewise.
1828 * src/output.c (prepare_rules, token_definitions_output): Likewise.
1829 * src/reader.c (packgram, reader): Likewise.
1830 * src/state.c (state_new, state_free, state_transitions_set,
1831 state_reduction_find): Likewise.
1832 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
1833 symbol_pack): Likewise.
1834 * src/tables.c (conflict_row, pack_vector): Likewise.
1835 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
1836 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
1837 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
1838 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
1839
1840 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
1841 (ARGMATCH_CONSTRAINT): New macro.
1842 (ARGMATCH_ASSERT): Use it.
1843
1844 * src/system.h (verify): New macro.
1845 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
1846 rather than assert.
1847 * src/tables.c (tables_generate): Likewise.
1848
1849 * src/struniq.c (struniq_assert): Now returns void, and aborts
1850 if the assertion is false.
1851 (struniq_assert_p): Remove.
1852 * src/struniq.h: Likewise.
1853
76ae8198
PE
18542002-11-18 Paul Eggert <eggert@twinsun.com>
1855
1856 * data/glr.c (yygetLRActions): Replace `yyindex' with
1857 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
1858 This fixes the regression with Sun ONE Studio 7 cc that I reported in
e3aa65c5 1859 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 1860
d3c4e709
AD
18612002-11-18 Akim Demaille <akim@epita.fr>
1862
1863 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
1864 space.
1865 From Tim Van Holder.
1866
8d8a7238
PE
18672002-11-17 Paul Eggert <eggert@twinsun.com>
1868
1869 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
1870 to "SyntaxError" for consistency with my 2002-11-15 change.
1871
1872 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
1873 not define to {}, since this breaks the common use of `YYDPRINTF
1874 ((...));' if a single statement is desired (e.g. before `else').
1875 Work around GCC warnings by surrounding corresponding calls with
1876 {} if needed.
1877 (yyhasResolvedValue): Remove unused function.
1878 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
1879 loop body.
1880 (yyreportSyntaxError): Renamed from yyreportParseError.
1881 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
1882 All uses changed.
1883 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
1884 extern when possible. Remove unused initializations.
1885
b0937b22
AD
18862002-11-16 Akim Demaille <akim@epita.fr>
1887
1888 Augment the similarity between GLR and LALR traces.
1889
1890 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
1891 (YY_REDUCE_PRINT): New.
1892 (yyparse): Use them.
1893 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
1894 YYDPRINT here.
1895 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
1896 state reached after the reduction/recovery, since...
1897 (yyparse, yyprocessOneStack): Report the state we are entering in.
1898
c5e3e510
AD
18992002-11-16 Akim Demaille <akim@epita.fr>
1900
1901 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
1902 Add support for --trace=skeleton.
1903 * src/scan-skel.l: %option debug.
1904 Scan strings of non-@ or \n instead of character by character.
1905 (scan_skel): Handle trace_skeleton.
1906 (QPUTS): New.
1907 (@output_parser_name@, @output_header_name@): ``Restore'' their
1908 support (used to be M4 macros).
1909 * data/yacc.c: Quote larger chunks, a la glr.c.
1910 * data/lalr1.cc: Likewise.
1911 The header guards are no longer available, so use some other
1912 string than `YYLSP_NEEDED'.
1913
4c6cc1db
AD
19142002-11-16 Akim Demaille <akim@epita.fr>
1915
1916 Make the ``Printers and Destructors'' test more verbose, taking
1917 `yacc.c''s behavior as (possibly wrong) reference.
1918
1919 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
1920 instead of fprint on stdout.
1921 Set and report the last_line of the symbols.
1922 Consistently display values and locations.
1923
6d9e8019
PE
19242002-11-16 Paul Eggert <eggert@twinsun.com>
1925
1926 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
1927
6e649e65
PE
19282002-11-15 Paul Eggert <eggert@twinsun.com>
1929
b25d88f6
PE
1930 * tests/actions.at (Actions after errors): New test case.
1931
6e649e65
PE
1932 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
1933 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
1934 tests/action.at, tests/calc.at, tests/conflicts.at,
1935 tests/cxx-type.at, tests/regression.at:
1936 "parse error" -> "syntax error" for POSIX compatibility.
1937 "parsing stack overflow..." -> "parser stack overflow" so
1938 that code matches Bison documentation.
1939
0f39aab9
AD
19402002-11-15 Akim Demaille <akim@epita.fr>
1941
1942 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
1943 take two BRACED_CODE, not two string_content.
1944 Free the scanner's obstack when we are done.
1945 (code_content): New.
1946 * tests/calc.at: Adjust.
1947 * doc/bison.texinfo: Adjust.
1948 Also, make sure to include the `,' for these declarations.
1949
761c1926
AD
19502002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
1951
1952 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
1953 definition; avoids potential autoreconf problems.
1954
b0f98b10
AD
19552002-11-15 Akim Demaille <akim@epita.fr>
1956
1957 Always check the value returned by yyparse.
1958
1959 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
1960 returned by yyparse.
1961 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
1962 Adjust calls.
1963 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
1964 returned by yyparse.
1965
970785f1
PH
19662002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1967
1968 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
1969 on input.at test.
1970
8fcc7db1
PE
19712002-11-14 Paul Eggert <eggert@twinsun.com>
1972
7ec1b48e
PE
1973 * src/output.c (output_skeleton): Call xfopen instead of
1974 duplicating xfopen's body.
1975
cfff7583 1976 Fix bugs reported by Nelson H. F. Beebe in
e3aa65c5 1977 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 1978
8fcc7db1
PE
1979 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
1980 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
1981 Group compiler. Instead, use "$CC -E bar.c". Include the .h
1982 file twice in the grammar, as an extra check.
1983
1984 * tests/input.at (Torturing the Scanner): Surround the
1985 backslash-newline tests with "#if 0", to make it less likely that
1986 we'll run into compiler bugs. Bring back solitary \ inside
1987 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 1988 test backslash-newline in C character constant.
8fcc7db1 1989
4e8d992c
AD
19902002-11-14 Akim Demaille <akim@epita.fr>
1991
1992 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
1993 status of the compiler.
f32b346d 1994 Calling `exit 1' is no longer needed.
4e8d992c
AD
1995 Reported by Nelson H. F. Beebe.
1996
9501dc6e
AD
19972002-11-14 Akim Demaille <akim@epita.fr>
1998
1999 * tests/atlocal.in (CPPFLAGS): We have config.h.
2000 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
2001 New.
2002 * tests/actions.at, tests/calc.at, tests/conflicts.at,
2003 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
2004 * tests/regression.at, tests/torture.at: Use them for all the
2005 grammars that are to be compiled.
2006 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
2007 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
2008 * doc/bison.texinfo (GLR Parsers): Document `inline'.
2009
18b519c0
AD
20102002-11-14 Akim Demaille <akim@epita.fr>
2011
2012 * doc/bison.texinfo: Various formatting changes (alignments in
2013 samples, additional @group/@end group, GCS in samples.
2014 Use @deffn instead of simple @table to define the directives,
2015 macros, variables etc.
2016
9a86cdb9
PE
20172002-11-13 Paul Eggert <eggert@twinsun.com>
2018
daa33def 2019 Fix some bugs reported by Albert Chin-A-Young in
e3aa65c5 2020 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 2021
daa33def 2022 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 2023 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
2024 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2025 * tests/headers.at (export YYLTYPE): Likewise.
2026
2027 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 2028 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 2029
9a86cdb9
PE
2030 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
2031 comments, since they're not portable. Use GNU coding style.
2032
9c1e26bd
AD
20332002-11-13 Akim Demaille <akim@epita.fr>
2034
2035 * data/yacc.c: Leave bigger chunks of quoted text.
2036 (YYDSYMPRINTF): New.
2037 Use it to report symbol activities.
2038 * data/glr.c (YYDSYMPRINTF): New.
2039 Use it.
2040
87f721cc
PE
20412002-11-12 Paul Eggert <eggert@twinsun.com>
2042
2043 Version 1.75b.
2044
2045 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
2046 (yyglrReduce): Return yyok, not 0.
2047 This should avoid the enumerated-type warnings reported
464c6927 2048 by Nelson H. F. Beebe in
e3aa65c5 2049 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
2050
2051 * lib/bbitset.h (BITSET_INLINE): Remove.
2052 * lib/bitset.h [! BITSET_INLINE]: Remove.
2053 (bitset_set, bitset_reset, bitset_test): Rename local vars
2054 to avoid shadowing warnings by GCC.
2055
2056 * data/glr.c (inline): Remove #define. It's the user's
2057 responsibility to #define it away, just like 'const'.
464c6927 2058 This fixes one of the bugs reported by Nelson H. F. Beebe in
e3aa65c5 2059 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 2060
87f721cc
PE
2061 * Makefile.maint (po-check): Scan .l and .y files instead of the
2062 .c and the .h files that they generate. This fixes the bug
2063 reported by Tim Van Holder in:
e3aa65c5 2064 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
2065 Look for N_ as well as for _. Try to avoid matching #define for
2066 N_ and _.
2067 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
2068 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
2069 * src/scan-gram.l: Revamp regular expressions so that " and '
2070 do not confuse xgettext.
2071
2072 * src/struniq.h (struniq_new): Do not declare the return type
2073 to be 'const'; this violates the C standard.
2074 * src/struniq.c (struniq_new): Likewise.
2075
be14ade5
AD
20762002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
2077
2078 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
2079 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
2080 linker.
2081
05291fbc
AD
20822002-11-12 Akim Demaille <akim@epita.fr>
2083
2084 * Makefile.maint: Sync with Autoconf:
2085 (local_updates): New.
2086
1f5fd52e
AD
20872002-11-12 Akim Demaille <akim@epita.fr>
2088
2089 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
2090
283f1e64
AD
20912002-11-12 Akim Demaille <akim@epita.fr>
2092
2093 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
2094 locations.
2095
886b69d1
AD
20962002-11-12 Akim Demaille <akim@epita.fr>
2097
2098 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
2099 not yyvalue.
2100
3df37415
AD
21012002-11-12 Akim Demaille <akim@epita.fr>
2102
2103 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
2104 Use it to test the GLR parser.
2105
7bd6c77e
AD
21062002-11-12 Akim Demaille <akim@epita.fr>
2107
2108 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
2109 defines it.
2110 * data/glr.c (yystos): New.
2111 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
2112 (YYDSYMPRINT): New.
2113 (yyval): Don't define it, it is handled via M4.
2114 (yyrecoverParseError): Free verbosely the discarded symbols.
2115 * data/yacc.c (yysymprint): Remove, rather...
2116 (b4_yysymprint_generate): invoke.
2117 * data/c.m4 (b4_yysymprint_generate): New.
2118 Accept pointers as arguments, as opposed to the version from
2119 yacc.c.
2120 (b4_yydestruct_generate): Likewise.
2121 * tests/cations.at (Printers and Destructors): Use Bison directives
2122 instead of CPP macros.
2123 Don't rely on internal details.
2124
b0400cc6
AD
21252002-11-12 Akim Demaille <akim@epita.fr>
2126
2127 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
2128 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
2129 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
2130 it against YYEMPTY and so forth), work on yytoken (i.e., set
2131 it to YYEMPTY etc.).
2132 (yydestruct): Replace with a b4_yydestruct_generate invocation.
2133 (b4_symbol_actions): Remove.
2134 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
2135 for 0, end-of-input.
2136
72f889cc
AD
21372002-11-12 Akim Demaille <akim@epita.fr>
2138
2139 * doc/bison.texinfo (Destructor Decl): New.
2140
b1ae9233
AD
21412002-11-12 Akim Demaille <akim@epita.fr>
2142
2143 * src/tables.c (tables_generate): Use free for pointers that
2144 cannot be NULL, not XFREE.
2145 (pack_vector): Use assert, not fatal, for bound violations.
2146 * src/state.c (state_new): Likewise.
2147 * src/reader.c (reader): Likewise.
2148 * src/lalr.c (set_goto_map): Likewise.
72f889cc 2149 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
2150 the file name.
2151
7ec2d4cd
AD
21522002-11-12 Akim Demaille <akim@epita.fr>
2153
2154 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
2155 Restore.
2156 * src/scan-gram.l (last_string): Is global to the file, not to
2157 yylex.
2158 * src/parse-gram.y (input): Don't append the epilogue here,
2159 (epilogue.opt): do it here, and free the scanner's obstack.
2160 * src/reader.c (epilogue_set): Rename as...
2161 (epilogue_augment): this.
2162 * data/c.m4 (b4_epilogue): Defaults to empty.
2163
573a6cd3
AD
21642002-11-12 Akim Demaille <akim@epita.fr>
2165
2166 * src/getargs.c (long_options): Remove duplicates.
2167 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
2168 Remove.
2169 * doc/bison.rnh: Remove.
2170 * doc/bison.texinfo (VMS Invocation): Remove.
2171
95612cfa
AD
21722002-11-12 Akim Demaille <akim@epita.fr>
2173
2174 * src/struniq.h, src/struniq.c (struniq_t): Is const.
2175 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
2176
2177 Use struniq for symbols.
2178
2179 * src/symtab.h (symbol_t): The tag member is a struniq.
2180 (symbol_type_set): Adjust.
2181 * src/symtab.c (symbol_new): Takes a struniq.
2182 (symbol_free): Don't free the tag member.
2183 (hash_compare_symbol_t, hash_symbol_t): Rename as...
2184 (hash_compare_symbol, hash_symbol): these.
2185 Use the fact that tags as struniqs.
2186 (symbol_get): Use struniq_new.
2187 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
2188 Returns a strniq.
2189 * src/reader.h (merger_list, grammar_currentmerge_set): The name
2190 and type members are struniqs.
2191 * src/reader.c (get_merge_function)
2192 (grammar_current_rule_merge_set): Adjust.
2193 (TYPE, current_type): Are struniq.
2194
2195 Use struniq for file names.
2196
2197 * src/files.h, src/files.c (infile): Split into...
2198 (grammar_file, current_file): these.
2199 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
2200 * src/reduce.c (reduce_print): Likewise.
2201 * src/getargs.c (getargs): Likewise.
2202 * src/complain.h, src/complain.c: Likewise.
2203 * src/main.c (main): Call struniqs_new early enough to use it for
2204 file names.
2205 Don't free the input file name.
2206
3e6656f9
AD
22072002-11-12 Akim Demaille <akim@epita.fr>
2208
2209 * src/symtab.c (symbol_free): Remove dead deactivated code:
2210 type_name are properly removed.
2211 Don't use XFREE to free items that cannot be NULL.
2212 * src/struniq.h, src/struniq.c: New.
2213 * src/main.c (main): Initialize/free struniqs.
2214 * src/parse-gram.y (%union): Add astruniq member.
2215 (yyprint): Adjust.
2216 * src/scan-gram.l (<{tag}>): Return a struniq.
2217 Free the obstack bit that used to store it.
2218 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
2219
7672019c
PE
22202002-11-11 Paul Eggert <eggert@twinsun.com>
2221
2222 Revamp to fix many (but not all) of the C- and M4-related quoting
2223 problems. Among other things, this fixes the Bison bug reported
2224 by Jan Hubicka when processing the Bash grammar; see:
e3aa65c5 2225 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
2226
2227 Use new @ escapes consistently. Represent brackets with @{ and @}
2228 rather than @<:@ and @:>@, since this works a bit better with dumb
2229 editors like vi. Represent @ with @@, since @ is now consistently
2230 an escape. Use @oline@ and @ofile@ rather than __oline__ and
2231 __ofile__, to avoid unexpected expansions. Similarly, use @output
2232 rather than #output.
2233
2234 * data/c.m4 (b4_copyright): Omit file name from comment, since
2235 the file name could contain "*/".
2236 (b4_synclines_flag): Don't quote the 2nd argument; it should already
2237 be quoted. All uses changed.
2238
2239 * data/glr.c: Use new @ escapes consistently.
2240 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
2241 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
2242 Remove, since they couldn't handle arbitrary characters in file
2243 names.
2244 * data/lalr1.cc: Likewise.
2245 * data/yacc.c: Likewise.
2246
2247 * src/files.c (output_infix): Remove; all uses removed.
2248 * src/files.h: Likewise.
2249
2250 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
2251 mishandled funny characters in file names, and anyway it isn't
2252 needed any more.
2253 * data/yacc.c: Likewise.
2254 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
2255
2256 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
2257 * data/yacc.c: Likewise.
2258
2259 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
2260 strings now.
2261 (muscle_init): Quote filename as a C string.
2262 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
2263 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
2264 * src/output.c (escaped_file_name_output): New function.
2265 (prepare_symbols): Quote tokens for M4.
2266 (prepare): Don't insert output_infix, output_prefix,
2267 output_parser_name, output_header_name; this is now down by scan-skel.
2268 Insert skeleton as a C string.
2269
2270 * src/output.c (user_actions_output, symbol_destructors_output,
2271 symbol_printers_output): Quote filenames for C and M4.
2272 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2273
2274 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
2275 escapes other than \\ and \'; this simplifies the code.
2276 (<SC_STRING>): Likewise, for \\ and \".
2277 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
2278 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
2279 Use new escapes @{ and @} for [ and ].
2280
2281 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
2282 them with auto vars.
2283 Switch to new escape scheme, where @ is the escape character uniformly.
2284 Abort if a stray escape character is found. Avoid unbounded input
2285 buffer when parsing non-escaped text.
2286
2287 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
2288 __oline__, #output, $@, and @{ do not have unintended meanings.
2289
acea4f3b
PE
22902002-11-09 Paul Eggert <eggert@twinsun.com>
2291
2292 Fix the test failure due to GCC warnings described in
e3aa65c5 2293 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
2294 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
2295 evaluate to 0 if it's impossible for NINF to be in the respective
2296 table.
2297 (yygetLRActions, yyrecoverParseError): Use them.
2298
2299 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
2300 counted in the token inserted at end of file. Now takes
2301 location_t *, not location_t, so that the location can be
2302 adjusted. All uses changed.
2303
2304 * tests/regression.at (Invalid inputs): Adjust wording in
2305 diagnostic to match the new behavior.
2306
2307 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
2308 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
2309 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
2310 abort ();'. This reduces the runtime of the "Many lookaheads"
2311 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
2312 GCC 3.2.
2313
20ef1ad5
PE
23142002-11-07 Paul Eggert <eggert@twinsun.com>
2315
2316 * src/parse-gram.y (CHARACTER): Remove unused token.
2317 All uses removed.
2318
2319 * src/scan-gram.l: Remove stack option. We no longer use the
2320 stack, since the stack was never deeper than 1; instead, use the
2321 new auto var c_context to record the stacked value.
2322
2323 Remove nounput option. At an unexpected end of file, we now unput
2324 the minimal input necessary to end cleanly; this simplifies the
2325 code.
2326
2327 Avoid unbounded token sizes where this is easy.
2328
2329 (unexpected_end_of_file): New function.
2330 Use it to systematize the error message on unexpected EOF.
2331 (last-string): Now auto, not static.
2332 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
2333 (scanner_last_string_free): Remove; not used.
2334 (percent_percent_count): Move decl to just before use.
2335 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
2336 not the (never otherwised-used) CHARACTER.
2337
93724f13
AD
23382002-11-07 Akim Demaille <akim@epita.fr>
2339
2340 Let yyerror always receive the msg as last argument, so that
2341 yyerror can be variadic.
2342
2343 * data/yacc.c (b4_yyerror_args): New.
2344 Use it when calling yyerror.
2345 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
2346 Use it when calling yyerror.
2347 * doc/bison.texinfo (Error Reporting): Adjust.
2348 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
2349 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
2350
6e40b4eb
AD
23512002-11-06 Akim Demaille <akim@epita.fr>
2352
2353 #line should have quoted strings.
2354 Ideally, this should be done by m4_quotearg.
2355
2356 * src/scan-skel.l: Include quotearg.h.
2357 Quote __ofile__.
2358 * src/output.c (symbol_printers_output)
2359 (symbol_destructors_output): Quote the file name.
2360
2dfbfc12
AD
23612002-11-06 Akim Demaille <akim@epita.fr>
2362
2363 * tests/regression.at (Invalid inputs): Adjust to the recent
2364 messages.
2365
437c2d80
AD
23662002-11-06 Akim Demaille <akim@epita.fr>
2367
2368 Restore --no-lines.
2369 Reported by Jim Kent.
2370
2371 * data/c.m4 (b4_syncline): New.
2372 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
2373 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
2374 * src/output.c (user_actions_output): Likewise.
2375 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 2376 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 2377
900c5db5
AD
23782002-11-06 Akim Demaille <akim@epita.fr>
2379
2380 * src/main.c (main): Free `infile'.
2381 * src/scan-gram.l (handle_syncline): New.
2382 Recognize `#line'.
2383 * src/output.c (user_actions_output, symbol_destructors_output)
2384 (symbol_printers_output): Use the location's file name, not
2385 infile.
2386 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2387
e183b123 23882002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 2389
e183b123 2390 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 2391 either has GLR conflict entries.
e183b123 2392
193eb6b7
PE
23932002-11-05 Paul Eggert <eggert@twinsun.com>
2394
e183b123
PE
2395 * src/scan-gram.l: Use more accurate diagnostics, e.g.
2396 "integer out of range" rather than "invalid value".
2397 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
2398 accordingly.
2399
193eb6b7
PE
2400 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
2401 Also, remove one static variable in the scanner.
2402
2403 * src/scan-gram.l (braces_level): Now auto, not static.
2404 Initialize to zero if the compiler is being picky.
2405 (INITIAL): Clear braces_level instead of incrementing it.
2406 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
2407 as POSIX 1003.1-2001 requires.
2408 * src/system.h (IF_LINT): New macro, taken from coreutils.
2409 * configure.ac: Define "lint" if --enable-gcc-warnings.
2410
29c01725
AD
24112002-11-05 Akim Demaille <akim@epita.fr>
2412
2413 * src/scan-gram.l: When it starts with `%', complain about the
2414 whole directive, not just that `invalid character: %'.
2415
8aeac3ca
AD
24162002-11-04 Akim Demaille <akim@epita.fr>
2417
2418 * Makefile.maint: Update from Autoconf.
2419 (update, cvs-update, po-update, do-po-update): New.
2420
793a58bb
AD
24212002-11-04 Akim Demaille <akim@epita.fr>
2422
2423 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
2424 and yyerror.
2425 Have yyerror `use' its arguments.
2426 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
2427 returns true when location & yacc & pure & parse-param.
2428 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
2429
c4d720cd
AD
24302002-11-04 Akim Demaille <akim@epita.fr>
2431
2432 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
2433 clashes.
2434 * src/scan-gram.l: Use [\'] instead of ['] to pacify
2435 font-lock-mode.
2436 Use complain_at.
2437 Use quote, not quote_n since LOCATION_PRINT no longer uses the
2438 slot 0.
2439
613a0dc5
PE
24402002-11-03 Paul Eggert <eggert@twinsun.com>
2441
2442 * src/reader.c (get_merge_function, grammar_current_rule_check):
2443 Use consistent diagnostics for reporting type name clashes.
2444 Quote the types with <>, for consistency with Yacc.
2445 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
2446
2a8d363a
AD
24472002-11-03 Akim Demaille <akim@epita.fr>
2448
2449 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
2450 New.
2451 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
2452 (b4_parse_param): Remove.
2453 Use b4_identification.
2454 Propagate b4_pure_args where needed to pass them to yyerror.
2455 * data/glr.m4 (b4_parse_param): Remove.
2456 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
2457 (b4_lpure_formals): New.
2458 Use b4_identification.
2459 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
2460 b4_user_formals and b4_user_args.
2461 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
2462 (yyreportAmbiguity): When using a pure parser, also need
2463 the location, and the parse-params.
2464 Adjust callers.
2465 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
2466 When using a pure parser, also need the parse-params.
2467 Adjust callers.
2468 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
2469 (%pure-parser + %parse-param) LALR and GLR parsers.
2470 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
2471 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
2472 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
2473 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
2474 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
2475 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
2476 * doc/bison.texinfo: Untabify the whole file.
2477 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
2478 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
2479 (Error Reporting): Adjust to these new directives.
2480 Document %error-verbose, deprecate YYERROR_VERBOSE.
2481
9e32add8
AD
24822002-11-03 Akim Demaille <akim@epita.fr>
2483
2484 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
2485 AT_CHECK_CALC_GLR invocations to use % directives, instead of
2486 command line options.
2487 * tests/cxx-type.at: Formatting changes.
2488
b02d90a5
PE
24892002-11-03 Paul Eggert <eggert@twinsun.com>
2490
2491 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
2492 to count columns correctly, and to check for invalid inputs.
9e32add8 2493
b02d90a5
PE
2494 Use mbsnwidth to count columns correctly. Account for tabs, too.
2495 Include mbswidth.h.
2496 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
2497 (extend_location): New function.
2498 (YY_LINES): Remove.
2499
2500 Handle CRLF in C code rather than in Lex code.
2501 (YY_INPUT): New macro.
2502 (no_cr_read): New function.
2503
2504 Scan UCNs, even though we don't fully handle them yet.
2505 (convert_ucn_to_byte): New function.
2506
2507 Handle backslash-newline correctly in C code.
2508 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
2509 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
2510 all uses changed.
2511 (tag, splice): New EREs. Do not allow NUL or newline in tags.
2512 Use {splice} wherever C allows backslash-newline.
2513 YY_STEP after space, newline, vertical-tab.
2514 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 2515
b02d90a5
PE
2516 (letter, id): Don't assume ASCII; e.g., spell out a-z.
2517
2518 ({int}, handle_action_dollar, handle_action_at): Check for integer
2519 overflow.
9e32add8 2520
b02d90a5
PE
2521 (YY_STEP): Omit trailing semicolon, so that it's more like C.
2522
2523 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
2524 as well as \000. Check for UCHAR_MAX, not 255.
2525 Allow \x with an arbitrary positive number of digits, as in C.
2526 Check for overflow here.
2527 Allow \? and UCNs, for compatibility with C.
2528
2529 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
2530 with quote slot used by complain_at.
2531
2532 * tests/input.at: Add tests for backslash-newline, m4 quotes
2533 in symbols, long literals, and funny escapes in strings.
2534
2535 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
2536 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
2537 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
2538 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
2539 * m4/mbswidth.m4: New file, from GNU coreutils.
2540
2541 * doc/bison.texinfo (Grammar Outline): Document // comments.
2542 (Symbols): Document that trigraphs have no special meaning in Bison,
2543 nor is backslash-newline allowed.
2544 (Actions): Document that trigraphs have no special meaning.
2545
2546 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
2547 no longer used.
2548
25492002-11-02 Paul Eggert <eggert@twinsun.com>
2550
2551 * src/reader.c: Don't include quote.h; not needed.
2552 (get_merge_function): Reword warning to be consistent with
2553 type clash diagnostic in grammar_current_rule_check.
2554
2555 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
2556 bug in trigraph handling.
2557
2558 * src/output.c (prepare_symbols): When printing token names,
2559 escape "[" as "@<:@" and likewise for "]".
2560
2561 * src/system.h (errno): Remove declaration, as we are now
2562 assuming C89 or better, and C89 guarantees errno.
2563
762b212b
PE
25642002-10-30 Paul Eggert <eggert@twinsun.com>
2565
2566 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
2567 Check for close failures.
2568 * src/files.h (xfclose): Return void, not int, since it always
2569 returned zero.
2570 * src/files.c (xfclose): Likewise. Report I/O error if ferror
2571 indicates one.
2572 * src/output.c (output_skeleton): Use xfclose rather than fclose
2573 and ferror. xfclose now checks ferror.
2574
2575 * data/glr.c (YYLEFTMOST_STATE): Remove.
2576 (yyreportTree): Use a stack-based leftmost state. This avoids
2577 our continuing battles with bogus warnings about initializers.
2578
56100c60
AD
25792002-10-30 Akim Demaille <akim@epita.fr>
2580
2581 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
2582 #if.
2583
51b4a04c
PH
25842002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2585
2586 * tests/glr-regr1.at: New test for reported regressions.
2587 * tests/testsuite.at: Add glr-regr1.at test.
2588 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 2589
bf1ebda2
PE
25902002-10-24 Paul Eggert <eggert@twinsun.com>
2591
5c16c6b1
PE
2592 Version 1.75a.
2593
bf1ebda2
PE
2594 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
2595 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
2596 we use malloc. Don't assume 'A' through 'Z' are contiguous.
2597 Don't assume strdup exists; POSIX says its an XSI extension.
2598 Check for buffer overflow on input.
2599
b526ee61
AD
26002002-10-24 Akim Demaille <akim@epita.fr>
2601
2602 * src/output.c (output_skeleton): Don't disable M4sugar comments
2603 too soon: it results in comments being expanded.
2604 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
2605 first output.
2606
f1886bb2
AD
26072002-10-24 Akim Demaille <akim@epita.fr>
2608
2609 * data/yacc.c (m4_int_type): New.
2610 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
2611 char' as only yacc.c wants K&R portability.
2612 * data/glr.c (yysigned_char): Remove.
2613 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
2614 Reported by Quoc Peyrot.
2615
c5576256
PE
26162002-10-23 Paul Eggert <eggert@twinsun.com>
2617
2618 * src/main.c (main): With --trace=time, report times even if a
2619 non-fatal error occurs. Formerly, the times were reported in some
2620 such cases but not in others.
2621 * src/reader.c (reader): Just return if a complaint has been issued,
2622 instead of exiting, so that 'main' can report times.
2623
27b0ffea
AD
26242002-10-22 Akim Demaille <akim@epita.fr>
2625
2626 * src/system.h: Include sys/types.
2627 Reported by Bert Deknuydt.
2628
223a7883
PE
26292002-10-23 Paul Eggert <eggert@twinsun.com>
2630
2631 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
2632 Suggested by Art Haas.
2633
26342002-10-22 Paul Eggert <eggert@twinsun.com>
2635
2636 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
2637 decl; not needed any more.
2638 * src/main.c (main): Use return to exit, undoing yesterday's change.
2639 The last OS that we could find where this wouldn't work is
2640 SunOS 3.5, and that's too old to worry about now.
2641
2642 * data/glr.c (struct yyltype): Define members even when not
2643 doing locations. This is more consistent with yacc.c, and it
2644 works around the following bug reports:
e3aa65c5
PE
2645 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
2646 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 2647
223a7883
PE
2648 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
2649 @acronym consistently. Standardize on "Yacc" instead of "YACC",
2650 "Algol" instead of "ALGOL". Give a bit more history about BNF.
2651
8b76775a
AD
26522002-10-22 Akim Demaille <akim@epita.fr>
2653
2654 * data/README: New.
2655
6db10d14
PE
26562002-10-21 Paul Eggert <eggert@twinsun.com>
2657
2658 Be consistent about 'bool'; the old code used an enum in one
2659 module and an int in another, and this violates the C standard.
2660 * m4/stdbool.m4: New file, from coreutils 4.5.3.
2661 * configure.ac (AC_HEADER_STDBOOL): Add.
2662 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
2663 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
2664 * src/symtab.c (hash_compare_symbol_t): Likewise.
2665 * src/system.h (bool, false, true): Use a definition consistent
2666 with ../lib/hash.c. All uses changed.
2667
2668 * src/complain.c (warning_issued): Renamed from warn_message_count,
2669 so that we needn't worry about integer overflow (!).
2670 Now of type bool. All uses changed.
2671 (complaint_issued): Renamed from complain_message_count; likewise.
2672
2673 * src/main.c (main): Use exit to exit with failure.
27b0ffea 2674
6db10d14
PE
2675 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
2676 rather than 1 and 0.
2677 * src/main.c (main): Likewise.
2678 * src/getargs.c (getargs): Likewise.
2679 * src/reader.c (reader): Likewise.
2680
2681 * src/getarg.c (getargs): Remove duplicate code for
2682 "Try `bison --help'".
2683
2684 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
2685 What was that "2" for?
2686
2687 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
2688 * src/getargs.c (usage): Likewise.
2689
2690 * src/getargs.c (getargs): When there are too few operands, report
2691 the last one. When there are too many, report the first extra
2692 one. This is how diffutils does it.
2693
92a060fd
PE
26942002-10-20 Paul Eggert <eggert@twinsun.com>
2695
2696 Remove K&R vestiges.
2697 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
2698 * src/complain.c (VA_START): Remove. Assume prototypes.
2699 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
2700 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
2701 fatal): Assume prototypes.
2702 * src/complain.h: Assume prototypes.
2703 * src/system.h (PARAMS): Remove.
2704 Include <limits.h> unconditionally, since it's guaranteeed even
2705 for a freestanding C89 compiler.
2706 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
2707 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 2708
e7cb57c0
AD
27092002-10-20 Akim Demaille <akim@epita.fr>
2710
2711 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
2712 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
2713 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
2714 (yyresolveStates, yyresolveAction, yyresolveStack)
2715 (yyprocessOneStack): Use them.
2716 (yy_reduce_print): New.
2717 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
2718
0245f82d
AD
27192002-10-20 Akim Demaille <akim@epita.fr>
2720
2721 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
2722 arguments and output `void'.
2723 (b4_c_function): Rename as...
2724 (b4_c_function_def): this.
2725 (b4_c_function_decl, b4_c_ansi_function_def)
2726 (b4_c_ansi_function_decl): New.
2727 Change the interpretation of the arguments: before `int, foo', now
2728 `int foo, foo'.
2729 * data/yacc.c (yyparse): Prototype and define thanks to these.
2730 Adjust b4_c_function_def uses.
2731 * data/glr.c (yyparse): Likewise, but ANSI only.
2732
39912f52
AD
27332002-10-20 Akim Demaille <akim@epita.fr>
2734
2735 * src/output.c (prepare): Move the definition of `tokens_number',
2736 `nterms_number', `undef_token_number', `user_token_number_max'
2737 to...
2738 (prepare_tokens): Here.
2739 (prepare_tokens): Rename as...
2740 (prepare_symbols): this.
2741 (prepare): Move the definition of `rules_number' to...
2742 (prepare_rules): here.
2743 (prepare): Move the definition of `last', `final_state_number',
2744 `states_number' to...
2745 (prepare_states): here.
2746 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
2747
20c1e2ad
AD
27482002-10-20 Akim Demaille <akim@epita.fr>
2749
2750 * src/tables.h, src/tables.c, src/output.c: Comment changes.
2751
21964f43
AD
27522002-10-20 Akim Demaille <akim@epita.fr>
2753
2754 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
2755 * data/c.m4: here.
2756
66d30cd4
AD
27572002-10-20 Akim Demaille <akim@epita.fr>
2758
2759 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
2760 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
2761 `pair'.
2762 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
2763 `name' to...
2764 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
2765 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
2766 These.
2767
95f2c9fe
PE
27682002-10-19 Paul Eggert <eggert@twinsun.com>
2769
2770 Do not create a temporary file, as that involves security and
2771 cleanup headaches. Instead, use a pair of pipes.
2772 Derived from a suggestion by Florian Krohm.
2773 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
2774 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
2775 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
2776 (BISON_PREREQ_SUBPIPE): Add.
2777 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
2778 Add subpipe.h, subpipe.c.
2779 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
2780 * po/POTFILES.in: Add lib/subpipe.c.
2781 * src/output.c: Include "subpipe.h".
2782 (m4_invoke): Remove decl.
2783 (scan_skel): New decl.
2784 (output_skeleton): Use pipe rather than temporary file for m4 input.
2785 Check that m4sugar.m4 is readable, to avoid deadlock.
2786 Check for pipe I/O error.
2787 * src/scan-skel.l (readpipe): Remove decl.
2788 (scan_skel): New function, to be used in place of m4_invoke.
2789 Read from stream rather than file.
66d30cd4 2790
95f2c9fe
PE
2791 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
2792 float, as this generates a warning on Solaris 8 + GCC 3.2 with
2793 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
2794 this generates a more-accurate value anyway.
2795
2796 * lib/timevar.c (timervar_accumulate): Rename locals to
2797 avoid confusion with similarly-named more-global.
2798 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
2799
2800 * src/output.c (prepare): Use xstrdup to convert char const *
2801 to char *, to avoid GCC warning.
2802
c19988b7
AD
28032002-10-19 Akim Demaille <akim@epita.fr>
2804
2805 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
2806 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
2807 Use them to have `calc.y' ready for %pure-parser.
2808 * data/yacc.c (YYLEX): Pass a yylex return type to
2809 b4_c_function_call.
2810
ae7453f2
AD
28112002-10-19 Akim Demaille <akim@epita.fr>
2812
2813 Prototype support of %lex-param and %parse-param.
2814
2815 * src/parse-gram.y: Add the definition of the %lex-param and
2816 %parse-param tokens, plus their rules.
2817 Drop the `_' version of %glr-parser.
2818 Add the "," token.
2819 * src/scan-gram.l (INITIAL): Scan them.
2820 * src/muscle_tab.c: Comment changes.
2821 (muscle_insert, muscle_find): Rename `pair' as `probe'.
2822 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
2823 (muscle_entry_s): The `value' member is no longer const.
2824 Adjust all dependencies.
2825 * src/muscle_tab.c (muscle_init): Adjust: use
2826 MUSCLE_INSERT_STRING.
2827 Initialize the obstack earlier.
2828 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
2829 (muscle_pair_list_grow): New.
2830 * data/c.m4 (b4_c_function_call, b4_c_args): New.
2831 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
2832 * tests/calc.at: Use %locations, not --locations.
2833 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
2834
0e575721
AD
28352002-10-19 Akim Demaille <akim@epita.fr>
2836
2837 * src/getargs.c (usage): Take status as argument and exit
2838 accordingly.
2839 Report the traditional `Try ... --help' message when status != 0.
2840 (usage, version): Don't take a FILE * as arg, it is pointless.
2841 (getargs): When there is an incorrect number of arguments, make it
2842 an error, and report it GNUlically thanks to `usage ()'.
2843
724ce7f5
PE
28442002-10-18 Paul Eggert <eggert@twinsun.com>
2845
3a781eb2
PE
2846 * data/glr.c (yyreportParseError): Don't assume that sprintf
2847 yields the length of the printed string, as this is not true
2848 on SunOS 4.1.4. Reported by Peter Klein.
2849
724ce7f5
PE
2850 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
2851 * tests/conflicts.at (%nonassoc and eof): Likewise.
2852 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
2853
473d0a75
AD
28542002-10-17 Akim Demaille <akim@epita.fr>
2855
2856 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
2857 * src/getargs.c (trace_types, trace_args): Adjust.
2858 * src/reader.c (grammar_current_rule_prec_set)
2859 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
2860 Standardize error messages.
2861 And s/@prec/%prec/!
2862 (reader): Use trace_flag to enable scanner/parser debugging,
2863 instead of an adhoc scheme.
2864 * src/scan-gram.l: Remove trailing debugging code.
2865
e76d2469
PE
28662002-10-16 Paul Eggert <eggert@twinsun.com>
2867
93e2236a
PE
2868 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
2869 MUSCLE_TAB_H.
2870
e76d2469
PE
2871 * NEWS: Officially drop support for building Bison with K&R C,
2872 since it didn't work anyway and it's not worth worrying about.
2873 * Makefile.maint (wget_files): Remove ansi2knr.c.
2874 (ansi2knr.c-url_prefix): Remove.
2875 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
2876 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2877 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2878
5bd1c419
PE
28792002-10-15 Paul Eggert <eggert@twinsun.com>
2880
2881 Stop using the "enum_" trick for K&R-style function definitions;
2882 it confused me, and I was the author! Instead, assume that people
2883 who want to use K&R C compilers (when using these modules in GCC,
2884 perhaps?) will run ansi2knr.
2885
2886 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
2887 All uses of "enum_" changed to "enum ".
2888 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
2889 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 2890
5bd1c419
PE
2891 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
2892 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
2893 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
2894 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
2895 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
2896 abitset_not, abitset_ones, abitset_or, abitset_or_and,
2897 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
2898 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
2899 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
2900 Use function prototypes; this removes the need for declaring
2901 static functions simply to provide their prototypes.
2902 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
2903 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
2904 bitset_count_, bitset_create, bitset_dump, bitset_first,
2905 bitset_free, bitset_init, bitset_last, bitset_next,
2906 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
2907 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
2908 bitset_print, bitset_release_memory, bitset_toggle_,
2909 bitset_type_choose, bitset_type_get, bitset_type_name_get,
2910 debug_bitset): Likewise.
2911 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
2912 * lib/bitset_stats.c (bitset_log_histogram_print,
2913 bitset_percent_histogram_print, bitset_stats_and,
2914 bitset_stats_and_cmp, bitset_stats_and_or,
2915 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
2916 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
2917 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
2918 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
2919 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
2920 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
2921 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
2922 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
2923 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
2924 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
2925 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
2926 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
2927 bitset_stats_zero): Likewise.
2928 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
2929 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
2930 bitsetv_dump, debug_bitsetv): Likewise.
2931 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
2932 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
2933 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
2934 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
2935 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
2936 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
2937 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
2938 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
2939 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
2940 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
2941 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
2942 Likewise.
2943 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
2944 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
2945 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
2946 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
2947 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
2948 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
2949 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
2950 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
2951 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
2952 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
2953 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 2954
ae26e1f0
AD
29552002-10-14 Akim Demaille <akim@epita.fr>
2956
2957 Version 1.75.
2958
d43baf71
AD
29592002-10-14 Akim Demaille <akim@epita.fr>
2960
2961 * tests/Makefile.am (maintainer-check-posix): New.
2962
7ebc83e3
AD
29632002-10-14 Akim Demaille <akim@epita.fr>
2964
2965 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
2966 member.
2967
05846dae
AD
29682002-10-14 Akim Demaille <akim@epita.fr>
2969
2970 * src/tables.c (table_ninf_remap): base -> tab.
2971 Reported by Matt Rosing.
2972
1318e37d
PE
29732002-10-14 Paul Eggert <eggert@twinsun.com>
2974
447fbb17
PE
2975 * tests/action.at, tests/calc.at, tests/conflicts.at,
2976 tests/cxx-type.at, tests/headers.at, tests/input.at,
2977 tests/regression.at, tests/synclines.at, tests/torture.at:
2978 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
2979 so that the tests still work even if POSIXLY_CORRECT is set.
2980 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 2981
1318e37d
PE
2982 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
2983 for portability to K&R hosts. Fix typo: signed char is guaranteed
2984 only to 127, not to 128.
2985 * data/glr.c (yysigned_char): New type.
2986 * data/yacc.c (yysigned_char): Likewise.
2987 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
2988
cc0f0794
PE
29892002-10-13 Paul Eggert <eggert@twinsun.com>
2990
5038f418
PE
2991 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
2992 true due to limited range of data type" warning from GCC.
2993
cc0f0794
PE
2994 * data/c.m4 (b4_token_defines): Protect against double-inclusion
2995 by wrapping enum yytokentype's definition inside #ifndef
2996 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
2997
6fed0802
AD
29982002-10-13 Akim Demaille <akim@epita.fr>
2999
3000 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
3001 Un yy- yyrhs to avoid the name clash with the global YYRHS.
3002
32f0598d
AD
30032002-10-13 Akim Demaille <akim@epita.fr>
3004
3005 * Makefile.maint: Update from Autoconf 2.54.
3006 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
3007
7ea9a33f
AD
30082002-10-13 Akim Demaille <akim@epita.fr>
3009
3010 * src/print.c (print_state): Separate the list of solved conflicts
3011 from the other items.
3012 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
3013
ea99527d
AD
30142002-10-13 Akim Demaille <akim@epita.fr>
3015
3016 Let nondeterministic skeletons be usable with deterministic
3017 tables.
3018
3019 With the patch, GAWK compiled by GCC without -O2 passes its test
3020 suite using a GLR parser driven by LALR tables. It fails with -O2
3021 because `struct stat' gives two different answers on my machine:
3022 88 (definition of an auto var) and later 96 (memset on this var).
3023 Hence the stack is badly corrumpted. The headers inclusion is to
3024 blame: if I move the awk.h inclusion before GLR's system header
3025 inclusion, the two struct stat have the same size.
3026
3027 * src/tables.c (pack_table): Always create conflict_table.
3028 (token_actions): Always create conflict_list.
3029 * data/glr.c (YYFLAG): Remove, unused.
3030
f377f69f
AD
30312002-10-13 Akim Demaille <akim@epita.fr>
3032
3033 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
3034 (O0FLAGS): New.
3035 (VALGRIND, GXX): New.
3036 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
3037 * tests/bison.in: Run $PREBISON a pre-command.
3038 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
3039 (maintainer-check-g++): New.
3040 * Makefile.am (maintainer-check): New.
3041
2a1fe6ed
AD
30422002-10-13 Akim Demaille <akim@epita.fr>
3043
3044 * data/glr.c: Formatting changes.
3045 Tweak some trace messages to match yacc.c's.
3046
f50adbbd
AD
30472002-10-13 Akim Demaille <akim@epita.fr>
3048
3049 GLR parsers sometimes raise parse errors instead of performing the
3050 default reduction.
3051 Reported by Charles-Henry de Boysson.
3052
3053 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
3054 check the length of the traces when %glr.
3055 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
3056 GLR's traces.
3057 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
3058 Test GLR parsers.
3059 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
3060 (yyltype): Remove the yy prefix from the member names.
3061 (yytable): Complete its comment.
3062 (yygetLRActions): Map error action number from YYTABLE from
3063 YYTABLE_NINF to 0.
3064 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
3065 (which was a bug: it should have been YYTABEL_NINF, and yet it was
3066 not satisfying as we could compare an YYACTION computed from
3067 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
3068 only value for error actions.
3069 (yyreportParseError): In verbose parse error messages, don't issue
3070 `error' in the list of expected tokens.
3071 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
3072 next action to perform to match glr.c's decoding.
3073 (yytable): Complete its comment.
3074
bcbad5b9
PE
30752002-10-13 Paul Eggert <eggert@twinsun.com>
3076
3077 Fix problem reported by Henrik Grubbstroem in
e3aa65c5 3078 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
3079 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
3080 because the Bison parser reads the second action before reducing
3081 the first one.
3082 * src/scan-gram.l (rule_length): New static var.
3083 Use it to keep track of the rule length in the scanner, since
3084 we can't expect the parser to be in lock-step sync with the scanner.
3085 (handle_action_dollar, handle_action_at): Use this var.
3086 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 3087
14904b89
PE
30882002-10-12 Paul Eggert <eggert@twinsun.com>
3089
1fe611e5
PE
3090 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
3091 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
3092 Include <sys/time.h> when checking for clock_t and struct tms.
3093 Use same include order as source.
3094 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
e3aa65c5 3095 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 3096
1fe611e5
PE
3097 * lib/timevar.c: Update copyright date and clarify comments.
3098 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 3099
1fe611e5
PE
3100 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
3101 GCC version as of today, then merge Bison's changes.
3102 Change "GCC" to "Bison" in copyright notice. timevar.def's
3103 author is Akim, so change that too.
3104
98194095
PE
3105 * src/reader.c (grammar_current_rule_check):
3106 Don't worry about the default action if $$ is untyped.
3107 Prevents bogus warnings reported by Jim Gifford in
e3aa65c5 3108 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 3109
14904b89
PE
3110 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
3111 * data/glr.c, data/lalr1.cc, data/yacc.c:
3112 Output token definitions before the first part of user declarations.
3113 Fixes compatibility problem reported by Jim Gifford for kbd in
e3aa65c5 3114 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 3115
ff6dca18
PE
31162002-10-11 Paul Eggert <eggert@twinsun.com>
3117
3118 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
3119 (yyparse): here. This undoes some of the 2002-07-25 change.
3120 Compatibility problem reported by Ralf S. Engelschall with
3121 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
3122
eb714592
AD
31232002-10-11 Akim Demaille <akim@epita.fr>
3124
3125 * tests/regression.at Characters Escapes): New.
3126 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
3127 characters.
3128 Reported by Jan Nieuwenhuizen.
3129
b7195100
AD
31302002-10-11 Akim Demaille <akim@epita.fr>
3131
3132 * po/id.po: New.
3133
f28a0f2d
PE
31342002-10-10 Paul Eggert <eggert@twinsun.com>
3135
3136 Portability fixes for bitsets; this also avoids several GCC
3137 warnings.
3138
3139 * lib/abitset.c: Include <stddef.h>, for offsetof.
3140 * lib/lbitset.c: Likewise.
3141
3142 * lib/abitset.c (abitset_bytes): Return a size that is aligned
3143 properly for vectors of objects. Do not assume that adding a
3144 header size to a multiple of a word size yields a value that is
3145 properly aligned for the whole union.
3146 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3147
3148 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
3149 unique names for structures.
3150 * lib/ebitset.c (ebitset_bytes): Likewise.
3151 * lib/lbitset.c (lbitset_bytes): Likewise.
3152
3153 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
3154 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
3155 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
3156 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
3157 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
3158 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
3159 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
3160 to improve the type-checking that GCC can do.
3161 * lib/bitset.c (bitset_op4_cmp): Likewise.
3162 * lib/bitset_stats.c (bitset_stats_count,
3163 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
3164 bitset_stats_copy, bitset_stats_disjoint_p,
3165 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
3166 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
3167 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
3168 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
3169 bitset_stats_and_or_cmp, bitset_stats_andn_or,
3170 bitset_stats_andn_or_cmp, bitset_stats_or_and,
3171 bitset_stats_or_and_cmp): Likewise.
3172 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
3173 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
3174 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
3175 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
3176
3177 * lib/abitset.h: Include bitset.h, not bbitset.h.
3178 * lib/ebitset.h: Likewise.
3179 * lib/lbitset.h: Likewise.
3180
3181 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
3182 All instances of parameters of type enum bitset_opts are now of
3183 type enum_bitset_opts, to conform to the C Standard, and similarly
3184 for enum_bitset_type.
3185 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3186 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3187
3188 Do not use "struct bitset_struct" to mean different things in
3189 different modules. Not only is this confusing, it violates
3190 the C Standard, which requires that structure types in different
3191 modules must be compatible if one is to be passed to the other.
3192 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
3193 All instances of "struct bitset_struct *" replaced with "bitset".
3194 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
3195 (union bitset_union, struct abitset_struct, struct ebitset_struct,
3196 struct lbitset_struct, struct bitset_stats_struct): New types.
3197 All uses of struct bitset_struct changed to union bitset_union,
3198 etc.
3199 * lib/abitset.c (struct abitset_struct, abitset,
3200 struct bitset_struct): Remove.
3201 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
3202 struct bitset_struct): Remove.
3203 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
3204 bitset_struct): Remove.
3205 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
3206 Likewise.
3207
3208 Do not call a function of type T using a call that assumes the
3209 function is of a different type U. Standard C requires that a
3210 function must be called with a type that is compatible with its
3211 definition.
3212 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3213 New decls.
3214 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3215 New functions.
3216 * lib/ebitset.c (PFV): Remove.
3217 * lib/lbitset.c (PFV): Likewise.
3218 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
3219 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
3220 decls.
3221 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
3222 (ebitset_vtable): Use them.
3223 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
3224 lbitset_xor): New functions.
3225 (lbitset_vtable): Use them.
3226
3227 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
3228 Declare.
3229
3230 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
3231 GCC warning.
3232 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
3233 Use offsetof, for simplicity.
3234
6fbe4984
PE
32352002-10-06 Paul Eggert <eggert@twinsun.com>
3236
3237 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
3238 the same width as int. This reapplies a hunk of the 2002-08-12 patch
e3aa65c5 3239 <http://mail.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
3240 which was inadvertently undone by the 2002-09-30 patch.
3241 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
3242 the same width as int.
3243
420f93c8
PE
32442002-10-04 Paul Eggert <eggert@twinsun.com>
3245
3246 Version 1.50.
3247
3248 * configure.ac (AC_INIT), NEWS: Increment version number.
3249
3250 * doc/bison.texinfo: Minor spelling, grammar, and white space
3251 fixes.
3252 (Symbols): Mention that any negative value returned from yylex
3253 signifies end-of-input. Warn about negative chars. Mention
3254 the portable Standard C character set.
3255
3256 The GNU coding standard says CFLAGS and YFLAGS are reserved
3257 for the installer to set.
3258 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
3259 * src/Makefile.am (AM_CFLAGS): Likewise.
3260 (AM_YFLAGS): Renamed from YFLAGS.
3261
3262 Fix some MAX and MIN problems.
3263 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
3264 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
3265 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
3266 * src/reader.c (reader): Use it.
3267
3268 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
3269 POSIX 1003.1-2001 has removed fgrep.
3270
32712002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
3272
3273 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
3274 interpreted as signed.
3275 * lib/ebitset.c (ebitset_list): Fix bug.
3276
ff68026d
PE
32772002-10-01 Paul Eggert <eggert@twinsun.com>
3278
3279 More fixes for 64-bit hosts and large bitsets.
3280
3281 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
3282 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
3283 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
3284 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
3285 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
3286 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
3287 bitset_count_): Likewise.
3288 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
3289 bitset_first, bitset_last): Likewise.
3290 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
3291 bitset_stats_list_reverse, bitset_stats_size,
3292 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
3293 Likewise.
3294 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3295 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3296 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3297 bitsetv_reflexive_transitive_closure): Likewise.
3298 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
3299 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
3300 Likewise.
3301 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
3302 Likewise.
420f93c8 3303
ff68026d
PE
3304 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
3305 Use size_t, not unsigned int, to count bytes.
3306 * lib/abitset.h (abitset_bytes): Likewise.
3307 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
3308 Likewise.
3309 * lib/bitset.h (bitset_bytes): Likewise.
3310 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
3311 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
3312 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3313 * lib/ebitset.c (ebitset_bytes): Likewise.
3314 * lib/ebitset.h (ebitset_bytes): Likewise.
3315 * lib/lbitset.c (lbitset_bytes): Likewise.
3316 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 3317
ff68026d
PE
3318 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
3319 abitset_subset_p, abitset_disjoint_p, abitset_and,
3320 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
3321 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
3322 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
3323 abitset_or_and, abitset_or_and_cmp):
3324 Use bitset_windex instead of unsigned int.
3325 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3326 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
3327 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
3328 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
3329 Likewise.
3330 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 3331
ff68026d
PE
3332 * lib/bitset.c (bitset_print):
3333 Use proper printf formats for widths of integer types.
3334 * lib/bitset_stats.c (bitset_percent_histogram_print,
3335 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
3336 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3337 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3338 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 3339
ff68026d
PE
3340 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
3341 BITSET_SIZE_MAX): New macros.
3342 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
3343 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
3344 to BITSET_WINDEX_MAX.
3345
3346 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
3347 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
3348 since we now return the bitset_bindex type (not int).
3349
3350 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
3351 when computing sizes.
3352 * lib/ebitset.c (ebitset_elts_grow): Likewise.
3353
3354 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
3355 and avoid cast to unsigned.
3356
6aa452a6
AD
33572002-09-30 Akim Demaille <akim@epita.fr>
3358
3359 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
3360 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
3361 Updates from Michael Hayes.
3362
927f7817
AD
33632002-09-30 Art Haas <ahaas@neosoft.com>
3364
3365 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
3366 invocations.
3367 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
3368 defined.
3369
9738f41e
AD
33702002-09-27 Akim Demaille <akim@epita.fr>
3371
3372 Version 1.49c.
3373
a5c75d7f
AD
33742002-09-27 Akim Demaille <akim@epita.fr>
3375
3376 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
3377 (Because of AC_LIBSOURCE).
3378
8280e179
AD
33792002-09-27 Akim Demaille <akim@epita.fr>
3380
3381 Playing with Autoscan.
3382
3383 * configure.ac: Remove the old LIBOBJ tweaks.
3384 (AC_REPLACE_FUNCS): Add strrchr and strtol.
3385 * lib/strrchr.c: New.
3386 * lib/strtol.c: New, from the Coreutils 4.5.1.
3387
ae64af35
AD
33882002-09-27 Akim Demaille <akim@epita.fr>
3389
3390 Playing with Autoscan.
3391
3392 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
3393 * lib/Makefile.am (libbison_a_SOURCES): No longer include
3394 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
3395 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
3396 Coreutils 4.5.1.
3397
d1a1114f
AD
33982002-09-24 Akim Demaille <akim@epita.fr>
3399
3400 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
3401 (Frequently Asked Questions, Parser Stack Overflow): New.
3402
b906441c
AD
34032002-09-13 Akim Demaille <akim@epita.fr>
3404
3405 Playing with autoscan.
3406
3407 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
3408 * src/files.c (skeleton_find): Remove, unused.
3409 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
3410 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
3411
bd701811
AD
34122002-09-13 Akim Demaille <akim@epita.fr>
3413
3414 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
3415 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
3416
e0a13e7b
AD
34172002-09-13 Akim Demaille <akim@epita.fr>
3418
3419 * configure.ac: Require 2.54.
3420 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
3421 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
3422 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
3423 Remove, provided by Autoconf macros.
3424
c97011bf
AD
34252002-09-12 Akim Demaille <akim@epita.fr>
3426
3427 * m4/prereq.m4: Update, from Coreutils 4.5.1.
3428
d862b1be
AD
34292002-09-12 Akim Demaille <akim@epita.fr>
3430
3431 * m4/prereq.m4: Update, from Fileutils 4.1.5.
3432 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
3433 Reported by Martin Mokrejs.
3434
3d38c03a
AD
34352002-09-10 Akim Demaille <akim@epita.fr>
3436
3437 * src/parse-gram.y: Associate a human readable string to each
3438 token type.
3439 * tests/regression.at (Invalid inputs): Adjust.
3440
b6347355
AD
34412002-09-10 Gary V. Vaughan <gary@gnu.org>
3442
3443 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
3444 with an Autoconf-2.5x style configure.ac.
3445
09ba4ab2
PE
34462002-09-06 Paul Eggert <eggert@twinsun.com>
3447
3448 * doc/bison.texinfo (Conditions): Make explicit that the GPL
3449 exception applies only to yacc.c. This is a modification of a
3450 patch originally suggested by Akim Demaille.
3451
21846f69
AD
34522002-09-06 Akim Demaille <akim@epita.fr>
3453
09ba4ab2
PE
3454 * data/c.m4 (b4_copyright): Move the GPL exception comment from
3455 here to...
3456 * data/yacc.c: here.
3457
21846f69
AD
3458 * data/lalr1.cc (struct yyltype): Don't define it, since we use
3459 LocationType.
3460 (b4_ltype): Default to yy::Location from location.hh.
3461
c0ad8bf3
AD
34622002-09-04 Jim Meyering <jim@meyering.net>
3463
3464 * data/yacc.c: Guard the declaration of yytoknum also with
3465 `#ifdef YYPRINT', so it is declared only when used.
3466
3a93251e
AD
34672002-09-04 Akim Demaille <akim@epita.fr>
3468
3469 * configure.in: Rename as...
3470 * configure.ac: this.
3471 Bump to 1.49c.
3472
427c0dda
AD
34732002-09-04 Akim Demaille <akim@epita.fr>
3474
3475 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
3476 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
3477 translate maintainer only messages.
3478
6a254321
PE
34792002-08-12 Paul Eggert <eggert@twinsun.com>
3480
645e30d1
PE
3481 Version 1.49b.
3482
6a254321
PE
3483 * Makefile.am (SUBDIRS): Remove intl.
3484 (DISTCLEANFILES): Remove.
3485 * NEWS: Mention that GNU M4 is now required. Clarify what is
3486 meant by "larger grammars". Mention the pt_BR translation.
3487 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
3488 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
3489 Bump version from 0.11.2 to 0.11.5.
3490 (BISON_PREREQ_STAGE): Remove.
3491 (AM_GNU_GETTEXT): Use external gettext.
3492 (AC_OUTPUT): Remove intl/Makefile.
3493
3494 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
3495
3496 * data/glr.c: Include string.h, for strlen.
3497 (yyreportParseError): Use size_t for yysize.
3498 (yy_yypstack): No longer nested inside yypstates, as nested
3499 functions are not portable. Do not assume size_t is the
3500 same width as int.
3501 (yypstates): Do not assume that ptrdiff_t is the same width
3502 as int, and similarly for yyposn and YYINDEX.
3503
3504 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
3505
3506 * lib/Makefile.am (INCLUDES): Do not include from the intl
3507 directory, which has been removed.
3508 * src/Makefile.am (INCLUDES): Likewise.
3509
3510 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
3511 (bitsets_sources, additional_bitsets_sources, timevars_sources):
3512 New vars.
3513
3514 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
3515 * tests/Makefile.am (EXTRA_DIST): Likewise.
3516
3517 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
3518 Do not assume that bitset_windex is the same width as unsigned.
3519
3520 * lib/abitset.c (abitset_unused_clear): Do not assume that
3521 bitset_word is the same width as int.
3522 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
3523 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
3524 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
3525 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
3526 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
3527
3528 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
3529 portability to one's complement hosts!).
3530 * lib/ebitset.c (ebitset_op1): Likewise.
3531 * lib/lbitset.c (lbitset_op1): Likewise.
3532
3533 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
3534 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
3535 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
3536 Sync with fileutils.
3537 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
3538 lib/gettext.h: Sync with diffutils.
3539
3540 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
3541 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
3542
3543 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
3544 PROTOTYPES to check for prototypes, and "defined __STDC__" to
3545 check for void *.
3546
3547 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
3548 size_t; the old version tried to do this but casted improperly.
3549 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
3550 (bitset_test): Now returns int, not unsigned long.
3551
3552 * lib/bitset_stats.c: Include "gettext.h".
3553 (_): New macro.
3554 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
3555 name locals "index", as it generates unnecessary warnings on some
3556 hosts that have an "index" function.
3557
3558 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
3559 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
3560 they need translation.
3561 * src/LR0.c (state_list_append, new_itemsets, get_state,
3562 append_states, generate_states): Likewise.
3563 * src/assoc.c (assoc_to_string): Likewise.
3564 * src/closure.c (print_closure, set_firsts, closure): Likewise.
3565 * src/gram.c (grammar_dump): Likewise.
3566 * src/injections.c (injections_compute): Likewise.
3567 * src/lalr.c (lookaheads_print): Likewise.
3568 * src/relation.c (relation_transpose): Likewise.
3569 * src/scan-gram.l: Likewise.
3570 * src/tables.c (table_grow, pack_vector): Likewise.
3571
3572 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
3573 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
3574 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
3575 * m4/mbstate_t.m4: Sync with fileutils.
3576 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
3577
3578 * po/LINGUAS: Add pt_BR.
3579 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
3580 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
3581 lib/timevar.c.
3582 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
3583 manual recommends.
3584 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
3585
3586 * src/complain.c (strerror_r): Remove decl; not needed.
3587 (strerror): Use same pattern as ../lib/error.c.
3588
3589 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
3590
3591 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
3592
3593 * src/main.c (main): Cast result of bindtextdomain and textdomain
3594 to void, to avoid a GCC warning when --disable-nls is in effect.
3595
3596 * src/scan-gram.l: Use strings rather than escapes when possible,
3597 to minimize the number of warnings from xgettext.
3598 (handle_action_dollar, handle_action_at): Don't use isdigit,
3599 as it mishandles negative chars and it may not work as expected
3600 outside the C locale.
3601
3602 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
3603 this is a GCC extension and is not portable to other compilers.
3604
3605 * src/system.h (alloca): Use same pattern as ../lib/error.c.
3606 Do not include <ctype.h>; no longer needed.
3607 Do not include <malloc.h>; no longer needed (and generates
3608 warnings on OpenBSD 3.0).
3609
3610 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
3611 it's not portable.
3612
3613 * tests/regression.at: Do not use 'cc -c input.c -o input';
3614 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
3615
3616 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
3617 exit status as failure, not just exit status 1. Sun C exits
3618 with status 2 sometimes.
3619
3620 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
3621 Use it for the two large tests.
3622
c8f002c7
AD
36232002-08-02 Akim Demaille <akim@epita.fr>
3624
3625 * src/conflicts.c (conflicts_output): Don't output rules never
3626 reduced here, since anyway that computation doesn't work.
3627 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
3628 (rule_useless_p, rule_never_reduced_p): New.
3629 (grammar_rules_partial_print): Use a filter instead of a range.
3630 Display the title only if needed.
3631 (grammar_rules_print): Adjust.
3632 (grammar_rules_never_reduced_report): New.
3633 * src/tables.c (action_row): Move the computation of rules never
3634 reduced to...
3635 (token_actions): here.
3636 * src/main.c (main): Make the parser before making the report, so
3637 that rules never reduced are computed.
3638 Call grammar_rules_never_reduced_report.
3639 * src/print.c (print_results): Report rules never reduced.
3640 * tests/conflicts.at, tests/reduce.at: Adjust.
3641
cd08e51e
AD
36422002-08-01 Akim Demaille <akim@epita.fr>
3643
3644 Instead of attaching lookaheads and duplicating the rules being
3645 reduced by a state, attach the lookaheads to the reductions.
3646
3647 * src/state.h (state_t): Remove the `lookaheads',
3648 `lookaheads_rule' member.
3649 (reductions_t): Add a `lookaheads' member.
3650 Use a regular array for the `rules'.
3651 * src/state.c (reductions_new): Initialize the lookaheads member
3652 to 0.
3653 (state_rule_lookaheads_print): Adjust.
3654 * src/state.h, src/state.c (state_reductions_find): New.
3655 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
3656 (count_rr_conflicts): Adjust.
3657 * src/lalr.c (LArule): Remove.
3658 (add_lookback_edge): Adjust.
3659 (state_lookaheads_count): New.
3660 (states_lookaheads_initialize): Merge into...
3661 (initialize_LA): this.
3662 (lalr_free): Adjust.
3663 * src/main.c (main): Don't free nullable and derives too early: it
3664 is used by --verbose.
3665 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
3666
bb0027a9
AD
36672002-08-01 Akim Demaille <akim@epita.fr>
3668
3669 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
3670 `rule_number_t**'.
3671 (set_derives, free_derives): Rename as...
3672 (derives_compute, derives_free): this.
3673 Adjust all dependencies.
3674 * src/nullable.c (set_nullable, free_nullable): Rename as...
3675 (nullable_compute, nullable_free): these.
3676 (rule_list_t): Store rule_t *, not rule_number_t.
3677 * src/state.c (state_rule_lookaheads_print): Directly compare rule
3678 pointers, instead of their numbers.
3679 * src/main.c (main): Call nullable_free, and derives_free earlier,
3680 as they were lo longer used.
3681
3325ddc4
AD
36822002-08-01 Akim Demaille <akim@epita.fr>
3683
3684 * lib/timevar.c (get_time): Include children time.
3685 * src/lalr.h (LA, LArule): Don't export them: used with the
3686 state_t.
3687 * src/lalr.c (LA, LArule): Static.
3688 * src/lalr.h, src/lalr.c (lalr_free): New.
3689 * src/main.c (main): Call it.
3690 * src/tables.c (pack_vector): Check whether loc is >= to the
3691 table_size, not >.
3692 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
3693 (tables_generate): do it, since that's also it which allocates
3694 them.
3695 Don't free LA and LArule, main does.
3696
c6f1a33c
AD
36972002-07-31 Akim Demaille <akim@epita.fr>
3698
3699 Separate parser tables computation and output.
3700
3701 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
3702 (conflict_list, conflict_list_cnt, table, check, table_ninf)
3703 (yydefgoto, yydefact, high): Move to...
3704 * src/tables.h, src/tables.c: here.
3705 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3706 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3707 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
3708 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
3709 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
3710 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
3711 (action_row, save_row, token_actions, save_column, default_goto)
3712 (goto_actions, sort_actions, matching_state, pack_vector)
3713 (table_ninf_remap, pack_table, prepare_actions): Move to...
3714 * src/tables.c: here.
3715 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
3716 * src/output.c (token_actions, output_base, output_conflicts)
3717 (output_check): Merge into...
3718 (prepare_actions): this.
3719 (actions_output): Rename as...
3720 (user_actions_output): this.
3721 * src/main.c (main): Call tables_generate and tables_free.
3722
1509d42f
AD
37232002-07-31 Akim Demaille <akim@epita.fr>
3724
3725 Steal GCC's --time-report support.
3726
3727 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
3728 stolen/adjusted from GCC.
3729 * m4/stage.m4: Remove time related checks.
3730 * m4/timevar.m4: New.
3731 * configure.in: Adjust.
3732 * src/system.h: Adjust to using timevar.h.
3733 * src/getargs.h, src/getargs.c: Support trace_time for
3734 --trace=time.
3735 * src/main.c (stage): Remove.
3736 (main): Replace `stage' invocations with timevar calls.
3737 * src/output.c: Insert pertinent timevar calls.
3738
273a74fa
AD
37392002-07-31 Akim Demaille <akim@epita.fr>
3740
3741 Let --trace have arguments.
3742
3743 * src/getargs.h (enum trace_e): New.
3744 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
3745 (long_options, short_options): --trace/-T takes an optional
3746 argument.
3747 Change all the uses of trace_flag to reflect the new flags.
3748 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
3749
3750 Strengthen `stage' portability.
3751
3752 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
3753 * configure.in: Use it.
3754 Don't check for malloc.h and sys/times.h.
3755 * src/system.h: Include them when appropriate.
3756 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
3757 times and struct tms are available.
3758
217598da
AD
37592002-07-30 Akim Demaille <akim@epita.fr>
3760
3761 In verbose parse error message, don't report `error' as an
3762 expected token.
3763 * tests/actions.at (Printers and Destructors): Adjust.
3764 * tests/calc.at (Calculator $1): Adjust.
3765 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
3766 error message, do not report the parser accepts the error token in
3767 that state.
3768
52489d44
AD
37692002-07-30 Akim Demaille <akim@epita.fr>
3770
3771 Normalize conflict related messages.
3772
3773 * src/complain.h, src/complain.c (warn, complain): New.
3774 * src/conflicts.c (conflicts_print): Use them.
3775 (conflict_report_yacc): New, extracted from...
3776 (conflicts_print): here.
3777 * tests/conflicts.at, tests/existing.at: Adjust.
3778
e8832397
AD
37792002-07-30 Akim Demaille <akim@epita.fr>
3780
3781 Report rules which are never reduced by the parser: those hidden
3782 by conflicts.
3783
3784 * src/LR0.c (save_reductions): Don't make the final state too
3785 different: save its reduction (accept) instead of having a state
3786 without any action (no shift or goto, no reduce).
3787 Note: the final state is now a ``regular'' state, i.e., the
3788 parsers now contain `reduce 0' as default reduction.
3789 Nevertheless, since they decide to `accept' when yystate =
3790 final_state, they still will not reduce rule 0.
3791 * src/print.c (print_actions, print_reduction): Adjust.
3792 * src/output.c (action_row): Track reduced rules.
3793 (token_actions): Report rules never reduced.
3794 * tests/conflicts.at, tests/regression.at: Adjust.
3795
caf23d24
AD
37962002-07-30 Akim Demaille <akim@epita.fr>
3797
3798 `stage' was accidently included in a previous patch.
3799 Initiate its autoconfiscation.
3800
3801 * configure.in: Look for malloc.h and sys/times.h.
3802 * src/main.c (stage): Adjust.
3803 Report only when trace_flag.
3804
640748ee
AD
38052002-07-29 Akim Demaille <akim@epita.fr>
3806
3807 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
3808 state_number_t.
3809 (errs_t): symbol_t*, not symbol_number_t.
3810 (reductions_t): rule_t*, not rule_number_t.
3811 (FOR_EACH_SHIFT): New.
3812 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
3813 * src/print.c, src/print_graph.c: Adjust.
3814
88bce5a2
AD
38152002-07-29 Akim Demaille <akim@epita.fr>
3816
3817 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
3818
3819 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
3820 (endtoken, accept): these.
3821 * src/reader.c (reader): Set endtoken's default tag to "$end".
3822 Set undeftoken's tag to "$undefined" instead of "$undefined.".
3823 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
3824 Adjust.
3825
1bfb97db
AD
38262002-07-29 Akim Demaille <akim@epita.fr>
3827
3828 * src/reduce.c (reduce_grammar): When the language is empty,
3829 complain about the start symbol, not the axiom.
3830 Use its location.
3831 * tests/reduce.at (Empty Language): New.
3832
fc5734fe
AD
38332002-07-26 Akim Demaille <akim@epita.fr>
3834
3835 * src/reader.h, src/reader.c (gram_error): ... can't get
3836 yycontrol without making too strong assumptions on the parser
3837 itself.
3838 * src/output.c (prepare_tokens): Use the real 0th value of
3839 token_translations instead of `0'.
3840 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
3841 visible here.
3842 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
3843 for the time being: %locations ought to provide it to yyerror.
3844
3650b4b8
AD
38452002-07-25 Akim Demaille <akim@epita.fr>
3846
3847 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
3848 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
3849 * tests/regression.at (Web2c Actions): Adjust.
3850
4b3d3a8e
AD
38512002-07-25 Akim Demaille <akim@epita.fr>
3852
3853 Stop storing rules from 1 to nrules + 1.
3854
3855 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
3856 * src/nullable.c, src/output.c, src/print.c, src/reader.c
3857 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
3858 Iterate from 0 to nrules.
3859 Use rule_number_as_item_number and item_number_as_rule_number.
3860 Adjust to `derive' now containing possibly 0.
3861 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
3862 Handle the `- 1' part in rule numbers from/to item numbers.
3863 * src/conflicts.c (log_resolution): Fix the message which reversed
3864 shift and reduce.
3865 * src/output.c (action_row): Initialize default_rule to -1.
3866 (token_actions): Adjust.
3867 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
3868 expected output.
3869 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
3870
4a2a22f4
AD
38712002-07-25 Akim Demaille <akim@epita.fr>
3872
3873 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
3874 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
3875 (b4_c_knr_arg_decl): New.
3876 * data/yacc.c: Use it to define yysymprint, yydestruct, and
3877 yyreport_parse_error.
3878
b8df3223
AD
38792002-07-25 Akim Demaille <akim@epita.fr>
3880
3881 * data/yacc.c (yyreport_parse_error): New, extracted from...
3882 (yyparse): here.
3883 (yydestruct, yysymprint): Move above yyparse.
3884 Be K&R compliant.
3885
a762e609
AD
38862002-07-25 Akim Demaille <akim@epita.fr>
3887
3888 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
3889 replace...
3890 (b4_sint_type, b4_uint_type): these.
3891 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
3892 * tests/regression.at (Web2c Actions): Adjust.
3893
12b0043a
AD
38942002-07-25 Akim Demaille <akim@epita.fr>
3895
3896 * src/gram.h (TIEM_NUMBER_MAX): New.
3897 (item_number_of_rule_number, rule_number_of_item_number): Rename
3898 as...
3899 (rule_number_as_item_number, item_number_as_rule_number): these.
3900 Adjust dependencies.
3901 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3902 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3903 (symbol_number_to_vector_number): New.
3904 (order): Of vector_number_t* type.
3905 (base_t, BASE_MAX, BASE_MIN): New.
3906 (froms, tos, width, pos, check): Of base_t type.
3907 (action_number_t, ACTION_MIN, ACTION_MAX): New.
3908 (actrow): Of action_number_t type.
3909 (conflrow): Of unsigned int type.
3910 (table_ninf, base_ninf): New.
3911 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
3912 (muscle_insert_int_table, muscle_insert_base_table)
3913 (muscle_insert_rule_number_table): New.
3914 (prepare_tokens): Output `toknum' as int_table.
3915 (action_row): Returns a rule_number_t.
3916 Use ACTION_MIN, not SHRT_MIN.
3917 (token_actions): yydefact is rule_number_t*.
3918 (table_ninf_remap): New.
3919 (pack_table): Use it for `base' and `table'.
3920 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
3921 replaced with...
3922 (YYPACT_NINF, YYTABLE_NINF): these.
3923 (yypact, yytable): Compute their types instead of hard-coded
3924 `short'.
3925 * tests/regression.at (Web2c Actions): Adjust.
3926
5dde258a
AD
39272002-07-19 Akim Demaille <akim@epita.fr>
3928
3929 * src/scan-gram.l (id): Can start with an underscore.
3930
a945ec39
AD
39312002-07-16 Akim Demaille <akim@epita.fr>
3932
3933 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
3934 Adjust all former `associativity' dependencies.
3935 * src/symtab.c (symbol_new): Default associativity is `undef', not
3936 `right'.
3937 (symbol_check_alias_consistence): Adjust.
3938
fae437e8
AD
39392002-07-09 Akim Demaille <akim@epita.fr>
3940
3941 * doc/bison.texinfo: Properly set the ``header'' part.
3942 Use @dircategory ``GNU programming tools'' as per Texinfo's
3943 documentation.
3944 Use @copying.
3945
1a715ef2
AD
39462002-07-09 Akim Demaille <akim@epita.fr>
3947
3948 * lib/quotearg.h: Protect against multiple inclusions.
3949 * src/location.h (location_t): Add a `file' member.
3950 (LOCATION_RESET, LOCATION_PRINT): Adjust.
3951 * src/complain.c (warn_at, complain_at, fatal_at): Drop
3952 `error_one_per_line' support.
3953
a5d50994
AD
39542002-07-09 Akim Demaille <akim@epita.fr>
3955
3956 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
3957 * src/reader.c (lineno): Remove.
3958 Adjust all dependencies.
3959 (get_merge_function): Take a location and use complain_at.
3960 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
3961 * tests/regression.at (Invalid inputs, Mixing %token styles):
3962 Adjust.
3963
b275314e
AD
39642002-07-09 Akim Demaille <akim@epita.fr>
3965
3966 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
3967 recovery rule, and forbid extensions when --yacc.
3968 (gram_error): Use complain_at.
3969 * src/reader.c (reader): Exit if there were parse errors.
3970
865b9df1
AD
39712002-07-09 Akim Demaille <akim@epita.fr>
3972
3973 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
3974 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
3975 Reported by R Blake <blakers@mac.com>.
3976
c76e14da
AD
39772002-07-09 Akim Demaille <akim@epita.fr>
3978
3979 * data/yacc.c: Output the copyright notive in the header.
3980
7db2ed2d
AD
39812002-07-03 Akim Demaille <akim@epita.fr>
3982
3983 * src/output.c (froms, tos): Are state_number_t.
3984 (save_column): sp, sp1, and sp2 are state_number_t.
3985 (prepare): Rename `final' as `final_state_number', `nnts' as
3986 `nterms_number', `nrules' as `rules_number', `nstates' as
3987 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
3988 unused.
3989 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
3990 * data/lalr1.cc (nsym_): Remove, unused.
3991
e68e0410
AD
39922002-07-03 Akim Demaille <akim@epita.fr>
3993
3994 * src/lalr.h, src/lalr.c (goto_number_t): New.
3995 * src/lalr.c (goto_list_t): New.
3996 Propagate them.
3997 * src/nullable.c (rule_list_t): New.
3998 Propagate.
3999 * src/types.h: Remove.
4000
e1a4f3a4
AD
40012002-07-03 Akim Demaille <akim@epita.fr>
4002
4003 * src/closure.c (print_fderives): Use rule_rhs_print.
4004 * src/derives.c (print_derives): Use rule_rhs_print.
4005 (rule_list_t): New, replaces `shorts'.
4006 (set_derives): Add comments.
4007 * tests/sets.at (Nullable, Firsts): Adjust.
4008
536545f3
AD
40092002-07-03 Akim Demaille <akim@epita.fr>
4010
4011 * src/output.c (prepare_actions): Free `tally' and `width'.
4012 (prepare_actions): Allocate and free `order'.
4013 * src/symtab.c (symbols_free): Free `symbols'.
4014 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
4015 * src/output.c (m4_invoke): Move to...
4016 * src/scan-skel.l: here.
4017 (<<EOF>>): Close yyout, and free its name.
4018
8b752b00
AD
40192002-07-03 Akim Demaille <akim@epita.fr>
4020
4021 Fix some memory leaks, and fix a bug: state 0 was examined twice.
4022
4023 * src/LR0.c (new_state): Merge into...
4024 (state_list_append): this.
4025 (new_states): Merge into...
4026 (generate_states): here.
4027 (set_states): Don't ensure a proper `errs' state member here, do it...
4028 * src/conflicts.c (conflicts_solve): here.
4029 * src/state.h, src/state.c: Comment changes.
4030 (state_t): Rename member `shifts' as `transitions'.
4031 Adjust all dependencies.
4032 (errs_new): For consistency, also take the values as argument.
4033 (errs_dup): Remove.
4034 (state_errs_set): New.
4035 (state_reductions_set, state_transitions_set): Assert that no
4036 previous value was assigned.
4037 (state_free): New.
4038 (states_free): Use it.
4039 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
4040 temporary storage: use `errs' and `nerrs' as elsewhere.
4041 (set_conflicts): Allocate and free this `errs'.
4042
613f5e1a
AD
40432002-07-02 Akim Demaille <akim@epita.fr>
4044
4045 * lib/libiberty.h: New.
4046 * lib: Update the bitset implementation from upstream.
4047 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
4048 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
4049 * src/main.c: Adjust bitset stats calls.
4050
26e0cadc
PE
40512002-07-01 Paul Eggert <eggert@twinsun.com>
4052
4053 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
4054 char, so that negative chars don't collide with $.
4055
1154cced
AD
40562002-06-30 Akim Demaille <akim@epita.fr>
4057
4058 Have the GLR tests be `warning' checked, and fix the warnings.
4059
4060 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
4061 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
4062 (yyremoveDeletes): `yyi' and `yyj' are size_t.
4063 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
4064 (yyaddDeferredAction): static.
4065 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
4066 (yyreportParseError): yyprefix is const.
4067 yytokenp is used only when verbose.
4068 (yy__GNUC__): Replace with __GNUC__.
4069 (yypdumpstack): yyi is size_t.
4070 (yypreference): Un-yy local variables and arguments, to avoid
4071 clashes with `yyr1'. Anyway, we are not in the user name space.
4072 (yytname_size): be an int, as is compared with ints.
4073 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
4074 Use them.
4075 * tests/cxx-gram.at: Use quotation to protect $1.
4076 Use AT_COMPILE to enable warnings hunts.
4077 Prototype yylex and yyerror.
4078 `Use' argc.
4079 Include `string.h', not `strings.h'.
4080 Produce and prototype stmtMerge only when used.
4081 yylex takes a location.
4082
97650f4e
AD
40832002-06-30 Akim Demaille <akim@epita.fr>
4084
4085 We spend a lot of time in quotearg, in particular when --verbose.
4086
4087 * src/symtab.c (symbol_get): Store a quoted version of the key.
4088 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
4089 Adjust all callers.
4090
d2576365
AD
40912002-06-30 Akim Demaille <akim@epita.fr>
4092
4093 * src/state.h (reductions_t): Rename member `nreds' as num.
4094 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
4095 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
4096
ccaf65bc
AD
40972002-06-30 Akim Demaille <akim@epita.fr>
4098
4099 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
4100 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
4101 (shifts_to): Rename as...
4102 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
4103 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
4104 (TRANSITION_IS_DISABLED, transitions_to): these.
4105
87675353
AD
41062002-06-30 Akim Demaille <akim@epita.fr>
4107
4108 * src/print.c (print_shifts, print_gotos): Merge into...
4109 (print_transitions): this.
4110 (print_transitions, print_errs, print_reductions): Align the
4111 lookaheads columns.
4112 (print_core, print_transitions, print_errs, print_state,
4113 print_grammar): Output empty lines separator before, not after.
4114 (state_default_rule_compute): Rename as...
4115 (state_default_rule): this.
4116 * tests/conflicts.at (Defaulted Conflicted Reduction),
4117 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
4118 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
4119
ce4ccb4b
AD
41202002-06-30 Akim Demaille <akim@epita.fr>
4121
4122 Display items as we display rules.
4123
4124 * src/gram.h, src/gram.c (rule_lhs_print): New.
4125 * src/gram.c (grammar_rules_partial_print): Use it.
4126 * src/print.c (print_core): Likewise.
4127 * tests/conflicts.at (Defaulted Conflicted Reduction),
4128 (Unresolved SR Conflicts): Adjust.
4129 (Unresolved SR Conflicts): Adjust and rename as...
4130 (Resolved SR Conflicts): this, as was meant.
4131 * tests/regression.at (Web2c Report): Adjust.
4132
bc933ef1
AD
41332002-06-30 Akim Demaille <akim@epita.fr>
4134
4135 * src/print.c (state_default_rule_compute): New, extracted from...
4136 (print_reductions): here.
4137 Pessimize, but clarify the code.
4138 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
4139
53d4308d
AD
41402002-06-30 Akim Demaille <akim@epita.fr>
4141
4142 * src/output.c (action_row): Let default_rule be always a rule
4143 number.
4144
574fb2d5
AD
41452002-06-30 Akim Demaille <akim@epita.fr>
4146
4147 * src/closure.c (print_firsts, print_fderives, closure):
4148 Use BITSET_EXECUTE.
4149 * src/lalr.c (lookaheads_print): Likewise.
4150 * src/state.c (state_rule_lookaheads_print): Likewise.
4151 * src/print_graph.c (print_core): Likewise.
4152 * src/print.c (print_reductions): Likewise.
4153 * src/output.c (action_row): Likewise.
4154 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
4155
05811fd7
AD
41562002-06-30 Akim Demaille <akim@epita.fr>
4157
4158 * src/print_graph.c: Use report_flag.
4159
0e4d5753
AD
41602002-06-30 Akim Demaille <akim@epita.fr>
4161
4162 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
4163 to...
4164 * src/relation.h, src/relation.c (traverse, relation_digraph)
4165 (relation_print, relation_transpose): New.
4166
24c7d800
AD
41672002-06-30 Akim Demaille <akim@epita.fr>
4168
4169 * src/state.h, src/state.c (shifts_to): New.
4170 * src/lalr.c (build_relations): Use it.
4171
9222837b
AD
41722002-06-30 Akim Demaille <akim@epita.fr>
4173
4174 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
4175 (item_number_of_rule_number, rule_number_of_item_number): New.
4176 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
4177 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
4178 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
4179 Propagate their use.
4180 Much remains to be done, in particular wrt `shorts' from types.h.
4181
260008e5
AD
41822002-06-30 Akim Demaille <akim@epita.fr>
4183
4184 * src/symtab.c (symbol_new): Initialize the `printer' member.
4185
8a731ca8
AD
41862002-06-30 Akim Demaille <akim@epita.fr>
4187
4188 * src/LR0.c (save_reductions): Remove, replaced by...
4189 * src/state.h, src/state.c (state_reductions_set): New.
4190 (reductions, errs): Rename as...
4191 (reductions_t, errs_t): these.
4192 Adjust all dependencies.
4193
32e1e0a4
AD
41942002-06-30 Akim Demaille <akim@epita.fr>
4195
4196 * src/LR0.c (state_list_t, state_list_append): New.
4197 (first_state, last_state): Now symbol_list_t.
4198 (this_state): Remove.
4199 (new_itemsets, append_states, save_reductions): Take a state_t as
4200 argument.
4201 (set_states, generate_states): Adjust.
4202 (save_shifts): Remove, replaced by...
4203 * src/state.h, src/state.c (state_shifts_set): New.
4204 (shifts): Rename as...
4205 (shifts_t): this.
4206 Adjust all dependencies.
4207 * src/state.h (state_t): Remove the `next' member.
4208
e5fb6710
AD
42092002-06-30 Akim Demaille <akim@epita.fr>
4210
4211 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
4212 escaped in slot 0.
4213
c7ca99d4
AD
42142002-06-30 Akim Demaille <akim@epita.fr>
4215
4216 Use hash.h for the state hash table.
4217
4218 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
4219 (allocate_storage): Use state_hash_new.
4220 (free_storage): Use state_hash_free.
4221 (new_state, get_state): Adjust.
4222 * src/lalr.h, src/lalr.c (states): Move to...
4223 * src/states.h (state_t): Remove the `link' member, no longer
4224 used.
4225 * src/states.h, src/states.c: here.
4226 (state_hash_new, state_hash_free, state_hash_lookup)
4227 (state_hash_insert, states_free): New.
4228 * src/states.c (state_table, state_compare, state_hash): New.
4229 * src/output.c (output_actions): Do not free states now, since we
4230 still need to know the final_state number in `prepare', called
4231 afterwards. Do it...
4232 * src/main.c (main): here: call states_free after `output'.
4233
df0e7316
AD
42342002-06-30 Akim Demaille <akim@epita.fr>
4235
4236 * src/state.h, src/state.c (state_new): New, extracted from...
4237 * src/LR0.c (new_state): here.
4238 * src/state.h (STATE_ALLOC): Move to...
4239 * src/state.c: here.
4240 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
4241 * src/state.h, src/state.c: here.
4242
39f41916
AD
42432002-06-30 Akim Demaille <akim@epita.fr>
4244
4245 * src/reader.c (gensym): Rename as...
4246 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
4247 (getsym): Rename as...
4248 (symbol_get): this.
4249
d57650a5
AD
42502002-06-30 Akim Demaille <akim@epita.fr>
4251
4252 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
4253 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
4254 * src/output.c, src/print.c, src/print_graph.c: Propagate.
4255 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
4256
5a08f1ce
AD
42572002-06-30 Akim Demaille <akim@epita.fr>
4258
4259 Make the test suite pass with warnings checked.
4260
4261 * tests/actions.at (Printers and Destructors): Improve.
4262 Avoid unsigned vs. signed issues.
4263 * tests/calc.at: Don't exercise the scanner here, do it...
4264 * tests/input.at (Torturing the Scanner): here.
4265
720623af
PH
42662002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4267
88e7e941 4268 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
4269 reorganize first lines parallel to yacc.c.
4270
fb8135fa
AD
42712002-06-28 Akim Demaille <akim@epita.fr>
4272
4273 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
4274 (b4_token_enum, b4_token_defines): New, factored from...
4275 * data/lalr1.cc, data/yacc.c, glr.c: here.
4276
41442480
AD
42772002-06-28 Akim Demaille <akim@epita.fr>
4278
4279 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
4280 unused variables.
4281 * src/output.c (merger_output): static.
4282
e0e5bf84
AD
42832002-06-28 Akim Demaille <akim@epita.fr>
4284
4285 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
4286 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
4287 pacify GCC.
4288 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 4289
676385e2
PH
42902002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4291
4292 Accumulated changelog for new GLR parsing features.
4293
6a254321 4294 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
4295 conflicts_total_count.
4296 * src/conflicts.h: Ditto.
4297 * src/output.c (token_actions): Use the new name.
4298 (output_conflicts): Change conflp => conflict_list_heads, and
4299 confl => conflict_list for better readability.
4300 * data/glr.c: Use the new names.
4301 * NEWS: Add self to GLR announcement.
e0e5bf84 4302
676385e2
PH
4303 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
4304
4305 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
4306 Akim Demaille.
4307
4308 * data/bison.glr: Change name to glr.c
4309 * data/glr.c: Renamed from bison.glr.
4310 * data/Makefile.am: Add glr.c
e0e5bf84
AD
4311
4312 * src/getargs.c:
4313
676385e2
PH
4314 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
4315 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 4316
676385e2
PH
4317 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4318
4319 * data/bison.glr: Be sure to restore the
4320 current #line when returning to the skeleton contents after having
4321 exposed the input file's #line.
4322
4323 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4324
4325 * data/bison.glr: Bring up to date with changes to bison.simple.
4326
4327 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4328
4329 * data/bison.glr: Correct definitions that use b4_prefix.
4330 Various reformatting.
4331 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
4332 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
4333 yytokenp argument; now part of stack.
4334 (yychar): Define to behave as documented.
4335 (yyclearin): Ditto.
e0e5bf84 4336
676385e2
PH
4337 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4338
4339 * src/reader.h: Add declaration for free_merger_functions.
4340
4341 * src/reader.c (merge_functions): New variable.
4342 (get_merge_function): New function.
4343 (free_merger_functions): New function.
4344 (readgram): Check for %prec that is not followed by a symbol.
4345 Handle %dprec and %merge declarations.
4346 (packgram): Initialize dprec and merger fields in rules array.
4347
4348 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
4349 conflict_list_cnt, conflict_list_free): New variables.
4350 (table_grow): Also grow conflict_table.
e0e5bf84 4351 (prepare_rules): Output dprec and merger tables.
676385e2 4352 (conflict_row): New function.
e0e5bf84 4353 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
4354 default reduction in conflicted states for GLR parser so that there
4355 are spaces for the conflict lists.
4356 (save_row): Also save conflict information.
4357 (token_actions): Allocate conflict list.
4358 (merger_output): New function.
4359 (pack_vector): Pack conflict table, too.
4360 (output_conflicts): New function to output yyconflp and yyconfl.
4361 (output_check): Allocate conflict_tos.
4362 (output_actions): Output conflict tables, also.
4363 (output_skeleton): Output b4_mergers definition.
4364 (prepare): Output b4_max_rhs_length definition.
4365 Use 'bison.glr' as default skeleton for GLR parsers.
4366
4367 * src/gram.c (glr_parser): New flag.
4368 (grammar_free): Call free_merger_functions.
4369
4370 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
4371 all pairs of conflicting reductions, rather than just all tokens
4372 causing conflicts. Needed to size conflict tables.
e0e5bf84 4373 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
4374 interface.
4375 (conflicts_print): Ditto.
4376 (count_total_conflicts): New function.
4377
4378 * src/reader.h (merger_list): New type.
4379 (merge_functions): New variable.
4380
4381 * src/lex.h (tok_dprec, tok_merge): New token types.
4382
4383 * src/gram.h (rule_s): Add dprec and merger fields.
4384 (glr_parser): New flag.
4385
4386 * src/conflicts.h (count_total_conflicts): New function.
4387
4388 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
4389
4390 * doc/bison.texinfo (Generalized LR Parsing): New section.
4391 (GLR Parsers): New section.
4392 (Language and Grammar): Mention GLR parsing.
4393 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
4394 Correct typo ("tge" -> "the").
4395
4396 * data/bison.glr: New skeleton for GLR parsing.
4397
4398 * tests/cxx-gram.at: New tests for GLR parsing.
4399
4400 * tests/testsuite.at: Include cxx-gram.at.
4401
4402 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 4403
676385e2
PH
4404 * src/parse-gram.y:
4405
4406 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
4407
4408 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 4409
b5480d74 44102002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
4411
4412 * src/options.h, src/options.c: Remove.
4413 * src/getargs.c (short_options, long_options): New.
4414
60491a94
AD
44152002-06-27 Akim Demaille <akim@epita.fr>
4416
4417 * data/bison.simple, data/bison.c++: Rename as...
4418 * data/yacc.c, data/lalr1.cc: these.
4419 * doc/bison.texinfo (Environment Variables): Remove.
4420
9be0c25b
AD
44212002-06-25 Raja R Harinath <harinath@cs.umn.edu>
4422
4423 * src/getargs.c (report_argmatch): Initialize strtok().
4424
1ae72863
AD
44252002-06-20 Akim Demaille <akim@epita.fr>
4426
4427 * data/bison.simple (b4_symbol_actions): New, replaces...
4428 (b4_symbol_destructor, b4_symbol_printer): these.
4429 (yysymprint): Be sure to call YYPRINT only for tokens, and using
4430 user token numbers.
4431
87542d29
AD
44322002-06-20 Akim Demaille <akim@epita.fr>
4433
4434 * data/bison.simple (yydestructor): Rename as...
4435 (yydestruct): this.
4436
1a31ed21
AD
44372002-06-20 Akim Demaille <akim@epita.fr>
4438
4439 * src/symtab.h, src/symtab.c (symbol_type_set)
4440 (symbol_destructor_set, symbol_precedence_set): The location is
4441 the last argument.
4442 Adjust all callers.
4443
e776192e
AD
44442002-06-20 Akim Demaille <akim@epita.fr>
4445
4446 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
4447 internals.
4448 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
4449 Takes a location.
4450 * src/symtab.h, src/symtab.c (symbol_class_set)
4451 (symbol_user_token_number_set): Likewise.
4452 Adjust all callers.
4453 Promote complain_at.
4454 * tests/input.at (Type Clashes): Adjust.
4455
5c1180b3
AD
44562002-06-20 Akim Demaille <akim@epita.fr>
4457
4458 * data/bison.simple (YYLEX): Fix the declaration when
4459 %pure-parser.
4460
e3170060
AD
44612002-06-20 Akim Demaille <akim@epita.fr>
4462
4463 * data/bison.simple (yysymprint): Don't print the token number,
4464 just its name.
4465 * tests/actions.at (Destructors): Rename as...
4466 (Printers and Destructors): this.
4467 Also exercise %printer.
4468
253862fd
AD
44692002-06-20 Akim Demaille <akim@epita.fr>
4470
4471 * data/bison.simple (YYDSYMPRINT): New.
4472 Use it to remove many of the #if YYDEBUG/if (yydebug).
4473
366eea36
AD
44742002-06-20 Akim Demaille <akim@epita.fr>
4475
4476 * src/symtab.h, src/symtab.c (symbol_t): printer and
4477 printer_location are new members.
4478 (symbol_printer_set): New.
4479 * src/parse-gram.y (PERCENT_PRINTER): New token.
4480 Handle its associated rule.
4481 * src/scan-gram.l: Adjust.
4482 (handle_destructor_at, handle_destructor_dollar): Rename as...
4483 (handle_symbol_code_at, handle_symbol_code_dollar): these.
4484 * src/output.c (symbol_printers_output): New.
4485 (output_skeleton): Call it.
4486 * data/bison.simple (yysymprint): New. Cannot be named yyprint
4487 since there are already many grammar files with a user `yyprint'.
4488 Replace the calls to YYPRINT to calls to yysymprint.
4489 * tests/calc.at: Adjust.
4490 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
4491 taking advantage of parser very internal details (stack size!).
4492
4f25ebb0
AD
44932002-06-20 Akim Demaille <akim@epita.fr>
4494
4495 * src/scan-gram.l: Complete the scanner with the missing patterns
4496 to pacify Flex.
4497 Use `quote' and `symbol_tag_get' where appropriate.
4498
93b68a0e
AD
44992002-06-19 Akim Demaille <akim@epita.fr>
4500
4501 * tests/actions.at (Destructors): Augment to test locations.
4502 * data/bison.simple (yydestructor): Pass it the current location
4503 if locations are enabled.
4504 Prototype only when __STDC__ or C++.
4505 Change the argument names to move into the yy name space: there is
4506 user code here.
4507
58612f1d
AD
45082002-06-19 Akim Demaille <akim@epita.fr>
4509
74310291
AD
4510 * data/bison.simple (b4_pure_if): New.
4511 Use it instead of #ifdef YYPURE.
4512
45132002-06-19 Akim Demaille <akim@epita.fr>
4514
4515 * data/bison.simple (b4_location_if): New.
58612f1d
AD
4516 Use it instead of #ifdef YYLSP_NEEDED.
4517
f25bfb75
AD
45182002-06-19 Akim Demaille <akim@epita.fr>
4519
4520 Prepare @$ in %destructor, but currently don't bind it in the
4521 skeleton, as %location use is not cleaned up yet.
4522
4523 * src/scan-gram.l (handle_dollar, handle_destructor_at)
4524 (handle_action_at): New.
4525 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
4526 a braced_code_t and a location as additional arguments.
4527 (handle_destructor_dollar): Instead of requiring `b4_eval', just
4528 unquote one when outputting `b4_dollar_dollar'.
4529 Adjust callers.
4530 * data/bison.simple (b4_eval): Remove.
4531 (b4_symbol_destructor): Adjust.
4532 * tests/input.at (Invalid @n): Adjust.
4533
c732d2c6
AD
45342002-06-19 Zack Weinberg <zack@codesourcery.com>
4535
4536 * doc/bison.texinfo: Document ability to have multiple
4537 prologue sections.
4538
8c165d89
AD
45392002-06-18 Akim Demaille <akim@epita.fr>
4540
4541 * src/files.c (compute_base_names): When computing the output file
4542 names from the input file name, strip the directory part.
4543
ca98bf57
AD
45442002-06-18 Akim Demaille <akim@epita.fr>
4545
4546 * data/bison.simple.new: Comment changes.
4547 Reported by Andreas Schwab.
4548
0bfb02ff
AD
45492002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
4550
4551 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
4552 there are no `label `yyoverflowlab' defined but not used' warnings
4553 when yyoverflow is defined.
4554
24c0aad7
AD
45552002-06-18 Akim Demaille <akim@epita.fr>
4556
4557 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
4558 new member.
4559 (symbol_destructor_set): Adjust.
4560 * src/output.c (symbol_destructors_output): Output the destructor
4561 locations.
4562 Output the symbol name.
4563 * data/bison.simple (b4_symbol_destructor): Adjust.
4564
5719c109
AD
45652002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
4566 and Akim Demaille <akim@epita.fr>
4567
4568 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
4569 what's left on the stack when the error recovery hits EOF.
4570 * tests/actions.at (Destructors): Complete to exercise this case.
4571
9280d3ef
AD
45722002-06-17 Akim Demaille <akim@epita.fr>
4573
4574 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
4575 arguments is really empty, not only equal to `[]'.
4576 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
4577 member.
4578 (symbol_destructor_set): New.
4579 * src/output.c (symbol_destructors_output): New.
4580 * src/reader.h (brace_code_t, current_braced_code): New.
4581 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
4582 (handle_dollar): Rename as...
4583 (handle_action_dollar): this.
4584 (handle_destructor_dollar): New.
4585 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
4586 (grammar_declaration): Use it.
4587 * data/bison.simple (yystos): Is always defined.
4588 (yydestructor): New.
4589 * tests/actions.at (Destructors): New.
4590 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
4591
dafdc66f
AD
45922002-06-17 Akim Demaille <akim@epita.fr>
4593
4594 * src/symlist.h, src/symlist.c (symbol_list_length): New.
4595 * src/scan-gram.l (handle_dollar, handle_at): Compute the
4596 rule_length only when needed.
4597 * src/output.c (actions_output, token_definitions_output): Output
4598 the full M4 block.
4599 * src/symtab.c: Don't access directly to the symbol tag, use
4600 symbol_tag_get.
4601 * src/parse-gram.y: Use symbol_list_free.
4602
56c47203
AD
46032002-06-17 Akim Demaille <akim@epita.fr>
4604
4605 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
4606 (symbol_list_prepend, get_type_name): Move to...
4607 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
4608 (symbol_list_prepend, symbol_list_n_type_name_get): here.
4609 Adjust all callers.
4610 (symbol_list_free): New.
4611 * src/scan-gram.l (handle_dollar): Takes a location.
4612 * tests/input.at (Invalid $n): Adjust.
4613
1e0bab92
AD
46142002-06-17 Akim Demaille <akim@epita.fr>
4615
4616 * src/reader.h, src/reader.c (symbol_list_new): Export it.
4617 (symbol_list_prepend): New.
4618 * src/parse-gram.y (%union): `list' is a new member.
4619 (symbols.1): New, replaces...
4620 (terms_to_prec.1, nterms_to_type.1): these.
4621 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
4622 Take a location as additional argument.
4623 Adjust all callers.
4624
04e60654
AD
46252002-06-15 Akim Demaille <akim@epita.fr>
4626
4627 * src/parse-gram.y: Move %token in the declaration section so that
4628 we don't depend upon CVS Bison.
4629
10e5b8bd
AD
46302002-06-15 Akim Demaille <akim@epita.fr>
4631
4632 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
4633 * src/print.c (print_core): Use it.
4634
9801d40c
AD
46352002-06-15 Akim Demaille <akim@epita.fr>
4636
4637 * src/conflicts.c (log_resolution): Accept the rule involved in
4638 the sr conflicts instead of the lookahead number that points to
4639 that rule.
4640 (flush_reduce): Accept the current lookahead vector as argument,
4641 instead of the index in LA.
4642 (resolve_sr_conflict): Accept the current number of lookahead
4643 bitset to consider for the STATE, instead of the index in LA.
4644 (set_conflicts): Adjust.
4645 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
4646
c0263492
AD
46472002-06-15 Akim Demaille <akim@epita.fr>
4648
4649 * src/state.h (state_t): Replace the `lookaheadsp' member, a
4650 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
4651 Adjust all dependencies.
4652 * src/lalr.c (initialize_lookaheads): Split into...
4653 (states_lookaheads_count, states_lookaheads_initialize): these.
4654 (lalr): Adjust.
4655
9757c359
AD
46562002-06-15 Akim Demaille <akim@epita.fr>
4657
4658 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
4659 out of...
4660 (grammar_rules_print): here.
4661 * src/reduce.c (reduce_output): Use it.
4662 * tests/reduce.at (Useless Rules, Reduced Automaton)
4663 (Underivable Rules): Adjust.
4664
6b98e4b5
AD
46652002-06-15 Akim Demaille <akim@epita.fr>
4666
4667 Copy BYacc's nice way to report the grammar.
4668
4669 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
4670 New.
4671 Don't print the rules' location, it is confusing and useless.
4672 (rule_print): Use grammar_rhs_print.
4673 * src/print.c (print_grammar): Use grammar_rules_print.
4674
6b98e4b5
AD
46752002-06-15 Akim Demaille <akim@epita.fr>
4676
4677 Complete and rationalize `useless thing' warnings.
4678
4679 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
4680 (symbol_tag_print): New.
4681 Use them everywhere in place of accessing directly the tag member.
4682 * src/gram.h, src/gram.c (rule_print): New.
4683 Use it where a rule used to be printed `by hand'.
4684 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
4685 (reduce_grammar_tables): Report the useless rules.
4686 (reduce_print): Useless things are a warning, not an error.
4687 Report it as such.
4688 * tests/reduce.at (Useless Nonterminals, Useless Rules):
4689 (Reduced Automaton, Underivable Rules): Adjust.
4690 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
4691 * tests/conflicts.at (Unresolved SR Conflicts)
4692 (Solved SR Conflicts): Adjust.
4693
ee000ba4
AD
46942002-06-15 Akim Demaille <akim@epita.fr>
4695
4696 Let symbols have a location.
4697
4698 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
4699 (getsym): Adjust.
4700 Adjust all callers.
4701 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
4702 Use location_t, not int.
4703 * src/symtab.c (symbol_check_defined): Take advantage of the
4704 location.
4705 * tests/regression.at (Invalid inputs): Adjust.
4706
8efe435c
AD
47072002-06-15 Akim Demaille <akim@epita.fr>
4708
4709 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
4710 (input): Don't try to initialize yylloc here, do it in the
4711 scanner.
4712 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
4713 * src/gram.h (rule_t): Change line and action_line into location
4714 and action_location, of location_t type.
4715 Adjust all dependencies.
4716 * src/location.h, src/location.c (empty_location): New.
4717 * src/reader.h, src/reader.c (grammar_start_symbol_set)
4718 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
4719 (grammar_current_rule_symbol_append)
4720 (grammar_current_rule_action_append): Expect a location as argument.
4721 * src/reader.c (grammar_midrule_action): Adjust to attach an
4722 action's location as dummy symbol location.
4723 * src/symtab.h, src/symtab.c (startsymbol_location): New.
4724 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
4725 the line numbers.
4726
1921f1d7
AD
47272002-06-14 Akim Demaille <akim@epita.fr>
4728
4729 Grammar declarations may be found in the grammar section.
4730
4731 * src/parse-gram.y (rules_or_grammar_declaration): New.
4732 (declarations): Each declaration may end with a semicolon, not
4733 just...
4734 (grammar_declaration): `"%union"'.
4735 (grammar): Branch to rules_or_grammar_declaration.
4736
4515534c
AD
47372002-06-14 Akim Demaille <akim@epita.fr>
4738
4739 * src/main.c (main): Invoke scanner_free.
4740
f958596b
AD
47412002-06-14 Akim Demaille <akim@epita.fr>
4742
4743 * src/output.c (m4_invoke): Extracted from...
4744 (output_skeleton): here.
4745 Free tempfile.
4746
2c569025
AD
47472002-06-14 Akim Demaille <akim@epita.fr>
4748
4749 * src/parse-gram.y (directives, directive, gram)
4750 (grammar_directives, precedence_directives, precedence_directive):
4751 Rename as...
4752 (declarations, declaration, grammar, grammar_declaration)
4753 (precedence_declaration, precedence_declarator): these.
4754 (symbol_declaration): New.
4755
592e8d4d
AD
47562002-06-14 Akim Demaille <akim@epita.fr>
4757
4758 * src/files.c (action_obstack): Remove, unused.
4759 (output_obstack): Remove it, and all its dependencies, as it is no
4760 longer needed.
4761 * src/reader.c (epilogue_set): Build the epilogue in the
4762 muscle_obstack.
4763 * src/output.h, src/output.c (muscle_obstack): Move to...
4764 * src/muscle_tab.h, src/muscle_tab.h: here.
4765 (muscle_init): Initialize muscle_obstack.
4766 (muscle_free): New.
4767 * src/main.c (main): Call it.
4768
0c15323d
AD
47692002-06-14 Akim Demaille <akim@epita.fr>
4770
4771 * src/location.h: New, extracted from...
4772 * src/reader.h: here.
4773 * src/Makefile.am (noinst_HEADERS): Merge into
4774 (bison_SOURCES): this.
4775 Add location.h.
4776 * src/parse-gram.y: Use location_t instead of Bison's.
4777 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
4778 Use location_t instead of ints.
4779
e96c9728
AD
47802002-06-14 Akim Demaille <akim@epita.fr>
4781
4782 * data/bison.simple, data/bison.c++: Be sure to restore the
4783 current #line when returning to the skeleton contents after having
4784 exposed the input file's #line.
4785
75d1fe16
AD
47862002-06-12 Akim Demaille <akim@epita.fr>
4787
4788 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
4789 eager.
4790 * tests/actions.at (Exotic Dollars): New.
4791
6c35d22c
AD
47922002-06-12 Akim Demaille <akim@epita.fr>
4793
4794 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
4795 ['"/] too eagerly.
4796 * tests/input.at (Torturing the Scanner): New.
4797
1d6412ad
AD
47982002-06-11 Akim Demaille <akim@epita.fr>
4799
4800 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
4801 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
4802 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
4803 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
4804 * src/reader.c (reader): Use it.
4805
4cdb01db
AD
48062002-06-11 Akim Demaille <akim@epita.fr>
4807
4808 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
4809 Adjust all callers.
4810 (scanner_last_string_free): New.
4811
44995b2e
AD
48122002-06-11 Akim Demaille <akim@epita.fr>
4813
4814 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
4815 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
4816 (last_string, YY_OBS_FREE): New.
4817 Use them when returning an ID.
4818
e9955c83
AD
48192002-06-11 Akim Demaille <akim@epita.fr>
4820
4821 Have Bison grammars parsed by a Bison grammar.
4822
4823 * src/reader.c, src/reader.h (prologue_augment): New.
4824 * src/reader.c (copy_definition): Remove.
4825
4826 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
4827 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
4828 (grammar_current_rule_prec_set, grammar_current_rule_check)
4829 (grammar_current_rule_symbol_append)
4830 (grammar_current_rule_action_append): Export.
4831 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
4832 (symbol_list_action_append): Remove.
4833 Hook the routines from reader.
4834 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
4835 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
4836
4837 * src/reader.c (read_declarations): Remove, unused.
4838
4839 * src/parse-gram.y: Handle the epilogue.
4840 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
4841 (grammar_start_symbol_set): this.
4842 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
4843 * src/reader.c (readgram): Remove, unused.
4844 (reader): Adjust to insert eoftoken and axiom where appropriate.
4845
4846 * src/reader.c (copy_dollar): Replace with...
4847 * src/scan-gram.h (handle_dollar): this.
4848 * src/parse-gram.y: Remove `%thong'.
4849
4850 * src/reader.c (copy_at): Replace with...
4851 * src/scan-gram.h (handle_at): this.
4852
4853 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
4854 New.
4855
4856 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
4857 time being.
4858
4859 * src/reader.h, src/reader.c (grammar_rule_end): New.
4860
4861 * src/parse.y (current_type, current_class): New.
4862 Implement `%nterm', `%token' support.
4863 Merge `%term' into `%token'.
4864 (string_as_id): New.
4865 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
4866 type name.
4867
4868 * src/parse-gram.y: Be sure to handle properly the beginning of
4869 rules.
4870
4871 * src/parse-gram.y: Handle %type.
4872 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
4873
4874 * src/parse-gram.y: More directives support.
4875 * src/options.c: No longer handle source directives.
4876
4877 * src/parse-gram.y: Fix %output.
4878
4879 * src/parse-gram.y: Handle %union.
4880 Use the prologue locations.
4881 * src/reader.c (parse_union_decl): Remove.
4882
4883 * src/reader.h, src/reader.c (epilogue_set): New.
4884 * src/parse-gram.y: Use it.
4885
4886 * data/bison.simple, data/bison.c++: b4_stype is now either not
4887 defined, then default to int, or to the contents of %union,
4888 without `union' itself.
4889 Adjust.
4890 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
4891
4892 * src/output.c (actions_output): Don't output braces, as they are
4893 already handled by the scanner.
4894
4895 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
4896 characters to themselves.
4897
4898 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
4899 that the epilogue has a proper #line.
4900
4901 * src/parse-gram.y: Handle precedence/associativity.
4902
4903 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
4904 a terminal.
4905 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
4906 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
4907 at all to define terminals that cannot be emitted.
4908
4909 * src/scan-gram.l: Escape M4 characters.
4910
4911 * src/scan-gram.l: Working properly with escapes in user
4912 strings/characters.
4913
4914 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
4915 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
4916 grammar.
4917 Use more modest sizes, as for the time being the parser does not
4918 release memory, and therefore the process swallows a huge amount
4919 of memory.
4920
4921 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
4922 stricter %token grammar.
4923
4924 * src/symtab.h (associativity): Add `undef_assoc'.
4925 (symbol_precedence_set): Do nothing when passed an undef_assoc.
4926 * src/symtab.c (symbol_check_alias_consistence): Adjust.
4927
4928 * tests/regression.at (Invalid %directive): Remove, as it is now
4929 meaningless.
4930 (Invalid inputs): Adjust to the new error messages.
4931 (Token definitions): The new grammar doesn't allow too many
4932 eccentricities.
4933
4934 * src/lex.h, src/lex.c: Remove.
4935 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
4936 (copy_character, copy_string2, copy_string, copy_identifier)
4937 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
4938 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
4939 (parse_action): Remove.
4940 * po/POTFILES.in: Adjust.
4941
2e047461
AD
49422002-06-11 Akim Demaille <akim@epita.fr>
4943
cd05d13c 4944 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
4945 rule's action member: return the action as a string.
4946 Don't require `rule_length' as an argument: compute it.
4947 (grammar_current_rule_symbol_append)
4948 (grammar_current_rule_action_append): New, eved out from
4949 (readgram): here.
4950 Remove `action_flag', `rulelength', unused now.
4951
9af3fbce
AD
49522002-06-11 Akim Demaille <akim@epita.fr>
4953
4954 * src/reader.c (grammar_current_rule_prec_set).
4955 (grammar_current_rule_check): New, eved out from...
4956 (readgram): here.
4957 Remove `xaction', `first_rhs': useless.
4958 * tests/input.at (Type clashes): New.
4959 * tests/existing.at (GNU Cim Grammar): Adjust.
4960
1485e106
AD
49612002-06-11 Akim Demaille <akim@epita.fr>
4962
4963 * src/reader.c (grammar_midrule_action): New, Eved out from
4964 (readgram): here.
4965
da4160c3
AD
49662002-06-11 Akim Demaille <akim@epita.fr>
4967
4968 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
4969 New.
4970 (readgram): Use them as replacement of inlined code, crule and
4971 crule1.
4972
f6d0f937
AD
49732002-06-11 Akim Demaille <akim@epita.fr>
4974
4975 * src/reader.c (grammar_end, grammar_symbol_append): New.
4976 (readgram): Use them.
4977 Make the use of `p' as local as possible.
4978
69078d4b
AD
49792002-06-10 Akim Demaille <akim@epita.fr>
4980
4981 GCJ's parser requires the tokens to be defined before the prologue.
4982
4983 * data/bison.simple: Output the token definition before the user's
4984 prologue.
4985 * tests/regression.at (Braces parsing, Duplicate string)
4986 (Mixing %token styles): Check the output from bison.
4987 (Early token definitions): New.
4988
5e424082
AD
49892002-06-10 Akim Demaille <akim@epita.fr>
4990
4991 * src/symtab.c (symbol_user_token_number_set): Don't complain when
4992 assigning twice the same user number to a token, so that we can
4993 use it in...
4994 * src/lex.c (lex): here.
4995 Also use `symbol_class_set' instead of hand written code.
4996 * src/reader.c (parse_assoc_decl): Likewise.
4997
44536b35
AD
49982002-06-10 Akim Demaille <akim@epita.fr>
4999
5000 * src/symtab.c, src/symtab.c (symbol_class_set)
5001 (symbol_user_token_number_set): New.
5002 * src/reader.c (parse_token_decl): Use them.
5003 Use a switch instead of ifs.
5004 Use a single argument.
5005
8b9f2372
AD
50062002-06-10 Akim Demaille <akim@epita.fr>
5007
5008 Remove `%thong' support as it is undocumented, unused, duplicates
5009 `%token's job, and creates useless e-mail traffic with people who
5010 want to know what it is, why it is undocumented, unused, and
5011 duplicates `%token's job.
5012
5013 * src/reader.c (parse_thong_decl): Remove.
5014 * src/options.c (option_table): Remove "thong".
5015 * src/lex.h (tok_thong): Remove.
5016
3ae2b51f
AD
50172002-06-10 Akim Demaille <akim@epita.fr>
5018
5019 * src/symtab.c, src/symtab.c (symbol_type_set)
5020 (symbol_precedence_set): New.
5021 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
5022 (value_components_used): Remove, unused.
5023
2f1afb73
AD
50242002-06-09 Akim Demaille <akim@epita.fr>
5025
5026 Move symbols handling code out of the reader.
5027
5028 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
5029 (axiom): Move to...
5030 * src/symtab.h, src/symtab.c: here.
5031
5032 * src/gram.c (start_symbol): Remove: use startsymbol->number.
5033 * src/reader.c (startval): Rename as...
5034 * src/symtab.h, src/symtab.c (startsymbol): this.
5035 * src/reader.c: Adjust.
5036
5037 * src/reader.c (symbol_check_defined, symbol_make_alias)
5038 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5039 (token_translations_init)
5040 Move to...
5041 * src/symtab.c: here.
5042 * src/reader.c (packsymbols): Move to...
5043 * src/symtab.h, src/symtab.c (symbols_pack): here.
5044 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
5045 argument.
5046
e9bca3ad
AD
50472002-06-03 Akim Demaille <akim@epita.fr>
5048
5049 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
5050 then statements.
5051
86eff183
AD
50522002-06-03 Akim Demaille <akim@epita.fr>
5053
5054 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
5055 structs with non literals.
5056 * src/scan-skel.l: never-interactive.
5057 * src/conflicts.c (enum conflict_resolution_e): No trailing
5058 comma.
5059 * src/getargs.c (usage): Split long literal strings.
5060 Reported by Hans Aberg.
5061
717be197
AD
50622002-05-28 Akim Demaille <akim@epita.fr>
5063
5064 * data/bison.c++: Use C++ ostreams.
5065 (cdebug_): New member.
5066
670ddffd
AD
50672002-05-28 Akim Demaille <akim@epita.fr>
5068
5069 * src/output.c (output_skeleton): Be sure to allocate enough room
5070 for `/' _and_ for `\0' in full_skeleton.
5071
769b430f
AD
50722002-05-28 Akim Demaille <akim@epita.fr>
5073
5074 * data/bison.c++: Catch up with bison.simple:
5075 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5076 and Paul Eggert <eggert@twinsun.com>: `error' handing.
5077 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
5078 and popping traces.
5079
7067cb36
PH
50802002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5081
5082 * src/output.c (output_skeleton): Put an explicit path in front of
5083 the skeleton file name, rather than relying on the -I directory,
5084 to partially alleviate effects of having a skeleton file lying around
5085 in the current directory.
769b430f 5086
4a713ec2
PH
50872002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5088
769b430f 5089 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
5090 obstack_printf should be obstack_fgrow1.
5091
b408954b
AD
50922002-05-26 Akim Demaille <akim@epita.fr>
5093
5094 * src/state.h (state_t): `solved_conflicts' is a new member.
5095 * src/LR0.c (new_state): Set it to 0.
5096 * src/conflicts.h, src/conflicts.c (print_conflicts)
5097 (free_conflicts, solve_conflicts): Rename as...
5098 (conflicts_print, conflicts_free, conflicts_solve): these.
5099 Adjust callers.
5100 * src/conflicts.c (enum conflict_resolution_e)
5101 (solved_conflicts_obstack): New, used by...
5102 (log_resolution): this.
5103 Adjust to attach the conflict resolution to each state.
5104 Complete the description with the precedence/associativity
5105 information.
5106 (resolve_sr_conflict): Adjust.
5107 * src/print.c (print_state): Output its solved_conflicts.
5108 * tests/conflicts.at (Unresolved SR Conflicts)
5109 (Solved SR Conflicts): Exercise --report=all.
5110
a49aecd5
AD
51112002-05-26 Akim Demaille <akim@epita.fr>
5112
5113 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5114 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5115 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
5116 (token_number_t, item_number_as_token_number)
5117 (token_number_as_item_number, muscle_insert_token_number_table):
5118 Rename as...
5119 (symbol_number_t, item_number_as_symbol_number)
5120 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
5121 these, since it is more appropriate.
5122
5504898e
AD
51232002-05-26 Akim Demaille <akim@epita.fr>
5124
5125 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
5126 `Error:' lines.
5127 * data/bison.simple (yystos) [YYDEBUG]: New.
5128 (yyparse) [YYDEBUG]: Display the symbols which are popped during
5129 error recovery.
5130 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
5131
ec3bc396
AD
51322002-05-25 Akim Demaille <akim@epita.fr>
5133
5134 * doc/bison.texinfo (Debugging): Split into...
5135 (Tracing): this new section, its former contents, and...
5136 (Understanding): this new section.
5137 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
5138 by...
5139 (report_flag): this.
5140 Adjust all dependencies.
5141 (report_args, report_types, report_argmatch): New.
5142 (usage, getargs): Report/support -r, --report.
5143 * src/options.h
5144 (struct option_table_struct): Rename as..,
5145 (struct option_table_s): this.
5146 Rename the `set_flag' member to `flag' to match with getopt_long's
5147 struct.
5148 * src/options.c (option_table): Split verbose into an entry for
5149 %verbose, and another for --verbose.
5150 Support --report/-r, so remove -r from the obsolete --raw.
5151 * src/print.c: Attach full item sets and lookaheads reports to
5152 report_flag instead of trace_flag.
5153 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
5154
78df8250
PE
51552002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5156 and Paul Eggert <eggert@twinsun.com>
769b430f 5157
78df8250
PE
5158 * data/bison.simple (yyparse): Correct error handling to conform to
5159 POSIX and yacc. Specifically, after syntax error is discovered,
5160 do not reduce further before shifting the error token.
5161 Clean up the code a bit by removing the labels yyerrdefault,
5162 yyerrhandle, yyerrpop.
5163 * NEWS: Document the above.
5164
c0c9ea05
PH
51652002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5166
5167 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
5168 type; it isn't always big enough, since it doesn't necessarily
5169 include non-terminals.
769b430f 5170 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
5171 the latter can be removed.
5172 (yy_token_number_type): Remove, only one use.
5173 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
5174 don't use TokenNumberType as element type.
769b430f 5175
c0c9ea05
PH
5176 * tests/regression.at: Modify expected output to agree with change
5177 to yyr1 and yytranslate.
769b430f 5178
6390a83f
FK
51792002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
5180
5181 * src/reader.c (parse_action): Use copy_character instead of
5182 obstack_1grow.
5183
db7c8e9a
AD
51842002-05-13 Akim Demaille <akim@epita.fr>
5185
5186 * tests/regression.at (Token definitions): Prototype yylex and
5187 yyerror.
5188
fcc61800
PH
51892002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5190
158c687b 5191 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
5192 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
5193 32-bit arithmetic.
5194 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
5195
5683e9b2
AD
51962002-05-07 Akim Demaille <akim@epita.fr>
5197
5198 * tests/synclines.at: Be sure to prototype yylex and yyerror to
5199 avoid GCC warnings.
5200
0c2d3f4c
AD
52012002-05-07 Akim Demaille <akim@epita.fr>
5202
5203 Kill GCC warnings.
5204
5205 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
5206 over the RHS of each rule.
5207 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
5208 * src/state.h (state_t): Member `nitems' is unsigned short.
5209 * src/LR0.c (get_state): Adjust.
5210 * src/reader.c (packgram): Likewise.
5211 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
5212 `Type'.
5213 (muscle_insert_int_table): Remove, unused.
5214 (prepare_rules): Remove `max'.
5215
1565b720
AD
52162002-05-06 Akim Demaille <akim@epita.fr>
5217
5218 * src/closure.c (print_firsts): Display of the symbol tags.
5219 (bitmatrix_print): Move to...
5220 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
5221 here.
5222 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
5223
cfaee611
AD
52242002-05-06 Akim Demaille <akim@epita.fr>
5225
5226 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
5227 hash_do_for_each.
5228
458be8e0
AD
52292002-05-06 Akim Demaille <akim@epita.fr>
5230
5231 * src/LR0.c (new_state, get_state): Instead of using the global
5232 `kernel_size' and `kernel_base', have two new arguments:
5233 `core_size' and `core'.
5234 Adjust callers.
5235
a900a624
AD
52362002-05-06 Akim Demaille <akim@epita.fr>
5237
5238 * src/reader.c (packgram): No longer end `ritem' with a 0
5239 sentinel: it is not used.
5240
d4e7d3a1
AD
52412002-05-05 Akim Demaille <akim@epita.fr>
5242
5243 New experimental feature: display the lookaheads in the report and
5244 graph.
5245
5246 * src/print (print_core): When --trace-flag, display the rules
5247 lookaheads.
5248 * src/print_graph.c (print_core): Likewise.
5249 Swap the arguments.
5250 Adjust caller.
5251
39ceb25b
AD
52522002-05-05 Akim Demaille <akim@epita.fr>
5253
5254 * tests/torture.at (Many lookaheads): New test.
5255
5372019f
AD
52562002-05-05 Akim Demaille <akim@epita.fr>
5257
5258 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
5259 (GENERATE_MUSCLE_INSERT_TABLE): this.
5260 (output_int_table, output_unsigned_int_table, output_short_table)
5261 (output_token_number_table, output_item_number_table): Replace with...
5262 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
5263 (muscle_insert_short_table, muscle_insert_token_number_table)
5264 (muscle_insert_item_number_table): these.
5265 Adjust all callers.
5266 (prepare_tokens): Don't free `translations', since...
5267 * src/reader.h, src/reader.c (grammar_free): do it.
5268 Move to...
5269 * src/gram.h, src/gram.c (grammar_free): here.
5270 * data/bison.simple, data/bison.c++: b4_token_number_max is now
5271 b4_translate_max.
5272
5df5f6d5
AD
52732002-05-05 Akim Demaille <akim@epita.fr>
5274
5275 * src/output.c (output_unsigned_int_table): New.
5276 (prepare_rules): `i' is unsigned.
5277 `prhs', `rline', `r2' are unsigned int.
5278 Rename muscle `rhs_number_max' as `rhs_max'.
5279 Output muscles `prhs_max', `rline_max', and `r2_max'.
5280 Free rline and r1.
5281 * data/bison.simple, data/bison.c++: Adjust to use these muscles
5282 to compute types instead of constant types.
5283 * tests/regression.at (Web2c Actions): Adjust.
5284
b87f8b21
AD
52852002-05-04 Akim Demaille <akim@epita.fr>
5286
5287 * src/symtab.h (SALIAS, SUNDEF): Rename as...
5288 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
5289 Adjust dependencies.
5290 * src/output.c (token_definitions_output): Be sure not to output a
5291 `#define 'a'' when fed with `%token 'a' "a"'.
5292 * tests/regression.at (Token definitions): New.
5293
8bb936e4
PE
52942002-05-03 Paul Eggert <eggert@twinsun.com>
5295
5296 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
5297 for K&R C.
5298
52992002-05-03 gettextize <bug-gnu-gettext@gnu.org>
5300
5301 * Makefile.am (SUBDIRS): Remove intl.
5302 (EXTRA_DIST): Add config/config.rpath.
5303
53c71a12
AD
53042002-05-03 Akim Demaille <akim@epita.fr>
5305
5306 * data/bison.simple (m4_if): Don't output empty enums.
5307 And actually, output valid enum definitions :(.
5308
289dd0cf
AD
53092002-05-03 Akim Demaille <akim@epita.fr>
5310
5311 * configure.bat: Remove, completely obsolete.
5312 * Makefile.am (EXTRA_DIST): Adjust.
5313 Don't distribute config.rpath...
5314 * config/Makefile.am (EXTRA_DIST): Do it.
5315
db85e524
AD
53162002-05-03 Akim Demaille <akim@epita.fr>
5317
5318 * configure.in (GETTEXT_VERSION): New.
5319 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
5320
83ccf991
AD
53212002-05-03 Akim Demaille <akim@epita.fr>
5322
5323 * data/bison.simple (b4_token_enum): New.
5324 (b4_token_defines): Use it to output tokens both as #define and
5325 enums.
5326 Suggested by Paul Eggert.
5327 * src/output.c (token_definitions_output): Don't output spurious
5328 white spaces.
5329
1f418995
AD
53302002-05-03 Akim Demaille <akim@epita.fr>
5331
5332 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5333
45119f04
RA
53342002-05-02 Robert Anisko <robert@lrde.epita.fr>
5335
5336 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
5337 Update the stack class, give a try to deque as the default container.
5338
b2d52318
AD
53392002-05-02 Akim Demaille <akim@epita.fr>
5340
5341 * data/bison.simple (yyparse): Do not implement @$ = @1.
5342 (YYLLOC_DEFAULT): Adjust to do it.
5343 * doc/bison.texinfo (Location Default Action): Fix.
5344
3a8b4109
AD
53452002-05-02 Akim Demaille <akim@epita.fr>
5346
5347 * src/reader.c (parse_braces): Merge into...
5348 (parse_action): this.
5349
84614e13
AD
53502002-05-02 Akim Demaille <akim@epita.fr>
5351
5352 * configure.in (ALL_LINGUAS): Remove.
5353 * po/LINGUAS, hr.po: New.
5354
fdbcd8e2
AD
53552002-05-02 Akim Demaille <akim@epita.fr>
5356
5357 Remove the so called hairy (semantic) parsers.
5358
5359 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
5360 * src/gram.h, src/gram.c (semantic_parser): Remove.
5361 (rule_t): Remove the guard and guard_line members.
5362 * src/lex.h (token_t): remove tok_guard.
5363 * src/options.c (option_table): Remove %guard and %semantic_parser
5364 support.
5365 * src/output.c, src/output.h (guards_output): Remove.
5366 (prepare): Adjust.
5367 (token_definitions_output): Don't output the `T'
5368 tokens (???).
5369 (output_skeleton): Don't output the guards.
5370 * src/files.c, src/files.c (attrsfile): Remove.
5371 * src/reader.c (symbol_list): Remove the guard and guard_line
5372 members.
5373 Adjust dependencies.
5374 (parse_guard): Remove.
5375 * data/bison.hairy: Remove.
5376 * doc/bison.texinfo (Environment Variables): Remove occurrences of
5377 BISON_HAIRY.
5378
82b6cb3f
AD
53792002-05-02 Akim Demaille <akim@epita.fr>
5380
5381 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
5382 (parse_guard): Rename the formal argument `stack_offset' as
5383 `rule_length', which is more readable.
5384 Adjust callers.
5385 (copy_at, copy_dollar): Instead of outputting the hard coded
5386 values of $$, $n and so forth, output invocation to b4_lhs_value,
5387 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
5388 Note: this patch partially drops `semantic-parser' support: it
5389 always does `rule_length - n', where semantic parsers ought to
5390 always use `-n'.
82b6cb3f
AD
5391 * data/bison.simple, data/bison.c++ (b4_lhs_value)
5392 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
5393
6cbfbcc5
AD
53942002-05-02 Akim Demaille <akim@epita.fr>
5395
5396 * configure.in (AC_INIT): Bump to 1.49b.
5397 (AM_INIT_AUTOMAKE): Short invocation.
5398
b8548114
AD
53992002-05-02 Akim Demaille <akim@epita.fr>
5400
5401 Version 1.49a.
5402
c20cd1fa
AD
54032002-05-01 Akim Demaille <akim@epita.fr>
5404
5405 * src/skeleton.h: Remove.
5406
8a9566d4
AD
54072002-05-01 Akim Demaille <akim@epita.fr>
5408
5409 * src/skeleton.h: Fix the #endif.
5410 Reported by Magnus Fromreide.
5411
8c6d399a
PE
54122002-04-26 Paul Eggert <eggert@twinsun.com>
5413
5414 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
5415 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 5416 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 5417
2b7ed18a
RA
54182002-04-25 Robert Anisko <robert@lrde.epita.fr>
5419
5420 * src/scan-skel.l: Postprocess quadrigraphs.
5421
5422 * src/reader.c (copy_character): New function, used to output
5423 single characters while replacing `[' and `]' with quadrigraphs, to
5424 avoid troubles with M4 quotes.
5425 (copy_comment): Output characters with copy_character.
5426 (read_additionnal_code): Likewise.
5427 (copy_string2): Likewise.
5428 (copy_definition): Likewise.
5429
5430 * tests/calc.at: Exercise M4 quoting.
5431
34a89c50
AD
54322002-04-25 Akim Demaille <akim@epita.fr>
5433
5434 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
5435 between `!' and the command.
5436 Reported by Paul Eggert.
5437
0dd1580a
RA
54382002-04-24 Robert Anisko <robert@lrde.epita.fr>
5439
5440 * tests/calc.at: Exercise prologue splitting.
5441
5442 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
5443 `b4_post_prologue' instead of `b4_prologue'.
5444
5445 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
5446 muscles.
5447 (output): Free pre_prologue_obstack and post_prologue_obstack.
5448 * src/files.h, src/files.c (attrs_obstack): Remove.
5449 (pre_prologue_obstack, post_prologue_obstack): New.
5450 * src/reader.c (copy_definition): Add a parameter to specify the
5451 obstack to fill, instead of using attrs_obstack unconditionally.
5452 (read_declarations): Pass pre_prologue_obstack to copy_definition if
5453 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
5454
83c1796f
PE
54552002-04-23 Paul Eggert <eggert@twinsun.com>
5456
5457 * data/bison.simple: Remove unnecessary commentary and white
5458 space differences from 1_29-branch.
5459 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
5460
5461 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
5462 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
5463 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
5464 constructors or destructors.
5465
5466 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
5467
1207eeac
AD
54682002-04-23 Akim Demaille <akim@epita.fr>
5469
5470 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
5471 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
5472 location with columns.
5473 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
5474 All reported by Paul Eggert.
5475
78ab8f67
AD
54762002-04-22 Akim Demaille <akim@epita.fr>
5477
5478 * src/reduce.c (dump_grammar): Move to...
5479 * src/gram.h, src/gram.c (grammar_dump): here.
5480 Be sure to separate long item numbers.
5481 Don't read the members of a rule's prec if its nil.
5482
133c20e2
AD
54832002-04-22 Akim Demaille <akim@epita.fr>
5484
5485 * src/output.c (table_size, table_grow): New.
5486 (MAXTABLE): Remove, replace uses with table_size.
5487 (pack_vector): Instead of dying when the table is too big, grow it.
5488
9515e8a7
AD
54892002-04-22 Akim Demaille <akim@epita.fr>
5490
5491 * data/bison.simple (yyr1): Its type is that of a token number.
5492 * data/bison.c++ (r1_): Likewise.
5493 * tests/regression.at (Web2c Actions): Adjust.
5494
23c5a174
AD
54952002-04-22 Akim Demaille <akim@epita.fr>
5496
5497 * src/reader.c (token_translations_init): 256 is now the default
5498 value for the error token, i.e., it will be assigned another
5499 number if the user assigned 256 to one of her tokens.
5500 (reader): Don't force 256 to error.
5501 * doc/bison.texinfo (Symbols): Adjust.
5502 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
5503 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
5504 etc. instead of 10, 20, 30 (which was used to `jump' over error
5505 (256) and undefined (2)).
5506
5fbb0954
AD
55072002-04-22 Akim Demaille <akim@epita.fr>
5508
5509 Propagate more token_number_t.
5510
5511 * src/gram.h (token_number_as_item_number)
5512 (item_number_as_token_number): New.
5513 * src/output.c (GENERATE_OUTPUT_TABLE): New.
5514 Use it to create output_item_number_table and
5515 output_token_number_table.
5516 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5517 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
5518 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
5519 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
5520
4f940944
AD
55212002-04-22 Akim Demaille <akim@epita.fr>
5522
5523 * src/output.h, src/output.c (get_lines_number): Remove.
5524
3ded9a63
AD
55252002-04-19 Akim Demaille <akim@epita.fr>
5526
5527 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
5528 as Lex/Flex'.
5529 (Debugging): More details about enabling the debugging features.
5530 (Table of Symbols): Describe $$, $n, @$, and @n.
5531 Suggested by Tim Josling.
5532
e0c471a9
AD
55332002-04-19 Akim Demaille <akim@epita.fr>
5534
5535 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
5536
fecc10cd
AD
55372002-04-10 Akim Demaille <akim@epita.fr>
5538
5539 * src/system.h: Rely on HAVE_LIMITS_H.
5540 Suggested by Paul Eggert.
5541
51dec47b
AD
55422002-04-09 Akim Demaille <akim@epita.fr>
5543
5544 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
5545 full stderr, and strip it according to the bison options, instead
5546 of composing the error message from different bits.
5547 This makes it easier to check for several error messages.
5548 Adjust all the invocations.
5549 Add an invocation exercising the error token.
5550 Add an invocation demonstrating a stupid error message.
5551 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
5552 Adjust the tests.
5553 Error message are for stderr, not stdout.
5554
007a50a4
AD
55552002-04-09 Akim Demaille <akim@epita.fr>
5556
5557 * src/gram.h, src/gram.c (error_token_number): Remove, use
5558 errtoken->number.
5559 * src/reader.c (reader): Don't specify the user token number (2)
5560 for $undefined, as it uselessly prevents using it.
5561 * src/gram.h (token_number_t): Move to...
5562 * src/symtab.h: here.
5563 (state_t.number): Is a token_number_t.
5564 * src/print.c, src/reader.c: Use undeftoken->number instead of
5565 hard coded 2.
5566 (Even though this 2 is not the same as above: the number of the
5567 undeftoken remains being 2, it is its user token number which
5568 might not be 2).
5569 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
5570 `user_token_number_max'.
5571 Output `undef_token_number'.
5572 * data/bison.simple, data/bison.c++: Use them.
5573 Be sure to map invalid yylex return values to
5574 `undef_token_number'. This saves us from gratuitous SEGV.
5575
5576 * tests/conflicts.at (Solved SR Conflicts)
5577 (Unresolved SR Conflicts): Adjust.
5578 * tests/regression.at (Web2c Actions): Adjust.
5579
06446ccf
AD
55802002-04-08 Akim Demaille <akim@epita.fr>
5581
5582 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
5583 Adding #line.
5584 Remove the duplicate `typedefs'.
5585 (RhsNumberType): Fix the declaration and various other typos.
5586 Use __ofile__.
5587 * data/bison.simple: Use __ofile__.
5588 * src/scan-skel.l: Handle __ofile__.
5589
62a3e4f0
AD
55902002-04-08 Akim Demaille <akim@epita.fr>
5591
5592 * src/gram.h (item_number_t): New, the type of item numbers in
5593 RITEM. Note that it must be able to code symbol numbers as
5594 positive number, and the negation of rule numbers as negative
5595 numbers.
5596 Adjust all dependencies (pretty many).
5597 * src/reduce.c (rule): Remove this `short *' pointer: use
5598 item_number_t.
5599 * src/system.h (MINSHORT, MAXSHORT): Remove.
5600 Include `limits.h'.
5601 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
5602 (shortcpy): Remove.
5603 (MAXTABLE): Move to...
5604 * src/output.c (MAXTABLE): here.
5605 (prepare_rules): Use output_int_table to output rhs.
5606 * data/bison.simple, data/bison.c++: Adjust.
5607 * tests/torture.at (Big triangle): Move the limit from 254 to
5608 500.
5609 * tests/regression.at (Web2c Actions): Ajust.
5610
5611 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
5612 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
5613 passes, but produces negative #line number, once fixed, GCC is
5614 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
5615 C), it passes.
5616 * src/state.h (state_h): Code input lines on ints, not shorts.
5617
bb88b0fc
AD
56182002-04-08 Akim Demaille <akim@epita.fr>
5619
5620 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
5621 and then the grammar.
5622
9a636f47
AD
56232002-04-08 Akim Demaille <akim@epita.fr>
5624
5625 * src/system.h: No longer using strndup.
5626
680e8701
AD
56272002-04-07 Akim Demaille <akim@epita.fr>
5628
5629 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
5630 * src/output.c (output_table_data): Return the longest number.
5631 (prepare_tokens): Output `token_number_max').
5632 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
5633 New.
5634 Use them to define yy_token_number_type/TokenNumberType.
5635 Use this type for yytranslate.
5636 * tests/torture.at (Big triangle): Push the limit from 124 to
5637 253.
5638 * tests/regression.at (Web2c Actions): Adjust.
5639
817e9f41
AD
56402002-04-07 Akim Demaille <akim@epita.fr>
5641
5642 * tests/torture.at (Big triangle): New.
5643 (GNU AWK Grammar, GNU Cim Grammar): Move to...
5644 * tests/existing.at: here.
5645
5123689b
AD
56462002-04-07 Akim Demaille <akim@epita.fr>
5647
5648 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
5649 nritems.
5650 Adjust dependencies.
5651
f3849179
AD
56522002-04-07 Akim Demaille <akim@epita.fr>
5653
5654 * src/reader.c: Normalize increments to prefix form.
5655
bd02036a
AD
56562002-04-07 Akim Demaille <akim@epita.fr>
5657
5658 * src/reader.c, symtab.c: Remove debugging code.
5659
db8837cb
AD
56602002-04-07 Akim Demaille <akim@epita.fr>
5661
5662 Rename all the `bucket's as `symbol_t'.
5663
5664 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
5665 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
5666 * src/symtab.c, src/symtab.h (bucket): Rename as...
5667 (symbol_t): this.
5668 (symbol_list_new, bucket_check_defined, bucket_make_alias)
5669 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
5670 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5671 (buckets_new, buckets_free, buckets_do): Rename as...
5672 (symbol_list_new, symbol_check_defined, symbol_make_alias)
5673 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5674 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
5675 (symbols_new, symbols_free, symbols_do): these.
5676
72a23c97
AD
56772002-04-07 Akim Demaille <akim@epita.fr>
5678
5679 Use lib/hash for the symbol table.
5680
5681 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
5682 EOF.
5683 * src/lex.c (lex): Set the `number' member of new terminals.
5684 * src/reader.c (bucket_check_defined, bucket_make_alias)
5685 (bucket_check_alias_consistence, bucket_translation): New.
5686 (reader, grammar_free, readgram, token_translations_init)
5687 (packsymbols): Adjust.
5688 (reader): Number the predefined tokens.
5689 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
5690 for predefined tokens.
5691 * src/symtab.h (bucket): Remove all the hash table related
5692 members.
5693 * src/symtab.c (symtab): Replace by...
5694 (bucket_table): this.
5695 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5696 (buckets_new, buckets_do): New.
5697
280a38c3
AD
56982002-04-07 Akim Demaille <akim@epita.fr>
5699
5700 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
5701 (start_symbol, max_user_token_number, semantic_parser)
5702 (error_token_number): Initialize.
5703 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
5704 Initialize.
5705 (reader): Don't.
5706 (errtoken, eoftoken, undeftoken, axiom): Extern.
5707
03b31c0c
AD
57082002-04-07 Akim Demaille <akim@epita.fr>
5709
5710 * src/gram.h (rule_s): prec and precsym are now pointers
5711 to the bucket giving the priority/associativity.
5712 Member `associativity' removed: useless.
5713 * src/reduce.c, src/conflicts.c: Adjust.
5714
8b3df748
AD
57152002-04-07 Akim Demaille <akim@epita.fr>
5716
5717 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
5718 Properly escape the symbols' TAG when outputting them.
5719
e601aa1d
AD
57202002-04-07 Akim Demaille <akim@epita.fr>
5721
5722 * src/lalr.h (LA): Is a bitsetv, not bitset*.
5723
b0299a2e
AD
57242002-04-07 Akim Demaille <akim@epita.fr>
5725
5726 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
5727 (LArule): this, which is an array to rule_t*.
5728 * src/print.c, src/conflicts.c: Adjust.
5729
d7e1f00c
AD
57302002-04-07 Akim Demaille <akim@epita.fr>
5731
5732 * src/gram.h (rule_t): Rename `number' as `user_number'.
5733 `number' is a new member.
5734 Adjust dependencies.
5735 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
5736
cc9305dd
AD
57372002-04-07 Akim Demaille <akim@epita.fr>
5738
5739 As a result of the previous patch, it is no longer needed
5740 to reorder ritem itself.
5741
5742 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
5743
b0940840
AD
57442002-04-07 Akim Demaille <akim@epita.fr>
5745
5746 Be sure never to walk through RITEMS, but use only data related to
5747 the rules themselves. RITEMS should be banished.
5748
5749 * src/output.c (output_token_translations): Rename as...
5750 (prepare_tokens): this.
5751 In addition to `translate', prepare the muscles `tname' and
5752 `toknum', which were handled by...
5753 (output_rule_data): this.
5754 Remove, and move the remainder of its outputs into...
5755 (prepare_rules): this new routines, which also merges content from
5756 (output_gram): this.
5757 (prepare_rules): Be sure never to walk through RITEMS.
5758 (output_stos): Rename as...
5759 (prepare_stos): this.
5760 (output): Always invoke prepare_states, after all, just don't use it
5761 in the output if you don't need it.
5762
643a5994
AD
57632002-04-07 Akim Demaille <akim@epita.fr>
5764
5765 * src/LR0.c (new_state): Display `nstates' as the name of the
5766 newly created state.
5767 Adjust to initialize first_state and last_state if needed.
5768 Be sure to distinguish the initial from the final state.
5769 (new_states): Create the itemset of the initial state, and use
5770 new_state.
5771 * src/closure.c (closure): Now that the initial state has its
5772 items properly set, there is no need for a special case when
5773 creating `ruleset'.
5774
5775 As a result, now the rule 0, reducing to $axiom, is visible in the
5776 outputs. Adjust the test suite.
5777
5778 * tests/conflicts.at (Solved SR Conflicts)
5779 (Unresolved SR Conflicts): Adjust.
5780 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
5781 * tests/conflicts.at (S/R in initial): New.
5782
b4c4ccc2
AD
57832002-04-07 Akim Demaille <akim@epita.fr>
5784
5785 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
5786 the RHS of the rules.
5787 * src/output.c (output_gram): Likewise.
5788
bba97eb2
AD
57892002-04-07 Akim Demaille <akim@epita.fr>
5790
5791 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
5792 bucket.
5793 Adjust all dependencies.
5794 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
5795 `number' of the buckets too.
5796 * src/gram.h: Include `symtab.h'.
5797 (associativity): Move to...
5798 * src/symtab.h: here.
5799 No longer include `gram.h'.
5800
c3b407f4
AD
58012002-04-07 Akim Demaille <akim@epita.fr>
5802
5803 * src/gram.h, src/gram.c (rules_rhs_length): New.
5804 (ritem_longest_rhs): Use it.
5805 * src/gram.h (rule_t): `number' is a new member.
5806 * src/reader.c (packgram): Set it.
5807 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
5808 the end of `rules', and count them out of `nrules'.
5809 (reduce_output, dump_grammar): Adjust.
5810 * src/print.c (print_grammar): It is no longer needed to check for
5811 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
5812 * tests/reduce.at (Reduced Automaton): New test.
5813
11652ab3
AD
58142002-04-07 Akim Demaille <akim@epita.fr>
5815
5816 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
5817 lacking `+ 1' to nrules, Bison reported as useless a token if it
5818 was used solely to set the precedence of the last rule...
5819
26b23c1a
AD
58202002-04-07 Akim Demaille <akim@epita.fr>
5821
5822 * data/bison.c++, data/bison.simple: Don't output the current file
5823 name in #line, to avoid useless diffs between two identical
5824 outputs under different names.
5825
18bcecb0
AD
58262002-04-07 Akim Demaille <akim@epita.fr>
5827
5828 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
5829 Normalize loops to using `< nrules + 1', not `<= nrules'.
5830
fa770c86
AD
58312002-04-07 Akim Demaille <akim@epita.fr>
5832
5833 * TODO: Update.
5834
d9b739c3
AD
58352002-04-07 Akim Demaille <akim@epita.fr>
5836
5837 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
5838 bucket.value as bucket.number.
5839
99013900
AD
58402002-04-07 Akim Demaille <akim@epita.fr>
5841
5842 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
5843 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5844 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
5845 RHS, instead of being an index in RITEMS.
5846
e966383b
PE
58472002-04-04 Paul Eggert <eggert@twinsun.com>
5848
5849 * doc/bison.texinfo: Update copyright date.
5850 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
5851 (Symbols): Warn about running Bison in one character set,
5852 but compiling and/or running in an incompatible one.
5853 Warn about character code 256, too.
5854
58552002-04-03 Paul Eggert <eggert@twinsun.com>
5856
5857 * src/bison.data (YYSTACK_ALLOC): Depend on whether
5858 YYERROR_VERBOSE is nonzero, not whether it is defined.
5859
5860 Merge changes from bison-1_29-branch.
c307773e 5861
8d6c48b9
PE
58622002-03-20 Paul Eggert <eggert@twinsun.com>
5863
5864 Merge fixes from Debian bison_1.34-1.diff.
5865
5866 * configure.in (AC_PREREQ): 2.53.
5867
e53c6322
AD
58682002-03-20 Akim Demaille <akim@epita.fr>
5869
5870 * src/conflicts.c (log_resolution): Argument `resolution' is const.
5871
9ffbeca7
PE
58722002-03-19 Paul Eggert <eggert@twinsun.com>
5873
21db0b2a
PE
5874 * src/bison.simple (YYCOPY): New macro.
5875 (YYSTACK_RELOCATE): Use it.
5876 Remove Type arg; no longer needed. All callers changed.
5877 (yymemcpy): Remove; no longer needed.
5878
9ffbeca7
PE
5879 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
5880 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5881
642cb8f8
AD
58822002-03-19 Akim Demaille <akim@epita.fr>
5883
5884 Test and fix the #line outputs.
5885
5886 * tests/atlocal.at (GCC): New.
5887 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
5888 (Prologue synch line, ,%union synch line, Postprologue synch line)
5889 (Action synch line, Epilogue synch line): New tests.
5890 * src/reader.c (parse_union_decl): Define the muscle stype_line.
5891 * data/bison.simple, data/bison.c++: Use it.
5892
3c31a486
AD
58932002-03-19 Akim Demaille <akim@epita.fr>
5894
5895 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
5896 (Solved SR Conflicts, %expect not enough, %expect right)
5897 (%expect too much): Move to...
5898 * tests/conflicts.at: this new file.
5899
0d8bed56
AD
59002002-03-19 Akim Demaille <akim@epita.fr>
5901
5902 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5903 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
5904 that we can move to enums for instance.
5905 * src/output.c (token_definitions_output): Output a list of
5906 `token-name, token-number' instead of the #define.
5907 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
5908
9208d17f
AD
59092002-03-14 Akim Demaille <akim@epita.fr>
5910
5911 Use Gettext 0.11.1.
5912
af27eacb
RA
59132002-03-09 Robert Anisko <robert@lrde.epita.fr>
5914
5915 * data/bison.c++: Make the user able to add members to the generated
5916 parser by subclassing.
5917
9101a310
RA
59182002-03-05 Robert Anisko <robert@lrde.epita.fr>
5919
5920 * src/reader.c (read_additionnal_code): `c' should be an integer, not
5921 a character.
5922 Reported by Nicolas Tisserand and Nicolas Burrus.
5923
fff9bf0b
RA
59242002-03-04 Robert Anisko <robert@lrde.epita.fr>
5925
5926 * src/reader.c: Warn about lacking semi-colons, do not complain.
5927
64dba31e
RA
59282002-03-04 Robert Anisko <robert@lrde.epita.fr>
5929
5930 * data/bison.c++: Remove a debug line.
5931
374f5a14
RA
59322002-03-04 Robert Anisko <robert@lrde.epita.fr>
5933
5934 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
5935 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
5936 provide a default implementation.
5937
bfcf1f3a
AD
59382002-03-04 Akim Demaille <akim@epita.fr>
5939
5940 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
5941 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
5942 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
5943 * tests/semantic.at (Parsing Guards): Similarly.
5944 * src/reader.at (readgram): Complain if the last rule is not ended
5945 with a semi-colon.
5946
65ccf9fc
AD
59472002-03-04 Akim Demaille <akim@epita.fr>
5948
5949 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
5950 * src/closure.c: here.
5951 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
5952 RTC.
5953 * src/warshall.h, src/warshall.c: Remove.
5954 * tests/sets.at (Broken Closure): Adjust.
5955
d0039cbc
AD
59562002-03-04 Akim Demaille <akim@epita.fr>
5957
5958 * src/output.c (output_skeleton): tempdir is const.
5959 bytes_read is unused.
5960
345cea78
AD
59612002-03-04 Akim Demaille <akim@epita.fr>
5962
5963 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
5964 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
5965 Update.
5966 From Michael Hayes.
5967
564801f7
AD
59682002-03-04 Akim Demaille <akim@epita.fr>
5969
5970 * src/closure.c (closure): `r' is unused.
5971
e5352bc7
AD
59722002-03-04 Akim Demaille <akim@epita.fr>
5973
5974 * tests/sets.at (Broken Closure): Add the ending `;'.
5975 * src/reader.at (readgram): Complain if a rule is not ended with a
5976 semi-colon.
5977
914feea9
AD
59782002-03-04 Akim Demaille <akim@epita.fr>
5979
5980 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
5981 (count_sr_conflicts): Use bitset_count.
5982 * src/reduce.c (inaccessable_symbols): Ditto.
5983 (bits_size): Remove.
5984 * src/warshall.h, src/warshall.c: Convert to bitsetv.
5985
f0250de6
AD
59862002-03-04 Akim Demaille <akim@epita.fr>
5987
5988 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
5989 * src/reduce.c: Remove the `bitset_zero's following the
5990 `bitset_create's, as now it is performed by the latter.
5991
ef017502
AD
59922002-03-04 Akim Demaille <akim@epita.fr>
5993
5994 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
5995 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
5996 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
5997 latest sources from Michael.
5998
76514394
AD
59992002-03-04 Akim Demaille <akim@epita.fr>
6000
6001 * src/output.c (output): Don't free the grammar.
6002 * src/reader.c (grammar_free): New.
6003 * src/main.c (main): Call it and don't free symtab here.
6004
55024580
AD
60052002-03-04 Akim Demaille <akim@epita.fr>
6006
6007 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
6008 before returning.
6009 Reported by Benoit Perrot.
6010
f9abaa2c
AD
60112002-03-04 Akim Demaille <akim@epita.fr>
6012
6013 Use bitset operations when possible, not loops over bits.
6014
6015 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
6016 bitset_or.
6017 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
6018 * src/reduce.c (useless_nonterminals): Formatting changes.
6019 * src/warshall.c (TC): Use bitset_or.
6020
0e721e75
AD
60212002-03-04 Akim Demaille <akim@epita.fr>
6022
6023 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
6024 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
6025 Ditto.
6026
0fb1ffb1
AD
60272002-03-04 Akim Demaille <akim@epita.fr>
6028
6029 * src/lalr.c (F): Now a bitset*.
6030 Adjust all dependencies.
6031
b86796bf
AD
60322002-03-04 Akim Demaille <akim@epita.fr>
6033
6034 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
6035 Adjust all dependencies.
6036
602bbf31
AD
60372002-03-04 Akim Demaille <akim@epita.fr>
6038
6039 * src/L0.c, src/LR0.h (nstates): Be size_t.
6040 Adjust comparisons (signed vs unsigned).
6041 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
6042 bitset*.
6043 Adjust all dependencies.
6044
d8a0245c
AD
60452002-03-04 Akim Demaille <akim@epita.fr>
6046
6047 * src/closure.c (firsts): Now, also a bitset.
6048 Adjust all dependencies.
6049 (varsetsize): Remove, now unused.
6050 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
6051
34ba9743
AD
60522002-03-04 Akim Demaille <akim@epita.fr>
6053
6054 * src/print.c: Convert to use bitset.h, not hand coded iterations
6055 over ints.
6056
ed86e78c
AD
60572002-03-04 Akim Demaille <akim@epita.fr>
6058
6059 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
6060
dfdb1797
AD
60612002-03-04 Akim Demaille <akim@epita.fr>
6062
6063 * src/closure.c (ruleset): Be a bitset.
6064 (rulesetsize): Remove.
6065
7086e707
AD
60662002-03-04 Akim Demaille <akim@epita.fr>
6067
6068 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6069 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
6070 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
6071 * src/closure.c (fderives): Be an array of bitsets.
6072
98254360
RA
60732002-02-28 Robert Anisko <robert@lrde.epita.fr>
6074
6075 * data/bison.c++: Merge the two generated headers. Insert a copyright
6076 notice in each output file.
6077
a75c057f
AD
60782002-02-28 Akim Demaille <akim@epita.fr>
6079
6080 * data/bison.c++: Copy the prologue of bison.simple to fetch
6081 useful M4 definitions, such as b4_header_guard.
6082
06b00abc
AD
60832002-02-25 Akim Demaille <akim@epita.fr>
6084
6085 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
6086 translator friendly scheme for the bgr
6087 copyright notice.
06b00abc 6088
70e7d534
AD
60892002-02-25 Akim Demaille <akim@epita.fr>
6090
6091 * src/output.c (header_output): Remove, now handled completely via
6092 M4.
6093
abe017f6
AD
60942002-02-25 Akim Demaille <akim@epita.fr>
6095
6096 * m4/m4.m4: New, from CVS Autoconf.
6097 * configure.in: Invoke it.
6098 * src/output.c (output_skeleton): Use its result instead of the
6099 hard coded name.
6100
381fb12e
AD
61012002-02-25 Akim Demaille <akim@epita.fr>
6102
6103 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
6104 Fileutils 4.1.5.
6105 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
6106 * src/output.c (output_skeleton): Use mkstemp to create a real
6107 temporary file.
6108 Move the filling of `skeleton' and its muscle to...
6109 (prepare): here.
6110 (output): Move the definition of the prologue muscle to...
6111 (prepare): here.
6112 * src/system.h (DEFAULT_TMPDIR): New.
6113
6f38107f
PE
61142002-02-14 Paul Eggert <eggert@twinsun.com>
6115
6116 Remove the support for C++ namespace cleanliness; it was
6117 causing more problems than it was curing, since it didn't work
6118 properly on some nonstandard C++ compilers. This can wait
6119 for a proper C++ parser.
6120
6121 * NEWS: Document this.
6122 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
6123 of C++, as it's treated like C now.
6124 * src/bison.simple (YYSTD): Remove.
6125 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
6126 Treat C++ just like Standard C instead of trying to support
6127 namespace cleanliness.
6128
80cce3da
AD
61292002-02-14 Akim Demaille <akim@epita.fr>
6130
6131 * tests/regression.at (else): Adjust to Andreas' change.
6132
842e8679
AD
61332002-02-14 Akim Demaille <akim@epita.fr>
6134
6135 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
6136
4bda3f10
AD
61372002-02-13 Andreas Schwab <schwab@suse.de>
6138
6139 * src/output.c (output_rule_data): Don't output NULL, it might
6140 not be defined yet.
6141
4162fa07 61422002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 6143
4162fa07
RA
6144 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
6145 (Copyright notice): Update.
b418ecd8 6146
bd16a5dc
AD
61472002-02-11 Akim Demaille <akim@epita.fr>
6148
6149 * tests/regression.at (%nonassoc and eof): Don't include
6150 nonportable headers.
6151
8d69a1a3
RA
61522002-02-08 Robert Anisko <robert@lrde.epita.fr>
6153
6154 * data/bison.c++: Correct error recovery. Make the user able to
6155 initialize the starting location.
6156
9b2d0677
AD
61572002-02-07 Akim Demaille <akim@epita.fr>
6158
6159 * tests/input.at: New.
6160
69e2658b
RA
61612002-02-07 Robert Anisko <robert@lrde.epita.fr>
6162
6163 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 6164 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
6165 directives around tables only needed for debugging.
6166
4aacc3a7
RA
61672002-02-07 Robert Anisko <robert@lrde.epita.fr>
6168
6169 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
6170 C++ parsers.
6171 (yy::b4_name::parse): Use print_.
6172
762a801e
RA
61732002-02-07 Robert Anisko <robert@lrde.epita.fr>
6174
6175 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
6176
4bb2bc3f
RA
61772002-02-07 Robert Anisko <robert@lrde.epita.fr>
6178
6179 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
6180 C++ parsers.
6181 (yy::b4_name::parse): Build verbose error messages, and use error_.
6182
6b45a3ca
RA
61832002-02-06 Robert Anisko <robert@lrde.epita.fr>
6184
6185 * data/bison.c++: Fix m4 quoting in comments.
6186
50997c6e
RA
61872002-02-06 Robert Anisko <robert@lrde.epita.fr>
6188
6189 * data/bison.c++: Adjust the parser code. Fix some muscles that were
6190 not expanded by m4.
6191
3f3eed27
AD
61922002-02-05 Akim Demaille <akim@epita.fr>
6193
6194 * data/bison.c++: Adjust to the M4 back end.
6195 More is certainly needed.
6196
be2a1a68
AD
61972002-02-05 Akim Demaille <akim@epita.fr>
6198
6199 Give a try to M4 as a back end.
6200
6201 * lib/readpipe.c: New, from wdiff.
6202 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
6203 BISON_HAIRY.
6204 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
6205 specific values. Now it is m4 that performs the lookup.
6206 * src/parse-skel.y: Remove.
6207 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
6208 * src/output.c (actions_output, guards_output)
6209 (token_definitions_output): No longer keeps track of the output
6210 line number, hence remove the second argument.
6211 (guards_output): Check against the guard member of a rule, not the
6212 action member.
6213 Adjust callers.
6214 (output_skeleton): Don't look for the skeleton location, let m4 do
6215 that.
6216 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
6217 file will be used.
6218 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
6219 (prepare): Given that for the time being changesyntax is not
6220 usable in M4, rename the muscles using `-' to `_'.
6221 Define `defines_flag', `output_parser_name' and `output_header_name'.
6222 * src/output.h (actions_output, guards_output)
6223 (token_definitions_output): Adjust prototypes.
6224 * src/scan-skel.l: Instead of scanning the skeletons, it now
6225 processes the output of m4: `__oline__' and `#output'.
6226 * data/bison.simple: Adjust to be used by M4(sugar).
6227 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
6228 to date.
6229 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
6230 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
6231 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
6232 shamelessly stolen from CVS Autoconf.
6233
beda758b
AD
62342002-02-05 Akim Demaille <akim@epita.fr>
6235
6236 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
6237 * configure.in: Check for the declarations of free and malloc.
6238 * src/muscle_tab.c: Adjust.
6239
5ece6d43
AD
62402002-02-05 Akim Demaille <akim@epita.fr>
6241
6242 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
6243 which have no values.
6244
5bb18f9a
AD
62452002-02-05 Akim Demaille <akim@epita.fr>
6246
6247 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
6248 * data/: here.
6249
894dd62e
PE
62502002-01-29 Paul Eggert <eggert@twinsun.com>
6251
6252 * src/bison.simple (YYSIZE_T): Do not define merely because
6253 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
6254 On some platforms, <alloca.h> does not declare YYSTD (size_t).
6255
82841af7
AD
62562002-01-27 Akim Demaille <akim@epita.fr>
6257
6258 Fix `%nonassoc and eof'.
6259
6260 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
6261 which were not properly copied! Replace
6262 memcpy (res->errs, src->errs, src->nerrs);
6263 with
6264 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
6265 !!!
6266 * tests/regression.at (%nonassoc and eof): Adjust to newest
6267 Autotest: `.' is not in the PATH.
6268
318b76e9
AD
62692002-01-27 Akim Demaille <akim@epita.fr>
6270
6271 * tests/sets.at (AT_EXTRACT_SETS): New.
6272 (Nullable): Use it.
6273 (Firsts): New.
6274
30d2f3d5
AD
62752002-01-26 Akim Demaille <akim@epita.fr>
6276
6277 * tests/actions.at, tests/calc.at, tests/headers.at,
6278 * tests/torture.at: Adjust to the newest Autotest which no longer
6279 forces `.' in the PATH.
6280
30f8c395
AD
62812002-01-25 Akim Demaille <akim@epita.fr>
6282
6283 * tests/regression.at (%nonassoc and eof): New.
6284 Suggested by Robert Anisko.
6285
29ae55f1
AD
62862002-01-24 Akim Demaille <akim@epita.fr>
6287
6288 Bison dumps core when trying to complain about broken input files.
6289 Reported by Cris van Pelt.
6290
6291 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
6292 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
6293 into...
6294 (Invalid inputs): Strengthen: exercise parse_percent_token.
6295
2b548aa6
RA
62962002-01-24 Robert Anisko <robert.anisko@epita.fr>
6297
6298 * src/Makefile.am: Add bison.c++.
6299 * src/bison.c++: New skeleton.
6300
bb0146c2
AD
63012002-01-21 Paolo Bonzini <bonzini@gnu.org>
6302
6303 * po/it.po: New.
6304
bec30531
AD
63052002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
6306
6307 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
6308
fc6edc45
MA
63092002-01-20 Marc Autret <marc@gnu.org>
6310
6311 * src/files.c (compute_output_file_names): Fix
6312
5e5d5415
MA
63132002-01-20 Marc Autret <marc@gnu.org>
6314
6315 * tests/output.at: New test.
6316 * src/files.c (compute_base_names): Don't map extensions when
6317 the YACC flag is set, use defaults.
6318 Reported by Evgeny Stambulchik.
6319
44ea3fbd
MA
63202002-01-20 Marc Autret <marc@gnu.org>
6321
bb0146c2 6322 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
6323 compilers as well (i.e. the vendor C compiler).
6324 Suggested by Albert Chin-A-Young.
6325
338963d1
TVH
63262002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
6327
6328 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
6329 canonical definition.
6330 * src/system.h: Use the canonical definition for PARAMS (avoids
6331 a conflict with the macro from lib/hash.h).
6332
c57b2479
AD
63332002-01-11 Akim Demaille <akim@epita.fr>
6334
6335 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 6336 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 6337
b85810ae
AD
63382002-01-09 Akim Demaille <akim@epita.fr>
6339
6340 * src/files.c, src/files.h (output_infix): New.
6341 (tab_extension): Remove.
6342 (compute_base_names): Compute the former, drop the latter.
6343 * src/output.c (prepare): Insert the muscles `output-infix', and
6344 `output-suffix'.
6345 * src/parse-skel.y (string, string.1): New.
6346 (section.header): Use it.
6347 (section.yacc): Remove.
6348 (prefix): Remove too.
6349 * src/scan-skel.l: Adjust.
6350 * src/bison.simple, src/bison.hairy: Adjust.
6351
cae60122
AD
63522002-01-09 Akim Demaille <akim@epita.fr>
6353
6354 * configure.in (WERROR_CFLAGS): Compute it.
6355 * src/Makefile.am (CFLAGS): Pass it.
6356 * tests/atlocal.in (CFLAGS): Idem.
6357 * src/files.c: Fix a few warnings.
6358 (get_extension_index): Remove, unused.
6359
ae404801
AD
63602002-01-08 Akim Demaille <akim@epita.fr>
6361
6362 * src/getargs.c (AS_FILE_NAME): New.
6363 (getargs): Use it to convert DOSish file names.
6364 * src/files.c (base_name): Rename as full_base_name to avoid
6365 clashes with `base_name ()'.
6366 (filename_split): New.
6367 (compute_base_names): N-th rewrite, using filename_split.
6368
22312b71
AD
63692002-01-08 Akim Demaille <akim@epita.fr>
6370
6371 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
6372 New, stolen from the Fileutils 4.1.
6373 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
6374 * configure.in: Check for the presence of memrchr, and of its
6375 prototype.
6376
a67cef01
TVH
63772002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
6378
6379 * lib/hash.h (__P): Added definition for this macro.
6380 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
6381 BUILT_SOURCES, to ensure they are generated first.
6382 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
6383 %error-verbose to allow bootstrapping with bison 1.30x.
6384
2b25d624
AD
63852002-01-06 Akim Demaille <akim@epita.fr>
6386
6387 * src/reader.c (parse_braces): Don't fetch the next char, the
6388 convention is to fetch on entry.
6389 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
6390 'switch' without a following semicolon.
6391 * tests/regression.at (braces parsing): New.
6392
3460813b
AD
63932002-01-06 Akim Demaille <akim@epita.fr>
6394
6395 Bison is dead wrong in its RR conflict reports.
6396
6397 * tests/torture.at (GNU Cim Grammar): New.
6398 * src/conflicts.c (count_rr_conflicts): Fix.
6399
73784c64
AD
64002002-01-06 Akim Demaille <akim@epita.fr>
6401
6402 Creating package.m4 from configure.ac causes too many problems.
6403
6404 * tests/Makefile.am (package.m4): Create it by hand,
6405 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
6406
25d81090
AD
64072002-01-06 Akim Demaille <akim@epita.fr>
6408
6409 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
6410 skeleton.h.
6411
a9b8959e
PE
64122002-01-04 Paul Eggert <eggert@twinsun.com>
6413
6414 * doc/bison.texinfo (Debugging):
6415 Remove YYSTDERR; it's no longer defined or used.
6416 Also, s/cstdio.h/cstdio/.
6417
25d81090
AD
64182002-01-03 Akim Demaille <akim@epita.fr>
6419
6420 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
6421
1109455c
AD
64222002-01-03 Akim Demaille <akim@epita.fr>
6423
6424 * src/parse-skel.y (process_skeleton): Don't bind the parser's
6425 tracing code to --trace, wait for a better --trace option, with
6426 args.
6427
7ea5e977
AD
64282002-01-03 Akim Demaille <akim@epita.fr>
6429
6430 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
6431 The ISO C++ standard is extremely clear about it: stderr is
6432 considered a macro, not a regular symbol (see table 94 `Header
6433 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
6434 Therefore std:: does not apply to it. It still does with fprintf.
6435 Also, s/cstdio.h/cstdio/.
6436
fab5b110
AD
64372002-01-03 Akim Demaille <akim@epita.fr>
6438
6439 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
6440 for non system headers.
6441
aed7fd9b
AD
64422002-01-02 Akim Demaille <akim@epita.fr>
6443
6444 Equip the skeleton chain with location tracking, runtime trace,
6445 pure parser and scanner.
6446
6447 * src/parse-skel.y: Request a pure parser, locations, and prefix
6448 renaming.
6449 (%union): Having several members with the same type does not help
6450 type mismatches, simplify.
6451 (YYPRINT, yyprint): New.
6452 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
6453 (skel_error): this.
6454 Handle locations.
6455 * src/scan-skel.l: Adjust to these changes.
6456 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
6457 (LOCATION_PRINT, skel_control_t): New.
6458
24fad99e
AD
64592001-12-30 Akim Demaille <akim@epita.fr>
6460
6461 * src/parse-skel.y: Get rid of the shift/reduce conflict:
6462 replace `gb' with BLANKS.
6463 * src/scan-skel.l: Adjust.
6464
a4b36db4
AD
64652001-12-30 Akim Demaille <akim@epita.fr>
6466
6467 * src/system.h: We don't need nor want bcopy.
6468 Throw away MS-DOS crap: we don't need getpid.
6469 * configure.in: We don't need strndup. It was even causing
6470 problems: because Flex includes the headers *before* us,
6471 _GNU_SOURCE is not defined by config.h, and therefore strndup was
6472 not visible.
6473 * lib/xstrndup.c: New.
6474 * src/scan-skel.l: Use it.
6475 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
6476 * src/parse-skel.y: Use %directives instead of #defines.
6477
1239777d
AD
64782001-12-30 Akim Demaille <akim@epita.fr>
6479
6480 * src/skeleton.h: New.
6481 * src/output.c (output_parser, output_master_parser): Remove, dead
6482 code.
6483 * src/output.h (get_lines_number, actions_output, guards_output)
6484 (token_definitions_output): Prototype them.
6485 * src/parse-skel.y: Add the license notice.
6486 Include output.h and skeleton.h.
6487 (process_skeleton): Returns void, and takes a single parameter.
6488 * src/scan-skel.l: Add the license notice.
6489 Include skeleton.h.
6490 Don't use %option yylineno: it seems that then Flex imagines
6491 REJECT has been used, and therefore it won't reallocate its
6492 buffers (which makes no other sense to me than a bug). It results
6493 in warnings for `unused: yy_flex_realloc'.
6494
9b3add5b
RA
64952001-12-30 Robert Anisko <robert.anisko@epita.fr>
6496
6497 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6498 (MUSCLE_INSERT_PREFIX): ...to there.
6499 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6500 (MUSCLE_INSERT_PREFIX): Move from here...
6501
6502 * src/bison.hairy: Add a section directive. Put braces around muscle
6503 names. This parser skeleton is still broken, but Bison should not
6504 choke on a bad muscle 'syntax'.
6505 * src/bison.simple: Add a section directive. Put braces around muscle
6506 names.
6507
6508 * src/files.h (strsuffix, stringappend): Add declarations.
6509 (tab_extension): Add declaration.
6510 (short_base_name): Add declaration.
6511
6512 * src/files.c (strsuffix, stringappend): No longer static. These
6513 functions are used in the skeleton parser.
6514 (tab_extension): New.
6515 (compute_base_names): Use the computations done in this function
fab5b110 6516 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
6517 names.
6518 (short_base_name): No longer static.
6519
6520 * src/output.c (output_skeleton): New.
6521 (output): Disable call to output_master_parser, and give a try to
6522 a new skeleton handling system.
6523 (guards_output, actions_output): No longer static.
6524 (token_definitions_output, get_lines_number): No longer static.
6525
6526 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
6527
fab5b110 6528 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
6529 parse-skel.y.
6530
6531 * src/parse-skel.y: New file.
6532 * src/scan-skel.l: New file.
6533
b5b61c61
AD
65342001-12-29 Akim Demaille <akim@epita.fr>
6535
6536 %name-prefix is broken.
6537
6538 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
6539 Adjust all dependencies.
6540 * tests/headers.at (export YYLTYPE): Strengthen this test: use
6541 %name-prefix.
6542
6543 Renaming yylval but not yylloc is not consistent. Now we do.
6544
6545 * src/bison.simple: Prefix yylloc if used.
6546 * doc/bison.texinfo (Decl Summary): Document that.
6547
8c9a50be
AD
65482001-12-29 Akim Demaille <akim@epita.fr>
6549
6550 * doc/bison.texinfo: Promote `%long-directive' over
6551 `%long_directive'.
6552 Remove all references to fixed-output-files, yacc is enough.
6553
d99361e6
AD
65542001-12-29 Akim Demaille <akim@epita.fr>
6555
6556 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
6557 user prologue. These are defaults.
6558 * tests/actions.at (Mid-rule actions): Make sure the user can
6559 define YYDEBUG and YYERROR_VERBOSE.
6560
b9cecb91
AD
65612001-12-29 Akim Demaille <akim@epita.fr>
6562
6563 * src/output.c (header_output): Don't forget to export YYLTYPE and
6564 yylloc.
6565 * tests/headers.at (export YYLTYPE): New, make sure it does.
6566 * tests/regression.at (%union and --defines, Invalid CPP headers):
6567 Move to...
6568 * tests/headers.at: here.
6569
aea13e97
AD
65702001-12-29 Akim Demaille <akim@epita.fr>
6571
6572 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
6573
931394cb
AD
65742001-12-29 Akim Demaille <akim@epita.fr>
6575
6576 * tests/actions.at (Mid-rule actions): Output on a single line
6577 instead of several.
6578
704a47c4
AD
65792001-12-29 Akim Demaille <akim@epita.fr>
6580
6581 * doc/bison.texinfo: Formatting changes.
6582
091e20bb
AD
65832001-12-29 Akim Demaille <akim@epita.fr>
6584
6585 Don't store the token defs in a muscle, just be ready to output it
6586 on command. Now possible via `symbols'. Fixes a memory leak.
6587
6588 * src/output.c (token_definitions_output): New.
6589 (output_parser, header_output): Use it.
6590 * src/reader.c (symbols_save): Remove.
6591
cce71710
AD
65922001-12-29 Akim Demaille <akim@epita.fr>
6593
6594 * src/bison.simple: Do not provide a default for YYSTYPE and
6595 YYLTYPE before the user's prologue. Otherwise it's hardly... a
6596 default.
6597
82c035a8
AD
65982001-12-29 Akim Demaille <akim@epita.fr>
6599
6600 Mid-rule actions are simply... ignored!
6601
6602 * src/reader.c (readgram): Be sure to attach mid-rule actions to
6603 the empty-rule associated to the dummy symbol, not to the host
6604 rule.
6605 * tests/actions.at (Mid-rule actions): New.
6606
8419d367
AD
66072001-12-29 Akim Demaille <akim@epita.fr>
6608
6609 Memory leak.
6610
6611 * src/reader.c (reader): Free grammar.
6612
375d5806
AD
66132001-12-29 Akim Demaille <akim@epita.fr>
6614
6615 Memory leak.
6616
6617 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
6618 since it allocates it for each state, although only one is needed.
6619 (allocate_storage): Do it here.
6620
f51cb8ff
AD
66212001-12-29 Akim Demaille <akim@epita.fr>
6622
6623 * src/options.h, src/options.c (create_long_option_table): Rename
6624 as...
6625 (long_option_table_new): this, with a clearer prototype.
6626 (percent_table): Remove, unused,
6627 * src/getargs.c (getargs): Adjust.
6628
29e88316
AD
66292001-12-29 Akim Demaille <akim@epita.fr>
6630
6631 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
6632 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
6633 as states.
6634
b9f71f19
AD
66352001-12-29 Akim Demaille <akim@epita.fr>
6636
6637 * src/lalr.c (build_relations): Rename `states' as `states1'.
6638 Sorry, I don't understand exactly what it is, no better name...
6639
1a2b5d37
AD
66402001-12-29 Akim Demaille <akim@epita.fr>
6641
6642 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
6643 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
6644 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
6645 as rules.
6646
1cca533e
AD
66472001-12-29 Akim Demaille <akim@epita.fr>
6648
6649 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
6650 ago.
6651
c03ae966
AD
66522001-12-29 Akim Demaille <akim@epita.fr>
6653
6654 * src/reader.c, src/reader.h (user_toknums): Remove.
6655 Adjust all users to use symbols[i]->user_token_number.
6656
5a670b1e
AD
66572001-12-29 Akim Demaille <akim@epita.fr>
6658
6659 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
6660 Adjust all users to use symbols[i]->prec or ->assoc.
6661
ad949da9
AD
66622001-12-29 Akim Demaille <akim@epita.fr>
6663
6664 * src/reader.c, src/reader.h (tags): Remove.
6665 Adjust all users to use symbols[i]->tag.
6666
0e78e603
AD
66672001-12-29 Akim Demaille <akim@epita.fr>
6668
6669 * src/gram.h, src/gram.c (symbols): New, similar to state_table
6670 and rule_table.
6671 * src/reader.c (packsymbols): Fill this table.
6672 Drop sprec.
6673 * src/conflicts.c (resolve_sr_conflict): Adjust.
6674 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
6675 single table.
6676 Use symbols[i]->tag instead of tags[i].
6677
213e640e
AD
66782001-12-29 Akim Demaille <akim@epita.fr>
6679
6680 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
6681 In addition, put a comment in there, to replace...
6682 * tests/regression.at (%union and C comments): Remove.
6683
e7b8bef1
AD
66842001-12-29 Akim Demaille <akim@epita.fr>
6685
6686 * tests/regression.at (Web2c Actions): Blindly move the actual
6687 output as expected output. The contents *seem* right to me, but I
6688 can't pretend reading perfectly parser tables... Nonetheless, all
6689 the other tests pass correctly, the table look OK, even though the
6690 presence of `$axiom' is to be noted: AFAICS it is useless (but
6691 harmless).
6692
b68e7744
AD
66932001-12-29 Akim Demaille <akim@epita.fr>
6694
6695 * src/reader.c (readgram): Don't add the rule 0 if there were no
6696 rules read. In other words, add it _after_ having performed
6697 grammar sanity checks.
6698 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
6699
78d5bae9
AD
67002001-12-29 Akim Demaille <akim@epita.fr>
6701
6702 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
6703 visible, and some states have now a different number.
6704
ff442794
AD
67052001-12-29 Akim Demaille <akim@epita.fr>
6706
6707 * src/reader.c (readgram): Bind the initial rule's lineno to that
6708 of the first rule.
6709 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
6710 (Solved SR Conflicts): Adjust rule 0's line number.
6711
610ab194
AD
67122001-12-29 Akim Demaille <akim@epita.fr>
6713
6714 Fix the `GAWK Grammar' failure.
6715
6716 * src/LR0.c (final_state): Initialize to -1 so that we do compute
6717 the reductions of the first state which was mistakenly confused
6718 with the final state because precisely final_state was initialized
6719 to 0.
6720 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
6721 now noticed by Bison.
6722 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
6723 have a reduction on $default.
6724
29d29c8f
AD
67252001-12-29 Akim Demaille <akim@epita.fr>
6726
6727 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
6728 rule line numbers.
6729 * src/closure.c (print_closure): Likewise.
6730 * src/derives.c (print_derives): Likewise.
6731 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
6732 now.
6733
7c6b64d0
AD
67342001-12-29 Akim Demaille <akim@epita.fr>
6735
6736 * src/lalr.c (lookaheads_print): New.
6737 (lalr): Call it when --trace-flag.
6738 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
6739 are dumped.
6740
3d4daee3
AD
67412001-12-29 Akim Demaille <akim@epita.fr>
6742
6743 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
6744 when walking through ritem, even via rule->rhs.
6745 * src/reduce.c (dump_grammar, useful_production, reduce_output)
6746 (useful_production, useless_nonterminals): Likewise.
6747 (reduce_grammar_tables): Likewise, plus update nritems.
6748 * src/nullable.c (set_nullable): Likewise.
6749 * src/lalr.c (build_relations): Likewise.
6750 * tests/sets.at (Nullable): Adjust.
6751 Fortunately, now, the $axiom is no longer nullable.
6752
9e7f6bbd
AD
67532001-12-29 Akim Demaille <akim@epita.fr>
6754
6755 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
6756 the 0-sentinel.
6757 * src/gram.c (ritem_longest_rhs): Likewise.
6758 * src/reduce.c (nonterminals_reduce): Likewise.
6759 * src/print_graph.c (print_graph): Likewise.
6760 * src/output.c (output_rule_data): Likewise.
6761 * src/nullable.c (set_nullable): Likewise.
6762
255ef638
AD
67632001-12-29 Akim Demaille <akim@epita.fr>
6764
6765 * src/output.c: Comment changes.
6766
0d8a7363
AD
67672001-12-27 Paul Eggert <eggert@twinsun.com>
6768
6769 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
6770 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
6771 Sparc, as they were causing more porting problems than the
6772 (minor) performance improvement was worth.
6773
6774 Also, catch up with 1.31's YYSTD.
6775
3db472b9
AD
67762001-12-27 Akim Demaille <akim@epita.fr>
6777
6778 * src/output.c (output_gram): Rely on nritems, not the
6779 0-sentinel. See below.
6780 Use -1 as separator, not 0.
6781 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
6782 Rely on -1 as separator in yyrhs, instead of 0.
6783 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
6784 twice `Now at end of input', therefore there are two lines less to
6785 expect.
6786
b365aa05
AD
67872001-12-27 Akim Demaille <akim@epita.fr>
6788
6789 * tests/regression.at (Unresolved SR Conflicts):
6790 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
6791 below.
6792
30171f79
AD
67932001-12-27 Akim Demaille <akim@epita.fr>
6794
6795 * src/LR0.c (new_state): Recognize the final state by the fact it
6796 is reached by eoftoken.
6797 (insert_start_shifting_state, insert_eof_shifting_state)
6798 (insert_accepting_state, augment_automaton): Remove, since now
6799 these states are automatically computed from the initial state.
6800 (generate_states): Adjust.
6801 * src/print.c: When reporting a rule number to the user, substract
6802 1, so that the axiom rule is rule 0, and the first user rule is 1.
6803 * src/reduce.c: Likewise.
6804 * src/print_graph.c (print_core): For the time being, just as for
6805 the report, depend upon --trace-flags to dump the full set of
6806 items.
6807 * src/reader.c (readgram): Once the grammar read, insert the rule
6808 0: `$axiom: START-SYMBOL $'.
6809 * tests/set.at: Adjust: rule 0 is now displayed, and since the
6810 number of the states has changed (the final state is no longer
6811 necessarily the last), catch up.
6812
75142d45
AD
68132001-12-27 Akim Demaille <akim@epita.fr>
6814
6815 Try to make the use of the eoftoken valid. Given that its value
6816 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
6817 is used instead of > 0 where appropriate, (ii), depend upon nritems
6818 instead of the 0-sentinel.
6819
6820 * src/gram.h, src/gram.c (nritems): New.
6821 Expected to be duplication of nitems, but for the time being...
6822 * src/reader.c (packgram): Assert nritems and nitems are equal.
6823 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
6824 * src/closure.c (print_closure, print_fderives): Likewise.
6825 * src/gram.c (ritem_print): Likewise.
6826 * src/print.c (print_core, print_grammar): Likewise.
6827 * src/print_graph.c: Likewise.
6828
b7c49edf
AD
68292001-12-27 Akim Demaille <akim@epita.fr>
6830
6831 * src/main.c (main): If there are complains after grammar
6832 reductions, then output the report anyway if requested, then die.
6833 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
6834 * src/reader.c (eoftoken): New.
6835 (parse_token_decl): If the token being defined has value `0', it
6836 is the eoftoken.
6837 (packsymbols): No longer hack `tags' to insert `$' by hand.
6838 Be sure to preserve the value of the eoftoken.
6839 (reader): Make sure eoftoken is defined.
6840 Initialize nsyms to 0: now eoftoken is created just like the others.
6841 * src/print.c (print_grammar): Don't special case the eof token.
6842 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
6843 lie anyway, albeit pleasant.
6844 * tests/calc.at: Exercise error messages with eoftoken.
6845 Change the grammar so that empty input is invalid.
6846 Adjust expectations.
6847 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
6848
ec2da99f
AD
68492001-12-27 Akim Demaille <akim@epita.fr>
6850
6851 * configure.in: Check the protos of strchr ans strspn.
6852 Replace strchr if needed.
6853 * src/system.h: Provide the protos of strchr, strspn and memchr if
6854 missing.
6855 * lib/strchr.c: New.
6856 * src/reader.c (symbols_save): Use strchr.
6857
8adfa272
AD
68582001-12-27 Akim Demaille <akim@epita.fr>
6859
6860 * src/print.c, src/print_graph.c (escape): New.
6861 Use it to quote the TAGS outputs.
6862 * src/print_graph.c (print_state): Now errors are in red, and
6863 reductions in green.
6864 Prefer high to wide: output the state number on a line of its own.
6865
80dac38c
AD
68662001-12-27 Akim Demaille <akim@epita.fr>
6867
6868 * src/state.h, src/state.c (reductions_new): New.
6869 * src/LR0.c (set_state_table): Let all the states have a
6870 `reductions', even if reduced to 0.
6871 (save_reductions): Adjust.
6872 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
6873 * src/print.c (print_reductions, print_actions): Adjust.
6874 * src/output.c (action_row): Adjust.
6875
2cec70b9
AD
68762001-12-27 Akim Demaille <akim@epita.fr>
6877
6878 * src/state.h, src/state.c (errs_new, errs_dup): New.
6879 * src/LR0.c (set_state_table): Let all the states have an errs,
6880 even if reduced to 0.
6881 * src/print.c (print_errs, print_reductions): Adjust.
6882 * src/output.c (output_actions, action_row): Adjust.
6883 * src/conflicts.c (resolve_sr_conflict): Adjust.
6884
13ca549a
AD
68852001-12-27 Akim Demaille <akim@epita.fr>
6886
6887 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
6888
5092aba5
AD
68892001-12-27 Akim Demaille <akim@epita.fr>
6890
6891 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
6892 * src/print.c: here.
6893 (lookaheadset, shiftset): New, used as additional storage by
6894 print_reductions.
6895 (print_results): Adjust.
6896 (print_shifts, print_gotos, print_errs): New, extracted from...
6897 (print_actions): here.
6898 * src/print_graph.c (print_actions): Remove dead code.
6899
11e2beca
AD
69002001-12-27 Akim Demaille <akim@epita.fr>
6901
6902 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
6903 `$n' and `@n'.
6904
dac3c910
AD
69052001-12-27 Akim Demaille <akim@epita.fr>
6906
6907 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
6908 (build_relations): Adjust.
6909
d0b0fefa
AD
69102001-12-27 Akim Demaille <akim@epita.fr>
6911
6912 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
6913 duplication.
6914
adc8c848
AD
69152001-12-27 Akim Demaille <akim@epita.fr>
6916
6917 * src/reader.c (packgram): Catch nitems overflows.
6918
14d293ac
AD
69192001-12-27 Akim Demaille <akim@epita.fr>
6920
6921 * src/files.c, src/files.h (guard_obstack): Remove.
6922 * src/output.c (output): Adjust.
6923 * src/reader.c (parse_braces): New, factoring...
6924 (copy_action, copy_guard): these two which are renamed as...
6925 (parse_action, parse_guard): these.
6926 As a voluntary consequence, using braces around guards is now
6927 mandatory.
6928
f499b062
AD
69292001-12-27 Akim Demaille <akim@epita.fr>
6930
6931 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
6932 * src/reader.c (symbol_list): `guard' and `guard_line' are new
6933 members.
6934 (symbol_list_new): Adjust.
6935 (copy_action): action_line is the first line, not the last.
6936 (copy_guard): Just as for actions, store the `action' only, not
6937 the switch/case/break flesh.
6938 Don't parse the user action that might follow the guard, let...
6939 (readgram): do it, i.e., now, there can be an action after a
6940 guard.
6941 In other words the guard is just explicitly optional.
6942 (packgram): Adjust.
6943 * src/output.c (guards_output): New.
6944 (output_parser): Call it when needed.
6945 (output): Also free the guard and attrs obstacks.
6946 * src/files.c, src/files.h (obstack_save): Remove.
6947 (output_files): Remove.
6948 As a result, if one needs the former `.act' file, using an
6949 appropriate skeleton which requires actions and guards is now
6950 required.
6951 * src/main.c (main): Adjust.
6952 * tests/semantic.at: New.
6953 * tests/regression.at: Use `input.y' as input file name.
6954 Avoid 8+3 problems by requiring input.c when the test needs the
6955 parser.
6956
d945f5cd
AD
69572001-12-27 Akim Demaille <akim@epita.fr>
6958
6959 * src/reader.c (symbol_list_new): Be sure to initialize all the
6960 fields.
6961
d200e455
AD
69622001-12-27 Akim Demaille <akim@epita.fr>
6963
6964 All the hacks using a final pseudo state are now useless.
6965
6966 * src/LR0.c (set_state_table): state_table holds exactly nstates.
6967 * src/lalr.c (nLA): New.
6968 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
6969 instead of lookaheadsp from the pseudo state (nstate + 1).
6970
f9507c28
AD
69712001-12-27 Akim Demaille <akim@epita.fr>
6972
6973 * src/output.c (action_row, token_actions): Use a state_t instead
6974 of a integer, and nlookaheads instead of the following state's
6975 lookaheadsp.
6976
065fbd27
AD
69772001-12-27 Akim Demaille <akim@epita.fr>
6978
6979 * src/conflicts.c (log_resolution, flush_shift)
6980 (resolve_sr_conflict, set_conflicts, solve_conflicts)
6981 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
6982 (conflicts_print, print_reductions): Use a state_t instead of an
6983 integer when referring to a state.
6984 As much as possible, depend upon nlookaheads, instead of the
6985 `lookaheadsp' member of the following state (since lookaheads of
6986 successive states are successive, the difference between state n + 1
6987 and n served as the number of lookaheads for state n).
6988 * src/lalr.c (add_lookback_edge): Likewise.
6989 * src/print.c (print_core, print_actions, print_state)
6990 (print_results): Likewise.
6991 * src/print_graph.c (print_core, print_actions, print_state)
6992 (print_graph): Likewise.
6993 * src/conflicts.h: Adjust.
6994
1b177bd7
AD
69952001-12-27 Akim Demaille <akim@epita.fr>
6996
6997 * src/bison.hairy: Formatting/comment changes.
6998 ANSIfy.
6999 Remove `register' indications.
7000 Add plenty of `static'.
7001
7742ddeb
AD
70022001-12-27 Akim Demaille <akim@epita.fr>
7003
7004 * src/output.c (prepare): Drop the muscle `ntbase' which
7005 duplicates ntokens.
7006 * src/bison.simple: Formatting/comment changes.
7007 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
7008 is an undocumented synonym.
7009
1fa14068
AD
70102001-12-22 Akim Demaille <akim@epita.fr>
7011
7012 * src/output.c (output_table_data): Change the prototype to use
7013 `int' for array ranges: some invocations do pass an int, not a
7014 short.
7015 Reported by Wayne Green.
7016
b9752825
AD
70172001-12-22 Akim Demaille <akim@epita.fr>
7018
7019 Some actions of web2c.y are improperly triggered.
7020 Reported by Mike Castle.
7021
7022 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
7023 * tests/regression.at (Web2c): Rename as...
7024 (Web2c Report): this.
7025 (Web2c Actions): New.
7026
776209d6
AD
70272001-12-22 Akim Demaille <akim@epita.fr>
7028
7029 Reductions in web2c.y are improperly reported.
7030 Reported by Mike Castle.
7031
7032 * src/conflicts.c (print_reductions): Fix.
7033 * tests/regression.at (Web2c): New.
7034
275fc3ad
AD
70352001-12-18 Akim Demaille <akim@epita.fr>
7036
7037 Some host fail on `assert (!"foo")', which expands to
7038 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
7039 Reported by Nelson Beebee.
7040
7041 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
7042 `#define it_succeeded 0' and `assert (it_succeeded)'.
7043
897668ee
MA
70442001-12-17 Marc Autret <autret_m@epita.fr>
7045
7046 * src/bison.simple: Don't hard code the skeleton line and filename.
7047 * src/output.c (output_parser): Rename 'line' as 'output_line'.
7048 New line counter 'skeleton_line' (skeleton-line muscle).
7049
ab3399e0
PE
70502001-12-17 Paul Eggert <eggert@twinsun.com>
7051
7052 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
7053 YYDEBUG must be defined to a nonzero value.
7054
7055 * src/bison.simple (yytname): Do not assume that the user defines
7056 YYDEBUG to a properly parenthesized expression.
7057
3877f72b
AD
70582001-12-17 Akim Demaille <akim@epita.fr>
7059
7060 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
7061 nlookaheads is a new member.
7062 Adjust all users.
7063 * src/lalr.h (nlookaheads): Remove this orphan declaration.
7064 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
7065 state.
776209d6 7066
331dbc1b
AD
70672001-12-17 Akim Demaille <akim@epita.fr>
7068
7069 * src/files.h, src/files.c (open_files, close_files): Remove.
7070 * src/main.c (main): Don't open/close files, nor invoke lex_free,
7071 let...
7072 * src/reader.c (reader): Do it.
776209d6 7073
be750e4c
AD
70742001-12-17 Akim Demaille <akim@epita.fr>
7075
7076 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 7077
709ae8c6
AD
70782001-12-17 Akim Demaille <akim@epita.fr>
7079
7080 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
7081 (flush_reduce): New.
7082 (resolve_sr_conflict): Adjust.
776209d6 7083
f87685c3
AD
70842001-12-17 Akim Demaille <akim@epita.fr>
7085
7086 * src/output.c (output_obstack): Be static and rename as...
7087 (format_obstack): this, to avoid any confusion with files.c's
7088 output_obstack.
7089 * src/reader.h (muscle_obstack): Move to...
7090 * src/output.h: here, since it's defined in output.c.
7091
837491d8
AD
70922001-12-17 Akim Demaille <akim@epita.fr>
7093
7094 * src/output.c (action_row, save_column, default_goto)
7095 (sort_actions, matching_state, pack_vector): Better variable
7096 locality.
7097
796d61fb
AD
70982001-12-17 Akim Demaille <akim@epita.fr>
7099
7100 * src/output.c: Various formatting changes.
776209d6 7101
64d15509
AD
71022001-12-17 Akim Demaille <akim@epita.fr>
7103
7104 * src/files.c (output_files): Free the output_obstack.
7105 * src/main.c (main): Call print and print_graph conditionally.
7106 * src/print.c (print): Work unconditionally.
7107 * src/print_graph.c (print_graph): Work unconditionally.
7108 * src/conflicts.c (log_resolution): Output only if verbose_flag.
7109
fbc8ecb7
MA
71102001-12-16 Marc Autret <autret_m@epita.fr>
7111
7112 * src/output.c (actions_output): Fix. When we use %no-lines,
7113 there is one less line per action.
7114
f0440388
MA
71152001-12-16 Marc Autret <autret_m@epita.fr>
7116
7117 * src/bison.simple: Remove a useless #line directive.
7118 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
7119 * src/output.c (get_lines_number): New.
776209d6 7120 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
7121 output muscles.
7122 Fix line numbering.
7123 (actions_output): Computes the number of lines taken by actions.
7124 (output_master_parser): Insert new skeleton which is the name of
7125 the output parser file name.
7126
a79986b8
MA
71272001-12-15 Marc Autret <autret_m@epita.fr>
7128
7129 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
7130
4ec8e00f
MA
71312001-12-15 Marc Autret <autret_m@epita.fr>
7132
7133 * src/output.c (output_gram): Keep track of the hairy one.
7134
1a4648ff
AD
71352001-12-15 Akim Demaille <akim@epita.fr>
7136
7137 Make `make distcheck' work.
7138
7139 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
7140 system.h which uses libgettext.h.
7141
9c2c67e6
AD
71422001-12-15 Akim Demaille <akim@epita.fr>
7143
7144 * src/nullable.c (set_nullable): Useless rules must be skipped,
7145 otherwise, since we range over their symbols, we might look at a
7146 nonterminal which no longer ``exists'', i.e., it is not counted in
7147 `nvars', hence we overflow our arrays.
7148
93ede233
AD
71492001-12-15 Akim Demaille <akim@epita.fr>
7150
7151 The header can also be produced directly, without any obstack!
7152 Yahoo!
7153
7154 * src/files.c, src/files.h (defines_obstack): Remove.
7155 (compute_header_macro): Global.
7156 (defines_obstack_save): Remove.
7157 * src/reader.c (parse_union_decl): No longer output to
7158 defines_obstack: its content can be found in the `stype' muscle
7159 anyway.
7160 (output_token_translations): Merge into...
7161 (symbols_output): this.
7162 Rename as...
7163 (symbols_save): this.
7164 (reader): Adjust.
7165 * src/output.c (header_output): New.
7166 (output): Call it.
7167
2666f928
AD
71682001-12-15 Akim Demaille <akim@epita.fr>
7169
7170 * src/reader.c (parse_union_decl): Instead of handling two obstack
7171 simultaneously, use one to define the `stype' muscle, and use the
7172 value of the latter to fill defines_obstack.
7173 (copy_comment): Remove.
7174 (copy_comment2): Work for a single obstack.
7175 Rename as...
7176 (copy_comment): this.
7177
428046f8
AD
71782001-12-15 Akim Demaille <akim@epita.fr>
7179
7180 * src/lex.c, src/lex.h (xgetc): No longer static.
7181 * src/reader.c (parse_union_decl): Revamp.
7182
ea52d706
AD
71832001-12-15 Akim Demaille <akim@epita.fr>
7184
7185 Still making progress in separating Bison into (i) input, (ii)
7186 process, (iii) output: now we can directly output the parser file
7187 without using table_obstack at all.
7188
7189 * src/files.c, src/files.h (table_obstack): Bye bye.
7190 (parser_file_name): New.
7191 * src/files.c (compute_output_file_names): Compute it.
7192 * src/output.c (actions_output, output_parser)
7193 (output_master_parser): To a file instead of an obstack.
7194
3f96f4dc
AD
71952001-12-15 Akim Demaille <akim@epita.fr>
7196
7197 Attach actions to rules, instead of pre-outputting them to
7198 actions_obstack.
7199
7200 * src/gram.h (rule_t): action and action_line are new members.
7201 * src/reader.c (symbol_list): Likewise.
7202 (copy_action): Save the actions within the rule.
7203 (packgram): Save them in rule_table.
7204 * src/output.c (actions_output): New.
7205 (output_parser): Use it on `%%actions'.
7206 (output_rule_data): Don't free rule_table.
7207 (output): Do it.
7208 (prepare): Don't save the `action' muscle.
7209 * src/bison.simple: s/%%action/%%actions/.
7210
51576fb3
AD
72112001-12-15 Akim Demaille <akim@epita.fr>
7212
7213 * src/reader.c (copy_action): When --yacc, don't append a `;'
7214 to the user action: let it fail if lacking.
dee049eb 7215 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 7216
2648a72d
AD
72172001-12-14 Akim Demaille <akim@epita.fr>
7218
7219 * src/lex.c (literalchar): Simply return the char you decoded, non
7220 longer mess around with obstacks and int pointers.
7221 Adjust all callers.
7222
92790e5b
AD
72232001-12-14 Akim Demaille <akim@epita.fr>
7224
7225 * src/lex.c (literalchar): Don't escape the special characters,
7226 just decode them, and keep them as char (before, eol was output as
7227 the 2 char string `\n' etc.).
7228 * src/output.c (output_rule_data): Use quotearg to output the
7229 token strings.
7230
927c1557
PE
72312001-12-13 Paul Eggert <eggert@twinsun.com>
7232
7233 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
7234 Do not infringe on the global user namespace when using C++.
7235 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
7236 All uses of `fprintf' and `stderr' changed.
7237
7238 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
7239
ed8e1f68
AD
72402001-12-13 Akim Demaille <akim@epita.fr>
7241
7242 The computation of nullable is broken: it doesn't handle empty
7243 RHS's properly.
7244
7245 * tests/torture.at (GNU AWK Grammar): New.
7246 * tests/sets.at (Nullable): New.
7247 * src/nullable.c (set_nullable): Instead of blindly looping over
7248 `ritems', loop over the rules, and then over their rhs's.
7249
7250 Work around Autotest bugs.
7251
7252 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
7253 frame, because Autotest understand lines starting with a `+' as
7254 traces from the shell. Then, they are not processed properly.
7255 Admittedly an Autotest bug, but we don't have time to wait for
7256 Autotest to catch up.
7257 * tests/regression.at (Broken Closure): Adjust to the new table
7258 frames.
7259 Move to...
7260 * tests/sets.at: here.
7261
cb581495
AD
72622001-12-13 Akim Demaille <akim@epita.fr>
7263
7264 * src/closure.c (closure): Use nrules instead of playing tricks
7265 with BITS_PER_WORD.
7266
2e729273
AD
72672001-12-13 Akim Demaille <akim@epita.fr>
7268
7269 * src/print.c (print_actions): Output the handling of `$' as the
7270 traces do: shifting the token EOF. Before EOF was treated as a
7271 nonterminal.
7272 * tests/regression.at: Adjust some tests.
7273 * src/print_graph.c (print_core): Complete the set of items via
7274 closure. The next-to-final and final states are still unsatisfying,
7275 but that's to be addressed elsewhere.
7276 No longer output the rule numbers, but do output the state number.
7277 A single loop for the shifts + gotos is enough, but picked a
7278 distinct color for each.
7279 (print_graph): Initialize and finalize closure.
7280
107f7dfb
AD
72812001-12-13 Akim Demaille <akim@epita.fr>
7282
7283 * src/reader.c (readgram): Remove dead code, an strip useless
7284 braces.
7285 (get_type): Remove, unused.
7286
9b53a24f
AD
72872001-12-12 Akim Demaille <akim@epita.fr>
7288
7289 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
7290 on that of lib/error.c.
7291
dbfb6dcd
AD
72922001-12-12 Akim Demaille <akim@epita.fr>
7293
7294 Some hosts don't like `/' in includes.
7295
7296 * src/system.h: Include libgettext.h without qualifying the path.
7297 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
7298 $(top_srcdir).
7299
c25fb648
MA
73002001-12-11 Marc Autret <autret_m@epita.fr>
7301
7302 * src/output.c (output_parser): Remove useless muscle.
7303
710ddc4f
MA
73042001-12-11 Marc Autret <autret_m@epita.fr>
7305
7306 * src/bison.simple: Remove #line just before %%epilogue. It
7307 is now handled in ...
7308 * src/reader.c (read_additionnal_code): Add the output of a
7309 #line for the epilogue.
7310
e83d80b8
MA
73112001-12-10 Marc Autret <autret_m@epita.fr>
7312
927c1557 7313 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
7314 replace precedent remove.
7315 * src/bison.simple: Remove #line before %%prologue because
7316 %%input-line is wrong at this time.
7317
971d5158
MA
73182001-12-10 Marc Autret <autret_m@epita.fr>
7319
7320 * src/reader.c (symbols_output): Clean up.
927c1557 7321 * src/output.c (output_gram, output): Clean up.
971d5158 7322
5edafffd
AD
73232001-12-10 Akim Demaille <akim@epita.fr>
7324
7325 * src/lalr.c (initialize_lookaheads): New. Extracted from...
7326 * src/LR0.c (set_state_table): here.
7327 * src/lalr.c (lalr): Call it.
7328
0279f8e9
AD
73292001-12-10 Akim Demaille <akim@epita.fr>
7330
7331 * src/state.h (shifts): Remove the `number' member: shifts are
7332 attached to state, hence no longer need to be labelled with a
7333 state number.
7334
190c4f5f
AD
73352001-12-10 Akim Demaille <akim@epita.fr>
7336
7337 Now that states have a complete set of members, the linked list of
7338 shifts is useless: just fill directly the state's shifts member.
7339
7340 * src/state.h (shifts): Remove the `next' member.
7341 * src/LR0.c (first_state, last_state): Remove.
7342 Adjust the callers.
7343 (augment_automaton): Don't look for the shifts that must be added
7344 a shift on EOF: it is those of the state we looked for! But now,
7345 since shifts are attached, it is no longer needed to looking
7346 merely by its id: its number.
7347
2a73b93d
AD
73482001-12-10 Akim Demaille <akim@epita.fr>
7349
7350 * src/LR0.c (augment_automaton): Better variable locality.
7351 Remove an impossible branch: if there is a state corresponding to
7352 the start symbol being shifted, then there is shift for the start
7353 symbol from the initial state.
7354
74392f6a
AD
73552001-12-10 Akim Demaille <akim@epita.fr>
7356
7357 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
7358 only when appropriate: when insert_start_shifting_state' is not
7359 invoked.
7360 * tests/regression.at (Rule Line Numbers): Adjust.
7361
37c82725
AD
73622001-12-10 Akim Demaille <akim@epita.fr>
7363
7364 * src/LR0.c (augment_automaton): Now that all states have shifts,
7365 merge the two cases addition shifts to the initial state.
7366
6a164e0c
AD
73672001-12-10 Akim Demaille <akim@epita.fr>
7368
7369 * src/lalr.c (set_state_table): Move to...
7370 * src/LR0.c: here.
7371 * src/lalr.c (lalr): Don't call it...
7372 * src/LR0.c (generate_states): do it.
7373 * src/LR0.h (first_state): Remove, only the table is used.
7374
7215de24
AD
73752001-12-10 Akim Demaille <akim@epita.fr>
7376
7377 * src/LR0.h (first_shift, first_reduction): Remove.
7378 * src/lalr.c: Don't use first_shift: find shifts through the
7379 states.
7380
80e25d4d
AD
73812001-12-10 Akim Demaille <akim@epita.fr>
7382
7383 * src/LR0.c: Attach shifts to states as soon as they are
7384 computed.
7385 * src/lalr.c (set_state_table): Instead of assigning shifts to
7386 state, just assert that the mapping was properly done.
7387
0ab3728b
AD
73882001-12-10 Akim Demaille <akim@epita.fr>
7389
7390 * src/LR0.c (insert_start_shift): Rename as...
7391 (insert_start_shifting_state): this.
7392 (insert_eof_shifting_state, insert_accepting_state): New.
7393 (augment_automaton): Adjust.
7394 Better locality of the variables.
7395 When looking if the start_symbol is shifted from the initial
7396 state, using `while (... symbol != start_symbol ...)' sounds
7397 better than `while (... symbol < start_symbol ...)': If fail
7398 to see how the order between symbols could be relevant!
7399
78af9bbc
AD
74002001-12-10 Akim Demaille <akim@epita.fr>
7401
7402 * src/getargs.h: Don't declare `spec_name_prefix' and
7403 `spec_file_prefix', declared by src/files.h.
7404 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
7405 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
7406 * src/output.c (prepare): Adjust.
7407 * src/reader.c (symbols_output): Likewise.
7408 * src/vmsgetargs.c: Vaguely adjust, but who cares?
7409
bdef2a41
AD
74102001-12-10 Akim Demaille <akim@epita.fr>
7411
7412 * src/muscle_tab.c (muscle_init): NULL is a better default than
7413 `"0"'.
7414
3735969c
AD
74152001-12-10 Akim Demaille <akim@epita.fr>
7416
7417 * src/reader.c (reader): Calling symbols_output once is enough.
7418
49701457
AD
74192001-12-10 Akim Demaille <akim@epita.fr>
7420
7421 Now that states have a complete set of members, the linked list of
7422 reductions is useless: just fill directly the state's reductions
7423 member.
7424
7425 * src/state.h (struct reductions): Remove member `number' and
7426 `next'.
7427 * src/LR0.c (first_reduction, last_reduction): Remove.
7428 (save_reductions): Don't link the new reductions, store them in
7429 this_state.
7430 * src/lalr.c (set_state_table): No need to attach reductions to
7431 states, it's already done.
7432 * src/output.c (output_actions): No longer free the shifts, then
7433 the reductions, then the states: free all the states and their
7434 members.
7435
0edad749
AD
74362001-12-10 Akim Demaille <akim@epita.fr>
7437
7438 * src/options.c (OPTN, DRTV, BOTH): New.
7439 (option_table): Use them.
7440
0edad749
AD
7441 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
7442 the job of system.h.
7443 * src/options.c: Don't include stdio.h and xalloc.h for the same
7444 reasons.
7445
5449dd0f
AD
74462001-12-10 Akim Demaille <akim@epita.fr>
7447
7448 * src/output.c (output, prepare): Make sure the values of the
7449 muscles `action' and `prologue' are 0-terminated.
7450
a870c567
AD
74512001-12-10 Akim Demaille <akim@epita.fr>
7452
7453 Clean up GCC warnings.
7454
7455 * src/reader.c (copy_action): `buf' is not used.
7456 (parse_skel_decl): Be static.
7457 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
7458 * src/options.h (create_long_option_table): Have a real prototype.
7459 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
7460 (hash_delete_at): Return const void *.
7461 Adjust casts to preserve the const.
7462
80df8768
AD
74632001-12-10 Akim Demaille <akim@epita.fr>
7464
7465 * configure.in: Require 2.52g.
7466 M4 is not needed, but AUTOM4TE is.
7467 * m4/m4.m4: Remove.
7468 * tests/Makefile.am: Adjust.
7469
f693ad14
AD
74702001-12-10 Akim Demaille <akim@epita.fr>
7471
7472 One structure for states is enough, even though theoretically
7473 there are LR(0) states and LALR(1) states.
7474
7475 * src/lalr.h (state_t): Remove.
7476 (state_table): Be state_t **, not state_t *.
7477 * src/state.h (core, CORE_ALLOC): Rename as...
7478 (state_t, STATE_ALLOC): this.
7479 Add the LALR(1) members: shifts, reductions, errs.
7480 * src/LR0.c (state_table): Rename as...
7481 (state_hash): this, to avoid name clashes with the global
7482 `state_table'.
7483 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
7484 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
7485
74ffbcb6
AD
74862001-12-10 Akim Demaille <akim@epita.fr>
7487
7488 Bison dumps core on bash.y.
7489 Reported by Pascal Bart.
7490
7491 * src/warshall.c (bitmatrix_print): New.
7492 (TC): Use it.
7493 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
7494 j must be the outer loop.
7495 * tests/regression.at (Broken Closure): New.
7496
07708e19
AD
74972001-12-05 Akim Demaille <akim@epita.fr>
7498
7499 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
7500 its argument.
ba1ecc07 7501 Reported by Peter Hamorsky.
07708e19 7502
92b16366
AD
75032001-12-05 Akim Demaille <akim@epita.fr>
7504
7505 * src/conflicts.c (err_table): Remove.
7506 (resolve_sr_conflict): Adjust.
7507 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
7508 Rename as...
7509 (state_t.reductions, state_t.shifts): this.
7510
076ab033
AD
75112001-12-05 Akim Demaille <akim@epita.fr>
7512
7513 * src/reduce.c (reduce_grammar_tables): No longer disable the
7514 removal of useless rules via CPP but via `if (0)', so that the
7515 compiler still check the code is valid.
7516 For instance, it should have noticed `rline' no longer exists: use
7517 the `line' member of rule_t.
7518 * src/gram.c (dummy, rline): Remove, unused.
7519
3843c413
AD
75202001-12-05 Akim Demaille <akim@epita.fr>
7521
7522 * src/output.c (pack_vector): Use assert, not berror.
7523 * src/main.c (berror): Remove, unused.
7524
43168960
AD
75252001-12-05 Akim Demaille <akim@epita.fr>
7526
7527 New experimental feature: if --verbose --trace output all the
7528 items of a state, not only its kernel.
7529
7530 * src/print.c (print_core): If `trace_flag', then invoke closure
7531 before outputting the items of the state (print_core is no longer
7532 a correct name them).
7533 (print_results): Invoke new_closure/free_closure if needed.
7534
b2872512
AD
75352001-12-05 Akim Demaille <akim@epita.fr>
7536
7537 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
7538 * src/closure.c, src/closure.h (itemsetsize): Rename as...
7539 (nitemset): for consistency with the rest of the project.
7540
23cbcc6c
AD
75412001-12-05 Akim Demaille <akim@epita.fr>
7542
7543 * src/closure.c (print_closure): Improve.
7544 (closure): Use it for printing input and output.
7545
03ec521c
AD
75462001-12-05 Akim Demaille <akim@epita.fr>
7547
7548 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
7549 indexed by nonterminals.
7550
3a7456dd
AD
75512001-12-05 Akim Demaille <akim@epita.fr>
7552
7553 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
7554 what it was!).
7555 * src/warshall.h: Remove accidental duplication of the content.
7556
1cbcf2e7
AD
75572001-12-05 Akim Demaille <akim@epita.fr>
7558
7559 * src/closure.c (set_fderives): De-obfuscate.
7560
84182270
AD
75612001-12-05 Akim Demaille <akim@epita.fr>
7562
7563 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
7564
3f6f053c
AD
75652001-12-05 Akim Demaille <akim@epita.fr>
7566
7567 * src/closure.c (set_firsts): De-obfuscate.
7568
7a5350ba
AD
75692001-12-05 Akim Demaille <akim@epita.fr>
7570
7571 * src/output.c (action_row): De-obfuscate
7572 using the good o' techniques: arrays not pointers, variable
7573 locality, BITISSET, RESETBIT etc.
7574
d954473d
AD
75752001-12-05 Akim Demaille <akim@epita.fr>
7576
7577 Pessimize the code to simplify it: from now on, all the states
7578 have a valid SHIFTS, which NSHIFTS is possibly 0.
7579
7580 * src/LR0.c (shifts_new): Be global and move to..
7581 * src/state.c, src/state.h: here.
7582 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
7583 * src/print_graph: Adjust.
7584
9839bbe5
AD
75852001-12-05 Akim Demaille <akim@epita.fr>
7586
7587 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
7588 * src/conflicts.c: Use it.
7589 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
7590 incorrectly ``simplified''.
7591
9f136c07
AD
75922001-12-05 Akim Demaille <akim@epita.fr>
7593
7594 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
7595 using the good o' techniques: arrays not pointers, variable
7596 locality, BITISSET, RESETBIT etc.
7597
b608206e
AD
75982001-12-05 Akim Demaille <akim@epita.fr>
7599
7600 * src/state.h (SHIFT_SYMBOL): New.
7601 * src/conflicts.c: Use it to deobfuscate.
7602
52afa962
AD
76032001-12-05 Akim Demaille <akim@epita.fr>
7604
7605 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
7606 (print_reductions): De-obfuscate using the good o' techniques:
7607 arrays not pointers, variable locality, BITISSET.
7608
e74dc321
AD
76092001-12-05 Akim Demaille <akim@epita.fr>
7610
7611 * src/conflicts.c (print_reductions): Arrays, not pointers.
7612 Use BITISSET.
7613
768fca83
AD
76142001-12-05 Akim Demaille <akim@epita.fr>
7615
7616 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7617
a17e599f
AD
76182001-12-05 Akim Demaille <akim@epita.fr>
7619
7620 * src/conflicts.c (print_reductions): Improve variable locality.
7621
a04bc341
AD
76222001-12-05 Akim Demaille <akim@epita.fr>
7623
7624 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7625
c8ea038e
AD
76262001-12-05 Akim Demaille <akim@epita.fr>
7627
7628 * src/conflicts.c (print_reductions): Improve variable locality.
7629
aa2aab3c
AD
76302001-12-05 Akim Demaille <akim@epita.fr>
7631
7632 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
7633 * src/lalr.c: Use them.
7634
b178c8cc
AD
76352001-12-05 Akim Demaille <akim@epita.fr>
7636
7637 * src/LR0.c (augment_automaton): Formatting changes.
7638 Better variable locality.
7639
f67d13aa
AD
76402001-12-05 Akim Demaille <akim@epita.fr>
7641
7642 * src/lalr.c (matrix_print): New.
7643 (transpose): Use it.
7644 Use arrays instead of pointers.
7645
c2713865
AD
76462001-12-05 Akim Demaille <akim@epita.fr>
7647
7648 * src/lalr.c (maxrhs): Move to...
7649 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
7650 * src/lalr.c (build_relations): Adjust.
7651
9887c18a
AD
76522001-12-05 Akim Demaille <akim@epita.fr>
7653
7654 * src/lalr.c (transpose): Free the memory allocated to the
7655 argument, as it is replaced by the results by the unique caller.
7656 (build_relations): Merely invoke transpose: it handles the memory
7657 deallocation.
7658 Improve variable locality.
7659 Avoid variables used as mere abbreviations.
7660 (compute_lookaheads): Use arrays instead of pointers.
7661
4d4f699c
AD
76622001-12-05 Akim Demaille <akim@epita.fr>
7663
7664 * src/lalr.c (initialize_F): Improve variable locality.
7665 Avoid variables used as mere abbreviations.
7666
80a69750
AD
76672001-12-05 Akim Demaille <akim@epita.fr>
7668
7669 * src/derives.c (print_derives): Display the ruleno.
7670 * src/lalr.c (initialize_F, transpose): Better variable locality
7671 to improve readability.
7672 Avoid variables used as mere abbreviations.
7673
fe961097
AD
76742001-12-05 Akim Demaille <akim@epita.fr>
7675
7676 * src/lalr.c (traverse): Use arrays instead of pointers.
7677
e3e4e814
AD
76782001-12-05 Akim Demaille <akim@epita.fr>
7679
7680 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
7681 the handling of squeue.
7682 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7683
630e182b
AD
76842001-12-05 Akim Demaille <akim@epita.fr>
7685
7686 Because useless nonterminals are now kept alive (instead of being
7687 `destroyed'), we now sometimes examine them, and store information
7688 related to them. Hence we need to know their number, and adjust
7689 memory allocations.
7690
7691 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
7692 static.
7693 * src/LR0.c (allocate_itemsets): The memory allocated to
7694 `symbol_count' was used for two different purpose: once to count
7695 the number of occurrences of each symbol, and later reassigned to
7696 `shift_symbol', containing the symbol that can be shifted from a
7697 given state.
7698 Deobfuscate, i.e., allocate, use and free `symbol_count' here
7699 only, and...
7700 (new_itemsets): Allocate `shift_symbol' here.
7701 (allocate_itemsets): symbol_count includes useless nonterminals.
7702 Make room for them.
7703 (free_storage): Use `free', not `XFREE', for pointers that cannot
7704 be null.
7705
81b51460
AD
77062001-12-05 Akim Demaille <akim@epita.fr>
7707
7708 * src/nullable.c (set_nullable): Deobfuscate the handling of
7709 ritem.
7710 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7711
3067fbef
AD
77122001-12-05 Akim Demaille <akim@epita.fr>
7713
7714 * src/gram.c, src/gram.h (ritem_print): New.
7715 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
7716 (This useless function was defined only to work around VMS linkers
7717 that can't handle compilation units with variables only).
7718 * src/reduce.c (dump_grammar): Use it to trace the construction of
7719 ritem.
7720
c2bea5f9
PE
77212001-12-04 Paul Eggert <eggert@twinsun.com>
7722
7d27c823
PE
7723 * src/bison.simple (union yyalloc): Change member names
7724 to be the same as the stack names.
7725 (yyparse): yyptr is now union yyalloc *, not char *.
7726 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
7727 and may generate better code on some machines.
c2bea5f9
PE
7728 (yystpcpy): Use prototype if __STDC__ is defined, not just
7729 if __cplusplus is defined.
35687a9d 7730
2c8a9dfa
AD
77312001-11-30 Akim Demaille <akim@epita.fr>
7732
7733 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
7734 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
7735 Gettext doesn't compile cleanly, and dies with -Werror.
7736 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
7737 Include WARNING_CFLAGS here.
7738 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
7739 before being defined.
7740
f4e421e6
AD
77412001-11-27 Paul Eggert <eggert@twinsun.com>
7742
7743 * lib/quotearg.h (quotearg_n, quotearg_n_style):
7744 First arg is int, not unsigned.
7745 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
7746 (SIZE_MAX, UINT_MAX): New macros.
7747 (quotearg_n_options): Abort if N is negative.
7748 Avoid overflow check on hosts where size_t is 64 bits and int
7749 is 32 bits, as overflow is impossible there.
7750 Fix off-by-one typo that caused unnecessary reallocation.
7751
7093d0f5
AD
77522001-11-29 Paul Eggert <eggert@twinsun.com>
7753
7754 Name space cleanup in generated parser.
7755
7756 * doc/bison.texinfo (Bison Parser): Discuss system headers
7757 and their effect on the user name space.
7758
7759 * src/bison.simple:
7760 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
7761 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
7762 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
7763
7764 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
7765 on user names when possible.
7766
7767 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
7768 Simplify test for whather <alloca.h> exists.
7769
7770 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
7771
7772 (<stdio.h>): Include if YYDEBUG.
7773
7774 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
7775 ! defined (yyoverflow) && ! defined (yymemcpy).
7776
7777 (yymemcpy, yyparse): Rename local variables as needed so that
7778 they all begin with 'yy'.
7779
7780 (yystrlen, yystpcpy): New functions.
7781
7782 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
7783 All uses changed.
7784
7785 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
7786 instead of relying on string.h functions. Use YYSTACK_ALLOC
7787 and YYSTACK_FREE instead of malloc and free.
7788
fd51e5ff
AD
77892001-11-30 Akim Demaille <akim@epita.fr>
7790
7791 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
7792 before their first uses.
7793 (YYBISON, YYPURE): Move to the top of the output.
7794
7d13ff5f
AD
77952001-11-30 Akim Demaille <akim@epita.fr>
7796
7797 * tests/reduce.at (Useless Nonterminals): Fix.
7798
892a3995
AD
77992001-11-30 Akim Demaille <akim@epita.fr>
7800
7801 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
7802 if body instead of `;' to pacify GCC's warnings.
7803
68f1e3ed
AD
78042001-11-30 Akim Demaille <akim@epita.fr>
7805
7806 Instead of mapping the LHS of unused rules to -1, keep the LHS
7807 valid, but flag the rules as invalid.
7808
7809 * src/gram.h (rule_t): `useful' is a new member.
7810 * src/print.c (print_grammar): Adjust.
7811 * src/derives.c (set_derives): Likewise.
7812 * src/reader.c (packgram, reduce_output): Likewise.
7813 * src/reduce.c (reduce_grammar_tables): Likewise.
7814 * tests/reduce.at (Underivable Rules, Useless Rules): New.
7815
d2d1b42b
AD
78162001-11-30 Akim Demaille <akim@epita.fr>
7817
7818 * src/reduce.c (reduce_output): Formatting changes.
7819 * src/print.c (print_results, print_grammar): Likewise.
7820 * tests/regression.at (Rule Line Numbers)
7821 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
7822
760b53a8
AD
78232001-11-30 Akim Demaille <akim@epita.fr>
7824
7825 * src/reduce.c (nonterminals_reduce): Instead of throwing away
7826 useless nonterminals, move them at the end of the symbol arrays.
7827 (reduce_output): Adjust.
7828 * tests/reduce.at (Useless Nonterminals): Adjust.
7829
00238958
AD
78302001-11-30 Akim Demaille <akim@epita.fr>
7831
7832 * src/reduce.c: Various comment/formatting changes.
7833 (nonterminals_reduce): New, extracted from...
7834 (reduce_grammar_tables): here.
7835 (reduce_grammar): Call nonterminals_reduce.
7836
396452de
PE
78372001-11-29 Paul Eggert <eggert@twinsun.com>
7838
7839 * src/bison.simple (YYSTACK_REALLOC): Remove.
7840 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
7841 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
7842 New macros.
7843 (union yyalloc): New type.
7844 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
7845 an arbitrary restriction on hosts where size_t is wider than int.
7846
7847 (yyparse): Don't dump core if alloca or malloc fails; instead, report
7848 a parser stack overflow. Allocate just one block of memory for all
7849 three stacks, instead of allocating three blocks; this typically is
7850 faster and reduces fragmentation.
7851
7852 Do not limit the number of items in the stack to a value that fits
7853 in 'int', as this is an arbitrary limit on hosts with 64-bit
7854 size_t and 32-bit int.
7855
147e184c
MA
78562001-11-29 Marc Autret <autret_m@epita.fr>
7857
7858 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
7859 of defining YYERROR_VERBOSE.
7860 [AT_DATA]: $4 is now out of C declarations in the prologue.
7861
426cf563
MA
78622001-11-28 Marc Autret <autret_m@epita.fr>
7863
7864 * src/reader.c (parse_dquoted_param): New.
7865 (parse_skel_decl): Use it.
7866 * src/lex.h: Add its prototype.
7867 * src/lex.c (literalchar): Become not static.
7868
c7925b99
MA
78692001-11-28 Marc Autret <autret_m@epita.fr>
7870
7871 * src/output.h: And put its extern declaration here.
7872 * src/output.c (error_verbose): Define here.
7873 (prepare): Echo name modification.
7874 * src/getargs.h: Clean its extern declaration.
7875 * src/getargs.c (error_verbose_flag): Remove.
7876 (getargs): Remove case 'e'.
7877 * src/options.c (option_table): 'error-verbose' is now seen as simple
7878 percent option.
7879 Include output.h.
7880
7881 * src/reader.c (read_declarations): Remove case tok_include.
7882 (parse_include_decl): Remove.
7883 * src/lex.h (token_t): Remove tok_include.
7884 * src/options.c (option_table): 'include' is now a simple command line
7885 option.
7886
5b5d1929
MA
78872001-11-28 Marc Autret <autret_m@epita.fr>
7888
7889 * src/bison.simple: Adjust muscle names.
7890 * src/muscle_tab.c (muscle_init): Also rename the muscles.
7891 * src/output.c (prepare): s/_/-/ for the muscles names.
7892 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
7893
8850be4b
MA
78942001-11-28 Marc Autret <autret_m@epita.fr>
7895
7896 * src/bison.simple: Fix debug.
7897 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
7898
4a38e613
AD
78992001-11-28 Akim Demaille <akim@epita.fr>
7900
7901 * src/LR0.c (shifts_new): New.
7902 (save_shifts, insert_start_shift, augment_automaton): Use it.
7903
4b35e1c1
AD
79042001-11-28 Akim Demaille <akim@epita.fr>
7905
7906 * src/closure.c (closure): `b' and `ruleno' denote the same value:
7907 keep ruleno only.
7908
d2b04478
AD
79092001-11-28 Akim Demaille <akim@epita.fr>
7910
7911 * src/closure.c (closure): Instead of looping over word in array
7912 then bits in words, loop over bits in array.
7913
2c4c30aa
AD
79142001-11-28 Akim Demaille <akim@epita.fr>
7915
7916 * src/closure.c (closure): No longer optimize the special case
7917 where all the bits of `ruleset[r]' are set to 0, to make the code
7918 clearer.
7919
576890b7
AD
79202001-11-28 Akim Demaille <akim@epita.fr>
7921
7922 * src/closure.c (closure): `r' and `c' are new variables, used to
7923 de-obfuscate accesses to RULESET and CORE.
7924
cb487d7d
AD
79252001-11-28 Akim Demaille <akim@epita.fr>
7926
7927 * src/reduce.c (reduce_print): Use ngettext.
7928 (dump_grammar): Improve the trace accuracy.
7929
6013d43f
AD
79302001-11-28 Akim Demaille <akim@epita.fr>
7931
7932 * src/reduce.c (dump_grammar): Don't translate trace messages.
7933
cb4956ee
AD
79342001-11-28 Akim Demaille <akim@epita.fr>
7935
7936 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
7937 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
7938 as all tags are free'ed afterwards.
7939 From Enrico Scholz.
7940
648185ab
PE
79412001-11-27 Paul Eggert <eggert@twinsun.com>
7942
7943 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
7944 use alloca when we didn't want to, and vice versa.
7945
68254a03
MA
79462001-11-27 Marc Autret <autret_m@epita.fr>
7947
9113b58f
AD
7948 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
7949 initialization.
68254a03
MA
7950 * src/output.c (prepare): Remove its update.
7951
04d843a2
MA
79522001-11-27 Marc Autret <autret_m@epita.fr>
7953
7954 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
7955 Use %error-verbose.
7956
d2079671 79572001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
7958
7959 * src/bison.simple: Remove YYERROR_VERBOSE using.
7960 Use %%error_verbose.
7961 (yyparse): Likewise.
7962 * src/output.c (prepare): Give its final value.
7963 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
7964 * src/getargs.h: Add its extern declaration.
7965 * src/getargs.c (error_verbose_flag): New int.
7966 (getargs): Update to catch new case.
7967 * src/options.c (option_table): 'error-verbose' is a new option.
7968 (shortopts): Update.
7969
e0327bc8
AD
79702001-11-27 Akim Demaille <akim@epita.fr>
7971
7972 * src/system.h: Use intl/libgettext.h.
7973 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
7974
000f1a3c
AD
79752001-11-27 Akim Demaille <akim@epita.fr>
7976
7977 * tests/torture.at (Exploding the Stack Size with Malloc):
7978 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
7979
26cfe0be
AD
79802001-11-27 Akim Demaille <akim@epita.fr>
7981
7982 * src/files.c: Include error.h.
7983 Reported by Hans Aberg.
7984
f6bd5427
MA
79852001-11-26 Marc Autret <autret_m@epita.fr>
7986
d2079671 7987 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
7988 (read_declarations): Add case tok_include.
7989 * src/getargs.h (include): Add its extern definition.
7990 * src/getargs.c (include): New const char *.
7991 (getargs): Add case '-I'.
7992 * src/options.c (option_table): Add include as command line and
7993 percent option.
7994 * src/lex.h (token_t): Add tok_include.
7995
2ca209c1
AD
79962001-11-26 Akim Demaille <akim@epita.fr>
7997
7998 * src/reader.c (readgram): Make sure rules for mid-rule actions
7999 have a lineno equal to that of their host rule.
8000 Reported by Hans Aberg.
8001 * tests/regression.at (Rule Line Numbers): New.
8002
0e41b407
AD
80032001-11-26 Akim Demaille <akim@epita.fr>
8004
8005 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
8006 size_ts.
8007
80082001-11-26 Akim Demaille <akim@epita.fr>
8009
8010 * src/complain.c, src/complain.h (error): Remove, provided by
8011 lib/error.[ch].
8012
e0c40012
AD
80132001-11-26 Akim Demaille <akim@epita.fr>
8014
8015 * src/reader.c (read_declarations): Don't abort on tok_illegal,
8016 issue an error message.
8017 * tests/regression.at (Invalid %directive): New.
8018 Reported by Hans Aberg.
8019
5e147124
AD
80202001-11-26 Akim Demaille <akim@epita.fr>
8021
8022 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
8023 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
8024
a034c8b8
AD
80252001-11-26 Akim Demaille <akim@epita.fr>
8026
8027 * src/conflicts.c (conflicts_print): Don't complain at all when
8028 there are no reduce/reduce conflicts, and as many shift/reduce
8029 conflicts as expected.
8030 * tests/regression.at (%expect right): Adjust.
8031
c64a20f3
AD
80322001-11-23 Akim Demaille <akim@epita.fr>
8033
8034 * lib/alloca.c: Update, from fileutils.
8035
5b0d29bb
AD
80362001-11-23 Akim Demaille <akim@epita.fr>
8037
8038 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
8039
722c4bfe
AD
80402001-11-23 Akim Demaille <akim@epita.fr>
8041
8042 * src/system.h: Include alloca.h.
8043 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
8044
6255b435
AD
80452001-11-23 Akim Demaille <akim@epita.fr>
8046
8047 * src/print_graph.c (print_actions): Remove `rule', unused.
8048 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
8049 pacify GCC's signed < unsigned warnings.
8050 * src/closure.c (itemsetsize): Likewise.
8051 * src/reader.c (symbol_list_new): Static.
8052
b29b2ed5
AD
80532001-11-23 Akim Demaille <akim@epita.fr>
8054
8055 Attaching lineno to buckets is stupid, since only one copy of each
8056 symbol is kept, only the line of the first occurrence is kept too.
8057
8058 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
8059 * src/reader.c (rline_allocated): Remove, unused.
8060 (symbol_list): Have a `line' member.
8061 (symbol_list_new): New.
8062 (readgram): Use it.
8063 * src/print.c (print_grammar): Output the rule line numbers.
8064 * tests/regression.at (Solved SR Conflicts)
8065 (Unresolved SR Conflicts): Adjust.
8066 Reported by Hans Aberg.
8067
a81b1d4a
MA
80682001-11-22 Marc Autret <autret_m@epita.fr>
8069
8070 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
8071
c1ecb3c1
MA
80722001-11-22 Marc Autret <autret_m@epita.fr>
8073
8074 * src/muscle_tab.c (muscle_init): Remove initialization of
8075 skeleton muscle.
8076 * src/output.c (output_master_parser): Do it here.
8077
fbe01355
AD
80782001-11-20 Akim Demaille <akim@epita.fr>
8079
8080 * po/sv.po: New.
8081 * configure.in (ALL_LINGUAS): Adjust.
8082 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
8083 longer contains strings to translate.
8084
81e895c0
AD
80852001-11-19 Akim Demaille <akim@epita.fr>
8086
8087 * src/conflicts.c (conflicts_print): Add a missing \n.
8088
6bb1878b
AD
80892001-11-19 Akim Demaille <akim@epita.fr>
8090
8091 * src/nullable.c (nullable_print): New.
8092 (set_nullable): Call it when tracing.
8093 Better locality of variables.
8094
d9ec2d07
AD
80952001-11-19 Akim Demaille <akim@epita.fr>
8096
8097 * src/print.c (print_actions): Better locality of variables.
8098
720e5c1b
AD
80992001-11-19 Akim Demaille <akim@epita.fr>
8100
8101 * src/derives.c (print_derives): Fix and enrich.
8102 * src/closure.c (print_fderives): Likewise.
8103
fb908786
AD
81042001-11-19 Akim Demaille <akim@epita.fr>
8105
8106 * src/closure.c (itemsetend): Remove, replaced with...
8107 (itemsetsize): new.
8108
125ecb56
AD
81092001-11-19 Akim Demaille <akim@epita.fr>
8110
8111 * src/LR0.c (kernel_end): Remove, replaced with...
8112 (kernel_size): new.
8113
d8cf039f
AD
81142001-11-19 Akim Demaille <akim@epita.fr>
8115
8116 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
8117 to clarify.
8118
7bec0760
AD
81192001-11-19 Akim Demaille <akim@epita.fr>
8120
8121 * src/closure.c (closure): Use arrays instead of pointers to clarify.
8122
c87d4863
AD
81232001-11-19 Akim Demaille <akim@epita.fr>
8124
8125 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
8126 trace messages.
8127 * src/LR0.c: Likewise.
8128 (allocate_itemsets): Use arrays instead of pointers to clarify.
8129
9bfe901c
AD
81302001-11-19 Akim Demaille <akim@epita.fr>
8131
8132 * src/getargs.c (statistics_flag): Replace with...
8133 (trace_flag): New.
8134 (longopts): Accept --trace instead of --statistics.
8135 * src/getargs.h, src/options.c: Adjust.
8136 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
8137 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
8138
97db7bd4
AD
81392001-11-19 Akim Demaille <akim@epita.fr>
8140
cc72668c 8141 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
8142 pointers to clarify the code.
8143 (save_reductions, save_shifts): Factor common parts of alternatives.
8144
2c5f66ed
AD
81452001-11-19 Akim Demaille <akim@epita.fr>
8146
8147 * src/LR0.c (new_state, get_state): Complete TRACE code.
8148 * src/closure.c: Include `reader.h' to get `tags', needed by the
8149 trace code.
8150 Rename the conditional DEBUG as TRACE.
8151 Output consistently TRACEs to stderr, not stdout.
8152 * src/derives.c: Likewise.
8153 * src/reduce.c: (inaccessable_symbols): Using if is better style
8154 than goto.
8155 Use `#if TRACE' instead of `#if 0' for tracing code.
8156
300f275f
AD
81572001-11-19 Akim Demaille <akim@epita.fr>
8158
8159 * src/system.h (LIST_FREE, shortcpy): New.
8160 * src/LR0.c: Use them.
8161 * src/output.c (free_itemsets, free_reductions, free_shifts):
8162 Remove, replaced by LIST_FREE.
8163
f59c437a
AD
81642001-11-19 Akim Demaille <akim@epita.fr>
8165
8166 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
8167 (REDUCTIONS_ALLOC): New.
8168 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
8169 allocation.
8170
6986fd9e
AD
81712001-11-19 Akim Demaille <akim@epita.fr>
8172
8173 * src/LR0.c (new_state): Complete trace code.
8174 * src/nullable.c (set_nullable): Don't translate traces.
8175
4bc30f78
AD
81762001-11-19 Akim Demaille <akim@epita.fr>
8177
8178 * src/print_graph.c (print_core): Better locality of variables.
8179 * src/print.c (print_core): Likewise.
8180
08a946e0
AD
81812001-11-19 Akim Demaille <akim@epita.fr>
8182
8183 * src/vcg.c: You do the output, so you are responsible of the
8184 handling of VCG syntax, in particular: use quotearg.
8185 * src/print_graph.c: Don't.
8186 (print_actions): Don't output the actions as part of the nodes,
8187 since that's the job of the edges.
8188 (print_state): Don't output by hand: fill the node description,
9bfe901c 8189 and ask for its output.
08a946e0 8190
f0473484
AD
81912001-11-19 Akim Demaille <akim@epita.fr>
8192
cc72668c
AD
8193 * src/bison.simple (yyparse): When verbosely reporting an error,
8194 no longer put additional quotes around token names.
f0473484
AD
8195 * tests/calc.at: Adjust.
8196
e41dc700
AD
81972001-11-19 Akim Demaille <akim@epita.fr>
8198
8199 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
8200 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
8201 * src/output.c: Adjust.
8202
652a871c
AD
82032001-11-19 Akim Demaille <akim@epita.fr>
8204
8205 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
8206 (rule_t): this.
8207 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
8208
b2ed6e58
AD
82092001-11-19 Akim Demaille <akim@epita.fr>
8210
8211 * src/gram.h (rule_t): New.
8212 (rule_table): New.
8213 (rrhs, rlhs): Remove, part of state_t.
8214 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
8215 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8216 * src/reader.c, src/reduce.c: Adjust.
8217
edad7067
AD
82182001-11-19 Akim Demaille <akim@epita.fr>
8219
8220 * src/reader.c (symbols_output): New, extracted from...
8221 (packsymbols): Here.
8222 (reader): Call it.
8223
3feec034
AD
82242001-11-19 Akim Demaille <akim@epita.fr>
8225
8226 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
8227 (maxrhs): this new function.
8228
ddcd5fdf
AD
82292001-11-19 Akim Demaille <akim@epita.fr>
8230
cc72668c 8231 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
8232 Adjust.
8233
bb527fc2
AD
82342001-11-19 Akim Demaille <akim@epita.fr>
8235
cc72668c 8236 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
8237 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8238 * src/lalr.c: Adjust.
8239
a845a697
AD
82402001-11-19 Akim Demaille <akim@epita.fr>
8241
8242 * src/lalr.c (initialize_LA): Only initialize LA. Let...
8243 (set_state_table): handle the `lookaheads' members.
8244
f004bf6a
AD
82452001-11-19 Akim Demaille <akim@epita.fr>
8246
cc72668c
AD
8247 * src/lalr.h (lookaheads): Removed array, whose contents is now
8248 a member of...
f004bf6a
AD
8249 (state_t): this structure.
8250 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8251 Adjust.
8252
de326cc0
AD
82532001-11-19 Akim Demaille <akim@epita.fr>
8254
cc72668c
AD
8255 * src/lalr.h (consistent): Removed array, whose contents is now
8256 a member of...
de326cc0
AD
8257 (state_t): this structure.
8258 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8259 Adjust.
8260
90b4416b
AD
82612001-11-19 Akim Demaille <akim@epita.fr>
8262
cc72668c
AD
8263 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
8264 contents are now members of...
90b4416b
AD
8265 (state_t): this structure.
8266 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8267 Adjust.
8268
9703cc49
AD
82692001-11-19 Akim Demaille <akim@epita.fr>
8270
8271 * src/lalr.h (state_t): New.
8272 (state_table): Be a state_t * instead of a core **.
8273 (accessing_symbol): Remove, part of state_t.
8274 * src/lalr.c: Adjust.
8275 (set_accessing_symbol): Merge into...
8276 (set_state_table): this.
8277 * src/print_graph.c, src/conflicts.c: Adjust.
8278
d803322e
AD
82792001-11-14 Akim Demaille <akim@epita.fr>
8280
8281 * tests/calc.at, tests/output.at, tests/regression.at,
8282 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
8283 now the tests are run in private dirs, therefore AC_CLEANUP and
8284 family can be simplified to 0-ary.
8285 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
8286 use abs. path to find config.h.
8287 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
8288 stderr, there can be way too much random noise.
8289 Instead pass -Werror to GCC and rely on the exit status.
8290 Reported by Wolfram Wagner.
8291
3d76b07d
AD
82922001-11-14 Akim Demaille <akim@epita.fr>
8293
8294 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
8295 defined only if yyoverflow is defined, to avoid `warning: unused
8296 variable `yyvs1''.
8297 Reported by The Test Suite.
8298
09b503c8
AD
82992001-11-14 Akim Demaille <akim@epita.fr>
8300
8301 * src/print.c: Include reduce.h.
8302 Reported by Hans Aberg.
8303
83042001-11-14 Akim Demaille <akim@epita.fr>
8305
8306 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
8307 Revert a previous patch: these are really const.
8308 * src/conflicts.c (conflict_report): Additional useless pair of
8309 braces to pacify GCC's warnings for `if () if () {} else {}'.
8310 * src/lex.c (parse_percent_token): Replace equal_offset with
8311 arg_offset.
8312 arg is const.
8313 Be sure to strdup `arg' when used, since there is no reason for
8314 token_buffer not to change.
8315
0f37a994
AD
83162001-11-14 Akim Demaille <akim@epita.fr>
8317
8318 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
8319 definition.
8320 * src/main.c (main): Use them.
8321 Suggested by Hans Aberg.
8322
d39d93b8
AD
83232001-11-12 Akim Demaille <akim@epita.fr>
8324
8325 * src/system.h (ngettext): Now that we use ngettext, be sure to
8326 provide a default definition when NLS are not used.
8327
9edcd895
AD
83282001-11-12 Akim Demaille <akim@epita.fr>
8329
8330 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
8331 Use @kbd to denote user input.
8332 (Language and Grammar): ANSIfy the example.
8333 Adjust its layout for info/notinfo.
8334 (Location Tracking Calc): Output error messages to stderr.
8335 Output locations in a more GNUtically correct way.
8336 Fix a couple of Englishos.
8337 Adjust @group/@end group pairs.
8338
7da99ede
AD
83392001-11-12 Akim Demaille <akim@epita.fr>
8340
e3aa65c5 8341 %expect was not functioning at all.
7da99ede
AD
8342
8343 * src/conflicts.c (expected_conflicts): Set to -1.
8344 (conflict_report): Use ngettext.
8345 (conflicts_print): Check %expect and make its violation an error.
8346 * doc/bison.texinfo (Expect Decl): Adjust.
8347 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
8348 * tests/regression.at (%expect not enough, %expect right)
8349 (%expect too much): New.
8350
ba9dda1a
AD
83512001-11-12 Akim Demaille <akim@epita.fr>
8352
8353 * tests/regression.at (Conflicts): Rename as...
8354 (Unresolved SR Conflicts): this.
8355 (Solved SR Conflicts): New.
8356
337c5bd1
AD
83572001-11-12 Akim Demaille <akim@epita.fr>
8358
8359 * src/reduce.c (print_results): Rename as...
8360 (reduce_output): This.
8361 Output to OUT, passed as argument, instead of output_obstack.
8362 (dump_grammar): Likewise.
8363 (reduce_free): New.
8364 Also free V1.
8365 (reduce_grammar): No longer call reduce_output, since...
8366 * src/print.c (print_results): do it.
8367 * src/main.c (main): Call reduce_free;
8368
c73a41af
AD
83692001-11-12 Akim Demaille <akim@epita.fr>
8370
8371 * src/conflicts.c (print_reductions): Accept OUT as argument.
8372 Output to it, not to output_obstack.
8373 * src/print.c (print_actions): Adjust.
8374
0df87bb6
AD
83752001-11-12 Akim Demaille <akim@epita.fr>
8376
8377 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
8378 the result instead of using...
8379 (src_total, rrc_total, src_count, rrc_count): Remove.
8380 (any_conflicts): Remove.
8381 (print_conflicts): Split into...
8382 (conflicts_print, conflicts_output): New.
8383 * src/conflicts.h: Adjust.
8384 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 8385 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
8386 * tests/regression.at (Conflicts): New.
8387 Reported by Tom Lane.
8388
e4d3d4de
AD
83892001-11-12 Akim Demaille <akim@epita.fr>
8390
8391 * tests/regression.at (Invalid input): Remove, duplicate with
8392 ``Invalid input: 1''.
8393
6d7d248e
AD
83942001-11-12 Akim Demaille <akim@epita.fr>
8395
8396 * tests/torture.at (AT_DATA_STACK_TORTURE)
8397 (Exploding the Stack Size with Alloca)
8398 (Exploding the Stack Size with Malloc): New.
8399
e9e4c321
AD
84002001-11-12 Akim Demaille <akim@epita.fr>
8401
8402 * src/bison.simple (YYSTACK_REALLOC): New.
8403 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 8404 Reported by Per Allansson.
e9e4c321 8405
5f7e0832
AD
84062001-11-12 Pascal Bart <pascal.bart@epita.fr>
8407
8408 * src/bison.simple: Define type yystype instead of YYSTYPE, and
8409 define CPP macro, which substitute YYSTYPE by yystype.
8410 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
8411 with yyltype/YYLTYPE. This allows inclusion of the generated
8412 header within the parser if the compiler, such as GGC, accepts
8413 multiple equivalent #defines.
8414 From Akim.
8415
e3f1699f
AD
84162001-11-05 Akim Demaille <akim@epita.fr>
8417
8418 * src/reader.c (symbols_output): New, extracted from...
8419 (packsymbols): here.
8420 (reader): Adjust.
8421
65be0866
AD
84222001-11-05 Akim Demaille <akim@epita.fr>
8423
8424 * src/lex.c (parse_percent_token): s/quotearg/quote/.
8425
e4d910bf
AD
84262001-11-05 Akim Demaille <akim@epita.fr>
8427
8428 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
8429 pattern.
8430
951366c1
AD
84312001-11-05 Akim Demaille <akim@epita.fr>
8432
8433 * src/options.h (struct option_table_struct): set_flags is void*.
8434 * src/options.c (longopts): Support `--output' and `%output'.
8435 (usage): Adjust.
8436 * src/lex.h (tok_setopt): Remove, replaced with...
8437 (tok_intopt, tok_stropt): these new guys.
8438 * src/lex.c (getopt.h): Not needed.
8439 (token_buffer, unlexed_token_buffer): Not const.
8440 (percent_table): Promote `-' over `_' in directive names.
8441 Active `%name-prefix', `file-prefix', and `output'.
8442 (parse_percent_token): Accept possible arguments to directives.
8443 Promote `-' over `_' in directive names.
8444
d8988b2f
AD
84452001-11-04 Akim Demaille <akim@epita.fr>
8446
8447 * doc/bison.texinfo (Decl Summary): Split the list into
8448 `directives for grammars' and `directives for bison'.
8449 Sort'em.
8450 Add description of `%name-prefix', `file-prefix', and `output'.
8451 Promote `-' over `_' in directive names.
8452 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
8453 Simplify the description of `--name-prefix'.
8454 Promote `-' over `_' in directive names.
8455 Promote `--output' over `--output-file'.
8456 Fix the description of `--defines'.
8457 * tests/output.at: Exercise %file-prefix and %output.
8458
6468d18e
AD
84592001-11-02 Akim Demaille <akim@epita.fr>
8460
8461 * doc/refcard.tex: Update.
8462
6b7e85b9
AD
84632001-11-02 Akim Demaille <akim@epita.fr>
8464
8465 * src/symtab.h (SUNDEF): New.
8466 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
8467 stand for `uninitialized', instead of 0.
8468 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
8469 * src/lex.c (lex): Adjust.
8470
8471 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
8472 Number it 0.
8473 Let yylex return it instead of a plain 0.
8474 Reported by Dick Streefland.
8475
cd5aafcf
AD
84762001-11-02 Akim Demaille <akim@epita.fr>
8477
8478 * tests/regression.at (Mixing %token styles): New test.
8479
037ca2f1
AD
84802001-11-02 Akim Demaille <akim@epita.fr>
8481
8482 * src/reader.c (parse_thong_decl): Formatting changes.
8483 (token_translations_init): New, extracted from...
8484 (packsymbols): Here.
8485 Adjust.
8486
270a173c
AD
84872001-11-01 Akim Demaille <akim@epita.fr>
8488
8489 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
8490 Check that `9foo.y' produces correct cpp guards.
8491 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
8492 guards.
8493 Reported by Wwp.
8494
561f9a30
AD
84952001-11-01 Akim Demaille <akim@epita.fr>
8496
8497 * tests/regression.at (Invalid input: 2): New.
8498 * src/lex.c (unlexed_token_buffer): New.
8499 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
8500 too.
8501 Reported by Wwp.
8502
f987e9d2
AD
85032001-11-01 Akim Demaille <akim@epita.fr>
8504
8505 * tests/calc.at: Catch up with 1.30.
8506 * configure.in: Bump to 1.49a.
8507 Adjust to newer Autotest.
8508
0846f581
PB
85092001-10-19 Pascal Bart <pascal.bart@epita.fr>
8510
8511 * src/conflicts.c: Move global variables rrc_total and src_total ...
8512 (print_conflicts): here.
8513 * src/output.c (output): Free global variable user_toknums.
8514 * src/lex.c (token_obstack): Become static.
8515
3c1a79b3
AD
85162001-10-18 Akim Demaille <akim@epita.fr>
8517
8518 * tests/atlocal.in (GCC): Add.
8519 * tests/calc.at: s/m4_match/m4_bmatch/.
8520 s/m4_patsubst/m4_bpatsubst/.
8521 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
8522 * configure.in: AC_SUBST(GCC).
8523
5d52e7d0
MA
85242001-10-14 Marc Autret <autret_m@epita.fr>
8525
8526 * src/options.c (create_long_option_table): Fix.
8527
631aa1d3
AD
85282001-10-10 Akim Demaille <akim@epita.fr>
8529
8530 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
8531
f6ec6d13
AD
85322001-10-04 Akim Demaille <akim@epita.fr>
8533
8534 * src/reader.c (parse_union_decl): Push the caracters in
8535 union_obstack, not attrs_obstack.
8536
342b8b6e
AD
85372001-10-04 Akim Demaille <akim@epita.fr>
8538
8539 Merge in the branch 1.29.
8540
8541 * src/reader.c (packsymbols): Use a temporary obstack for
8542 `%%tokendef', since output_stack is already used elsewhere.
8543
8544 2001-10-02 Akim Demaille <akim@epita.fr>
8545
8546 Bump 1.29d.
8547
8548 2001-10-02 Akim Demaille <akim@epita.fr>
8549
8550 Version 1.29c.
8551
8552 2001-10-02 Akim Demaille <akim@epita.fr>
8553
8554 * tests/regression.at (Invalid CPP headers): New.
8555 From Alexander Belopolsky.
8556 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
8557
8558 2001-10-02 Akim Demaille <akim@epita.fr>
8559
8560 * tests/regression.at (Invalid input): New.
8561 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
8562 Reported by Shura.
8563
8564 2001-10-02 Akim Demaille <akim@epita.fr>
8565
8566 * tests/calc.at: Now that --debug works, the tests must be adjusted.
8567
8568 2001-10-02 Akim Demaille <akim@epita.fr>
8569
8570 * src/output.c (output_parser): Assert `skeleton'.
8571 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
8572 systems.
8573 From Shura.
8574
8575 2001-10-01 Marc Autret <autret_m@epita.fr>
8576
8577 * src/lex.h: Echo modifications.
8578 * src/lex.c (unlex): Parameter is now token_t.
8579 From Hans Aberg.
8580
8581 2001-10-01 Marc Autret <autret_m@epita.fr>
8582
8583 * src/main.c: Include lex.h.
8584 From Hans Aberg.
8585
8586 2001-09-29 Akim Demaille <akim@epita.fr>
8587
8588 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
8589
8590 2001-09-28 Akim Demaille <akim@epita.fr>
8591
8592 * tests/testsuite.at: Update to newer Autotest.
8593 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
8594
8595 2001-09-27 Akim Demaille <akim@epita.fr>
8596
8597 Position independent wrapper.
8598
8599 * tests/bison: Remove.
8600 * tests/bison.in: New.
8601 * configure.in: Adjust.
8602
8603 2001-09-27 Paul Eggert <eggert@twinsun.com>
8604
8605 Port quotearg fixes from tar 1.13.24.
8606
8607 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8608 tm to be declared.
8609 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8610 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8611
8612 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
8613 * m4/mbrtowc.m4: New file.
8614 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
8615 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
8616
8617 2001-09-27 Akim Demaille <akim@epita.fr>
8618
8619 Bump to 1.29c.
8620
8621 2001-09-27 Akim Demaille <akim@epita.fr>
8622
8623 Version 1.29b.
8624
8625 2001-09-25 Akim Demaille <akim@epita.fr>
8626
8627 * src/system.h: Include `xalloc.h'.
8628 Remove it from the C files.
8629 * src/files.c (output_files): Free the obstacks.
8630 * src/lex.c (init_lex): Rename as...
8631 (lex_init): this.
8632 (lex_free): New.
8633 * src/main.c (main): Use it.
8634
8635 2001-09-24 Marc Autret <autret_m@epita.fr>
8636
8637 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
8638 to output informations in fout (FILE*).
8639 (open_graph, close_graph): Likewise.
8640 (output_graph, output_edge, output_node): Likewise.
8641 * src/vcg.h: Update function prototypes.
8642 * src/print_graph.c (print_graph): Open output graph file.
8643 (print_actions): Adjust.
8644 * src/files.h: Remove extern declaration.
8645 * src/files.c: Remove graph_obstack declaration.
8646 (open_files): Remove graph_obstack initialization.
8647 (output_files): Remove graph_obstack saving.
8648
8649 2001-09-24 Marc Autret <autret_m@epita.fr>
8650
8651 * src/files.c (compute_output_file_names): Fix.
8652
8653 2001-09-24 Marc Autret <autret_m@epita.fr>,
8654 Akim Demaille <akim@epita.fr>
8655
8656 * src/reader.c (reader): Remove call to free_symtab ().
8657 * src/main.c (main): Call it here.
8658 Include symtab.h.
8659 * src/conflicts.c (initialize_conflicts): Rename as...
8660 (solve_conflicts): this.
8661 * src/print.c (print_core, print_actions, print_state)
8662 (print_grammar): Dump to a file instead a `output_obstack'.
8663 (print_results): Dump `output_obstack', and then proceed with the
8664 FILE *.
8665 * src/files.c (compute_output_file_names, close_files): New.
8666 (output_files): Adjust.
8667 * src/main.c (main): Adjust.
8668
8669 2001-09-23 Marc Autret <autret_m@epita.fr>
8670
8671 * src/files.c (compute_header_macro): Computes header macro name
8672 from spec_defines_file when given.
8673
8674 2001-09-23 Marc Autret <autret_m@epita.fr>
8675
8676 * src/files.c (output_files): Add default extensions.
8677
8678 2001-09-22 Akim Demaille <akim@epita.fr>
8679
8680 * src/conflicts.c (finalize_conflicts): Rename as...
8681 (free_conflicts): this.
8682
8683 2001-09-22 Akim Demaille <akim@epita.fr>
8684
8685 * src/gram.c (gram_free): Rename back as...
8686 (dummy): this.
8687 (output_token_translations): Free `token_translations'.
8688 * src/symtab.c (free_symtab): Free the tag field.
8689
8690 2001-09-22 Akim Demaille <akim@epita.fr>
8691
8692 Remove `translations' as it is always set to true.
8693
8694 * src/gram.h: Adjust.
8695 * src/reader.c (packsymbols, parse_token_decl): Adjust
8696 * src/print.c (print_grammar): Adjust.
8697 * src/output.c (output_token_translations): Adjust.
8698 * src/lex.c (lex): Adjust.
8699 * src/gram.c: Be sure the set pointers to NULL.
8700 (dummy): Rename as...
8701 (gram_free): this.
8702
8703 2001-09-22 Akim Demaille <akim@epita.fr>
8704
8705 * configure.in: Invoke AM_LIB_DMALLOC.
8706 * src/system.h: Use dmalloc.
8707 * src/LR0.c: Be sure to have pointers initialized to NULL.
8708 (allocate_itemsets): Allocate kernel_items only if needed.
8709
8710 2001-09-22 Akim Demaille <akim@epita.fr>
8711
8712 * configure.in: Bump to 1.29b.
8713 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
8714 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
8715 need xmalloc.c in calc.y.
8716 From Pascal Bart.
8717
8718 2001-09-21 Akim Demaille <akim@epita.fr>
8719
8720 Version 1.29a.
8721 * Makefile.maint, config/config.guess, config/config.sub,
8722 * config/missing: Update from masters.
8723 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
8724 upon package.m4.
8725 * configure.in (ALL_LINGUAS): Add `tr'.
8726
8727 2001-09-21 Akim Demaille <akim@epita.fr>
8728
8729 * tests/Makefile.am (package.m4): Move to...
8730 ($(srcdir)/$(TESTSUITE)): here.
8731
8732 2001-09-20 Akim Demaille <akim@epita.fr>
8733
8734 * src/complain.c: No longer try to be standalone: use system.h.
8735 Don't assume __STDC__ is defined to 1. Just test if it is defined.
8736 * src/complain.h: Likewise.
8737 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
8738 Remove the unused variable `n'.
8739 From Albert Chin-A-Young.
8740
8741 2001-09-18 Marc Autret <autret_m@epita.fr>
8742
8743 * doc/bison.1: Update.
8744 * doc/bison.texinfo (Bison Options): Update --defines and --graph
8745 descriptions.
8746 (Option Cross Key): Update.
8747 Add --graph.
8748
8749 2001-09-18 Marc Autret <autret_m@epita.fr>
8750
8751 * tests/regression.at: New test (comment in %union).
8752
8753 2001-09-18 Marc Autret <autret_m@epita.fr>
8754
8755 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
8756 do that.
8757 Reported by Keith Browne.
8758
8759 2001-09-18 Marc Autret <autret_m@epita.fr>
8760
8761 * tests/output.at: Add tests for --defines and --graph.
8762
8763 2001-09-18 Marc Autret <autret_m@epita.fr>
8764
8765 * tests/output.at: Removes tests of %{header,src}_extension features.
8766
8767 2001-09-18 Akim Demaille <akim@epita.fr>
8768
8769 * tests/Makefile.am (package.m4): New.
8770 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
8771 (_AT_CHECK_CALC_ERROR): Likewise.
8772 Factor the `, ' part of verbose error messages.
8773
8774 2001-09-18 Marc Autret <autret_m@epita.fr>
8775
8776 * src/getargs.c (longopts): Declare --defines and --graph as options
8777 with optional arguments.
8778 * src/files.h: Add extern declarations.
8779 * src/files.c (spec_graph_file, spec_defines_file): New.
8780 (output_files): Update.
8781 Remove CPP-outed code.
8782
8783 2001-09-18 Marc Autret <autret_m@epita.fr>
8784
8785 Turn off %{source,header}_extension feature.
8786
8787 * src/files.c (compute_exts_from_gf): Update.
8788 (compute_exts_from_src): Update.
8789 (output_files): CPP-out useless code.
8790 * src/files.h: Remove {header,source}_extension extern declarations.
8791 * src/reader.c (parse_dquoted_param): CPP-out.
8792 (parse_header_extension_decl): Remove.
8793 (parse_source_extension_decl): Remove.
8794 (read_declarations): Remove cases tok_{hdrext,srcext}.
8795 * src/lex.c (percent_table): Remove {header,source}_extension entries.
8796 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
8797
8798 2001-09-10 Akim Demaille <akim@epita.fr>
8799
8800 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
8801 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
8802 (AT_CHECK_OUTPUT): this.
8803 Merely check ls' exit status, its output is useless.
8804
8805 2001-09-10 Akim Demaille <akim@epita.fr>
8806
8807 * tests/calc.at: Use m4_match.
8808 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
8809
8810 2001-09-10 Marc Autret <autret_m@epita.fr>,
8811 Akim Demaille <akim@epita.fr>
8812
8813 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
8814 enum color_e.
8815 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
8816 to `normal'.
8817 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
8818 * src/lex.h: Adjust prototype.
8819 (token_t): Add `tok_undef'.
8820 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
8821 (parse_percent_token): Now returns token_t.
8822 Add default statement in switch.
8823 (lex): Separate `c' as an input variable, from the token_t result
8824 part.
8825 (unlexed): Is a token_t.
8826
8827 2001-09-10 Akim Demaille <akim@epita.fr>
8828
8829 * configure.in: Bump to 1.29a.
8830
8831 2001-09-07 Akim Demaille <akim@epita.fr>
8832
8833 Version 1.29.
8834
8835 2001-08-30 Akim Demaille <akim@epita.fr>
8836
8837 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
8838 * m4/atconfig.m4: Remove.
8839 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
8840 * tests/bison: New.
8841 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
8842 m4_if, m4_patsubst, and m4_regexp.
8843 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
8844 `input' file instead of echo.
8845
8846 2001-08-29 Akim Demaille <akim@epita.fr>
8847
8848 Bump to 1.28e.
8849
8850 2001-08-29 Akim Demaille <akim@epita.fr>
8851
8852 Version 1.28d.
8853
8854 2001-08-29 Paul Eggert <eggert@twinsun.com>
8855
8856 * src/bison.simple (yyparse): Don't take the address of an
8857 item before the start of an array, as that doesn't conform to
8858 the C Standard.
8859
8860 2001-08-29 Robert Anisko <anisko_r@epita.fr>
8861
8862 * doc/bison.texinfo (Location Tracking Calc): New node.
8863
8864 2001-08-29 Paul Eggert <eggert@twinsun.com>
8865
8866 * src/output.c (output): Do not define const, as this now
8867 causes more problems than it cures.
8868
8869 2001-08-29 Akim Demaille <akim@epita.fr>
8870
8871 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
8872 the nodes.
8873 Be sure to tag the `detailmenu'.
8874
8875 2001-08-29 Akim Demaille <akim@epita.fr>
8876
8877 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
8878 download in a tmp dir.
8879
8880 2001-08-28 Marc Autret <autret_m@epita.fr>
8881
8882 * config/depcomp: New file.
8883
8884 2001-08-28 Marc Autret <autret_m@epita.fr>
8885
8886 * doc/bison.1 (mandoc): Adjust.
8887 From Juan Manuel Guerrero.
8888
8889 2001-08-28 Marc Autret <autret_m@epita.fr>
8890
8891 * src/print_graph.c (print_state): Fix.
8892
8893 2001-08-27 Marc Autret <autret_m@epita.fr>
8894
8895 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
8896 char * members.
8897 Echo modifications to the functions prototypes.
8898 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
8899
8900 2001-08-27 Marc Autret <autret_m@epita.fr>
8901
8902 * src/vcg.c: Include `xalloc.h'.
8903 (add_colorentry): New.
8904 (add_classname): New.
8905 (add_infoname): New.
8906 * src/vcg.h: Add new prototypes.
8907
8908 2001-08-27 Akim Demaille <akim@epita.fr>
8909
8910 * Makefile.maint: Sync. again with CVS Autoconf.
8911
8912 2001-08-27 Akim Demaille <akim@epita.fr>
8913
8914 * Makefile.maint: Formatting changes.
8915 (po-update, cvs-update, update): New targets.
8916 (AMTAR): Remove.
8917
8918 2001-08-27 Akim Demaille <akim@epita.fr>
8919
8920 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8921 * Makefile.maint: Sync. with CVS Autoconf.
8922
8923 2001-08-27 Marc Autret <autret_m@epita.fr>
8924
8925 * src/vcg.h (struct infoname_s): New.
8926 (struct colorentry_s): New.
8927 (graph_s): New fields {vertical,horizontal}_order in structure.
8928 Add `infoname' field.
8929 Add `colorentry' field;
8930 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
8931 (G_HORIZONTAL_ORDER): New.
8932 (G_INFONAME): New.
8933 (G_COLORENTRY): New.
8934 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
8935 Add output of `infoname'.
8936 Add output of `colorentry'.
8937
8938 2001-08-27 Marc Autret <autret_m@epita.fr>
8939
8940 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
8941 This one shadowed a global parameter.
8942
8943 2001-08-24 Marc Autret <autret_m@epita.fr>
8944
8945 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
8946 instead of `unsigned'.
8947 (print_state): Do not call obstack_object_size () in obstack_grow ()
8948 to avoid macro variables shadowing.
8949
8950 2001-08-23 Marc Autret <autret_m@epita.fr>
8951
8952 * src/lex.c (percent_table): Typo: s/naem/name/.
8953 Add graph option.
8954 Normalize new options declarations.
8955
8956 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
8957
8958 * tests/suite.at: Exercise %header_extension and %source_extension.
8959
8960 2001-08-16 Marc Autret <autret_m@epita.fr>
8961
8962 * src/reader.c (parse_dquoted_param): New.
8963 (parse_header_extension_decl): Use it.
8964 (parse_source_extension_decl): Likewise.
8965
8966 2001-08-16 Marc Autret <autret_m@epita.fr>
8967
8968 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
8969 (get_xxxx_str): Use assert () instead of complain ().
8970 Remove return invokations in default cases.
8971 (get_decision_str): Modify default behaviour. Remove second argument.
8972 Echo modifications on calls.
8973 (output_graph): Fix.
8974
8975 2001-08-16 Marc Autret <autret_m@epita.fr>
8976
8977 * src/getargs.c (usage): Update with ``-g, --graph''.
8978
8979 2001-08-16 Marc Autret <autret_m@epita.fr>
8980
8981 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
8982 (Option Cross Key): Likewise.
8983 * doc/bison.1: Update.
8984
1c8c2190
PB
89852001-09-25 Pascal Bart <pascal.bart@epita.fr>
8986
8987 * src/output.c (output_master_parser): Don't finish action_obstack.
8988 (output_parser): Don't care about the muscle action, here.
8989 (prepare): Copy the action_obstack in the action muscle.
8990 (output): Free action_obstack.
8991
180d45ba
PB
89922001-09-23 Pascal Bart <pascal.bart@epita.fr>
8993
8994 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
8995 will contain `%union' declaration.
8996 (parse_union_decl): Delete #line directive output.
8997 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
8998 informations about %union.
8999 (parse_union_decl): Copy the union_obstack in the muscle stype.
9000 * src/bison.simple: Add new #line directive.
9001 Add typdef %%stype YYSTYPE.
9002
c51d1a19
PB
90032001-09-23 Pascal Bart <pascal.bart@epita.fr>
9004
9005 * src/bison.simple: Add new `#line' directive.
9006
6f9344da
PB
90072001-09-22 Pascal Bart <pascal.bart@epita.fr>
9008
9009 * src/bison.simple: New `#line' directive.
9010 * src/output.c (output_parser): Support new dynamic muscle input_line.
9011
652def80
MA
90122001-09-22 Marc Autret <autret_m@epita.fr>
9013
9014 * src/output.c (output_master_parser): New.
9015 (output_parser): Be more re-entrant.
9016
25b222fa
MA
90172001-09-21 Marc Autret <autret_m@epita.fr>
9018
9019 * src/reader.c (copy_definition, parse_union_decl): Update and use
9020 `linef' muscle.
9021 (copy_action): Likewise.
9022 Use obstack_1grow ().
9023 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
9024
6bc35ae5
MA
90252001-09-21 Marc Autret <autret_m@epita.fr>
9026
9027 * src/options.c (option_table): Adjust.
9028 * src/lex.c (parse_percent_token): Fix.
9029
c0629aa1
PB
90302001-09-20 Pascal Bart <pascal.bart@epita.fr>
9031
9032 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 9033
82b6d266
PB
90342001-09-20 Pascal Bart <pascal.bart@epita.fr>
9035
9036 * src/lex.c (parse_percent_token): Change type of variable `tx', which
9037 is now an option_table_struct*.
9038 (option_strcmp): New function option_strcmp.
9039 (parse_percent_token): Call option_strcmp.
9040 * src/getargs.c (xalloc.h, options.h): Include it.
9041 (getargs): Call create_long_option_table.
9042 (getargs): Free longopts at the end of the function.
9043 (shortopts): Move in options.c.
9044 * src/options.c (create_long_option_table): New function. Convert
9045 information from option_table to option structure.
9046 * src/reader.c (options.h): Include it.
9047
9048 * src/Makefile.am: Adjust.
9049 * src/options.c (option_table): Create from longopts and percent_table.
9050 * src/getargs.c (longopts): Delete.
9051 * src/lex.c (struct percent_table_struct): Delete.
9052 (percent_table): Delete.
9053 (options.h): Include it.
9054 * src/options.c: Create.
9055 * src/options.h: Create.
9056 Declare enum opt_access_e.
9057 Define struct option_table_struct.
9058
75f5aaea
MA
90592001-09-20 Marc Autret <autret_m@epita.fr>
9060
9061 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
9062 sections of Bison.
9063
f508cb0a
PB
90642001-09-19 Pascal Bart <pascal.bart@epita.fr>
9065
9066 * src/bison.simple: s/%%filename/%%skeleton.
9067 * src/muscle_tab.c (getargs.h): Include it.
9068 (muscle_init): Insert new muscle skeleton.
9069
13105fc1
PB
90702001-09-18 Pascal Bart <pascal.bart@epita.fr>
9071
9072 * src/output.c (output_parser): Delete unused variable actions_dumped.
9073
b0c4483e
PB
90742001-09-07 Pascal Bart <pascal.bart@epita.fr>
9075
9076 * src/output.c (output): Delete call to reader_output_yylsp.
9077 * src/reader.c (reader): Likewise.
9078 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 9079
11d82f03
MA
90802001-09-02 Marc Autret <autret_m@epita.fr>
9081
9082 * src/reader.c: Include muscle_tab.h.
9083 (parse_union_decl): Update.
9084 (parse_macro_decl): Rename parse_muscle_decl.
9085 Update to use renamed functions and variable.
9086 (read_declarations, copy_action, read_additionnal_code, : Updated
9087 with correct variables and functions names.
9088 (packsymbols, reader): Likewise.
342b8b6e 9089
11d82f03 9090 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 9091
11d82f03
MA
9092 * src/output.c: Include muscle_tab.h
9093 In all functions using macro_insert, change by using muscle_insert ().
9094 (macro_obstack): Rename muscle_obstack.
9095 Echo modifications in the whole file.
9096 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
9097 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
9098 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
9099
9100 * src/muscle_tab.h: Update double inclusion macros.
9101 (macro_entry_s): Rename muscle_entry_s.
9102 Update prototypes.
342b8b6e 9103
11d82f03
MA
9104 * src/muscle_tab.c: Include muscle_tab.h.
9105 Rename macro_tabble to muscle_table.
9106 (mhash1, mhash2, mcmp): Use muscle_entry.
9107 (macro_init): Rename muscle_init. Update.
9108 (macro_insert): Rename muscle_insert. Update.
9109 (macro_find): Rename muscle_find. Update.
9110
9111 * src/main.c: Include muscle_tab.h.
9112 (main): Call muscle_init ().
9113 * src/Makefile.am (bison_SOURCES): Echo modifications.
9114
93a37297
MA
91152001-09-02 Marc Autret <autret_m@epita.fr>
9116
f753cd62 9117 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 9118
f753cd62
MA
9119 * src/muscle_tab.c, src/muscle_tab.h: Add files.
9120
91212001-09-02 Marc Autret <autret_m@epita.fr>
9122
9123 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 9124
682d48cd
PB
91252001-09-01 Pascal Bart <pascal.bart@epita.fr>
9126
342b8b6e 9127 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
9128 filename.
9129
087c8fda
MA
91302001-09-01 Marc Autret <autret_m@epita.fr>
9131
9132 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
9133 to an explicit value to activate the feature. We do it here.
9134
dda680cb
PB
91352001-08-31 Pascal Bart <pascal.bart@epita.fr>
9136
9137 * src/output.c (prepare): Delete the `filename' muscule insertion.
9138 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
9139 (parse_union_decl): Likewise.
9140 * src/macrotab.c (macro_init): Initialize filename by infile.
9141
9e644e64
MA
91422001-08-31 Marc Autret <autret_m@epita.fr>
9143
9144 * src/bison.simple (YYLSP_NEEDED): New definition.
9145 * src/output.c (prepare): Add macro insertion of `locations_flag'
9146
17da6427
PB
91472001-08-31 Pascal Bart <pascal.bart@epita.fr>
9148
9149 * src/output.c (prepare): Delete insertion of previous muscles,
9150 and insert the `prefix' muscles.
9151 * src/macrotab.c (macro_init): Likewise.
9152 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 9153 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
9154 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
9155 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 9156 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
9157 name_prefix.
9158
e8cb70b9
PB
91592001-08-31 Pascal Bart <pascal.bart@epita.fr>
9160
9161 * src/main.c (main): Standardize.
9162 * src/output.c (output_table_data, output_parser): Likewise.
9163 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
9164
63c2d5de
MA
91652001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
9166
342b8b6e 9167 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
9168 %%epilogue.
9169 * src/output.c (output): Rename %%declarations to %%prologue.
9170 * src/bison.simple: Echo modifications.
342b8b6e 9171
d8cb5183
MA
91722001-08-31 Marc Autret <autret_m@epita.fr>
9173
9174 * src/reader.c (readgram): CleanUp.
9175 (output_token_defines): Likewise.
9176 (packsymbols): Likewise.
9177 (reader): Likewise.
9178 * src/output.c (output): CPP-out useless code.
9179
6c686258
PB
91802001-08-31 Pascal Bart <pascal.bart@epita.fr>
9181
342b8b6e 9182 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
9183 output_trailers and output_headers.
9184 * src/output.h: Remove obsolete functions prototypes of output_headers
9185 and output_trailers.
9186
8f451ef7
PB
91872001-08-30 Pascal Bart <pascal.bart@epita.fr>
9188
9189 * src/main.c: Include macrotab.h.
342b8b6e 9190 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
9191 Adjust functions prototypes.
9192 * src/macrotab.c (macro_insert): Constify key and value.
9193 (macro_find): Constify key.
9194 (macro_insert): Include 'xalloc.h'
9195 (macro_insert): Use XMALLOC.
9196 (macro_find): Constify return value.
9197 * src/output.c (output_table_data): Rename table to table_data.
9198 (output_parser): Constify macro_key, macro_value.
9199
997b6fd0 92002001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
9201
9202 * src/reader.c (parse_skel_decl): New.
342b8b6e 9203 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
9204 * src/lex.h (token_t): New token `tok_skel'.
9205 * src/lex.c (percent_table): Add skeleton option entry.
9206 Standardize.
9207
ff48177d
MA
92082001-08-29 Marc Autret <autret_m@epita.fr>
9209
9210 * src/bison.simple: Add %%user_code directive at the end.
9211 * src/reader.c (read_additionnal_code): New.
9212 (reader): Use it.
9213 * src/output.c (output_program): Remove.
9214 (output): Update.
9215
b33160bf
MA
92162001-08-28 Marc Autret <autret_m@epita.fr>
9217
9218 * src/output.c (output_actions): Clean up.
4e5caae2 9219 (output_gram): CPP-out useless code.
b33160bf
MA
9220 * src/reader.c (reader): Clean up, CPP-out useless code.
9221
d1a2daf7
PB
92222001-08-28 Pascal Bart <pascal.bart@epita.fr>
9223
342b8b6e 9224 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 9225 directive.
d1a2daf7
PB
9226 * src/bison.simple: Add `%%definitions'.
9227
2b763dfe
MA
92282001-08-28 Marc Autret <autret_m@epita.fr>
9229
9230 * config/depcomp: New file.
9231
f1a87ef6
PE
92322001-08-27 Paul Eggert <eggert@twinsun.com>
9233
9234 * src/bison.simple (yyparse): Don't take the address of an
9235 item before the start of an array, as that doesn't conform to
9236 the C Standard.
9237
82e236e2
RA
92382001-08-27 Robert Anisko <robert.anisko@epita.fr>
9239
f1a87ef6 9240 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
9241 obstack. It was done too late here.
9242
9243 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
9244 completely wrong.
9245 (reader): Initialize the macro obstack here, since we need it to grow
9246 '%define' directives.
9247
9248 * src/reader.h: Declare the macro obstack as extern.
9249
b0cfa28a
RA
92502001-08-27 Robert Anisko <robert.anisko@epita.fr>
9251
9252 * src/output.c (output_parser): Fix. Store single '%' characters in
9253 the output obstack instead of throwing them away.
9254
6fc74234
AD
92552001-08-27 Akim Demaille <akim@epita.fr>
9256
9257 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9258
9c76d118
RA
92592001-08-25 Robert Anisko <robert.anisko@epita.fr>
9260
9261 * lib/Makefile.am: Adjust.
9262
a8289c62
RA
92632001-08-25 Robert Anisko <robert.anisko@epita.fr>
9264
9265 * src/bison.simple: Update and add '%%' directives.
9266
b6610515
RA
92672001-08-25 Robert Anisko <robert.anisko@epita.fr>
9268
9269 * src/reader.c (reader): Remove calls to 'output_headers' and
9270 'output_trailers'. Remove some C output.
9271 (readgram): Disable a piece of code that was writing a default
9272 definition for 'YYSTYPE'.
9273 (reader_output_yylsp): Remove.
9274 (packsymbols): Output token defintions to a macro.
9275 (copy_definition): Disable C output.
6fc74234 9276
b6610515
RA
9277 * src/reader.c (parse_macro_decl): New function used to parse macro
9278 declarations.
9279 (copy_string2): Put the body of copy_string into this new function.
9280 Add a parameter to let the caller choose whether he wants to copy the
9281 string delimiters or not.
9282 (copy_string): Be a simple call to copy_string2 with the last argument
9283 bound to true.
9284 (read_declarations): Add case for macro definition.
9285 (copy_identifier): New.
6fc74234 9286 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
9287 rather than lex.
9288
26f609ff
RA
92892001-08-25 Robert Anisko <robert.anisko@epita.fr>
9290
9291 * src/output.c (prepare): Add prefixed names.
9292 (output_parser): Output semantic actions.
9293 (output_parser): Fix bug on '%%line' directives.
6fc74234 9294
26f609ff
RA
9295 * src/output.c (output_headers): Remove. The C code printed by this
9296 function should now be in the skeletons.
9297 (output_trailers): Remove.
9298 (output): Disable call to 'reader_output_yylsp'.
9299 (output_rule_data): Do not output tables to the table obstack.
9300
9301 * src/output.c: Remove some C dedicated output.
9302 Improve the use of macro and output obstacks.
9303 (output_defines): Remove.
6fc74234 9304
26f609ff
RA
9305 * src/output.c (output_token_translations): Associate 'translate'
9306 table with a macro. No output to the table obstack.
9307 (output_gram): Same for 'rhs' and 'prhs'.
9308 (output_stos): Same for 'stos'.
9309 (output_rule_data): Same for 'r1' and 'r2'.
9310 (token_actions): Same for 'defact'.
9311 (goto_actions): Same for 'defgoto'.
9312 (output_base): Same for 'pact' and 'pgoto'.
9313 (output_table): Same for 'table'.
9314 (output_check): Same for 'check'.
6fc74234 9315
26f609ff
RA
9316 * src/output.c (output_table_data): New function.
9317 (output_short_table): Remove.
9318 (output_short_or_char_table): Remove.
6fc74234 9319
26f609ff
RA
9320 * src/output.c (output_parser): Replace most of the skeleton copy code
9321 with something new. Skeletons are now processed character by character
9322 rather than line by line, and Bison looks for '%%' macros. This is the
9323 first step in making Bison's output process (a lot) more flexible.
9324 (output_parser): Use the macro table.
9325
6f43b113
RA
93262001-08-25 Robert Anisko <robert.anisko@epita.fr>
9327
9328 * src/main.c (main): Initialize the macro table.
9329
dd3127cf
RA
93302001-08-25 Robert Anisko <robert.anisko@epita.fr>
9331
9332 * src/lex.c (percent_table): Add tok_define.
9333 * src/lex.h: Add tok_define.
9334
aa321494
RA
93352001-08-25 Robert Anisko <robert.anisko@epita.fr>
9336
9337 * src/macrotab.c: New file.
9338 * src/macrotab.h: New file.
9339 * src/Makefile.am: Update.
9340
68bd3b6b
RA
93412001-08-25 Robert Anisko <robert.anisko@epita.fr>
9342
9343 * lib/hash.c: New file.
9344 * lib/hash.h: New file.
9345 * lib/Makefile.am: Update.
9346
45f8dd1e
AD
93472001-08-15 Akim Demaille <akim@epita.fr>
9348
9349 Version 1.28c.
9350
40a64a7a 93512001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
9352
9353 * src/reader.c (readgram): Indent output macro YYSTYPE.
9354 (packsymbols): Likewise.
9355 (output_token_defines): Likewise.
9356 * src/files.c: Standardize.
9357 (compute_header_macro): New.
9358 (defines_obstack_save): New. Use compute_header_macro.
9359 (output_files): Update. Use defines_obstack_save.
9360
f9a8293a
AD
93612001-08-15 Akim Demaille <akim@epita.fr>
9362
9363 * doc/bison.texinfo (Table of Symbols): Document
9364 YYSTACK_USE_ALLOCA.
9365
150ca7a7
AD
93662001-08-15 Akim Demaille <akim@epita.fr>
9367
9368 * missing: Update from CVS Automake.
9369 * config/config.guess, config/config.sub, config/texinfo.tex:
9370 Update from gnu.org.
9371
69b5cec4
AD
93722001-08-15 Akim Demaille <akim@epita.fr>
9373
9374 * Makefile.maint: Sync with CVS Autoconf.
9375
f2b5126e
PB
93762001-08-14 Pascal Bart <pascal.bart@epita.fr>
9377
69b5cec4 9378 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
9379 `fdl.texi'.
9380 * doc/fdl.texi: Add to package.
9381
4ecbf796
MA
93822001-08-14 Marc Autret <autret_m@epita.fr>
9383
9384 Turn on %{source,header}_extension features.
9385
69b5cec4 9386 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
9387 source_extension.
9388 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 9389 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
9390 between options.
9391
95fb5662
MA
93922001-08-14 Marc Autret <autret_m@epita.fr>
9393
9394 * src/files.c (compute_base_names): Add extensions computing when
9395 `--file-prefix' used.
9396 Standardize function calls.
9397
78d09da9
MA
93982001-08-13 Marc Autret <autret_m@epita.fr>
9399
69b5cec4 9400 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
9401 defining it (defined but null disables alloca).
9402
5a009f2c
MA
94032001-08-13 Marc Autret <autret_m@epita.fr>
9404
9405 * src/bison.simple (_yy_memcpy): CPP reformat.
9406
1e41465a
PB
94072001-08-13 Pascal Bart <pascal.bart@epita.fr>
9408
9409 * tests/atconfig.in (CPPFLAGS): Fix.
9410
c67a198d
PB
94112001-08-10 Pascal Bart <pascal.bart@epita.fr>
9412
79282c6c 9413 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
9414 `gpl.texi'.
9415 * doc/gpl.texi: Add to package.
9416
09a6de7e
MA
94172001-08-10 Marc Autret <autret_m@epita.fr>
9418
9419 * src/print_graph.h: Fix.
9420 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
9421
b77b9ee0
AD
94222001-08-10 Akim Demaille <akim@epita.fr>
9423
9424 * src/system.h: Provide default declarations for stpcpy, strndup,
9425 and strnlen.
9426
3e259915
MA
94272001-08-10 Robert Anisko <anisko_r@epita.fr>
9428
9429 * doc/bison.texinfo (Locations): Update @$ stuff.
9430
ca96bc2d
MA
94312001-08-09 Robert Anisko <anisko_r@epita.fr>
9432
9433 * src/bison.simple (YYLLOC_DEFAULT): Update.
9434 (yyparse): Adjust.
9435
fdc6758b
MA
94362001-08-08 Marc Autret <autret_m@epita.fr>
9437
b77b9ee0 9438 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
9439 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
9440 Reported by Fabrice Bauzac.
957d4dbf 9441
600cad3b
MA
94422001-08-08 Marc Autret <autret_m@epita.fr>
9443
9444 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
9445 * src/vcg.c (output_node): Fix.
9446 * src/vcg.h: Cleanup.
9447 * src/print_graph.c: Add comments.
b77b9ee0 9448 (node_output_size): New global variable. Simplify the formatting of
600cad3b 9449 the VCG graph output.
b77b9ee0 9450 (print_actions): Unused code is now used. It notifies the final state
600cad3b 9451 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 9452 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
9453 blue.
9454 Get the current node name and node_obstack by argument.
9455 (node_obstack): New variable.
9456 (print_state): Manage node_obstack.
9457 (print_core): Use node_obstack given by argument.
9458 A node is not only computed here but in print_actions also.
9459 (print_graph): CPP out useless code instead of commenting it.
9460
976e528f
AD
94612001-08-07 Pascal Bart <pascal.bart@epita.fr>
9462
9463 * tests/atconfig.in (CPPFLAGS): Fix.
9464
20e8e5ca
AD
94652001-08-07 Akim Demaille <akim@epita.fr>
9466
9467 * src/print_graph.c (quote): New.
9468 (print_core): Use it.
9469
957d4dbf 94702001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 9471
3e3da797
AD
9472 * src/vcg.c (complain.h): Include it.
9473 Unepitaize `return' invocations.
c4b66126 9474 [NDEBUG] (main): Remove.
79282c6c 9475 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
9476 * src/files.c (open_files): Initialize graph_obstack.
9477 * src/print_graph.c (print_actions): CPP out useless code.
9478 (print_core): Don't output the last `\n' in labels.
9479 Use `quote'.
9480 * src/files.c (output_files): Output the VCG file.
9481 * src/main.c (main): Invoke print_graph ();
3e3da797 9482
957d4dbf 94832001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
9484
9485 Automaton VCG graph output.
9486 Using option ``-g'' or long option ``--graph'', you can generate
9487 a gram_filename.vcg file containing a VCG description of the LALR (1)
9488 automaton of your grammar.
9489
9490 * src/main.c: Call to print_graph() function.
9491 * src/getargs.h: Update.
9492 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
9493 (graph_flag): New flag.
9494 (longopts): Update.
9495 (getargs): Add case `g'.
9496 * src/files.c (graph_obstack): New obstack struct.
9497 (open_files): Initialize new obstack.
9498 (output_files): Saves graph_obstack if required.
9499 * src/files.h (graph_obstack): New extern declaration.
9500 * src/Makefile.am: Add new source files.
9501
927c1557 95022001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
9503
9504 * src/print_graph.c, src/print_graph.h (graph): New.
9505 * src/vcg.h: New file.
9506 * src/vcg.c: New file, VCG graph handling.
9507
7333d403
AD
95082001-08-06 Marc Autret <autret_m@epita.fr>
9509
9510 Add of %source_extension and %header_extension which specify
9511 the source or/and the header output file extension.
9512
9513 * src/files.c (compute_base_names): Remove initialisation of
9514 src_extension and header_extension.
9515 (compute_exts_from_gf): Update.
9516 (compute_exts_from_src): Update.
9517 (output_files): Update.
9518 * src/reader.c (parse_header_extension_decl): New.
9519 (parse_source_extension_decl): New.
9520 (read_declarations): New case statements for the new tokens.
9521 * src/lex.c (percent_table): Add entries for %source_extension
9522 and %header_extension.
9523 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
9524
84163231
AD
95252001-08-06 Marc Autret <autret_m@epita.fr>
9526
9527 * configure.in: Bump to 1.28c.
9528 * doc/bison.texinfo: Texinfo thingies.
9529
8303fc42
AD
95302001-08-04 Pascal Bart <pascal.bart@epita.fr>
9531
9532 * tests/atconfig.in (CPPFLAGS): Add.
9533 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
9534
70a84437
AD
95352001-08-03 Akim Demaille <akim@epita.fr>
9536
9537 Version 1.28b.
9538
2ce10144
AD
95392001-08-03 Akim Demaille <akim@epita.fr>
9540
9541 * tests/Makefile.am (check-local): Ship testsuite.
9542 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
9543 Include `string.h'.
9544
1e3e4bc1
AD
95452001-08-03 Akim Demaille <akim@epita.fr>
9546
9547 * configure.in: Try using -Wformat when compiling.
9548
42b45b7f
AD
95492001-08-03 Akim Demaille <akim@epita.fr>
9550
9551 * configure.in: Bump to 1.28b.
9552
8f13fe33
AD
95532001-08-03 Akim Demaille <akim@epita.fr>
9554
9555 * src/complain.c: Adjust strerror_r portability issues.
9556
b37ba92c
AD
95572001-08-03 Akim Demaille <akim@epita.fr>
9558
9559 Version 1.28a.
9560
b0ce6046
AD
95612001-08-03 Akim Demaille <akim@epita.fr>
9562
9563 * src/getargs.c, src/getarg.h (skeleton)): Constify.
9564 * src/lex.c (literalchar): Avoid name clashes on `buf'.
9565 * src/getargs.c: Include complain.h.
9566 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
9567 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
9568
d01c415b
AD
95692001-08-03 Akim Demaille <akim@epita.fr>
9570
9571 * src/reader.c (readgram): Display hidden chars in error messages.
9572
459dd1a6
AD
95732001-08-03 Akim Demaille <akim@epita.fr>
9574
9575 Update to gettext 0.10.39.
9576
53b74c0c
AD
95772001-08-03 Akim Demaille <akim@epita.fr>
9578
9579 * lib/strspn.c: New.
9580
234a3be3
AD
95812001-08-01 Marc Autret <autret_m@epita.fr>
9582
9583 * doc/bison.texinfo: Update.
9584 * doc/bison.1 (mandoc): Update.
9585 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
9586 * src/files.c: Support output files extensions computing.
9587 (src_extension): New static variable.
9588 (header_extension): New static variable.
9589 (tr): New function.
9590 (get_extension_index): New function, gets the index of an extension
9591 filename in a string.
9592 (compute_exts_from_gf): New function, computes extensions from the
9593 grammar file extension.
9594 (compute_exts_from_src): New functions, computes extensions from the
9595 C source file extension, file given by ``-o'' option.
9596 (compute_base_names): Update.
9597 (output_files): Update.
9598
847bf1f5
AD
95992001-08-01 Robert Anisko <anisko_r@epita.fr>
9600
d995fee7 9601 * doc/bison.texi: Document @$.
847bf1f5
AD
9602 (Locations): New section.
9603
d074a105
AD
96042001-07-18 Akim Demaille <akim@epita.fr>
9605
9606 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
9607 * config/prev-version.txt, config/move-if-change: New.
9608 * Makefile.am: Adjust.
9609
3419715d
AD
96102001-07-08 Pascal Bart <pascal.bart@epita.fr>
9611
9612 * src/bison.simple (yyparse): Suppress warning `comparaison
9613 between signed and unsigned'.
9614
62ab6972
AD
96152001-07-05 Pascal Bart <pascal.bart@epita.fr>
9616
9617 * src/getargs.h (raw_flag): Remove.
9618 * src/getargs.c: Die on `-r'/`--raw'.
9619 * src/lex.c (parse_percent_token): Die on `%raw'.
9620 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
9621 * tests/calc.at: Suppress test with option `--raw'.
9622
1e24cc5b
AD
96232001-07-14 Akim Demaille <akim@epita.fr>
9624
9625 * config/: New.
9626 * configure.in: Require Autoconf 2.50.
9627 Update to gettext 0.10.38.
9628
32dfccf8
AD
96292001-03-16 Akim Demaille <akim@epita.fr>
9630
9631 * doc/bison.texinfo: ANSIfy the examples.
9632
cd5bd6ac
AD
96332001-03-16 Akim Demaille <akim@epita.fr>
9634
9635 * getargs.c (skeleton): New variable.
9636 (longopts): --skeleton is a new option.
9637 (shortopts, getargs): -S is a new option.
9638 * getargs.h: Declare skeleton.
9639 * output.c (output_parser): Use it.
9640
5141b016
AD
96412001-03-16 Akim Demaille <akim@epita.fr>
9642
9643 * m4/strerror_r.m4: New.
9644 * m4/error.m4: Run AC_FUNC_STRERROR_R.
9645 * lib/error.h, lib/error.c: Update.
9646
447992b9
AD
96472001-03-16 Akim Demaille <akim@epita.fr>
9648
9649 * src/getargs.c (longopts): Clean up.
9650
274d42ce
AD
96512001-02-21 Akim Demaille <akim@epita.fr>
9652
9653 * src/reader.c (gensym): `gensym_count' is your own.
9654 Use a static buf to create the symbol name, as token_buffer is no
9655 longer a buffer.
9656
22c821f3
AD
96572001-02-08 Akim Demaille <akim@epita.fr>
9658
9659 * src/conflicts.c (conflict_report): Be sure not to append to res
9660 between two calls, which could happen if both first sprintf were
9661 skipped, but not the first cp += strlen.
9662
18569462
AD
96632001-02-08 Akim Demaille <akim@epita.fr>
9664
9665 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
9666 New, from fileutils 4.0.37.
9667 * configure.in: Require Autoconf 2.49c. I took some time before
9668 making this decision. This is the only way out for portability
9669 issues in Bison, it would mean way too much duplicate effort to
9670 import in Bison features implemented in 2.49c since 2.13.
9671 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
9672
0d8f3c8a
AD
96732001-02-02 Akim Demaille <akim@epita.fr>
9674
9675 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 9676 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 9677
f17bcd1f
AD
96782001-01-19 Akim Demaille <akim@epita.fr>
9679
9680 Get rid of the ad hoc handling of token_buffer in the scanner: use
9681 the obstacks.
9682
9683 * src/lex.c (token_obstack): New.
9684 (init_lex): Initialize it. No longer call...
9685 (grow_token_buffer): this. Remove it.
9686 Adjust all the places which used it to use the obstack.
9687
511e79b3
AD
96882001-01-19 Akim Demaille <akim@epita.fr>
9689
9690 * src/lex.h: Rename all the tokens:
9691 s/\bENDFILE\b/tok_eof/g;
9692 s/\bIDENTIFIER\b/tok_identifier/g;
9693 etc.
9694 Let them be enums, not #define, to ease debugging.
9695 Adjust all the code.
9696
0d6508ef
AD
96972001-01-18 Akim Demaille <akim@epita.fr>
9698
9699 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
9700 * src/lex.c (maxtoken, grow_token_buffer): Static.
9701
6deb4447
AD
97022001-01-18 Akim Demaille <akim@epita.fr>
9703
9704 Since we now use obstacks, more % directives can be enabled.
9705
9706 * src/lex.c (percent_table): Also accept `%yacc',
9707 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
9708 `%debug'.
9709 Handle the actions for `%semantic_parser' and `%pure_parser' here,
9710 instead of returning a token.
9711 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
9712 * src/reader.c (read_declarations): Adjust.
9713 * src/files.c (open_files): Don't call `compute_base_names', don't
9714 compute `attrsfile' since they depend upon data which might be
9715 *in* the input file now.
9716 (output_files): Do it here.
9717 * src/output.c (output_headers): Document the fact that this patch
9718 introduces a guaranteed SEGV for semantic parsers.
9719 * doc/bison.texinfo: Document them.
9720 * tests/suite.at: Exercise these %options.
9721
ff4423cc
AD
97222000-12-20 Akim Demaille <akim@epita.fr>
9723
9724 Also handle the output file (--verbose) with obstacks.
9725
9726 * files.c (foutput): Remove.
9727 (output_obstack): New.
9728 Adjust all dependencies.
9729 * src/conflicts.c: Return a string.
9730 * src/system.h (obstack_grow_string): Rename as...
9731 (obstack_sgrow): this. Be ready to work with non literals.
9732 (obstack_fgrow4): New.
9733
956dba3a
AD
97342000-12-20 Akim Demaille <akim@epita.fr>
9735
9736 * src/files.c (open_files): Fix the computation of short_base_name
9737 in the case of `-o foo.tab.c'.
9738
337bab46
AD
97392000-12-20 Akim Demaille <akim@epita.fr>
9740
9741 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
9742 (copy_dollar): Now that everything uses obstacks, get rid of the
9743 FILE * parameters.
9744
5d3214b8
AD
97452000-12-20 Akim Demaille <akim@epita.fr>
9746
9747 * src/files.c (open_files): Actually the `.output' file is based
9748 on the short_base_name, not base_name.
9749 * tests/suite.at (Checking output file names): Adjust.
9750
29092a57
AD
97512000-12-20 Akim Demaille <akim@epita.fr>
9752
9753 * src/bison.s1: Remove, we now use directly...
9754 * src/bison.simple: this.
9755 * src/Makefile.am: Use pkgdata instead of data.
9756
ea5607fd
AD
97572000-12-20 Akim Demaille <akim@epita.fr>
9758
9759 * src/files.c (guard_obstack): New.
9760 (open_files): Initialize it.
9761 (output_files): Dump it...
9762 * src/files.h: Export it.
9763 * src/reader.c (copy_guard): Use it.
9764
27110317
AD
97652000-12-19 Akim Demaille <akim@epita.fr>
9766
9767 * src/files.c (outfile, defsfile, actfile): Removed as global
9768 vars.
9769 (open_files): Don't compute them.
9770 (output_files): Adjust.
9771 (base_name, short_base_name): Be global.
9772 Adjust dependencies.
9773
19c50364
AD
97742000-12-19 Akim Demaille <akim@epita.fr>
9775
9776 * src/files.c (strsuffix): New.
9777 (stringappend): Be just like strcat but allocate.
9778 (base_names): Eve out from open_files.
9779 Try to simplify the rather hairy computation of base_name and
9780 short_base_name.
9781 (open_files): Use it.
9782 * tests/suite.at (Checking output file names): New test.
9783
573c1d9f
AD
97842000-12-19 Akim Demaille <akim@epita.fr>
9785
9786 * src/system.h (obstack_grow_literal_string): Rename as...
9787 (obstack_grow_string): this.
9788 * src/output.c (output_parser): Recognize `%% actions' instead of
9789 `$'.
9790 * src/bison.s1: s/$/%% actions/.
9791 * src/bison.hairy: Likewise.
9792
ef7ddedd
AD
97932000-12-19 Akim Demaille <akim@epita.fr>
9794
9795 * src/output.c (output_parser): Compute the `#line' lines when
9796 there are.
9797 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
9798 Suggested by Hans Aberg.
9799
ff61dabd
AD
98002000-12-19 Akim Demaille <akim@epita.fr>
9801
9802 Let the handling of the skeleton files be local to the procedures
9803 that use it.
9804
9805 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
9806 longer static.
9807 (fparser, open_extra_files): Remove.
9808 (open_files, output_files): Don't take care of fparser.
9809 * src/files.h: Adjust.
9810 * src/output.c (output_parser): Open and close the file to the
9811 skeleton.
9812 * src/reader.c (read_declarations): When %semantic_parser, open
9813 fguard.
9814
55b96341
AD
98152000-12-19 Akim Demaille <akim@epita.fr>
9816
9817 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
9818 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
9819
358c15b7
AD
98202000-12-19 Akim Demaille <akim@epita.fr>
9821
9822 * src/files.c (open_files): Yipee! We no longer need all the code
9823 looking for `/tmp' since we have no tmp file.
9824
7de3329e
AD
98252000-12-19 Akim Demaille <akim@epita.fr>
9826
9827 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
9828 New macros.
9829 * src/files.c (open_files): Less dependency on MSDOS etc.
9830
3abcd459
AD
98312000-12-14 Akim Demaille <akim@epita.fr>
9832
9833 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
9834 Provide a default definition.
9835 Use it when executing the default @ action.
9836 * src/reader.c (reader_output_yylsp): No longer include
9837 `timestamp' and `text' in the default YYLTYPE.
9838
2a91a95e
AD
98392000-12-12 Akim Demaille <akim@epita.fr>
9840
9841 * src/reader.c (copy_definition, parse_union_decl, copy_action)
9842 (copy_guard): Quote the file names.
9843 Reported by Laurent Mascherpa.
9844
14d3eb9b
AD
98452000-12-12 Akim Demaille <akim@epita.fr>
9846
9847 * src/output.c (output_headers, output_program, output): Be sure
9848 to escape special characters when outputting filenames.
9849 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
9850 (output_headers): Don't depend on them, Use ACTSTR.
9851
d7045ec6
AD
98522000-11-17 Akim Demaille <akim@epita.fr>
9853
9854 * lib/obstack.h: Formatting changes.
9855 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
9856 prevents type checking.
9857 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9858 cast the value to (void *): assigning a `foo *' to a `void *'
9859 variable is valid.
9860 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9861 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
9862 append characters.
9863
6fd54b73
AD
98642000-11-17 Akim Demaille <akim@epita.fr>
9865
9866 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
9867 as...
9868 (suite.m4, regression.m4, calc.m4): these.
9869 * tests/atgeneral.m4: Update from CVS Autoconf.
9870
4c50eae6
AD
98712000-11-17 Akim Demaille <akim@epita.fr>
9872
9873 * tests/regression.m4 (%union and --defines): New test,
9874 demonstrating a current bug in the obstack implementation.
9875
a35f64ea
AD
98762000-11-17 Akim Demaille <akim@epita.fr>
9877
9878 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
9879 macros.
9880 Use them to declare the variables which are global or local to
9881 `yyparse'.
9882
7de23534
AD
98832000-11-17 Akim Demaille <akim@epita.fr>
9884
9885 * acconfig.h: Remove, no longer used.
9886
aa7815f5
AD
98872000-11-07 Akim Demaille <akim@epita.fr>
9888
9889 * src: s/Copyright (C)/Copyright/g.
9890
5af1f549
AD
98912000-11-07 Akim Demaille <akim@epita.fr>
9892
9893 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
9894 defining.
9895 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
9896
553e2b22
AD
98972000-11-07 Akim Demaille <akim@epita.fr>
9898
9899 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
9900 Merge in a single CPP if/else.
9901
8a4f41d6
AD
99022000-11-07 Akim Demaille <akim@epita.fr>
9903
9904 * src/output.c (output): Remove useless variables.
9905 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
9906 argument `data' for consistency with the prototypes.
9907 Qualify it `const'.
9908 (obstack_copy, obstack_copy0): Rename the second argument as
9909 `address' for consistency. Qualify it `const'.
9910 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
9911 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
9912 `const' their input argument (`data' or `address').
9913 Adjust the corresponding macros to include `const' in casts.
9914
095a3fb5
AD
99152000-11-03 Akim Demaille <akim@epita.fr>
9916
9917 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
9918 s/PFILE1/BISON_HAIRY/.
9919 Adjust dependencies.
9920
d1cdce7c
AD
99212000-11-03 Akim Demaille <akim@epita.fr>
9922
090c5ebf 9923 For some reason, this was not applied.
d1cdce7c
AD
9924
9925 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
9926 `unlink': it's no longer used.
9927
9311529b
AD
99282000-11-03 Akim Demaille <akim@epita.fr>
9929
9930 * src/files.c (skeleton_find): New function, eved out of...
9931 (open_files, open_extra_files): here.
9932
d8880f69
AD
99332000-11-03 Akim Demaille <akim@epita.fr>
9934
9935 Don't use `atexit'.
9936
9937 * src/files.c (obstack_save): New function.
9938 (done): Rename as...
9939 (output_files): this.
9940 Use `obstack_save'.
9941 * src/main.c (main): Don't use `atexit' to register `done', since
9942 it no longer has to remove tmp files, just call `output_files'
9943 when there are no errors.
9944
0dbb648e
AD
99452000-11-02 Akim Demaille <akim@epita.fr>
9946
9947 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
9948 `unlink': it's no longer used.
9949 * src/files.h: Formatting changes.
9950
896fe5c1
AD
99512000-11-02 Akim Demaille <akim@epita.fr>
9952
9953 Remove the last uses of mktemp and unlink/delete.
9954
9955 * src/files.c (fdefines, ftable): Removed.
9956 (defines_ostack, table_obstack): New.
9957 Adjust dependencies of the former into uses of the latter.
9958 * src/output.c (output_short_or_char_table, output_short_table):
9959 Convert to using obstacks.
9960 * src/reader.c (copy_comment2): Accept one FILE * and two
9961 obstacks.
9962 (output_token_defines, reader_output_yylsp): Use obstacks.
9963 * src/system.h (obstack_fgrow3): New.
9964
dd60faec
AD
99652000-11-01 Akim Demaille <akim@epita.fr>
9966
9967 Change each use of `fattrs' into a use of `attrs_obstack'.
9968
9969 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
9970 * src/files.c (fattrs): Remove.
9971 (attrs_obstack): New.
9972 Adjust all dependencies.
9973 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
9974
8c7ebe49
AD
99752000-11-01 Akim Demaille <akim@epita.fr>
9976
9977 Introduce obstacks.
9978 Change each use of `faction' into a use of `action_obstack'.
9979
9980 * lib/obstack.h, lib/obstack.c: New files.
9981 * src/files.c (faction): Remove.
9982 (action_obstack): New.
9983 Adjust all dependencies.
9984
77aee789
AD
99852000-10-20 Akim Demaille <akim@epita.fr>
9986
9987 * lib/quote.h (PARAMS): New macro. Use it.
9988
43591cec
AD
99892000-10-16 Akim Demaille <akim@epita.fr>
9990
9991 * src/output.c (output_short_or_char_table): New function.
9992 (output_short_table, output_token_translations): Use it.
9993 (goto_actions): Use output_short_table.
9994
1e9798d5
AD
99952000-10-16 Akim Demaille <akim@epita.fr>
9996
9997 * src/symtab.c (bucket_new): New function.
9998 (getsym): Use it.
9999
10000 * src/output.c (output_short_table): New argument to display the
10001 comment associated with the table.
10002 Adjust dependencies.
10003 (output_gram): Use it.
10004 (output_rule_data): Nicer output layout for YYTNAME.
10005
f282676b
AD
100062000-10-16 Akim Demaille <akim@epita.fr>
10007
10008 * src/lex.c (read_typename): New function.
10009 (lex): Use it.
10010 * src/reader.c (copy_dollar): Likewise.
10011
550a72a3
AD
100122000-10-16 Akim Demaille <akim@epita.fr>
10013
10014 * src/reader.c (copy_comment2): Expect the input stream to be on
10015 the `/' which is suspected to open a comment, instead of being
10016 called after `//' or `/*' was read.
10017 (copy_comment, copy_definition, parse_union_decl, copy_action)
10018 (copy_guard): Adjust.
10019
131e2fef
AD
100202000-10-16 Akim Demaille <akim@epita.fr>
10021
10022 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
10023 `read_signed_integer'.
10024
79282c5a
AD
100252000-10-16 Akim Demaille <akim@epita.fr>
10026
10027 * src/reader.c (copy_dollar): New function.
10028 (copy_guard, copy_action): Use it.
10029
ff4a34be
AD
100302000-10-16 Akim Demaille <akim@epita.fr>
10031
10032 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
10033 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
10034 New files, from Fileutils 4.0.27.
10035 * src/main.c (printable_version): Remove.
10036 * src/lex.c, src/reader.c: Use `quote'.
10037
100382000-10-04 Akim Demaille <akim@epita.fr>
10039
10040 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
10041
14ded682
AD
100422000-10-04 Akim Demaille <akim@epita.fr>
10043
10044 * doc/bison.texinfo: Various typos spotted by Neil Booth.
10045
8e03724b
AD
100462000-10-04 Akim Demaille <akim@epita.fr>
10047
10048 When a literal string is used to define two different tokens,
10049 `bison -v' segfaults.
10050 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
10051
10052 * tests/regression.m4: New file.
10053 Include the core of the sample provided by Piotr Gackiewicz.
10054 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
10055 properly.
10056
a9e64249
AD
100572000-10-04 Akim Demaille <akim@epita.fr>
10058
10059 * src/reader.c (parse_expect_decl): Keep `count' within the size
10060 of `buffer'.
10061 From Neil Booth.
10062
da9abf43
AD
100632000-10-02 Paul Eggert <eggert@twinsun.com>
10064
10065 * bison.s1 (yyparse): Assign the default value
10066 unconditionally, to avoid a GCC warning and make the parser a
10067 tad smaller.
10068
c33638bb
AD
100692000-10-02 Akim Demaille <akim@epita.fr>
10070
10071 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
10072 options.
10073
444c570a
AD
100742000-10-02 Akim Demaille <akim@epita.fr>
10075
10076 * src/derives.c, src/print.c, src/reduce.c: To ease the
10077 translation, move some `\n' out of the translated strings.
10078
89cab50d
AD
100792000-10-02 Akim Demaille <akim@epita.fr>
10080
10081 The location tracking mechanism is precious for parse error
10082 messages. Nevertheless, it is enabled only when `@n' is used in
10083 the grammar, which is a different issue (you can use it in error
10084 message, but not in the grammar per se). Therefore, there should
10085 be another means to enable it.
10086
10087 * src/getargs.c (getargs): Support `--locations'.
10088 (usage): Report it.
10089 * src/getargs.h (locationsflag): Export it.
10090 * src/lex.c (percent_table): Support `%locations'.
10091 * src/reader.c (yylsp_needed): Remove this variable, now replaced
10092 with `locationsflag'.
10093 * doc/bison.texinfo: Document `--locations' and `%locations'.
10094 Sort the options.
10095 * tests/calc.m4: Test it.
10096
10097 For regularity of the names, replace each
10098 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
10099 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
10100 In addition replace each `flag' with `_flag'.
10101
d6c2cba0
AD
101022000-10-02 Akim Demaille <akim@epita.fr>
10103
10104 Also test parse error messages, including with YYERROR_VERBOSE.
10105
10106 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
10107 associative).
10108 Use it to check the computations.
10109 Use it to check `nonassoc' is honored.
10110 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
10111 `--yyerror-verbose'.
10112 (_AT_CHECK_CALC): Adjust to this option.
10113 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
10114
5a35a6cb
AD
101152000-10-02 Akim Demaille <akim@epita.fr>
10116
10117 Test also `--verbose', `--defines' and `--name-prefix'. Testing
10118 the latter demonstrates a flaw in the handling of non debugging
10119 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
10120 was used in order to simplify:
10121
10122 #if YYDEBUG
10123 if (yydebug)
10124 {
10125 ...
10126 }
10127 #endif
10128
10129 into
10130
10131 if (yydebug)
10132 {
10133 ...
10134 }
10135
10136 unfortunately this leads to a CPP conflict when
10137 `--name-prefix=foo' is used since it produces `#define yydebug
10138 foodebug'.
10139
10140 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
10141 (YYDPRINTF): New macro.
10142 Spread its use.
10143 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
10144 the bison options.
10145 Also test `--verbose', `--defines' and `--name-prefix'.
10146
71da9eea
AD
101472000-10-02 Akim Demaille <akim@epita.fr>
10148
10149 Improve the readability of the produced parsers.
10150
10151 * src/bison.s1: Formatting changes.
10152 Improve the comment related to the `$' mark.
10153 (yydefault): Don't fall through to `yyresume': `goto' there.
10154 * src/output.c (output_parser): When the `$' is met, skip the end
10155 of its line.
10156 New variable, `number_of_dollar_signs', to check there's exactly
10157 one `$' in the parser skeleton.
10158
95e36146
AD
101592000-10-02 Akim Demaille <akim@epita.fr>
10160
10161 * lib/xstrdup.c: New file, from the fileutils.
10162 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
10163 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
10164 instead of strlen + xmalloc + strcpy.
10165 * src/symtab.c (copys): Remove, use xstrdup instead.
10166
d7020c20
AD
101672000-10-02 Akim Demaille <akim@epita.fr>
10168
10169 * src/gram.h (associativity): New enum type which replaces the
10170 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
10171 `right_assoc', `left_assoc' and `non_assoc'.
10172 Adjust all dependencies.
10173 * src/reader.c: Formatting changes.
10174 (LTYPESTR): Don't define it, use it as a literal in
10175 `reader_output_yylsp'.
10176 * src/symtab.h (symbol_class): New enum type which replaces the
10177 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
10178 `sunknown', `stoken and `snterm'.
10179
1916f98e
AD
101802000-10-02 Akim Demaille <akim@epita.fr>
10181
10182 * src/getargs.c (fixed_outfiles): Rename as...
10183 (yaccflag): for consistency and accuracy.
10184 Adjust dependencies.
10185
d7913476
AD
101862000-10-02 Akim Demaille <akim@epita.fr>
10187
10188 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
10189 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
10190 difficult and introduced a lot of core dump. It turns out that
10191 Bison used an implementation of `xmalloc' based on `calloc', and
10192 at various places it does depend upon the initialization to 0. I
10193 have not tried to isolate the pertinent places, and all the former
10194 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
10195 someone should address this issue.
10196
10197 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
10198 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
10199 files.
10200 Adjust dependencies.
10201 * src/warshall.h: New file.
10202 Propagate.
10203
340ef489
AD
102042000-10-02 Akim Demaille <akim@epita.fr>
10205
10206 Various anti-`extern in *.c' changes.
10207
10208 * src/system.h: Include `assert.h'.
10209
b2ca4022
AD
102102000-10-02 Akim Demaille <akim@epita.fr>
10211
10212 * src/state.h (nstates, final_state, first_state, first_shift)
10213 (first_reduction): Move their exportation from here...
10214 * src/LR0.h: to here.
10215 Adjust dependencies.
10216 * src/getargs.c (statisticsflag): New variable.
10217 Add support for `--statistics'.
10218 Adjust dependencies.
10219
10220 Remove a lot of now useless `extern' statements in most files.
10221
403b315b
AD
102222000-10-02 Akim Demaille <akim@epita.fr>
10223
10224 * src/LR0.h: New file.
10225 Propagate its use.
10226
07a58c13
AD
102272000-10-02 Akim Demaille <akim@epita.fr>
10228
10229 * src/print.h: New file.
10230 Propagate its use.
10231 * src/print.c: Formatting and ordering changes.
10232 (verbose, terse): Replace with...
10233 (print_results): this new function.
10234 Adjust dependencies.
10235
0619caf0
AD
102362000-10-02 Akim Demaille <akim@epita.fr>
10237
10238 * src/conflicts.c (conflict_report): New function.
10239 (conflict_log, verbose_conflict_log): Replace with...
10240 (print_conflicts): this function.
10241 Adjust dependencies.
10242 * src/conflicts.h: New file.
10243 Propagate its inclusion.
10244
3519ec76
AD
102452000-10-02 Akim Demaille <akim@epita.fr>
10246
10247 * src/nullable.h: New file.
10248 Propagate its inclusion.
10249 * src/nullable.c: Formatting changes.
10250
015acc48
AD
102512000-10-02 Akim Demaille <akim@epita.fr>
10252
10253 * src/reduce.h: New file.
10254 Propagate its inclusion.
10255 * src/reduce.c: Topological sort and other formatting changes.
10256 (bool, TRUE, FALSE): Move their definition to...
10257 * src/system.h: here.
10258
8963a27b
AD
102592000-10-02 Akim Demaille <akim@epita.fr>
10260
10261 * src/files.c: Formatting changes.
10262 (tryopen, tryclose, openfiles): Rename as...
10263 (xfopen, xfclose, open_files): this.
10264 (stringappend): static.
10265 * src/files.h: Complete the list of exported symbols.
10266 Propagate its use.
10267
a70083a3
AD
102682000-10-02 Akim Demaille <akim@epita.fr>
10269
10270 * src/reader.h: New file.
10271 Propagate its use instead of tedious list of `extern' and
10272 prototypes.
10273 * src/reader.c: Formatting changes, topological sort,
10274 s/register//.
10275
abadc117
AD
102762000-10-02 Akim Demaille <akim@epita.fr>
10277
10278 * src/lex.h: Prototype `lex.c' exported functions.
10279 * src/reader.c: Adjust.
10280 * src/lex.c: Formatting changes.
10281 (safegetc): Rename as...
10282 (xgetc): this.
10283
720d742f
AD
102842000-10-02 Akim Demaille <akim@epita.fr>
10285
10286 * src/lalr.h: New file.
10287 Propagate its inclusion instead of prototypes and `extern'.
10288 * src/lalr.c: Formatting changes, topological sorting etc.
10289
f2acea59
AD
102902000-10-02 Akim Demaille <akim@epita.fr>
10291
10292 * src/output.c (token_actions): Introduce a temporary array,
10293 YYDEFACT, that makes it possible for this function to use
10294 output_short_table.
10295
d019d655
AD
102962000-10-02 Akim Demaille <akim@epita.fr>
10297
10298 `user_toknums' is output as a `short[]' in `output.c', while it is
10299 defined as a `int[]' in `reader.c'. For consistency with the
10300 other output tables, `user_toknums' is now defined as a table of
10301 shorts.
10302
10303 * src/reader.c (user_toknums): Be a short table instead of an int
10304 table.
10305 Adjust dependencies.
10306
10307 Factor the short table outputs.
10308
10309 * src/output.c (output_short_table): New function.
10310 * src/output.c (output_gram, output_stos, output_rule_data)
10311 (output_base, output_table, output_check): Use it.
10312
6c89f1c1
AD
103132000-10-02 Akim Demaille <akim@epita.fr>
10314
10315 * src/output.c (output): Topological sort of the functions, in
10316 order to get rid of the `static' prototypes.
10317 No longer use `register'.
10318 * src/output.h: New file.
10319 Propagate its inclusion in files explicitly prototyping functions
10320 from output.c.
10321
d9efd181
AD
103222000-09-21 Akim Demaille <akim@epita.fr>
10323
10324 * src/atgeneral.m4: Update from Autoconf.
10325
c29240e7 103262000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
10327
10328 * src/closure.h: New file.
10329 * src/closure.c: Formatting changes, topological sort over the
10330 functions, use of closure.h.
10331 (initialize_closure, finalize_closure): Rename as...
10332 (new_closure, free_closure): these. Adjust dependencies.
10333 * src/LR0.c: Formatting changes, topological sort, use of
10334 cloture.h.
10335 (initialize_states): Rename as...
10336 (new_states): this.
10337 * src/Makefile.am (noinst_HEADERS): Adjust.
10338
499daa50
AD
103392000-09-20 Akim Demaille <akim@epita.fr>
10340
10341 * src/acconfig.h: Don't protect config.h against multiple
10342 inclusion.
10343 Don't define PARAMS.
10344 * src/system.h: Define PARAMS.
10345 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
10346 purpose of config.h. system.h must not try to fix wrong
10347 definitions in config.h.
10348
cc84fd5d
AD
103492000-09-20 Akim Demaille <akim@epita.fr>
10350
10351 * src/derives.h: New file.
10352 * src/main.c, src/derives.h: Use it.
10353 Formatting changes.
10354 * src/Makefile.am (noinst_HEADERS): Adjust.
10355
db5b3a89
AD
103562000-09-20 Akim Demaille <akim@epita.fr>
10357
10358 * tests/atgeneral.m4: Update from Autoconf.
10359 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
10360 (AT_CHECK_CALC): New macros.
10361 Use these macros to test bison with options `', `--raw',
10362 `--debug', `--yacc', `--yacc --debug'.
10363
ceed8467
AD
103642000-09-19 Akim Demaille <akim@epita.fr>
10365
10366 * src/output.c: Formatting changes.
10367 * src/machine.h: Remove, leaving its contents in...
10368 * src/system.h: here.
10369 Include stdio.h.
10370 Adjust all dependencies on stdio.h and machine.h.
10371 * src/getargs.h: New file.
10372 Let all `extern' declarations about getargs.c be replaced with
10373 inclusion of `getargs.h'.
10374 * src/Makefile.am (noinst_HEADERS): Adjust.
10375
10376 * tests/calc.m4 (yyin): Be initialized in main, not on the global
10377 scope.
10378 (yyerror): Returns void, not int.
10379 * doc/bison.texinfo: Formatting changes.
10380
05a1d24b
AD
103812000-09-19 Akim Demaille <akim@epita.fr>
10382
10383 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
10384 portable.
10385
cbd25751
AD
103862000-09-18 Akim Demaille <akim@epita.fr>
10387
10388 * configure.in: Append WARNING_CFLAGS to CFLAGS.
10389 * src/Makefile.am (INCLUDES): Don't.
10390 Be ready to fetch headers in lib/.
10391
13863333
AD
103922000-09-18 Akim Demaille <akim@epita.fr>
10393
10394 * doc/bison.texinfo: Update the copyright.
10395 ANSIfy and GNUify the examples.
10396 Remove the old menu.
10397
0d533154
AD
103982000-09-18 Akim Demaille <akim@epita.fr>
10399
10400 First set of tests: use the `calc' example from the documentation.
10401
10402 * src/bison.s1 (yyparse): Condition the code using `yytname' which
10403 is defined only when YYDEBUG is.
10404 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
10405 * src/files.c (tryopen, tryclose): Formatting changes.
10406 Move to the top and be static.
10407 * src/reader.c (read_signed_integer): Likewise.
10408 * tests/calc.m4: New file.
10409 * Makefile.am, suite.m4: Adjust.
10410 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
10411
e79137ac
AD
104122000-09-18 Akim Demaille <akim@epita.fr>
10413
10414 Add support for an Autotest test suite for Bison.
10415
10416 * m4/m4.m4, m4/atconfig.m4: New files.
10417 * m4/Makefile.am (EXTRA_DIST): Adjust.
10418 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
10419 files.
10420 * src/getargs.c: Display a more standard --version message.
10421 * src/reader.c (reader): Formatting changes.
10422 No longer depend upon VERSION_STRING.
10423 * configure.in: No longer use `dnl'.
10424 Set up the test suite and the new directory `tests/.
10425 (VERSION_STRING): Remove.
10426
27821bff
AD
104272000-04-14 Akim Demaille <akim@epita.fr>
10428
10429 * src/reader.c (copy_comment2): New function, same as former
10430 `copy_comment', but outputs into two FILE *.
10431 (copy_comment): Use it.
10432 (parse_union_decl): Use it.
10433 (get_type, parse_start_decl): Use the same `invalid' message.
10434 (parse_start_decl, parse_union_decl): Use the same `multiple'
10435 message.
10436 (parse_union_decl, copy_guard, copy_action): Use the same
10437 `unmatched' message.
10438 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
10439
cfe5fbc0
AD
104402000-03-31 Akim Demaille <akim@epita.fr>
10441
10442 * src/files.c (tryopen, tryclose): Move to the top.
10443 Be static.
10444
cb7db13e
AD
104452000-03-31 Akim Demaille <akim@epita.fr>
10446
10447 * src/main.c (main): Don't call `done', exit does it.
10448
a0f6b076
AD
104492000-03-31 Akim Demaille <akim@epita.fr>
10450
36281465
AD
10451 * allocate.c: s/return (foo)/return foo/.
10452 * lalr.c: Likewise.
10453 * LR0.c: Likewise.
10454 * output.c: Likewise.
10455 * reader.c: Likewise.
10456 * symtab.c: Likewise.
10457 * vmsgetargs.c: Likewise.
10458
104592000-03-31 Akim Demaille <akim@epita.fr>
10460
10461 Clean up the error reporting functions.
a0f6b076
AD
10462
10463 * src/report.c: New file.
10464 * src/report.h: Likewise.
10465 * src/Makefile.am: Adjust.
10466 * m4/error.m4: New file.
10467 * m4/Makefile.am: Adjust.
10468 * configure.in (jm_PREREQ_ERROR): Call it.
10469 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
10470 Remove.
10471 (fatal, fatals): Remove. All callers use complain.c::fatal.
10472 (warn, warni, warns, warnss, warnss): Remove. All callers use
10473 complain.c::complain.
10474 (toomany): Remove, use fatal instead.
10475 * src/files.c (done): No argument, use complain_message_count.
10476 * src/main.c (main): Register `done' to `atexit'.
10477
10478 * src/getargs.c (usage): More `fputs', less `fprintf'.
10479
18539825
AD
104802000-03-28 Akim Demaille <akim@epita.fr>
10481
10482 * lib/: New directory.
10483 * Makefile.am (SUBDIRS): Adjust.
10484 * configure.in: Adjust.
10485 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
10486 useless.
10487 * src/alloca.c: Moved to lib/.
10488 * src/getopt.c: Likewise.
10489 * src/getopt1.c: Likewise.
10490 * src/getopt.h: Likewise.
10491 * src/ansi2knr.c: Likewise.
10492 * src/ansi2knr.1: Likewise.
10493 * src/Makefile.am: Adjust.
10494 * lib/Makefile.am: New file.
10495
9f306f2a
AD
104962000-03-28 Akim Demaille <akim@epita.fr>
10497
10498 * src/getargs.c (usage): Refresh the help message.
10499
0ba347b6
AD
105002000-03-17 Akim Demaille <akim@epita.fr>
10501
10502 * src/getopt1.c: Updated from textutils 2.0e
10503 * src/getopt.c: Likewise.
10504 * src/getopt.h: Likewise.
10505
dbe7f271
AD
105062000-03-17 Akim Demaille <akim@epita.fr>
10507
10508 * src/Makefile.am (bison.simple): Fix the awk program: quote only
10509 the file name, not the whole `#line LINE FILE'.
10510
75bbe78d
AD
105112000-03-17 Akim Demaille <akim@epita.fr>
10512
10513 On syntax errors, report the token on which we choked.
10514
aa5fd0ee
AD
10515 * src/bison.s1 (yyparse): In the label yyerrlab, when
10516 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 10517
7b306f52
AD
105182000-03-17 Akim Demaille <akim@epita.fr>
10519
aa5fd0ee 10520 * src/reader.c (copy_at): New function.
7b306f52
AD
10521 (copy_guard): Use it.
10522 (copy_action): Use it.
10523
e87b5700
AD
105242000-03-17 Akim Demaille <akim@epita.fr>
10525
10526 Be kind to translators, save some useless translations.
10527
aa5fd0ee 10528 * src/main.c (banner): New function.
e87b5700
AD
10529 (fatal_banner): Use it.
10530 (warn_banner): Use it.
10531
ae3c3164
AD
105322000-03-17 Akim Demaille <akim@epita.fr>
10533
aa5fd0ee
AD
10534 * src/reader.c (copy_definition): Use copy_string and
10535 copy_comment. Removed now unused `match', `ended',
10536 `cplus_comment'.
ae3c3164
AD
10537 (copy_comment, copy_string): Moved, to be visible from
10538 copy_definition.
10539
4dc58e7c
AD
105402000-03-17 Akim Demaille <akim@epita.fr>
10541
aa5fd0ee
AD
10542 * src/reader.c (copy_string): Declare `static inline'. No
10543 problems with inline, since it is checked by configure.
4dc58e7c
AD
10544 (copy_comment): Likewise.
10545
0a6384c4
AD
105462000-03-17 Akim Demaille <akim@epita.fr>
10547
aa5fd0ee 10548 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 10549
3cef001a
AD
105502000-03-17 Akim Demaille <akim@epita.fr>
10551
aa5fd0ee 10552 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
10553 (copy_action): Use it. Removed now unused `match', `ended',
10554 `cplus_comment'.
10555 (copy_guard): Likewise.
10556
ca36d2ef
AD
105572000-03-17 Akim Demaille <akim@epita.fr>
10558
aa5fd0ee 10559 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
10560 (copy_action): Use it.
10561 (copy_guard): Likewise.
10562
6666f98f
AD
105632000-03-17 Akim Demaille <akim@epita.fr>
10564
10565 Change the handling of @s so that they behave exactly like $s.
10566 There is now a pseudo variable @$ (readble and writable), location
10567 of the lhs of the rule (by default ranging from the location of
10568 the first symbol of the rhs, to the location of the last symbol,
10569 or, if the rhs is empty, YYLLOC).
10570
10571 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
10572 yyval.
10573 (yyparse): When providing a default semantic action, provide a
10574 default location action.
10575 (after the $): No longer change `*YYLSP', just stack YYLOC the
10576 same way you stack YYVAL.
10577 * src/reader.c (read_declarations): Use warns.
10578 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
10579 (copy_action, case '@'): Likewise.
10580 Use a standard error message, to save useless work from
10581 translators.
10582
41aca2e0
AD
105832000-03-17 Akim Demaille <akim@epita.fr>
10584
aa5fd0ee
AD
10585 * src/bison.s1: Formatting and cosmetics changes.
10586 * src/reader.c: Likewise.
41aca2e0
AD
10587 Update the Copyright notice.
10588
dc08c1d5
AD
105892000-03-17 Akim Demaille <akim@epita.fr>
10590
aa5fd0ee
AD
10591 * src/bison.s1 (#line): All set to `#line' only, since the
10592 Makefile now handles them.
dc08c1d5 10593
9ee3c97b
AD
105942000-03-16 Akim Demaille <akim@epita.fr>
10595
10596 * src/output.c (output_rule_data): Output the documentation of
10597 some of the tables.
10598 (Copyright notice): Update.
10599 Formatting changes.
10600
0de741ca
AD
106012000-03-16 Akim Demaille <akim@epita.fr>
10602
10603 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
10604 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
10605 One `#if YYDEBUG' remains, since it uses variables which are
10606 defined only if `YYDEBUG != 0'.
10607
bb10be54
AD
106082000-03-16 Akim Demaille <akim@epita.fr>
10609
10610 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
10611 and related variables so that the similarities are highlighted.
10612
b07b484a
AD
106132000-03-16 Akim Demaille <akim@epita.fr>
10614
10615 * src/bison.s1: Properly indent CPP directives.
10616
361f60b3
AD
106172000-03-16 Akim Demaille <akim@epita.fr>
10618
10619 * src/bison.s1: Properly indent the `alloca' CPP section.
10620
8c44d3ec
AD
106212000-03-16 Akim Demaille <akim@epita.fr>
10622
10623 Do not hard code values of directories in `configure.in'.
10624 Update the `configure' tool chain.
10625
10626 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
10627 src/makefile.am.
10628 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
10629 (AC_OUTPUT): Add m4/Makefile.
10630 Bump to bison 1.28a, 1.29 has never been released.
10631 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
10632 handled via src/Makefile.am.
10633 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
10634 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
10635 autoheader.
10636 * Makefile.am (SUBDIRS): Add m4.
10637 (ACLOCAL_AM_FLAGS): New variable.
10638 (AUTOMAKE_OPTIONS): Add check-news.
10639 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
10640 the proper line number and file name.
10641 (DEFS): Propagate the location of bison library files and of the
10642 locale files.
10643 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
10644 builddir.
10645 * acinclude.m4: Remove, replaced by the directory m4.
10646 * m4/Makefile.am (EXTRA_DIST): New variable.
10647 * m4/gettext.m4: New file, from the fileutils.
10648 * m4/lcmessage.m4: Likewise
10649 * m4/progtest.m4: Likewise.
10650 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
10651
f95997e7
AD
106522000-03-10 Akim Demaille <akim@epita.fr>
10653
10654 * src/closure.c:
10655 Formatting changes of various comments.
10656 Respect the GNU coding standards at various places.
10657 Don't use `_()' when no translation is needed.
10658
106591999-12-13 Jesse Thilo <jthilo@gnu.org>
10660
10661 * src/files.c:
10662 OS/2 honors TMPDIR environment variable.
10663
106641999-12-13 Jesse Thilo <jthilo@gnu.org>
10665
10666 * doc/bison.texinfo: Tweaked spelling and grammar.
10667 Updated ISBN.
10668 Removed reference to price of printed copy.
10669 Mention BISON_SIMPLE and BISON_HAIRY.
10670
106711999-12-13 Jesse Thilo <jthilo@gnu.org>
10672
10673 * configure.in, NEWS:
10674 Bison 1.29 released.
10675
106761999-10-27 Jesse Thilo <jthilo@gnu.org>
10677
10678 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
10679 Added reference card.
10680
106811999-07-26 Jesse Thilo <jthilo@gnu.org>
10682
10683 * po/ru.po: Added Russian translation.
10684
106851999-07-26 Jesse Thilo <jthilo@gnu.org>
10686
10687 * configure.in: Added Russian translation.
10688
106891999-07-06 Jesse Thilo <jthilo@gnu.org>
10690
10691 * configure.in, NEWS, README:
10692 Released version 1.28.
10693
106941999-06-14 Jesse Thilo <jthilo@gnu.org>
10695
10696 * src/system.h:
10697 Squashed redefinition warning on some systems.
10698
10699 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
10700 Have configure build version string instead of relying on ANSI string
10701 concatentation.
10702
107031999-06-14 Jesse Thilo <jthilo@gnu.org>
10704
10705 * po/POTFILES.in: Got rid of version.c.
10706
107071999-06-14 Jesse Thilo <jthilo@gnu.org>
10708
10709 * acconfig.h, configure.in:
10710 Have configure build version string instead of relying on ANSI string
10711 concatentation.
10712
107131999-06-08 Jesse Thilo <jthilo@gnu.org>
10714
10715 * doc/bison.1:
10716 Dropped mention of `+' for long-named options.
10717
107181999-05-30 Jesse Thilo <jthilo@gnu.org>
10719
10720 * src/files.c: Added <unistd.h> for unlink().
10721
10722 * src/Makefile.am, src/system.h:
10723 I18n fixes.
10724
107251999-05-30 Jesse Thilo <jthilo@gnu.org>
10726
10727 * README: Added a FAQ list.
10728
10729 * configure.in, acconfig.h:
10730 I18n fixes.
10731
107321999-05-30 Jesse Thilo <jthilo@gnu.org>
10733
10734 * doc/FAQ, doc/Makefile.am:
10735 Added a FAQ list.
10736
107371999-05-19 Jesse Thilo <jthilo@gnu.org>
10738
10739 * src/alloc.h, src/symtab.h, src/version.c:
10740 Protected inclusion of "config.h" with HAVE_CONFIG_H.
10741
107421999-04-18 Jesse Thilo <jthilo@gnu.org>
10743
10744 * src/.cvsignore, src/Makefile.am:
10745 Reorganized: sources in `src', documentation in `doc'.
10746
10747 * src/lex.c (literalchar):
10748 fixed the code for escaping double quotes (thanks
10749 Jonathan Czisny.)
10750
107511999-04-18 Jesse Thilo <jthilo@gnu.org>
10752
10753 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
10754 Adjusted paths to reflect directory reorganization.
10755
107561999-04-18 Jesse Thilo <jthilo@gnu.org>
10757
10758 * doc/.cvsignore, doc/Makefile.am:
10759 Reorganized: sources in `src', documentation in `doc'.
10760
107611999-04-18 Jesse Thilo <jthilo@gnu.org>
10762
10763 * configure.in:
10764 Updated AC_INIT file to reflect directory reorganization.
10765
10766 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
10767 Reorganized: sources in `src', documentation in `doc'.
10768
107691999-04-13 Jesse Thilo <jthilo@gnu.org>
10770
10771 * src/allocate.c:
10772 Don't declare calloc() and realloc() if not necessary.
10773
107741999-04-13 Jesse Thilo <jthilo@gnu.org>
10775
10776 * configure.in, acconfig.h, acinclude.m4:
10777 Don't declare calloc() and realloc() if not necessary.
10778
107791999-03-23 Jesse Thilo <jthilo@gnu.org>
10780
10781 * po/.cvsignore: Added i18n support.
10782
107831999-03-23 Jesse Thilo <jthilo@gnu.org>
10784
10785 * acconfig.h, configure.in, Makefile.am:
10786 Added i18n support.
10787
107881999-03-22 Jesse Thilo <jthilo@gnu.org>
10789
10790 * src/bison.s1: Fixed #line numbers.
10791
107921999-03-15 Jesse Thilo <jthilo@gnu.org>
10793
10794 * po/es.po, po/fr.po, po/nl.po, po/de.po:
10795 Added PO files from Translation Project.
10796
107971999-03-03 Jesse Thilo <jthilo@gnu.org>
10798
10799 * Makefile.am:
10800 Added support for non-ANSI compilers (ansi2knr).
10801
108021999-02-16 Jesse Thilo <jthilo@gnu.org>
10803
10804 * configure.in: Bumped version number to 1.27.
10805
10806 * Makefile.am:
10807 Added `bison.simple' to list of files removed by `make distclean'.
10808
108091999-02-12 Jesse Thilo <jthilo@gnu.org>
10810
10811 * src/files.c, src/files.h:
10812 Defined locations of parser files in config.h instead of Makefile.
10813
108141999-02-12 Jesse Thilo <jthilo@gnu.org>
10815
10816 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
10817 Defined locations of parser files in config.h instead of Makefile.
10818
108191999-02-09 Jesse Thilo <jthilo@gnu.org>
10820
10821 * Makefile.am:
10822 Removed inappropriate use of $< macro.
10823
108241999-02-05 Jesse Thilo <jthilo@gnu.org>
10825
10826 * po/Makefile.in.in, po/POTFILES.in:
10827 Add `po' directory skeleton.
10828
108291999-01-27 Jesse Thilo <jthilo@gnu.org>
10830
10831 * README: Document help-bison list.
10832
10833 * configure.in: Add check for mkstemp().
10834
108351999-01-20 Jesse Thilo <jthilo@gnu.org>
10836
10837 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
10838 Hush a few compiler warnings.
10839
10840 * src/files.c:
10841 Add tryclose(), which verifies that fclose was successful.
10842 Hush a couple of compiler warnings.
10843
108441999-01-20 Jesse Thilo <jthilo@gnu.org>
10845
10846 * Makefile.am, OChangeLog:
10847 ChangeLog is now automatically generated. Include the old version as
10848 OChangeLog.
10849
108501999-01-14 Jesse Thilo <jthilo@gnu.org>
10851
10852 * 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:
10853 Update FSF address.
10854
108551999-01-14 Jesse Thilo <jthilo@gnu.org>
10856
10857 * doc/bison.texinfo: Fix formatting glitch.
10858
10859 * doc/bison.texinfo: Update FSF address.
10860
108611999-01-14 Jesse Thilo <jthilo@gnu.org>
10862
10863 * acconfig.h: Update FSF address.
10864
108651999-01-08 Jesse Thilo <jthilo@gnu.org>
10866
10867 * src/system.h:
10868 Don't define PACKAGE here, since config.h defines it.
10869
108701998-12-30 Jesse Thilo <jthilo@gnu.org>
10871
10872 * src/reader.c: Update copyright date.
10873
10874 * src/main.c:
10875 Ditch sprintf to statically-sized buffers in fatal/warn functions in
10876 favor of output directly to stderr (avoids buffer overruns).
10877
10878 * src/reader.c: Some checks for premature EOF.
10879
10880 * 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:
10881 Use prototypes if the compiler understands them.
10882
10883 * src/files.c: Honor TMPDIR on Unix hosts.
10884 Use prototypes if the compiler understands them.
10885
10886 * src/reader.c:
10887 Fix a couple of buffer overrun bugs.
10888 Use prototypes if the compiler understands them.
10889
10890 * src/system.h: Include unistd.h and ctype.h.
10891 Use #ifdef instead of #if for NLS symbols.
10892
108931998-12-30 Jesse Thilo <jthilo@gnu.org>
10894
10895 * doc/bison.texinfo:
10896 Delete comment "consider using @set for edition number, etc..." since
10897 we now are doing so.
10898
108991998-12-30 Jesse Thilo <jthilo@gnu.org>
10900
10901 * configure.in:
10902 Use prototypes if the compiler understands them.
10903
10904 * NEWS: Document 1.26 highlights.
10905
10906 * Makefile.am: Require Automake 1.3 or later.
10907
10908 * acconfig.h:
10909 Use prototypes if the compiler understands them.
10910
109111998-12-29 Jesse Thilo <jthilo@gnu.org>
10912
10913 * src/version.c:
10914 Use VERSION symbol from automake for version number.
10915
109161998-12-29 Jesse Thilo <jthilo@gnu.org>
10917
10918 * acconfig.h, configure.in, version.cin:
10919 Use VERSION symbol from automake for version number.
10920
109211998-11-28 Jesse Thilo <jthilo@gnu.org>
10922
10923 * Makefile.am:
10924 Distribute original version of simple parser (bison.s1), not built
10925 version (bison.simple).
10926
109271998-11-28 Jesse Thilo <jthilo@gnu.org>
10928
10929 * doc/bison.texinfo: Add info dir entry.
10930
10931 * doc/bison.texinfo:
10932 Let automake put version number into documentation.
10933
109341998-11-26 Jesse Thilo <jthilo@gnu.org>
10935
10936 * src/bison.cld, src/build.com, src/vmshlp.mar:
10937 Add non-RCS files from /gd/gnu/bison.
10938
109391998-11-26 Jesse Thilo <jthilo@gnu.org>
10940
10941 * doc/bison.1:
10942 Document the BISON_HAIRY and BISON_SIMPLE variables.
10943
109441998-11-25 Jesse Thilo <jthilo@gnu.org>
10945
10946 * src/version.c: Build version.c automatically.
10947
10948 * src/reader.c:
10949 Fix token numbering (used to start at 258, not 257).
10950
10951 * src/system.h: Include config.h.
10952
10953 * src/getargs.c: Update bug report address.
10954
10955 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
10956 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
10957
109581998-11-25 Jesse Thilo <jthilo@gnu.org>
10959
10960 * Makefile.am:
10961 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
10962
10963 * configure.in, version.cin:
10964 Build version.c automatically.
10965
10966 * AUTHORS: Add AUTHORS file.
10967
10968 * README: Update bug report address.
10969
10970 * bison.simple:
10971 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
10972
10973 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
10974 Add automake stuff.
10975
109761998-11-25 Jesse Thilo <jthilo@gnu.org>
10977
10978 * doc/bison.texinfo: Clean up some formatting.
10979
109801998-05-05 Richard Stallman <rms@gnu.org>
10981
10982 * doc/bison.texinfo:
10983 Explain better why to make a pure parser.
10984
109851998-01-05 Richard Stallman <rms@gnu.org>
10986
10987 * src/files.c (openfiles):
10988 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
10989 find a temporary directory, if possible. Do not unlink files while
10990 they are open.
10991
109921997-08-25 Richard Stallman <rms@gnu.org>
10993
10994 * src/reader.c (stack_offset;):
10995 Change some warni to warns.
10996
10997 * src/lex.c (literalchar): Use warns, not warni.
10998
109991997-06-28 Richard Stallman <rms@gnu.org>
11000
11001 * src/bison.s1: Add a Bison version comment.
11002
11003 * src/main.c (fatal, warn, berror):
11004 Use program_name.
11005
110061997-06-28 Richard Stallman <rms@gnu.org>
11007
11008 * Makefile.in (bison_version): New variable.
11009 (dist): Use that variable.
11010 (bison.s1): Substitute the Bison version into bison.simple.
11011
11012 * bison.simple: Add a Bison version comment.
11013
110141997-06-18 Richard Stallman <rms@gnu.org>
11015
11016 * src/main.c (fatal, warn, berror):
11017 Make error messages standard.
11018 (toomany): Improve error message text.
11019
11020 * 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:
11021 new.h renamed to alloc.h.
11022
110231997-06-18 Richard Stallman <rms@gnu.org>
11024
11025 * Makefile.in: new.h renamed to alloc.h.
11026
110271997-05-24 Richard Stallman <rms@gnu.org>
11028
11029 * src/lex.c (literalchar):
11030 Fix the code for escaping \, " and '.
11031
11032 (lex): Avoid trouble when there are many chars
11033 to discard in a char literal with just several chars in it.
11034
110351997-05-17 Richard Stallman <rms@gnu.org>
11036
11037 * src/bison.s1:
11038 Use malloc, if using alloca is troublesome.
11039 (YYSTACK_USE_ALLOCA): New flag macro.
11040 Define it for some systems and compilers.
11041 (YYSTACK_ALLOC): New macro.
11042 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11043 If it was malloc'd, free it.
11044
110451997-05-17 Richard Stallman <rms@gnu.org>
11046
11047 * bison.simple:
11048 Use malloc, if using alloca is troublesome.
11049 (YYSTACK_USE_ALLOCA): New flag macro.
11050 Define it for some systems and compilers.
11051 (YYSTACK_ALLOC): New macro.
11052 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11053 If it was malloc'd, free it.
11054
110551997-04-23 Richard Stallman <rms@gnu.org>
11056
11057 * src/bison.s1:
11058 (alloca) [__hpux]: Always define as __builtin_alloca.
11059
110601997-04-23 Richard Stallman <rms@gnu.org>
11061
11062 * bison.simple:
11063 (alloca) [__hpux]: Always define as __builtin_alloca.
11064
110651997-04-22 Richard Stallman <rms@gnu.org>
11066
11067 * src/bison.s1:
11068 [__hpux]: Include alloca.h (right for HPUX 10)
11069 instead of declaring alloca (right for HPUX 9).
11070
11071 * src/bison.s1 (__yy_memcpy):
11072 Declare arg `count' as unsigned int.
11073 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11074
110751997-04-22 Richard Stallman <rms@gnu.org>
11076
11077 * bison.simple:
11078 [__hpux]: Include alloca.h (right for HPUX 10)
11079 instead of declaring alloca (right for HPUX 9).
11080
11081 * bison.simple (__yy_memcpy):
11082 Declare arg `count' as unsigned int.
11083 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11084
110851997-01-03 Richard Stallman <rms@gnu.org>
11086
11087 * src/allocate.c: [__STDC__ or _MSC_VER]:
11088 Declare calloc and realloc to return void *.
11089
110901997-01-02 Richard Stallman <rms@gnu.org>
11091
11092 * src/system.h:
11093 [_MSC_VER]: Include stdlib.h and process.h.
11094 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
11095
11096 * src/main.c (main): Return FAILURE as a value.
11097 (printable_version): Declare arg as int, not char.
11098
110991997-01-02 Richard Stallman <rms@gnu.org>
11100
11101 * Makefile.in (dist):
11102 Explicitly check for symlinks, and copy them.
11103
111041996-12-19 Richard Stallman <rms@gnu.org>
11105
11106 * src/files.c:
11107 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
11108
111091996-12-18 Paul Eggert <eggert@gnu.org>
11110
11111 * src/bison.s1 (yyparse):
11112 If __GNUC__ and YYPARSE_PARAM are both defined,
11113 declare yyparse to have a void * argument.
11114
111151996-12-18 Paul Eggert <eggert@gnu.org>
11116
11117 * bison.simple (yyparse):
11118 If __GNUC__ and YYPARSE_PARAM are both defined,
11119 declare yyparse to have a void * argument.
11120
111211996-12-17 Richard Stallman <rms@gnu.org>
11122
11123 * src/reduce.c (nbits): Add some casts.
11124
111251996-08-12 Richard Stallman <rms@gnu.org>
11126
11127 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
11128
111291996-08-12 Richard Stallman <rms@gnu.org>
11130
11131 * bison.simple: Test _MSDOS as well as _MSDOS_.
11132
111331996-07-31 Richard Stallman <rms@gnu.org>
11134
11135 * src/bison.s1:
11136 [__sun && __i386]: Include alloca.h.
11137
111381996-07-31 Richard Stallman <rms@gnu.org>
11139
11140 * bison.simple:
11141 [__sun && __i386]: Include alloca.h.
11142
111431996-07-30 Richard Stallman <rms@gnu.org>
11144
11145 * src/bison.s1: Comment change.
11146
11147 * src/bison.s1: Test _MSDOS_, not MSDOS.
11148
111491996-07-30 Richard Stallman <rms@gnu.org>
11150
11151 * bison.simple: Comment change.
11152
11153 * bison.simple: Test _MSDOS_, not MSDOS.
11154
111551996-06-01 Richard Stallman <rms@gnu.org>
11156
11157 * 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:
11158 Insert `_' macro around many string constants.
11159
11160 * src/main.c:
11161 Insert `_' macro around many string constants.
11162
11163 (main): Call setlocale, bindtextdomain and textdomain.
11164
11165 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
11166 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
11167 [ENABLE_NLS]: Include libintl.h.
11168 [ENABLE_NLS] (gettext): Define.
11169 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
11170 (N_, PACKAGE, LOCALEDIR): New macros.
11171
111721996-06-01 Richard Stallman <rms@gnu.org>
11173
11174 * POTFILES.in: New file.
11175
11176 * Makefile.in (allocate.o):
11177 Define target explicitly.
11178
11179 * Makefile.in (CFLAGS): Set to @CFLAGS@.
11180 (LDFLAGS): Set to @LDFLAGS@.
11181 (configure): Run autoconf only if preceding `cd' succeeds.
11182 (bison.s1): Redirect output to temporary file then move the
11183 temporary to the target, rather than redirecting directly to bison.s1.
11184 (clean): Remove config.status and config.log.
11185 (distclean): Don't remove config.status here.
11186
111871996-05-12 Richard Stallman <rms@gnu.org>
11188
11189 * src/bison.s1:
11190 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11191
111921996-05-12 Richard Stallman <rms@gnu.org>
11193
11194 * bison.simple:
11195 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11196
111971996-05-11 Richard Stallman <rms@gnu.org>
11198
11199 * src/bison.s1 (__yy_memcpy):
11200 Really reorder the args, as was supposedly done on Feb 14 1995.
11201 (yyparse): Calls changed accordingly.
11202
112031996-05-11 Richard Stallman <rms@gnu.org>
11204
11205 * Makefile.in (dist): Don't use $(srcdir).
11206
11207 * bison.simple (__yy_memcpy):
11208 Really reorder the args, as was supposedly done on Feb 14 1995.
11209 (yyparse): Calls changed accordingly.
11210
112111996-01-27 Richard Stallman <rms@gnu.org>
11212
11213 * src/output.c (output_rule_data):
11214 Test YYERROR_VERBOSE in the conditional
11215 around the definition of ttyname.
11216
112171995-12-29 Richard Stallman <rms@gnu.org>
11218
11219 * src/bison.s1:
11220 Fix line numbers in #line commands.
11221
112221995-12-29 Richard Stallman <rms@gnu.org>
11223
11224 * bison.simple:
11225 Fix line numbers in #line commands.
11226
112271995-12-27 Richard Stallman <rms@gnu.org>
11228
11229 * src/bison.s1 (YYPARSE_PARAM_DECL):
11230 In C++, make it always null.
11231 (YYPARSE_PARAM_ARG): New macro.
11232 (yyparse): Use YYPARSE_PARAM_ARG.
11233
112341995-12-27 Richard Stallman <rms@gnu.org>
11235
11236 * bison.simple (YYPARSE_PARAM_DECL):
11237 In C++, make it always null.
11238 (YYPARSE_PARAM_ARG): New macro.
11239 (yyparse): Use YYPARSE_PARAM_ARG.
11240
112411995-11-29 Richard Stallman <rms@gnu.org>
11242
11243 * doc/bison.texinfo:
11244 Describe literal string tokens, %raw, %no_lines, %token_table.
11245
112461995-11-29 Daniel Hagerty <hag@gnu.org>
11247
11248 * doc/bison.texinfo: Fixed update date
11249
112501995-10-16 Richard Stallman <rms@gnu.org>
11251
11252 * src/version.c: Version 1.25.
11253
112541995-10-16 Richard Stallman <rms@gnu.org>
11255
11256 * NEWS: *** empty log message ***
11257
112581995-10-16 Richard Stallman <rms@gnu.org>
11259
11260 * doc/bison.1, doc/bison.rnh:
11261 Add new options.
11262
112631995-10-15 Richard Stallman <rms@gnu.org>
11264
11265 * src/vmsgetargs.c, src/getargs.c:
11266 Added -n, -k, and -raw switches.
11267 (noparserflag, toknumflag, rawtoknumflag): New variables.
11268
11269 * src/symtab.h (SALIAS):
11270 New #define for adding aliases to %token.
11271 (struct bucket): Added `alias' field.
11272
11273 * src/reduce.c (reduce_grammar):
11274 Revise error message.
11275 (print_notices): Remove final `.' from error message.
11276
11277 * src/reader.c (reader_output_yylsp):
11278 New function.
11279 (readgram): Use `#if 0' around code that accepted %command
11280 inside grammar rules: The documentation doesn't allow it,
11281 and it will fail since the %command processors scan for the next %.
11282 (parse_token_decl): Extended the %token
11283 declaration to allow a multi-character symbol as an alias.
11284 (parse_thong_decl): New function.
11285 (read_declarations): Added %thong declarations.
11286 (read_declarations): Handle NOOP to deal with allowing
11287 % declarations as another means to specify the flags.
11288 (readgram): Allow %prec prior to semantics embedded in a rule.
11289 (skip_to_char, read_declarations, copy_definition)
11290 (parse_token_decl, parse_start_decl, parse_type_decl)
11291 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
11292 (get_type_name, copy_guard, copy_action, readgram)
11293 (get_type, packsymbols): Revised most error messages.
11294 Changed `fatal' to `warnxxx' to avoid aborting for error.
11295 Revised and use multiple warnxxx functions to avoid using VARARGS1.
11296 (read_declarations): Improve the error message for
11297 an invalid character. Do not abort.
11298 (read_declarations, copy_guard, copy_action): Use
11299 printable_version to avoid unprintable characters in printed output.
11300 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
11301 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
11302 Allow the type of a non-terminal can be given
11303 more than once, as long as all specifications give the same type.
11304
11305 * src/output.c:
11306 (output_headers, output_trailers, output, output_gram)
11307 (output_rule_data): Implement noparserflag variable.
11308 Implement toknumflag variable.
11309 (output): Call reader_output_yylsp to output LTYPESTR.
11310
11311 * src/main.c (main):
11312 If reader sees an error, don't process the grammar.
11313 (fatals): Updated to not use VARARGS1.
11314 (printable_version, int_to_string, warn, warni, warns, warnss)
11315 (warnsss): New error reporting functions. Avoid abort for error.
11316
11317 * src/lex.h:
11318 Added THONG and NOOP for alias processing.
11319 Added SETOPT for the new code that allows setting options with %flags.
11320
11321 * src/lex.c:
11322 Include getopt.h. Add some extern decls.
11323 (safegetc): New function to deal with EOF gracefully.
11324 (literalchar); new function to deal with reading \ escapes.
11325 (lex): Use literalchar.
11326 (lex): Implemented "..." tokens.
11327 (literalchar, lex, parse_percent_token): Made tokenbuffer
11328 always contain the token. This includes growing the token
11329 buffer while reading an integer.
11330 (parse_percent_token): Replaced if-else statement with percent_table.
11331 (parse_percent_token): Added % declarations as another
11332 way to specify the flags -n, -l, and -r. Also added hooks for
11333 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
11334 major changes to files.c.
11335 (lex) Retain in the incoming stream a character following
11336 an incorrect '/'.
11337 (skip_white_space, lex): Revised most error messages
11338 and changed fatal to warn to avoid aborting.
11339 (percent_table): Added %thong declarations.
11340
11341 * src/gram.h: Comment changes.
11342
11343 * src/files.c (openfiles, open_extra_files, done):
11344 Add faction flag
11345 and actfile file. Handle noparserflag. Both for -n switch.
11346
11347 * src/conflicts.c (resolve_sr_conflict):
11348 Remove use of alloca.
11349
113501995-06-01 Jim Meyering <meyering@gnu.org>
11351
11352 * doc/bison.texinfo: *** empty log message ***
11353
113541995-05-06 Richard Stallman <rms@gnu.org>
11355
11356 * src/bison.s1: Comment change.
11357
113581995-05-06 Richard Stallman <rms@gnu.org>
11359
11360 * bison.simple: Comment change.
11361
113621995-05-03 Richard Stallman <rms@gnu.org>
11363
11364 * src/version.c: Version now 1.24.
11365
11366 * src/bison.s1: Change distribution terms.
11367
11368 * src/version.c: Version now 1.23.
11369
113701995-05-03 Richard Stallman <rms@gnu.org>
11371
11372 * doc/bison.texinfo:
11373 Rewrite "Conditions for Using Bison".
11374 Update version to 1.24.
11375
113761995-05-03 Richard Stallman <rms@gnu.org>
11377
11378 * bison.simple: Change distribution terms.
11379
113801995-02-23 Richard Stallman <rms@gnu.org>
11381
11382 * src/files.c: Test __VMS_POSIX as well as VMS.
11383
113841995-02-14 Jim Meyering <meyering@gnu.org>
11385
11386 * src/bison.s1 (__yy_memcpy):
11387 Renamed from __yy_bcopy to avoid
11388 confusion. Reverse FROM and TO arguments to be consistent with
11389 those of memcpy.
11390
113911995-02-14 Jim Meyering <meyering@gnu.org>
11392
11393 * bison.simple (__yy_memcpy):
11394 Renamed from __yy_bcopy to avoid
11395 confusion. Reverse FROM and TO arguments to be consistent with
11396 those of memcpy.
11397
113981994-11-10 David J. MacKenzie <djm@gnu.org>
11399
11400 * NEWS: reformat
11401
11402 * NEWS: New file.
11403
11404 * Makefile.in (DISTFILES): Include NEWS.
11405
11406 * Makefile.in (DISTFILES):
11407 Include install-sh, not install.sh.
11408
11409 * configure.in: Update to Autoconf v2 macro names.
11410
114111994-10-05 David J. MacKenzie <djm@gnu.org>
11412
11413 * Makefile.in: fix typo
11414
11415 * Makefile.in (prefix, exec_prefix):
11416 Let configure set them.
11417
114181994-09-28 David J. MacKenzie <djm@gnu.org>
11419
11420 * Makefile.in: Set datadir to $(prefix)/share.
11421
114221994-09-15 Richard Stallman <rms@gnu.org>
11423
11424 * src/bison.s1:
11425 Update copyright notice and GPL version.
11426
114271994-09-15 Richard Stallman <rms@gnu.org>
11428
11429 * bison.simple:
11430 Update copyright notice and GPL version.
11431
114321994-07-12 Richard Stallman <rms@gnu.org>
11433
11434 * src/reduce.c, src/reader.c:
11435 entered into RCS
11436
114371994-05-05 David J. MacKenzie <djm@gnu.org>
11438
11439 * Makefile.in: entered into RCS
11440
114411994-03-26 Richard Stallman <rms@gnu.org>
11442
11443 * src/bison.s1: entered into RCS
11444
114451994-03-26 Richard Stallman <rms@gnu.org>
11446
11447 * bison.simple: entered into RCS
11448
114491994-03-25 Richard Stallman <rms@gnu.org>
11450
11451 * src/main.c: entered into RCS
11452
114531994-03-24 Richard Stallman <rms@gnu.org>
11454
11455 * src/conflicts.c: entered into RCS
11456
114571994-01-02 Richard Stallman <rms@gnu.org>
11458
11459 * Makefile.in: *** empty log message ***
11460
114611993-11-21 Richard Stallman <rms@gnu.org>
11462
11463 * src/bison.s1: *** empty log message ***
11464
114651993-11-21 Richard Stallman <rms@gnu.org>
11466
11467 * doc/bison.texinfo: entered into RCS
11468
11469 * doc/bison.texinfo: *** empty log message ***
11470
114711993-11-21 Richard Stallman <rms@gnu.org>
11472
11473 * bison.simple: *** empty log message ***
11474
114751993-10-25 David J. MacKenzie <djm@gnu.org>
11476
11477 * doc/bison.texinfo: *** empty log message ***
11478
114791993-10-19 Richard Stallman <rms@gnu.org>
11480
11481 * src/bison.s1: *** empty log message ***
11482
114831993-10-19 Richard Stallman <rms@gnu.org>
11484
11485 * bison.simple: *** empty log message ***
11486
114871993-10-14 Richard Stallman <rms@gnu.org>
11488
11489 * src/bison.s1: *** empty log message ***
11490
114911993-10-14 Richard Stallman <rms@gnu.org>
11492
11493 * bison.simple: *** empty log message ***
11494
114951993-09-14 David J. MacKenzie <djm@gnu.org>
11496
11497 * doc/bison.texinfo: *** empty log message ***
11498
114991993-09-13 Noah Friedman <friedman@gnu.org>
11500
11501 * Makefile.in: *** empty log message ***
11502
115031993-09-10 Richard Stallman <rms@gnu.org>
11504
11505 * src/conflicts.c: *** empty log message ***
11506
11507 * src/system.h: entered into RCS
11508
115091993-09-10 Richard Stallman <rms@gnu.org>
11510
11511 * doc/bison.1: entered into RCS
11512
115131993-09-06 Noah Friedman <friedman@gnu.org>
11514
11515 * src/version.c: entered into RCS
11516
115171993-09-06 Noah Friedman <friedman@gnu.org>
11518
11519 * Makefile.in: *** empty log message ***
11520
115211993-07-30 David J. MacKenzie <djm@gnu.org>
11522
11523 * Makefile.in: *** empty log message ***
11524
115251993-07-24 Richard Stallman <rms@gnu.org>
11526
11527 * src/bison.s1: *** empty log message ***
11528
115291993-07-24 Richard Stallman <rms@gnu.org>
11530
11531 * bison.simple: *** empty log message ***
11532
115331993-07-08 David J. MacKenzie <djm@gnu.org>
11534
11535 * Makefile.in: *** empty log message ***
11536
115371993-07-04 Richard Stallman <rms@gnu.org>
11538
11539 * src/bison.s1: *** empty log message ***
11540
115411993-07-04 Richard Stallman <rms@gnu.org>
11542
11543 * bison.simple: *** empty log message ***
11544
115451993-06-26 David J. MacKenzie <djm@gnu.org>
11546
11547 * src/getargs.c: entered into RCS
11548
115491993-06-26 David J. MacKenzie <djm@gnu.org>
11550
11551 * doc/bison.texinfo: *** empty log message ***
11552
11553 * doc/bison.1: New file.
11554
115551993-06-25 Richard Stallman <rms@gnu.org>
11556
11557 * src/getargs.c: New file.
11558
115591993-06-16 Richard Stallman <rms@gnu.org>
11560
11561 * src/bison.s1: *** empty log message ***
11562
115631993-06-16 Richard Stallman <rms@gnu.org>
11564
11565 * bison.simple: *** empty log message ***
11566
115671993-06-03 Richard Stallman <rms@gnu.org>
11568
11569 * src/bison.s1: New file.
11570
115711993-06-03 Richard Stallman <rms@gnu.org>
11572
11573 * doc/bison.texinfo: *** empty log message ***
11574
115751993-06-03 Richard Stallman <rms@gnu.org>
11576
11577 * bison.simple: New file.
11578
115791993-05-19 Richard Stallman <rms@gnu.org>
11580
11581 * doc/bison.texinfo: New file.
11582
115831993-05-07 Noah Friedman <friedman@gnu.org>
11584
11585 * Makefile.in: *** empty log message ***
11586
115871993-04-28 Noah Friedman <friedman@gnu.org>
11588
11589 * src/reader.c: *** empty log message ***
11590
115911993-04-23 Noah Friedman <friedman@gnu.org>
11592
11593 * src/alloc.h: entered into RCS
11594
115951993-04-20 David J. MacKenzie <djm@gnu.org>
11596
11597 * src/version.c: *** empty log message ***
11598
11599 * src/files.c, src/allocate.c:
11600 entered into RCS
11601
11602 * src/reader.c: *** empty log message ***
11603
11604 * src/lex.c: entered into RCS
11605
11606 * src/conflicts.c: New file.
11607
11608 * src/symtab.c: entered into RCS
11609
11610 * src/alloc.h: New file.
11611
11612 * src/LR0.c: entered into RCS
11613
116141993-04-18 Noah Friedman <friedman@gnu.org>
11615
11616 * src/reader.c: New file.
11617
11618 * src/version.c: *** empty log message ***
11619
116201993-04-18 Noah Friedman <friedman@gnu.org>
11621
11622 * Makefile.in: *** empty log message ***
11623
116241993-04-17 Noah Friedman <friedman@gnu.org>
11625
11626 * Makefile.in: *** empty log message ***
11627
116281993-04-15 Richard Stallman <rms@gnu.org>
11629
11630 * src/main.c, src/files.c:
11631 New file.
11632
116331993-04-15 Noah Friedman <friedman@gnu.org>
11634
11635 * configure.in: entered into RCS
11636
11637 * configure.in: *** empty log message ***
11638
11639 * configure.in: New file.
11640
116411993-04-14 Richard Stallman <rms@gnu.org>
11642
11643 * Makefile.in: New file.
11644
116451993-04-13 Richard Stallman <rms@gnu.org>
11646
11647 * src/version.c: New file.
11648
116491993-03-25 Richard Stallman <rms@gnu.org>
11650
11651 * src/output.c: entered into RCS
11652
116531992-09-25 Richard Stallman <rms@gnu.org>
11654
11655 * configure.bat: entered into RCS
11656
116571992-06-22 Richard Stallman <rms@gnu.org>
11658
11659 * src/vmsgetargs.c: entered into RCS
11660
116611992-06-22 Richard Stallman <rms@gnu.org>
11662
11663 * doc/bison.rnh: entered into RCS
11664
116651992-04-20 David J. MacKenzie <djm@gnu.org>
11666
11667 * README: entered into RCS
11668
116691992-01-22 Richard Stallman <rms@gnu.org>
11670
11671 * src/machine.h: entered into RCS
11672
116731991-12-21 Richard Stallman <rms@gnu.org>
11674
11675 * src/lalr.c, src/closure.c:
11676 entered into RCS
11677
116781991-12-20 Richard Stallman <rms@gnu.org>
11679
11680 * src/state.h: entered into RCS
11681
116821991-12-18 Richard Stallman <rms@gnu.org>
11683
11684 * src/print.c, src/nullable.c, src/derives.c:
11685 entered into RCS
11686
116871991-11-03 David J. MacKenzie <djm@gnu.org>
11688
11689 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
11690 entered into RCS
11691
116921988-09-09 Richard Stallman <rms@gnu.org>
11693
11694 * src/bison.hairy: entered into RCS
11695
116961987-12-16 Richard Stallman <rms@gnu.org>
11697
11698 * REFERENCES: entered into RCS
dc546b0f 11699
f294a2c2
AD
11700-----
11701
33167b8b 11702Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
dc546b0f 117031998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
f294a2c2 11704
33167b8b 11705This file is part of Bison, the GNU Compiler Compiler.
f294a2c2 11706
33167b8b 11707Bison is free software; you can redistribute it and/or modify
f294a2c2
AD
11708it under the terms of the GNU General Public License as published by
11709the Free Software Foundation; either version 2, or (at your option)
11710any later version.
11711
33167b8b 11712Bison is distributed in the hope that it will be useful,
f294a2c2
AD
11713but WITHOUT ANY WARRANTY; without even the implied warranty of
11714MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11715GNU General Public License for more details.
11716
11717You should have received a copy of the GNU General Public License
33167b8b 11718along with Bison; see the file COPYING. If not, write to
f294a2c2
AD
11719the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
11720Boston, MA 02111-1307, USA.