]> git.saurik.com Git - bison.git/blame - ChangeLog
* data/push.c (YYPUSH_MORE): Make it an enum instead.
[bison.git] / ChangeLog
CommitLineData
01e972b3
PE
12006-09-21 Paul Eggert <eggert@cs.ucla.edu>
2
3 * data/push.c (YYPUSH_MORE): Make it an enum instead.
4 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
5 Adjust white space and comments to match GNU style better.
6
c63d3e90
PE
72006-09-20 Bob Rossi <bob@brasko.net>
8
9 * data/push.c (yyresult_get): Remove function.
10 (YYPUSH_MORE): Add #define.
11 (yypushparse): Modify return value.
12
e70f46d1
PE
132006-09-20 Paul Eggert <eggert@cs.ucla.edu>
14
15 * stamp-h.in: Remove; no longer needed.
16 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
17 Remove config.h, config.hin, intl (no longer created).
18 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
19 stamp-h1.
20
21 Sync bootstrap from coreutils, as follows:
22
23 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
24
25 * bootstrap (symlink_to_gnulib): New function.
26 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
27 to copies-of-gnulib.
28 (cp_mark_as_generated, slurp, gnulib_files):
29 Avoid making a copy if it's the same as the old version.
30 (gnulib_files): Add support for this variable (used by Bison).
31
a92be413
PE
322006-09-20 Paul Eggert <eggert@cs.ucla.edu>
33
34 * src/getargs.c (usage): Rework to use conventions similar to
35 coreutils, to make translation a bit easier and the code a bit
36 smaller. Problem reported by Tim Van Holder.
37
4f82b42a
PE
382006-09-15 Paul Eggert <eggert@cs.ucla.edu>
39
3b2942e6
PE
40 Use some of gnulib's new modules, taken from coreutils.
41
42 * bootstrap: Sync from coreutils, except add support for gnulib_files.
43 * bootstrap.conf: New file.
44 (gnulib_modules): Add configmake, inttypes, unistd.
45 (XGETTEXT_OPTIONS): Add complain, complain_at,
46 fatal, fatal_at, warn, warn_at, unexpected_end.
47 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
48 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
49 (gl_EARLY): Add.
50 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
51 (gl_INIT): Add
52 (GNULIB_AUTOCONF_SNIPPET): Remove.
53 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
54 the pickiest.
55 * lib/.cvsignore: Add inttypes_.h.
56 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
57 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
58 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
59 no-longer-necessary initializations.
60 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
61 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
62 use the unistd module.
63 * src/system.h: Likewise.
64 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
65 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
66 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
67 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
68 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
69 * src/system.h: Include inttypes.h unconditionally, now that we
70 use the inttypes module. Don't bother to include stdint.h, since
71 inttypes.h now does that for us.
72 (LOCALEDIR): Remove, now that we use the configmake module.
73 * src/getargs.c: Include configmake.h.
74 * src/main.c: Likewise.
75 * src/output.c: Likewise.
76 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
77 not from $abs_top_builddir, since config.h moved.
78
79
4f82b42a
PE
80 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
81 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
82
83 * src/parse-gram.y (symbol_declaration): Don't put statements
84 before declarations; it's not portable to C89.
85 * src/scan-code.l (handle_action_at): Likewise.
86
87 * src/scan-code.l: Always initialize braces_level; the old code
88 left it uninitialized and therefore had undefined behavior.
89
90 Don't attempt to redefine 'assert', since it runs afoul of
91 systems where standard headers (mistakenly) include <assert.h>.
92 Instead, define and use our own alternative, called 'aver'.
93 * src/reader.c: Don't include assert.h, since we no longer
94 use assert.
95 * src/scan-code.l: Likewise.
96 * src/system.h (assert): Remove, replacing with....
97 (aver): New function, taking a bool arg. All uses changed.
98 * src/tables.c (pack_vector): Ensure that aver arg is bool,
99 not merely an integer.
100
31c10e38
PE
1012006-09-15 Bob Rossi <bob@brasko.net>
102
103 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
104 * data/c.m4 (YYPUSH): New.
105 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
106 * src/getargs.c (push_parser): New var.
107 * src/getargs.h (push_parser): New declaration.
108 * src/output.c (prepare): Add macro insertion of `push_flag'.
109 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
110 (prologue_declaration): Parse %push-parser.
111 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
112 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
113 list of removed lines from the traces observed.
114 (AT_CHECK_CALC_LALR): Added push parser tests.
115
fa7b79c0
PE
1162006-09-13 Paul Eggert <eggert@cs.ucla.edu>
117
21fe08ca
PE
118 * NEWS: Version 2.3a.
119 * configure.ac (AC_INIT): Likewise.
120
e8ec4d9b
PE
121 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
122 "#define YYSTYPE int" that caused "make maintainer-check" to fail
123 due to header ordering dependencies. I don't know why the #define
124 was there.
125
fa7b79c0
PE
126 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
127 runtime cost when YYDEBUG is not defined, and so that some tests
128 that used to fail now work. Problem and initial suggestion by
129 Paolo Bonzini.
130 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
131 * data/glr.cc (b4_parser_class_name):
132 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
133 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
134 (yydebug_) [YYDEBUG]: New member.
135 (yycdebug_): Now defined only if YYDEBUG.
136 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
137 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
138 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
139 if YYYDEBUG.
140 (debug_stream, set_debug_stream, debug_level, set_debug_level):
141 Define only if YYDEBUG.
142 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
143 set_debug_level.
144 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
145 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
146 AT_CHECK_CALC_GLR_CC that are working now.
147
4ec13d60
PE
1482006-09-12 Paul Eggert <eggert@cs.ucla.edu>
149
150 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
151 We don't need them in glr.cc, and glr.c defines them.
152 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
153 assumes that defining it to anything is the same as defining
154 it to 1. Problem reported by Paolo Bonzini.
155
8e1687ae
PE
1562006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
157
158 * data/c.m4 (b4_null, b4_case): Define.
159 * src/output.c (prepare_symbols): Use b4_null.
160 (user_actions_output): Use b4_case.
161
3dc5e96b
PE
1622006-09-11 Paul Eggert <eggert@cs.ucla.edu>
163
aef3da86
PE
164 * data/glr.c (b4_shared_declarations): Put start-header first,
165 before any #includes that we generate, so that feature-test
166 macros work. Problem reported by Michael Deutschmann in
167 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
168 * data/lalr1.cc: Likewise.
169 * doc/bison.texinfo (Prologue): Document that feature-test macros
170 should be defined before any Bison declarations.
171 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
172 that depend on location.hh after, not before, Bison decls, since
173 we now include location.hh after the first user prologue.
174
3dc5e96b
PE
175 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
176 Sander Brandenburg in
177 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
178 Also, fix minor white space and comment issues.
aef3da86
PE
179 (Prologue): Mention that it's better to define feature-test macros
180 before Bison declarations. Problem reported by Michael Deutschmann.
181
182 * README-cvs: Fix typo: "&" should be "&&". Problem reported
183 by Jim Meyering.
184 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
185 This adjusts to recent gnulib changes.
3dc5e96b 186
b2a0b7ca
JD
1872006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
188
189 Finish implementation of per-type %destructor/%printer. Discussed
190 starting at
191 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
192 and
193 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
194 * NEWS (2.3+): Add a description of this feature to the default
195 %destructor/%printer description.
196 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
197 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
198 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
199 list node contains a semantic type.
200 * src/symtab.c, src/symtab.h: Extend with a table that associates
201 semantic types with their %destructor's and %printer's.
202 (semantic_type_from_uniqstr, semantic_type_get,
203 semantic_type_destructor_set, semantic_type_printer_set): New functions
204 composing the public interface of that table.
205 (symbol_destructor_get, symbol_destructor_location_get,
206 symbol_printer_get, symbol_printer_location_get): If there's no
207 per-symbol %destructor/%printer, look up the per-type before trying
208 the default.
209 * tests/actions.at (Per-type %printer and %destructor): New test case.
210 * tests/input.at (Default %printer and %destructor redeclared):
211 Extend to check that multiple occurrences of %symbol-default in a
212 single %destructor/%printer declaration is an error.
213 (Per-type %printer and %destructor redeclared, Unused values with
214 per-type %destructor): New test cases.
215
3be03b13
JD
2162006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
217
218 Require default %destructor/%printer to be declared using
219 %symbol-default instead of an empty symbol list, and start working on
220 new per-type %destructor/%printer. Discussed at
221 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
222 * NEWS (2.3+): Add %symbol-default to example.
223 * bison.texinfo (Freeing Discarded Symbols): Likewise.
224 (Bison Symbols): Add entry for %symbol-default.
225 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
226 (generic_symlist, generic_symlist_item): New nonterminals for creating
227 a list in which each item is a symbol, semantic type, or
228 %symbol-default.
229 (grammar_declaration): Use generic_symlist in %destructor and %printer
230 declarations instead of symbols.1 or an empty list.
231 (symbol_declaration, precedence_declaration, symbols.1): Update actions
232 for changes to symbol_list.
233 * src/reader.c: Update for changes to symbol_list.
234 * src/scan-code.l: Likewise.
235 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
236 * src/symlist.c, src/symlist.h: Extend such that a list node may
237 represent a semantic type or a %symbol-default in addition to just an
238 ordinary symbol. Add switched functions for setting %destructor's and
239 %printer's.
240 * tests/actions.at, tests/input.at: Add %symbol-default to all default
241 %destructor/%printer declarations.
242
3508ce36
JD
2432006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
244
245 Whether the default %destructor/%printer applies to a particular symbol
246 isn't a question of whether the user *declares* that symbol (in %token,
247 for example). It's a question of whether the user by any means
248 *defines* the symbol at all (by simply using a char token, for
249 example). $end is defined by Bison whereas any other token with token
250 number 0 is defined by the user. The error token is always defined by
251 Bison regardless of whether the user declares it with %token, but we
252 may one day let the user define error as a nonterminal instead.
253 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
254 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
255 the meaning of "user-defined".
256 * tests/actions.at (Default %printer and %destructor for user-declared
257 end token): Rename to...
258 (Default %printer and %destructor for user-defined end token): ...
259 this.
260
261 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
262 computation of whether to apply the default, don't maintain a list of
263 every Bison-defined symbol. Instead, just check for a first character
264 of '$', which a user symbol cannot have, and check for the error token.
265
9350499c
JD
2662006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
267
268 Don't apply the default %destructor or %printer to the error token,
269 $undefined, or $accept. This change fits the general rule that the
270 default %destructor and %printer are only for user-declared symbols,
271 and it solves several difficulties that are described in the new test
272 cases listed below.
273 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
274 * tests/actions.at (Default %printer and %destructor are not for error
275 or $undefined, Default %printer and %destructor are not for $accept):
276 New test cases.
277
4d7370cb
JD
2782006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
279
280 Allow %start after the first rule.
281 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
282 when parsing the first rule.
283 (check_and_convert_grammar): Search for it here after all grammar
284 declarations have been parsed. Skip midrules, which have dummy LHS
285 nonterminals.
286 * src/symtab.c (symbol_is_dummy): New function.
287 * src/symtab.h (symbol_is_dummy): Declare it.
288 * tests/input.at (%start after first rule): New test.
289
6d0ef4ec
JD
2902006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
291
292 Redo some of the previous commit: add back the ability to use
293 non-aliased/undeclared string literals since it might be useful to
294 those declaring %token-table.
295 * src/reader.c (check_and_convert_grammar): Undo changes in previous
296 commit: don't worry about complaints from symbols_pack.
297 * src/symtab.c (symbol_new, symbol_class_set,
298 symbol_check_alias_consistency): Undo changes in previous commit: count
299 each string literal as a new symbol and token, assign it a symbol
300 number, and don't complain about non-aliased string literals.
301 (symbols_pack): Since symbol_make_alias still does not decrement symbol
302 and token counts but does still set aliased tokens to the same number,
303 symbol_pack_processor now leaves empty slots in the symbols array.
304 Remove those slots.
305 * tests/regression.at (Undeclared string literal): Remove test case
306 added in previous commit since non-aliased string literals are allowed
307 again.
308 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
309 remove unnecessary string literal declarations.
310 * tests/sets.at (Firsts): Likewise.
311
965537bc
JD
3122006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
313
314 Don't allow an undeclared string literal, but allow a string literal to
315 be used before its declaration.
316 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
317 symbols_pack complained.
318 * src/symtab.c (symbol_new): Don't count a string literal as a new
319 symbol.
320 (symbol_class_set): Don't count a string literal as a new token, and
321 don't assign it a symbol number since symbol_make_alias does that.
322 (symbol_make_alias): It's not necessary to decrement the symbol and
323 token counts anymore. Don't assume that an alias declaration occurs
324 before any uses of the identifier or string, and thus don't assert that
325 one of them has the highest symbol number so far.
326 (symbol_check_alias_consistency): Complain if there's a string literal
327 that wasn't declared as an alias.
328 (symbols_pack): Bail if symbol_check_alias_consistency failed since
329 symbol_pack asserts that every token has been assigned a symbol number
330 although undeclared string literals have not.
331 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 332 string literal): New test cases.
965537bc
JD
333 (Characters Escapes, Web2c Actions): Declare string literals as
334 aliases.
335 * tests/sets.at (Firsts): Likewise.
336
47aee066
JD
3372006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
338
339 In the grammar scanner, STRING_FINISH unclosed constructs and return
340 them to the parser in order to improve error messages.
341 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
342 SC_BRACED_CODE, SC_PROLOGUE): Implement.
343 * tests/input.at (Unclosed constructs): New test case.
344 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
345 seen.
346
347 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
348 unused global.
349
1f6b3679
JD
3502006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
351
352 Handle string aliases for character tokens correctly.
353 * src/symtab.c (symbol_user_token_number_set): If the token has an
354 alias, check and set its alias's user token number instead of its own,
355 which is set to indicate the alias. Previously, every occurrence of
356 the character token in the grammar overwrote that alias indicator with
357 the character code.
358 * tests/input.at (String aliases for character tokens): New test.
359
219741d8
JD
3602006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
361
362 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
363
11daa4e7
PE
3642006-08-11 Paul Eggert <eggert@cs.ucla.edu>
365
366 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
367 to prevent failures when building on older platforms.
368 Check for autopoint failure.
369 Set XGETTEXT_OPTIONS to values that check for C format strings,
370 so that translators are warned about them (this also helps
371 prevent core dumps).
372
373 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
374 function, since it simplifies our code a bit.
375
376 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
377 rather than -W, so we don't get bogus warnings about sign comparisons.
378 Add -Wpointer-arith, since that warning is useful (it reports code
379 that does not conform to C89 and that some compilers reject).
380 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
381 since it's no longer needed.
382
f9bfc42a
JD
3832006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
384
385 Clean up scanners a bit.
386 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
387 definitions so gcc won't warn when obstack_for_string is unused.
388 * src/scan-code.l: config.h and system.h are already #include'd by
389 scan-code-c.c, so get rid of them here.
390 * src/scan-gram.l: Likewise.
391 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
392 definitions rather than duplicating the rest of it.
393 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
394
06e8700a
JD
3952006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
396
397 Suppress signed/unsigned comparison warnings for yycheck.
398 * data/c.m4 (b4_safest_int_type): New macro.
399 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
400 a signed int type, cast it to b4_safest_int_type first.
401 * data/yacc.c: Likewise.
402 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
403 also overwritten.
404
9c437126
PE
4052006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
406
407 * doc/bison.texinfo: Fix some typos.
408
284d8a13
PE
4092006-08-02 Paul Eggert <eggert@cs.ucla.edu>
410
411 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
412 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
413
414 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
415 the latest gnulib does this a different way.
416 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
417 translation was patched, so stop omitting it.
418
ec5479ce
JD
4192006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
420
421 Enable declaration of default %printer/%destructor. Make the parser
422 use these for all user-declared grammar symbols for which the user does
423 not declare a specific %printer/%destructor. Thus, the parser uses it
424 for token 0 if the user declares it but not if Bison generates it as
425 $end. Discussed starting at
426 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
427 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
428 and
429 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
430 * NEWS (2.3+): Mention.
431 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
432 declare a %destructor for a mid-rule's semantic value. It's just
433 impossible to declare one specific to it.
434 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
435 code. Describe default %destructor form.
436 * src/parse-gram.y (grammar_declaration): Parse default
437 %printer/%destructor declarations.
438 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
439 and symbol_destructor_location_get rather than accessing the destructor
440 and destructor_location members of struct symbol.
441 (symbol_printers_output): Likewise but for %printer's.
442 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
443 again.
444 * src/symtab.c (default_destructor, default_destructor_location,
445 default_printer, default_printer_location): New static global
446 variables to record the default %destructor and %printer.
447 (symbol_destructor_get, symbol_destructor_location_get,
448 symbol_printer_get, symbol_printer_location_get): New functions to
449 compute the appropriate %destructor and %printer for a symbol.
450 (default_destructor_set, default_printer_set): New functions to set the
451 default %destructor and %printer.
452 * src/symtab.h: Prototype all those new functions.
453 * tests/actions.at (Default %printer and %destructor): New test to
454 check that the right %printer and %destructor are called, that they're
455 not called for $end, and that $$ and @$ work correctly.
456 (Default %printer and %destructor for user-declared end token): New
457 test to check that the default %printer and %destructor are called for
458 a user-declared end token.
459 * tests/input.at (Default %printer and %destructor redeclared, Unused
460 values with default %destructor): New tests to check related grammar
461 warnings and errors.
462
868d2d96
JD
4632006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
464
465 Clean up handling of %destructor for the end token (token 0).
466 Discussed starting at
467 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
468 and
469 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
470
471 Make the skeletons consistent in how they pop the end token and invoke
472 its %destructor.
473 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
474 state, which has token number 0, since this would invoke the
475 %destructor for the end token.
476 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
477 until after shifting the end token, or else it won't be popped.
478 * data/yacc.c (yyparse): Likewise.
479
480 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
481 it's the end token. Upon termination, destroy an unshifted lookahead
482 even when it's the end token.
483 * data/lalr1.cc (yy::parser::parse): Likewise.
484 * data/yacc.c (yyparse): Likewise.
485
486 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
487 value warnings for the end token when the user gives the end token a
488 %destructor.
489
490 * tests/actions.at (Printers and Destructors): Test all the above.
491
62a9592d
PE
4922006-07-24 Paul Eggert <eggert@cs.ucla.edu>
493
494 Update to latest gnulib and gettext versions.
495 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
496 Add fopen-safer.
497 (gnulib_files): Add m4/warning.m4. Don't worry about files
498 overwritten by autopoint.
499 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
500 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
501 rejects them.
502 Don't use autoreconf; instead, invoke autopoint etc. by hand,
503 so that we can remove the intl files at a better time.
504 (intl_files_to_remove): Remove aclocal.m4, since it gets
505 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
506 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
507 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
508 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
509 Remove datarootdir hack; no longer needed.
510 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
511 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
512 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
513 strdup.h.
514 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
515 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
516
10d6970f
PE
5172006-07-20 Paul Eggert <eggert@cs.ucla.edu>
518
519 * bootstrap: Adjust to today's change to gnulib-tool by invoking
520 it with --assume-autoconf='latest-stable'.
521
50a33993
JD
5222006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
523
524 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
525 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
526 YYSTYPE' and `{'.
527 * src/muscle_tab.h (muscle_grow): Replace the header comments with
528 those from muscle_tab.c since the old ones are misleading.
529
2ce4ed68
AD
5302006-07-13 Akim Demaille <akim@epita.fr>
531
532 Support %define "KEY" {VALUE}.
533 * src/scan-code.h, src/scan-code.l (translate_action)
534 (translate_rule_action, translate_symbol_action, translate_code):
535 Return char *, not const char *.
536 * src/parse-gram.y (declaration): Rename as...
537 (prologue_declaration): this.
538 (string_content): Remove this nonterminal, use STRING.
539 (braceless, content, content.opt): New nonterminal.
540 Use them.
541 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
542 as value.
543 * src/scan-gram.l (getargs.h): Don't include it.
544
db7e5eb5
PE
5452006-07-12 Paul Eggert <eggert@cs.ucla.edu>
546
547 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
548 rather than a for-loop that declares a local bool variable. This
549 should work around a compatibility problem with a Cray x1e C++
550 compiler reported by Hung Nguyen in
551 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
552 The for-loop was introduced in the 2004-11-17 change but I don't
553 know why it was needed.
554
a5d80ba5
AD
5552006-07-12 Akim Demaille <akim@epita.fr>
556
557 * data/c.m4: Comment changes.
558
23eb2a69
AD
5592006-07-10 Akim Demaille <akim@lrde.epita.fr>
560
561 * src/complain.c (error_message, ERROR_MESSAGE): New.
562 To factor...
563 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
564 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
565
ddc8ede1
PE
5662006-07-09 Paul Eggert <eggert@cs.ucla.edu>
567
568 * NEWS: Instead of %union, you can define and use your own union type
569 YYSTYPE if your grammar contains at least one <type> tag.
570 Your YYSTYPE need not be a macro; it can be a typedef.
571 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
572 (Union Decl, Decl Summary): Document this.
573 * data/glr.c (YYSTYPE): Implement this.
574 * data/glr.cc (YYSTYPE): Likewise.
575 * data/lalr1.cc (YYSTYPE): Likewise.
576 * data/yacc.c (YYSTYPE): Likewise.
577 * src/output.c (prepare): Output tag_seen_flag.
578 * src/parse-gram.y (declaration, grammar_declaration):
579 Use 'union_seen' rather than 'typed' to determine whether
580 %union has been seen, since grammars can now be typed without
581 %union.
582 (symbol_declaration, type.opt, symbol_def):
583 Keep track of whether a tag has been seen.
584 * src/reader.c (union_seen, tag_seen): New vars.
585 (typed): remove.
586 * src/reader.h (union_seen, tag_seen, typed): Likewise.
587 * src/scan-code.l (untyped_var_seen): New variable.
588 (handle_action_dollar): Adjust to above changes.
589 (handle_action_dollar, handle_action_at):
590 Improve overflow checking for outlandish numbers.
591 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
592 avoid new diagnostics generated by above changes.
593 * tests/regression.at (YYSTYPE typedef): Add test to check
594 for type tags without %union.
595
596 * src/symlist.c (symbol_list_length): Return int, not unsigned
597 int, since callers expect int. This may need to get revisited
598 once we have proper integer overflow checking.
599
600 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
601 object is now static.
602
603 * src/getargs.c (flags_argmatch): Return void, not int,
604 to pacify ./configure --enable-gcc-warnings.
605
606 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
607 since last_string is already defined to FLEX_PREFIX (last_string).
608
7b42569e
AD
6092006-07-09 Akim Demaille <akim@lrde.epita.fr>
610
611 Implement --warnings/-W.
612 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
613 replaced by...
614 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
615 Adjust callers.
616 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
617 (warnings_args, warnings_types): New.
618 (getargs, short_options, long_options): Accept -W/--warnings.
619 Sort the options by alphabetical order, upper case letter right
620 before its lower case.
621
3b452f4e
JD
6222006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
623
624 Change %merge result type clash warnings to errors. Discussed at
625 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
626 * src/reader.c (record_merge_function_type): Use complain_at.
627 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
628 declared later): Update test case results.
629
b8a41559
AD
6302006-07-09 Akim Demaille <akim@lrde.epita.fr>
631
632 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
633 to be in alphabetical order.
634 (trace_args): Spelling fixes.
635
cd9e1ba2
PE
6362006-07-09 Paul Eggert <eggert@cs.ucla.edu>
637
638 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
639 so they don't collide with user-defined macros.
640 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
641 this was never guaranteed, and now that we're using gnulib stdint,
642 which defines int_fast16_t to long int, the problem is exposed.
643
cb48f191
PE
6442006-07-08 Paul Eggert <eggert@cs.ucla.edu>
645
b8445a15
PE
646 * data/c.m4 (b4_basename): Simplify a bit, since we don't
647 need the full POSIX semantics (and weren't implementing them
648 anyway).
649
cb48f191
PE
650 Adjust to Autoconf 2.60 and today's gnulib.
651 * bootstrap (gnulib_modules): Add stdint.
652 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
653 no longer copies it.
654 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
655 since stdint needs the former and wcwidth (which is now required
656 by mbswidth) needs the latter.
657 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
658 work around a compatibility glitch between gettext 0.14.6 and
659 Autoconf 2.60.
660 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
661 Do not check for uintptr_t, since new stdint module does the right
662 thing.
663 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
664 Add stdint.h, stdint_.h, wcwidth.h.
665 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
666 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
667 stdint.m4, wchar_t.m4, wcwidth.m4.
668 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
669 usual order for ../lib/*.h files.
670 (file_name_split): Use last_component, not base_name, to adjust
671 to gnulib changes.
672 * src/parse-gram.h: Include <strverscmp.h> in the usual order
673 for ../lib/*.h files.
674 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
675 Define unconditionally, since we now assume the stdint module.
676 * src/scan-skel.l: Include <dirname.h>.
677 (BASE_QPUTS): Use last_component, not base_name.
678 * src/system.h: Include <unlocked-io.h> in the usual order
679 for ../lib/*.h files. Include <stdint.h> unconditionally,
680 since we now use the stdint module.
681 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
682 HAVE_UINTPTR_T, since we now use the stdint module.
683 (base_name): Remove decl, since files now include <dirname.h>
684 to get the decl.
685
cd48d21d
AD
6862006-07-08 Akim Demaille <akim@lrde.epita.fr>
687
688 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
689 New, default to 1.
690 * data/yacc.c, data/glr.c, data/location.cc: Use them.
691 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
692 default.
693 * tests/calc.at: Adjust.
694
8ec0a172
AD
6952006-07-08 Akim Demaille <akim@lrde.epita.fr>
696
b8445a15 697 * data/c.m4 (b4_basename): New.
8ec0a172
AD
698 (b4_syncline): Also output the location of its invocation (from
699 the skeleton).
700 (b4_user_action, b4_define_user_action, b4_user_actions)
701 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
702 (b4_user_stype): New.
703 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
704
4a678af8
JD
7052006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
706
707 In the grammar file, the first column is 1 not 0 on the first line as
708 on every other line.
709 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
710 * tests/input.at (Torturing the Scanner): Update output.
711
712 * src/scan-gram.l (scanner_cursor): Declare it static.
713
dd60572a
JD
7142006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
715
716 In warnings, say "previous declaration" rather than "first
717 declaration".
718 * src/symtab.c (redeclaration): Do that here.
719 * src/reader.c (record_merge_function_type): In the case of a result
720 type clash, report the previous declaration rather than the very first
721 one in the grammar file.
722 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
723 declared later): Add a third declaration to check this behavior.
724 * tests/input.at (Incompatible Aliases): Update output.
725
2073e1b6
AD
7262006-06-27 Akim Demaille <akim@epita.fr>
727
728 * doc/Doxyfile.in: New.
729 * doc/Makefile.am: Use it.
730 * src/lalr.h, src/symtab.h: Initial doxygenation.
731
8ee5b538
JD
7322006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
733
734 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
735 declared after the %merge. This continues the effort of the previous
736 patch.
8ee5b538
JD
737 * src/reader.c (get_merge_function): Don't set the merger type yet.
738 (record_merge_function_type): New function for setting the merger type
739 and checking for clashes.
740 (grammar_current_rule_merge_set): Set the location of the %merge for
741 the current rule.
742 (packgram): Invoke record_merge_function_type for each rule now that
743 all symbol type declarations have been parsed.
744 * src/reader.h (merger_list.type_declaration_location): New member
745 storing the location of the first %merge from which the type for this
746 merging function was derived.
747 * src/symlist.h (symbol_list.merger_declaration_location): New member
748 storing the location of a rule's %merge, if any.
749 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
750 declared later): New test to catch the error fixed by the above patch.
751
ffa4ba3a
JD
7522006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
753
754 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
755 declarations appear after the rules. Discussed at
756 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
757 and
758 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
759 Don't mistake the type of $$ in a midrule to be that of its parent
760 rule's $$.
ffa4ba3a
JD
761 * src/reader.c (grammar_current_rule_end): Don't invoke
762 grammar_rule_check yet since not all symbol declarations may have been
763 parsed yet.
764 (grammar_midrule_action): Likewise.
765 Don't record whether the midrule's $$ has been used yet since actions
766 haven't been translated yet.
767 Record the midrule's parent rule and its RHS index within the parent
768 rule.
769 (grammar_current_rule_action_append): Don't translate the action yet
770 since not all symbol declarations may have been parsed yet and, thus,
771 warnings about types for $$, $n, @$, and @n can't be reported yet.
772 (packgram): Translate the action and invoke grammar_rule_check now that
773 all symbol declarations have been parsed.
774 * src/scan-code.l (handle_action_dollar): Now that this is invoked
775 after parsing the entire grammar file, the symbol list here in the case
776 of a midrule is actually the midrule's empty RHS, so reference its
777 parent rule's RHS where necessary.
778 On the other hand, now that you can already know it's a midrule, you
779 aren't forced to think $$ has the same type as its parent rule's $$.
780 (handle_action_at): In the case of a midrule, reference the parent rule
781 where necessary.
782 * src/symlist.c (symbol_list_new): Initialize new midrule-related
783 members.
784 (symbol_list_length): Now that this is invoked after all rules have
785 been parsed, a NULL symbol (rather than a NULL symbol list node)
786 terminates a rule. symbol_list_print already does this correctly.
787 * src/symlist.h (symbol_list.midrule_parent_rule,
788 symbol_list.midrule_parent_rhs_index): New members so that midrules can
789 remember their relationships with their parents.
790 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
791 fixed by the above patch.
792 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
793 implementing...
794 (Unused values): ... this old test case and...
795 (Unused values before symbol declarations): ... this new test case.
796 This one is the same as `Unused values' except that all symbol
797 declarations appear after the rules in order to catch the rest of the
798 errors fixed by the above patch.
799
e256e17f
JD
8002006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
801
300a1930
JD
802 More cleanup.
803 * src/reader.c (current_rule): Declare it static since it's no longer
804 used outside this file.
805 (grammar_current_rule_action_append): Remove redundant arguments from
806 translate_rule_action invocation.
807 * src/reader.h (current_rule): Remove this unused extern.
808 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
809 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 810
381ecb06
JD
8112006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
812
813 Clean up yesterday's patch.
814 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
815 to...
816 * src/reader.c (grammar_current_rule_action_append): ... here for
817 consistency with grammar_current_rule_symbol_append.
818 * tests/regression.at (Braced code in declaration in rules section):
819 Make yyerror and yylex static as usual.
820
4210cd0b
JD
8212006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
822
823 Fix bug that mistakes braced code in a declaration in the rules section
824 to be a rule action. Mentioned at
825 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
826 * src/scan-gram.l: Move midrule action detection from the start of the
827 scanning of any braced code to...
828 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
829 action. For readability, use $2 and @2 rather than the equivalent
830 global variables.
831 * tests/regression.at (Braced code in declaration in rules section):
832 New test to catch the error fixed by the above patch.
833
834 Work on code readability some.
835 * src/scan-code.l (current_rule): Get rid of this misleading and
836 redundant declaration: it's actually extern'ed in reader.h.
837 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
838 translate_action): Add a rule argument and use it instead of the global
839 current_rule.
840 (translate_rule_action): This already receives current_rule through an
841 argument, so pass it on to translate_action instead of assigning
842 current_rule to current_rule.
843 (translate_symbol_action, translate_code): Pass rule = NULL to
844 translate_action.
845
34f98f46
JD
8462006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
847
848 Rename %before-definitions to %start-header and %after-definitions to
849 %end-header. Don't use these declarations to separate pre-prologue
850 blocks from post-prologue blocks. Add new order-independent
851 declarations %before-header and %after-header as alternatives to the
852 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
853 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
854 * NEWS (2.3+): Update for these changes.
855 * data/glr.c (b4_before_definitions): Update to...
856 (b4_start_header): ... this.
857 (b4_after_definitions): Update to...
858 (b4_end_header): ... this.
859 * data/glr.cc: Likewise.
860 * data/lalr1.cc: Likewise.
861 * data/yacc.c: Likewise.
862 * doc/bison.texinfo (The prologue): Update names, and replace remaining
863 prologue blocks with %*-header declarations.
864 (Calc++ Parser): Likewise.
865 (Bison Declaration Summary): Update names.
866 (Bison Symbols): Update description.
867 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
868 (PERCENT_END_HEADER): ... this.
869 (PERCENT_BEFORE_DEFINITIONS): Update to...
870 (PERCENT_START_HEADER): ... this.
871 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
872 (declaration): Update token names and m4 macro names.
873 When parsing %end-header and %start-header, invoke translate_code
874 before muscle_code_grow, and no longer set global booleans to remember
875 whether these declarations have been seen.
876 Parse new %after-header and %before-header.
877 * src/reader.c (before_definitions, after_definitions): Remove.
878 (prologue_augment): Accept a new bool argument to specify whether to
879 augment the pre-prologue or post-prologue.
880 * src/reader.h (before_definitions, after_definitions): Remove these
881 extern's.
882 (prologue_augment): Add new bool argument.
883 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
884 (PERCENT_END_HEADER): ... this.
885 (PERCENT_BEFORE_DEFINITIONS): Update to...
886 (PERCENT_START_HEADER): ... this.
887 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
888 * tests/actions.at (Printers and Destructors): Update names.
889
31b2b07e
JD
8902006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
891
892 Add comparison operators for C++ location classes. Discussed at
893 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
894 * data/c++.m4 (b4_define_location_comparison): New boolean %define
895 declaration indicating whether filename_type has an operator==. If
896 filename_type is `std::string', it defaults to `1', `0' otherwise.
897 * data/location.cc: Iff b4_define_location_comparison is `1', add
898 operator== and operator!= for class position and for class location.
899
900 Some minor fixes.
901 * src/scan-action.l: Remove unused file.
902 * src/symtab.c (symbol_printer_set): Use printer_location not
903 destructor_location.
904 * src/symtab.h (struct symbol): Replace incorrect source comment for
905 printer members.
906 * tests/input.at (Incompatible Aliases): Update output with correct
907 printer location.
908
9bc0dd67
JD
9092006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
910
911 Don't put the pre-prologue in the header file. For the yacc.c code
912 file and the glr.c header and code files, move the pre-prologue before
913 the token definitions. Add new %before-definitions and
914 %after-definitions to declare code that will go in both the header file
915 and code file. Discussed at
916 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
917 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
918 and
919 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
920 * NEWS (2.3+): Describe these changes.
921 * data/glr.c (b4_pre_prologue): Move from within to before...
922 (b4_shared_declarations): ... this.
923 Add new b4_before_definitions before b4_token_enums.
924 Add new b4_after_definitions at the end.
925 * data/glr.cc (b4_pre_prologue): Replace with...
926 (b4_before_definitions): ... this in the header file.
927 (b4_after_definitions): New near the end of the header file.
928 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
929 code file right before including the header file.
930 (b4_before_definitions): New in the previous position of
931 b4_pre_prologue in the header file.
932 (b4_after_definitions): New near the end of the header file.
933 * data/yacc.c: Clean up some m4 quoting especially in the header file.
934 (b4_token_enums_defines): In the code file, move to right before
935 YYSTYPE for consistency with the header file.
936 (b4_before_definitions): New right before b4_token_enums_defines in
937 both the header and code file.
938 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
939 header and code file.
940 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
941 of prologues for %union dependencies.
942 (Bison Declaration Summary): In %defines description, mention the
943 effect of %before-definitions and %after-definitions on the header
944 file.
945 (Calc++ Parser): Forward declare driver in a %before-definitions rather
946 than in the pre-prologue so that make check succeeds.
947 (Bison Symbols): Add entries for %before-definitions and
948 %after-definitions.
949 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
950 %before-definitions.
951 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
952 (declaration): Parse those declarations and append to
953 b4_before_definitions and b4_after_definitions, respectively.
954 * src/reader.c (before_definitions, after_definitions): New bools to
955 track whether those declarations have been seen.
956 (prologue_augment): Add to the post-prologue if %union,
957 %before-definitions, or %after-definitions has been seen.
958 * src/reader.h (before_definitions, after_definitions): New extern's.
959 * src/scan-gram.l: Scan the new declarations.
960 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
961 prologue block in a %before-definitions or a %after-definitions based
962 on whether the %union is declared.
963 * tests/regression.at (Early token definitions with --yacc, Early token
964 definitions without --yacc): Move tests for token definitions into the
965 post-prologue since token names are no longer defined in the
966 pre-prologue.
967
203b9274
AD
9682006-06-20 Akim Demaille <akim@epita.fr>
969
970 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
971 (symbol_get): Use it.
972 * src/parse-gram.y: Use it.
973
a7ee59cf
JD
9742006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
975
976 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
977 build succeeds when configured with --enable-gcc-warnings.
978
5a2baae7
PE
9792006-06-19 Paul Eggert <eggert@cs.ucla.edu>
980
33ad1a9c
PE
981 * src/parse-gram.y (char_name): New function.
982 (CHAR, STRING, string_content): For %printer, properly escape.
983 (ID): Prefer fputs to fprintf.
984 (id): Reindent to be consistent with other rules.
985 Properly quote char.
986
5a2baae7
PE
987 The Translation Project changed its way of publishing translations
988 to maintainers. I haven't received any responses to my request
989 for supporting the old way, or for documenting the new way. I
990 have modified 'bootstrap' to use screen scraping
991 (in this case, HTML scraping). This is unreliable and inelegant,
992 but I don't see any better way. Yuck.
993 * bootstrap (TP_URL, WGET_COMMAND): New vars.
994 (get_translations): New function, which uses HTML scraping to
995 deduce locations of latest translations.
996 Use this function to grab both bison and bison-runtime .po files.
997 Don't bother priming the pump for the runtime-po domain any more,
998 as it's now translated better than bison is.
999
58d7a1a1
AD
10002006-06-19 Akim Demaille <akim@epita.fr>
1001
1002 * src/scan-gram.l: No longer "parse" things after `%union' until
1003 `{'. Rather, return a single "%union" token.
1004 No longer make symbols: return strings, and leave the conversion
1005 to symbols to the parser.
1006 (SC_PRE_CODE, token_type): Remove.
1007 * src/parse-gram.y (%union): New field `character'.
1008 Sort tokens.
1009 (CHAR): New token.
1010 (ID, ID_COLON): Now that the scanner no longer makes them
1011 identifiers, adjust all uses to invoke symbol_get.
1012 (id_colon): New, wraps the conversion from string to symbol.
1013 (%union): Accept a possible union_name.
1014 (symbol): Now can be a char.
1015 * data/c.m4 (b4_union_name): Leave a default value.
1016 * data/glr.c, data/yacc.c: Use it.
1017
b931235e
JD
10182006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
1019
1020 For associating token numbers with token names for "yacc.c", don't use
1021 #define statements unless `--yacc' is specified; always use enum
1022 yytokentype. Most important discussions start at:
1023 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
1024 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
1025 and
1026 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
1027 * NEWS (2.3+): Mention.
1028 * data/c.m4 (b4_yacc_if): New.
1029 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
1030 token #define's.
1031 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
1032 on token name definitions.
1033 * src/getargs.c (usage): Capitalize `Yacc' in English.
1034 * src/output.c (prepare): Define b4_yacc_flag.
1035 * tests/regression.at (Early token definitions): Test that tokens names
1036 are defined before the pre-prologue not just before the post-prologue.
1037 Remove this test case and copy to...
1038 (Early token definitions with --yacc): ... this to test #define's.
1039 (Early token definitions without --yacc): ... and this to test enums.
1040
9e6e7ed2
PE
10412006-06-11 Paul Eggert <eggert@cs.ucla.edu>
1042
1043 * NEWS: Reword the post-2.3 change to not be so optimistic about
1044 removing the old "look-ahead" spelling.
1045 Update previous look-ahead/lookahead change reports.
1046 * REFERENCES: look-ahead -> lookahead (since that's
1047 what he actually wrote).
1048 * doc/refcard.tex: look ahead -> lookahead,
1049 look-ahead -> lookahead
1050
742e4900
JD
10512006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
1052
1053 For consistency, use `lookahead' instead of `look-ahead' or
1054 `look_ahead'. Discussed starting at
1055 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
1056 and then at
1057 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
1058 * NEWS: For the next release, note the change to `--report'.
1059 * TODO, doc/bison.1: Update English.
1060 * doc/bison.texinfo: Update English.
1061 (Understanding Your Parser, Bison Options): Document as
1062 `--report=lookahead' rather than `--report=look-ahead'.
1063 * src/conflicts.c: Update English in comments.
1064 (lookahead_set): Rename from look_ahead_set.
1065 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
1066 (resolve_sr_conflict): Rename local look_ahead_tokens to
1067 lookahead_tokens, and update other uses.
1068 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
1069 count_rr_conflicts, conflicts_free): Update uses.
1070 * src/getargs.c (report_args): Move "lookahead" before alternate
1071 spellings.
1072 (report_types): Update uses.
1073 (usage): For `--report' usage description, state `lookahead' spelling
1074 rather than `look-ahead'.
1075 * src/getargs.h (report.report_lookahead_tokens): Rename from
1076 report_look_ahead_tokens.
1077 * src/lalr.c: Update English in comments.
1078 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
1079 (state_lookahead_tokens_count): Rename from
1080 state_look_ahead_tokens_count.
1081 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1082 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
1083 Rename local n_look_ahead_tokens to n_lookahead_tokens.
1084 Update other uses.
1085 Update English in output.
1086 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
1087 * src/print.c: Update English in comments.
1088 (lookahead_set): Rename from look_ahead_set.
1089 (print_reduction): Rename argument lookahead_token from
1090 look_ahead_token.
1091 (print_core, state_default_rule, print_reductions, print_results):
1092 Update uses.
1093 * src/print_graph.c: Update English in comments.
1094 (print_core): Update uses.
1095 * src/state.c: Update English in comments.
1096 (reductions_new): Update uses.
1097 (state_rule_lookahead_tokens_print): Rename from
1098 state_rule_look_ahead_tokens_print, and update other uses.
1099 * src/state.h: Update English in comments.
1100 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
1101 (state_rule_lookahead_tokens_print): Rename from
1102 state_rule_look_ahead_tokens_print.
1103 * src/tables.c: Update English in comments.
1104 (conflict_row, action_row): Update uses.
1105 * tests/glr-regression.at
1106 (Incorrect lookahead during deterministic GLR,
1107 Incorrect lookahead during nondeterministic GLR): Rename
1108 print_look_ahead to print_lookahead.
1109 * tests/torture.at: Update English in comments.
1110 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
1111 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
1112 (Many lookahead tokens): Update uses.
1113 * data/glr.c: Update English in comments.
1114 * lalr1.cc: Likewise.
1115 * yacc.c: Likewise.
1116 * src/conflicts.h: Likewise.
1117 * src/lalr.h: Likewise.
1118 * src/main.c: Likewise.
1119 * src/output.c: Likewise.
1120 * src/parse-gram.c: Likewise.
1121 * src/tables.h: Likewise.
1122 * tests/calc.at: Likewise.
1123
3c40d0b5
JD
11242006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
1125
1126 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
1127
5d278082
PE
11282006-06-07 Paul Eggert <eggert@cs.ucla.edu>
1129
1130 * TODO: Add request from Nelson H. F. Beebe to be able to install
1131 Bison without installing the yacc script.
1132
9e668899
JD
11332006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1134
1135 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
1136 and yytext if they're already #define'd.
1137 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
1138 * src/scan-code-c.c: ... here.
1139 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
1140 <config.h>.
1141
0c8e079f
JD
11422006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
1143
1144 Get Bison to build again when configured with --enable-gcc-warnings.
1145 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
1146 missing #include's.
1147 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
1148 loc argument as it shadows a global.
1149 * src/scan-gram.l: Remove stray comma that prevents boundary_set
1150 invocation.
1151
1152 * src/.cvsignore: Add scan-code.c.
1153
2346344a
AD
11542006-06-07 Akim Demaille <akim@epita.fr>
1155
1156 * src/scan-gram.l: Move the "add a trailing ; to actions" code
1157 to...
1158 * src/scan-code.l: here.
1159 * tests/input.at (Torturing the Scanner): Fix another location
1160 error.
1161
4862bdfd
AD
11622006-06-07 Akim Demaille <akim@epita.fr>
1163
1164 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1165
e9071366
AD
11662006-06-06 Akim Demaille <akim@epita.fr>
1167
1168 Extract the parsing of user actions from the grammar scanner.
1169 As a consequence, the relation between the grammar scanner and
1170 parser is much simpler. We can also split "composite tokens" back
1171 into simple tokens.
1172 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1173 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1174 rename as...
1175 * src/location.h, src/location.c (add_column_width)
1176 (location_compute): these.
1177 Fix the column count: the initial column is 0.
1178 (location_print): Be robust to ending column being 0.
1179 * src/location.h (boundary_set): New.
1180 * src/main.c: Adjust to scanner_free being renamed as
1181 gram_scanner_free.
1182 * src/output.c: Include scan-code.h.
1183 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1184 Use boundary_set.
1185 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
1186 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
1187 which is now, again, a separate token.
1188 Adjust all dependencies.
1189 Whereever actions with $ and @ are used, use translate_code.
1190 (action): Remove this nonterminal which is now useless.
1191 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
1192 (grammar_current_rule_action_append): Use translate_code.
1193 (packgram): Bound check ruleno, itemno, and rule_length.
1194 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
1195 (last_string, last_braced_code_loc, max_left_semantic_context)
1196 (scanner_initialize, scanner_free, scanner_last_string_free)
1197 (gram_out, gram_lineno, YY_DECL_): Move to...
1198 * src/scan-gram.h: this new file.
1199 (YY_DECL): Rename as...
1200 (GRAM_DECL): this.
1201 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
1202 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1203 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1204 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1205 Move these declarations, and...
1206 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
1207 these to...
1208 * src/flex-scanner.h: this new file.
1209 * src/scan-gram.l (rule_length, rule_length_overflow)
1210 (increment_rule_length): Remove.
1211 (last_braced_code_loc): Rename as...
1212 (gram_last_braced_code_loc): this.
1213 Adjust to the changes of the parser.
1214 Move all the handling of $ and @ into...
1215 * src/scan-code.l: here.
1216 * src/scan-gram.l (handle_dollar, handle_at): Remove.
1217 (handle_action_dollar, handle_action_at): Move to...
1218 * src/scan-code.l: here.
1219 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
1220 scan-code.h, scan-code-c.c, scan-gram.h.
1221 (EXTRA_bison_SOURCES): Add scan-code.l.
1222 (BUILT_SOURCES): Add scan-code.c.
1223 (yacc): Be robust to white spaces.
1224
1225 * tests/conflicts.at, tests/input.at, tests/reduce.at,
1226 * tests/regression.at: Adjust the column numbers.
1227 * tests/regression.at: Adjust the error message.
7891a7c4 1228
184e42f0
JD
12292006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1230
1231 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1232 Use Akim's wording from
1233 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
1234
7891a7c4
JD
12352006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1236
1237 Between Bison releases, manually append `+' to the previous Bison
1238 release number, and use that as a signal to automatically print the
1239 ChangeLog's CVS Id keyword from --version. Discussed starting at
1240 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
1241 * ChangeLog: Add Id header.
1242 * configure.ac (AC_INIT): Append `+' to `2.3'.
1243 * src/.cvsignore: Add revision.c.
1244 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1245 (BUILT_SOURCES): Add revision.c.
1246 (revision.c): New target rule. This file defines a new global variable
1247 named revision. It initializes it with either the Id from ChangeLog
1248 or, if VERSION doesn't contain `+', with the empty string.
1249 * src/getargs.c (version): Print the value of revision.
1250 * src/revision.h: Extern revision.
1251
4ad3ed84
PE
12522006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1253
1254 * NEWS: Version 2.3.
1255 * configure.ac (AC_INIT): Likewise.
1256
02103984
PE
12572006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1258
1259 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1260 with no arguments, not as an object-like macro. This is for
1261 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1262 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1263 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1264 Document this.
1265
2c08afa5
JD
12662006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1267
1268 * src/getargs.c (usage): Back out yesterday's modification of the
1269 --help output so that we don't have to wait for translation before
1270 releasing 2.3.
1271
6077da58
PE
12722006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1273
1274 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1275 Problem reported by Akim Demaille.
1276
2a26b6c2
JD
12772006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1278
1279 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1280
aefef0d6
PE
12812006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1282
1283 * data/yacc.c (yy_reduce_print): Omit trailing white space in
1284 generated source code. Problem reported by Frans Englich in
1285 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
1286
fcd8e201
PE
12872006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1288
1289 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
1290 shell, not within 'make', so that 'make' by an ordinary builder
1291 (using GNU make) does not worry about configuring gzip. This also
1292 works around a bug reported independently by Keith Thompson and by
1293 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
1294 stderr rather than stdout, messing up the build logs.
1295
7b5cdcbd
JD
12962006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1297
1298 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
1299 to make sure that YYID will never be unused. This fixes a 'make
1300 maintainer-check' failure caused by the recent changes to the 'Trivial
1301 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
1302 not used.
1303 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
1304
5ad0a449
JD
13052006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1306
1307 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
1308 state before an empty RHS is always resolved here. Only the location
1309 of that state is guaranteed to be resolved, and that's enough. This
1310 fixes the remaining bug reported by Derek M. Jones in
1311 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1312 * tests/glr-regression.at (Uninitialized location when reporting
1313 ambiguity): Test the above case.
1314 Also, the embedded comments in this test case claim it checks the case
1315 of an empty RHS that has inherited the initial location. However, the
1316 corresponding LHS was already resolved, so yyresolveLocations didn't
1317 actually have reason to modify it. Fix this by forcing
1318 nondeterministic operation at the beginning of the parse.
1319
50cce58e
PE
13202006-05-20 Paul Eggert <eggert@cs.ucla.edu>
1321
1322 * data/c.m4 (b4_yy_symbol_print_generate):
1323 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
1324 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
1325 of the bugs reported today by Derek M Jones in
1326 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1327 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
1328 defined to be a type name without parens or brackets.
1329 (Location Type): Similarly for YYLTYPE.
1330 * tests/regression.at (Trivial grammars): Put in a test for this
1331 bug that will be caught by 'make maintainer-check' (though not,
1332 alas, by 'make check' unless your compiler is picky).
1333
ab8d9dc5
PE
13342006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1335
0d2c8934 1336 * NEWS: Version 2.2.
ab8d9dc5
PE
1337 * configure.ac (AC_INIT): Likewise.
1338
9138c575
JD
13392006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
1340
1341 * data/glr.c (yyreportTree): Make room in yystates for the state
1342 preceding the RHS. This fixes the segmentation fault reported by Derek
1343 M. Jones in
1344 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
1345 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
1346 to the user. Reported for yyreportTree by Derek M. Jones later in the
1347 same thread.
1348 * THANKS: Add Derek M. Jones.
1349 Update my email address.
1350 Fix typo in Steve Murphy's name.
1351
276f48df
PE
13522006-05-14 Paul Eggert <eggert@cs.ucla.edu>
1353
d6645148
PE
1354 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
1355 checking against YYLAST that caused the parser to miss a potential
1356 alternative in its diagnostic.
1357 Problem reported by Maria Jose Moron Fernandez in
1358 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
1359 * data/lalr1.cc (yysyntax_error_): Likewise.
1360 * data/yacc.c (yysyntax_error): Likewise.
1361 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
1362 tokens, in case we run into an older C compiler.
1363 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
1364 Use them to check for the off-by-one error fixed above.
1365
276f48df
PE
1366 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
1367 YYSIZE_T, not size_t.
1368 * tests/regression.at (Trivial grammars): New test, to catch
1369 the error fixed by the above patch.
1370
cd8b5791
AD
13712006-05-14 Akim Demaille <akim@lrde.epita.fr>
1372
1373 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
1374 scheme.
1375 Reported by Steve Murphy.
1376
34376418
AD
13772006-05-14 Akim Demaille <akim@lrde.epita.fr>
1378
1379 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
1380 * data/glr.cc: b4_location_flag is now b4_locations_flag.
1381
327afc7c
AD
13822006-05-14 Akim Demaille <akim@lrde.epita.fr>
1383
1384 Implement --trace=m4.
1385 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
1386 * src/output.c (output_skeleton): When set, pass -dV to m4.
1387
1388 Factor the handling of flags in m4.
1389 * src/output.c (prepare): Rename the muscle names debug, defines,
1390 error_verbose to debug_flag, defines_flag, error_verbose_flag.
1391 * data/c.m4: Adjust.
1392 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
1393 Use b4_define_flag_if to define other b4_FLAG_if macros.
1394 (b4_location_if): As a consequence, rename as...
1395 (b4_locations_if): this, for consistency.
1396 Adjust all the skeletons.
1397
ba9ecd19
AD
13982006-05-14 Akim Demaille <akim@lrde.epita.fr>
1399
1400 * etc/bench.pm: Shorten bench names.
1401
4e83ea15
AD
14022006-05-14 Akim Demaille <akim@lrde.epita.fr>
1403
1404 * src/output.h, src/output.c (error_verbose): Move to...
1405 * src/getargs.h, src/getargs.c: here.
1406 Sort the flags.
1407 Adjust dependencies.
1408
6e93d810
PE
14092006-05-13 Paul Eggert <eggert@cs.ucla.edu>
1410
1411 * data/c.m4 (b4_copyright): Put the special exception for Bison
1412 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
1413 uses changed. Suggested by Akim Demaille. Also, wrap the
1414 copyright notice, in case it is longer than 80 columns. Replace
1415 comma by newline after title.
6e93d810 1416
eaea13f5
PE
14172006-05-11 Paul Eggert <eggert@cs.ucla.edu>
1418
1419 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
1420 incompatibility, not a bug. Mention that it wasn't fixed as of
1421 flex 2.5.33.
1422
3cf084ec
AD
14232006-05-11 Akim Demaille <akim@lrde.epita.fr>
1424
1425 * examples/extexi: Enforce the precedence of concatenation over
1426 >>.
0a9f1c7d 1427 Reported by Tommy Nordgren.
3cf084ec 1428
32c96bd7
AD
14292006-05-11 Akim Demaille <akim@lrde.epita.fr>
1430
1431 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
1432 with the member "token".
f94705b2 1433 Reported by Martin Nylin.
32c96bd7 1434
eaea13f5
PE
14352006-05-08 Paul Eggert <eggert@cs.ucla.edu>
1436
1437 * data/glr.c: Switch to Bison 2.2 special-exception language in
1438 the copyright notice. Use more-regular format for titles and
1439 copyright notices.
1440 * data/glr.cc: Likewise.
1441 * data/location.cc: Likewise.
1442 * data/yacc.cc: Likewise.
1443 * doc/bison.texinfo (Conditions): Document this.
1444 * NEWS: likewise. Upgrade version to 2.2.
1445
6e2d1146
AD
14462006-04-27 Akim Demaille <akim@lrde.epita.fr>
1447
1448 * data/glr.cc: Remove dead code.
1449
47671055
PE
14502006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1451
1452 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
1453 that variable and the line breaks the bootstrap. Problem reported
1454 by Juan M. Guerrero.
1455
ed2e6384
AD
14562006-04-24 Akim Demaille <akim@lrde.epita.fr>
1457
1458 * doc/bison.texinfo (Multiple start-symbols): New.
1459
3cedc2dc
AD
14602006-04-24 Akim Demaille <akim@lrde.epita.fr>
1461
1462 * etc/README, etc/bench.pl: New.
1463
b2ddc3f3
AD
14642006-04-03 Akim Demaille <akim@lrde.epita.fr>
1465
1466 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
1467 rule.
1468 Reported by Mickael Labau.
1469 * tests/input.at (Torturing the Scanner): Test it.
1470
91e3ac9a
PE
14712006-03-16 Paul Eggert <eggert@cs.ucla.edu>
1472
1473 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
1474 Problem reported by Bob Rossi.
1475
14762006-03-13 Paul Eggert <eggert@cs.ucla.edu>
1477
1478 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
1479 and didn't really work.
1480 For the index, use @ifnotinfo, not @iftex.
1481 Minor cleanups of spacing and terminology.
1482
5cf61e93
AD
14832006-03-12 Akim Demaille <akim@lrde.epita.fr>
1484
1485 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
1486 of AT_NAME_PREFIX when %name-prefix is not used.
1487
aa08666d
AD
14882006-03-12 Akim Demaille <akim@lrde.epita.fr>
1489
1490 Apply --prefix to C++ skeletons too: they change the namespace.
1491 The test suite already exercize these cases.
1492 * data/c++.m4 (b4_namespace): New.
1493 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
1494 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
1495 * data/yacc.c, data/glr.c: Remove a useless `[]'.
1496 * doc/bison.texinfo: Document it.
1497 (Option Cross Key): Use @multitable in all formats. It looks
1498 nicer, even in TeX outputs.
1499 (Rules): Use the same code whatever the output type is.
1500 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
1501 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
1502 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 1503
45567173
AD
15042006-03-10 Akim Demaille <akim@lrde.epita.fr>
1505
1506 * TODO: Remove dead items.
1507
e9d8f881 15082006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
1509
1510 * doc/FAQ: Remove, merged into...
1511 * doc/bison.texinfo (FAQ): this.
1512 * doc/Makefile.am (EXTRA_DIST): Adjust.
1513
c095d689
AD
15142006-03-10 Akim Demaille <akim@lrde.epita.fr>
1515
1516 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
1517 even if empty.
1518 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
1519 * doc/bison.texinfo (Calc++ Scanner): Use it.
1520
6e0f8287
PE
15212006-03-09 Paul Eggert <eggert@cs.ucla.edu>
1522
1523 Fix two nits reported by twlevo, plus one more that I discovered.
1524
1525 * src/assoc.h (assoc_to_string): Give a name to the arg, as
1526 this is the usual Bison style.
1527 * src/location.h (location_print): Likewise.
1528
1529 * src/reader.h (token_name): Likewise.
1530
d6b771c3
PE
15312006-03-08 Paul Eggert <eggert@cs.ucla.edu>
1532
1533 Fix some nits reported by twlevo.
1534 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
1535 and "POSIX". Use more-modern syntax for URLs. Mention C++
1536 and ask for Java. Don't hardwire OS version numbers. Add
1537 copyright notice.
1538 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
1539 * src/conflicts.c (solved_conflicts_obstack): Now static.
1540
1e137b71
JD
15412006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1542
1543 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
1544 page. Say "you can use it" not "you may use it" as on the web page;
1545 we're describing capabilities not granting permission.
1546
73f2e47e
PE
15472006-03-06 Paul Eggert <eggert@cs.ucla.edu>
1548
6d05403d
PE
1549 * data/glr.c (yyresolveLocations): Rename local variables to avoid
1550 shadowing warnings. Use usual patter for iterating through RHS.
1551 * tests/glr-regression.at
1552 (Uninitialized location when reporting ambiguity):
1553 Modify yylex so that it uses its argument, rather than trying
1554 to rely on ARGSUSED (which doesn't work for gcc with warnings).
1555 const char -> char const.
1556
73f2e47e
PE
1557 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
1558 Don't use tabs inside commands; it messes up 'ps'.
1559 Problem reported by twlevo.
1560
8710fc41
JD
15612006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
1562
1563 * tests/glr-regression.at (Uninitialized location when reporting
1564 ambiguity): New test case.
1565 * data/glr.c (yyresolveLocations): New function, which uses
1566 YYLLOC_DEFAULT.
1567 (yyresolveValue): Invoke yyresolveLocations before reporting an
1568 ambiguity.
1569 * doc/bison.texinfo (Default Action for Locations): Note
1570 YYLLOC_DEFAULT's usage for ambiguity locations.
1571 (GLR Semantic Actions): Cross-reference those notes.
1572
ae952af2
JD
15732006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
1574
1575 * tests/glr-regression.at (Leaked semantic values when reporting
1576 ambiguity): Remove unnecessary union and type declarations.
1577 (Leaked lookahead after nondeterministic parse syntax error): New test
1578 case.
1579 * data/glr.c (yyparse): Check for zero stacks remaining before
1580 attempting to shift the lookahead so that you don't lose it.
1581
35ee866a
JD
15822006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1583
1584 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
1585 * tests/glr-regression.at (Leaked semantic values when reporting
1586 ambiguity): New test case.
1587 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
1588 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
1589 now unnecessary yystackp parameter.
1590 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
1591 destructors can be called.
1592
1593 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
1594 in existing testcases.
1595
520181ab
JD
15962006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1597
1598 Don't leak semantic values for parent RHS when a user action cuts the
1599 parser, and clean up related code a bit.
1600 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
1601 cuts parse): Rename to...
1602 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
1603 for leaked parent RHS values.
1604 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
1605 between an unresolved state (non-empty chain of semantic options) and
1606 an incomplete one (signaled by an empty chain).
ae952af2 1607 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
1608 successfully or unsuccessfully resolved yyGLRState to...
1609 (yyresolveValue): ... here so that yyresolveValue always leaves a
1610 yyGLRState with consistent data and thus is easier to understand.
1611 Remove the yyvalp and yylocp parameters since they are always just
1612 taken from the yys parameter. When reporting a discarded merged value
1613 in debugging output, note that it is incompletely merged. Document the
1614 interface.
1615 (yyresolveAction): If resolving any of the RHS states fails, destroy
1616 them all rather than leaking them. Thus, as long as user actions are
1617 written to clean up the RHS correctly, yyresolveAction always cleans up
1618 the RHS of a semantic option. Document the interface.
1619
18d9185c
PE
16202006-02-27 Paul Eggert <eggert@cs.ucla.edu>
1621
1622 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
1623 led to a segmentation fault in GNU Pascal. Problem reported
1624 by Waldek Hebisch.
1625
841a7737
JD
16262006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
1627
1628 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
1629 mid-rule action inside a nonterminal symbol in order to declare a
1630 destructor for its semantic value.
1631
fc3f467f
PE
16322006-02-16 Paul Eggert <eggert@cs.ucla.edu>
1633
1634 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
1635 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
1636 __cplusplus && ! defined _STDLIB_H && !
1637 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
1638 defined free))]: Include <stdlib.h> rather than rolling our own
1639 declarations of malloc and free, to avoid problems with
1640 incompatible declarations (using 'throw') C++'s stdlib.h. This
1641 should fix Debian bug 340012
1642 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
1643 reported by Guillaume Melquiond.
1644
a3af26dd
PE
16452006-02-13 Paul Eggert <eggert@cs.ucla.edu>
1646
4d7bc38c
PE
1647 * NEWS: Clarify symbols versus types in unused-value warnings.
1648
a3af26dd
PE
1649 * configure.ac (AC_INIT): Bump version number.
1650
4e26c69e
PE
16512006-02-13 Paul Eggert <eggert@cs.ucla.edu>
1652
1653 * NEWS: Version 2.1a.
1654 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
1655 since C99 requires this.
1656
498e897c
PE
16572006-02-11 Paul Eggert <eggert@cs.ucla.edu>
1658
1659 * m4/c-working.m4: New file.
1660 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
1661
57bb17ca
PE
16622006-02-10 Paul Eggert <eggert@cs.ucla.edu>
1663
1664 * Makefile.maint: Merge from coreutils.
1665
0be105dc
PE
16662006-02-09 Paul Eggert <eggert@cs.ucla.edu>
1667
1668 More portability fixes for problems summarized by Nelson H. F. Beebe.
1669
1670 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
1671 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
1672 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
1673 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
1674 messes up because C++ code is compiled in 32-bit mode but linked
1675 in 64-bit mode.
1676
6fc0c024
PE
16772006-02-08 Paul Eggert <eggert@cs.ucla.edu>
1678
1679 More portability fixes for problems summarized by Nelson H. F. Beebe.
1680
7870f699
PE
1681 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
1682 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
1683
6fc0c024
PE
1684 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
1685 nodist_PROGRAMS, since we don't need to actually compile the
1686 example if we're just doing a plain 'make'. This avoids bothering
1687 the installer unnecessarily about problems due to weird C++
1688 compilers.
1689
fe6c2fde
PE
16902006-02-06 Paul Eggert <eggert@cs.ucla.edu>
1691
1692 More portability fixes for problems summarized by Nelson H. F. Beebe.
1693
1694 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
1695 than #include "...", and compile with -I'.'. The old method was
1696 not portable, according to Posix and the C standard, and it does
1697 not work with Sun C 5.7, where previous #line directives affect
1698 the working directory used in later #include "..." directives.
1699
927b425b
JMG
17002006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1701
1702 Various DJGGP specific issues in /djgpp
1703
d9735e9e
PE
17042006-02-02 Paul Eggert <eggert@cs.ucla.edu>
1705
1706 More portability fixes for problems summarized by Nelson H. F. Beebe.
1707
1708 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
1709 '#include <map>' works and that you can apply ++ to iterators.
1710
5a6755af
PE
17112006-02-01 Paul Eggert <eggert@cs.ucla.edu>
1712
67a0dc4f
PE
1713 Work around portability problems summarized by Nelson H. F. Beebe in
1714 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
1715
8c86f0ef
PE
1716 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
1717 that '#include <string>' works.
1718
de35dd59
PE
1719 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
1720 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
1721 "warning: sorry: semantics of inline function static data `const
1722 unsigned char translate_table[262]' are wrong (you'll wind up with
1723 multiple copies)".
1724
67a0dc4f
PE
1725 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
1726 or, xor to not_, and_, or_, and xor_, respectively. This works
1727 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
1728 random system header somewhere that includes the equivalent of
1729 <iso646.h>.
1730
5a6755af
PE
1731 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
1732 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 1733 Suite Version 2.0.
5a6755af 1734
3f001415
JD
17352006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
1736
1737 During deterministic GLR operation, user actions should be able to
1738 influence the parse by changing yychar. To make this easier to fix and
1739 to make glr.c easier to evolve in general, don't maintain yytoken in
1740 parallel with yychar; just compute yytoken when needed.
1741 * tests/glr-regression.at (Incorrect lookahead during deterministic
1742 GLR): Check that setting yychar in a user action has the intended
1743 effect.
1744 * data/glr.c (yyGLRStack): Remove yytokenp member.
1745 (yyclearin): Don't set *yytokenp.
1746 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
1747 yychar rather than *yytokenp to determine the current lookahead.
1748 Compute yytoken locally when needed.
1749 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
1750 point to.
1751
1752 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
1753 after `--report' documentation.
1754
e2a8c0f5
PE
17552006-01-30 Paul Eggert <eggert@cs.ucla.edu>
1756
1757 * src/parse-gram.y (grammar_declaration): Location of printer
1758 symbol is @1, not list->location. Bug reported by twlevo.
1759 * tests/input.at (Incompatible Aliases): Adjust to above change.
1760
6b702268
PE
17612006-01-29 Paul Eggert <eggert@cs.ucla.edu>
1762
27622431
PE
1763 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
1764 all the test at once. This makes the output easier to read in the
1765 normal case.
1766
6b702268
PE
1767 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
1768 got from <http://bro-ids.org/download.html>. The bug is that
1769 when two actions appeared in succession, the second one was
1770 scanned before the first one was added to the grammar rule
1771 as a midrule action. Bison then output the incorrect warning
1772 "parse.y:905.17-906.36: warning: unused value: $3".
1773 * src/parse-gram.y (BRACED_CODE, action): These are no longer
1774 associated with a value.
1775 (rhs): Don't invoke grammar_current_rule_action_append.
1776 (action): Invoke it here instead.
1777 * src/reader.c (grammar_midrule_action): Now extern.
1778 (grammar_current_rule_action_append): Don't invoke
1779 grammar_midrule_action; that is now the scanner's job.
1780 * src/reader.h (last_string, last_braced_code_loc):
1781 (grammar_midrule_action): New decls.
1782 * src/scan-gram.l (last_string): Now extern, sigh.
1783 (last_braced_code_loc): New extern variable.
1784 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
1785 rule already has an action.
1786 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
1787 * tests/input.at (AT_CHECK_UNUSED_VALUES):
1788 Add some tests to check that the above changes fixed the bug.
1789
d40ba6c2
PE
17902006-01-27 Paul Eggert <eggert@cs.ucla.edu>
1791
1792 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
1793 All used changed. Check whether the symbol has a destructor,
1794 not whether it is typed.
1795 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
1796 that the values are still reported as unused. All line numbers
1797 adjusted.
1798
401aace6
PE
17992006-01-23 Paul Eggert <eggert@cs.ucla.edu>
1800
1801 Work around a bug in bro 0.8, which underparenthesizes its
1802 definition of YYLLOC_DEFAULT.
1803 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
1804 their arguments.
1805 * data/lalr1.cc: Likewise.
1806 * data/yacc.cc: Likewise.
1807
06f01bc4
PE
18082006-01-22 Paul Eggert <eggert@cs.ucla.edu>
1809
401aace6
PE
1810 Work around a bug in Pike 7.0, and give the Pike folks a
1811 better way to override the usual int widths.
1812 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
1813 user can override the types.
1814 (short): #undef, to work around a bug in Pike 7.0.
1815 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
1816 (union yyalloc.yyss): Use yytype_int16 rather than short.
1817 All uses changed.
1818 (yysigned_char): Remove.
1819 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
1820 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
1821 * tests/regression.at (Web2c Actions): Adjust to above changes.
1822
1823 * src/reader.c (check_and_convert_grammar): New function.
1824 (reader): Close the input file even if something went wrong during
1825 parsing. Minor file descriptor leak reported by twlevo.
1826
06f01bc4
PE
1827 * src/assoc.c (assoc_to_string): Use a default: abort (); case
1828 to pacify gcc -Wswitch-default.
1829 * src/scan-gram.l (adjust_location): Use a default: break; case
1830 to pacify gcc -Wswitch-default.
1831 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
1832 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
1833 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
1834 Move these decls to scan-skel.l, since they don't need to be
1835 visible elsewhere.
1836 * src/scan-skel.l: Accept the above decls.
1837 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
1838 is used.
1839
02650b7f
PE
18402006-01-21 Paul Eggert <eggert@cs.ucla.edu>
1841
1842 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
1843 since we don't want to insist on a version number at the start
1844 of the changelog every time.
1845 * Makefile.maint: Sync from coreutils a bit better.
1846 (sc_trailing_blank): Renamed from sc_trailing_space.
1847 All uses changed.
1848 (sc_no_if_have_config_h, sc_require_config_h):
1849 (sc_prohibit_assert_without_use): New rules.
1850 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
1851 (sc_dd_max_sym_length): Fix leading spaces in rule.
1852 (sc_system_h_headers): Prefix with @.
1853 (sc_useless_cpp_parens, m4-check): Output line numbers.
1854 (changelog-check): Allow version only in head.
1855 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
1856 satisfy new Makefile.maint rule.
1857 * data/glr.c: Likewise.
1858 * data/glr.cc: Likewise.
1859 * data/lalr1.cc: Likewise.
1860 * data/yacc.c: Likewise.
1861 * lib/ebitsetv.c: Likewise.
1862 * lib/lbitset.c: Likewise.
1863 * lib/subpipe.c: Likewise.
1864 * lib/timevar.c: Likewise.
1865 * src/system.h: Likewise.
1866 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
1867 * djgpp/Makefile.maint: Add copyright notice.
1868 * djgpp/README.in: Likewise.
1869 * djgpp/config.bat: Likewise.
1870 * djgpp/config.site: Likewise.
1871 * djgpp/config_h.sed: Likewise.
1872 * djgpp/djunpack.bat: Likewise.
1873 * djgpp/config.sed: Fix copyright notice to match standard format.
1874 * djgpp/subpipe.h: Likewise.
1875 * lib/bitsetv-print.c: Likewise.
1876 * lib/bitsetv.c: Likewise.
1877 * lib/subpipe.h: Likewise.
1878 * lib/timevar.c: Likewise.
1879 * lib/timevar.h: Likewise.
1880 * djgpp/subpipe.c: Use standard recipe for config.h.
1881 * lib/abitset.c: Likewise.
1882 * lib/bitset.c: Likewise.
1883 * lib/bitset_stats.c: Likewise.
1884 * lib/bitsetv-print.c: Likewise.
1885 * lib/bitsetv.c: Likewise.
1886 * lib/ebitsetv.c: Likewise.
1887 * lib/get-errno.c: Likewise.
1888 * lib/lbitset.c: Likewise.
1889 * lib/subpipe.c: Likewise.
1890 * lib/timevar.c: Likewise.
1891 * lib/vbitset.c: Likewise.
1892 * tests/local.at: Likewise.
1893 * src/scan-gram.l: Don't include verify.h, since system.h does
1894 that for us.
1895 * .x-sc_require_config_h: New file.
1896 * .x-sc_unmarked_diagnostics: New file.
1897
287c78f6
PE
18982006-01-20 Paul Eggert <eggert@cs.ucla.edu>
1899
287c78f6
PE
1900 Be a bit more systematic about using 'abort'.
1901 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
1902 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
1903 Put 'default: abort ();' before some other case, to satisfy older
1904 pedantic compilers.
1905 * lib/bitset_stats.c (bitset_stats_init): Likewise.
1906 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
1907 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
1908 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
1909 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
1910 (get_decision_str, get_orientation_str, get_node_alignment_str):
1911 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
1912 (get_linestyle_str, get_arrowstyle_str): Likewise.
1913 * src/conflicts.c (resolve_sr_conflict):
1914 Use a default case rather than one for the one remaining enum
1915 value, to catch invalid enum values as well.
1916 * src/lalr.c (set_goto_map, map_goto):
1917 Prefer "assert (FOO);" to "if (!FOO) abort ();".
1918 * src/nullable.c (nullable_compute, token_definitions_output):
1919 Likewise.
1920 * src/reader.c (packgram, reader): Likewise.
1921 * src/state.c (transitions_to, state_new, state_reduction_find):
1922 Likewise.
1923 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
1924 (symbol_pack): Likewise.
1925 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
1926 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
1927 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
1928 * src/system.h: Don't include <assert.h>.
1929 (assert): New macro.
1930
1931 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
1932 (Destructor Decl, Parser Function, Pure Calling):
1933 Describe rules for braces inside C code more carefully.
287c78f6 1934
c66dfadd
PE
19352006-01-19 Paul Eggert <eggert@cs.ucla.edu>
1936
c21493b8
PE
1937 Fix some porting glitches found by Nelson H. F. Beebe.
1938 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
1939 compilers that don't understand that abort () does not return.
1940 * src/state.c (transitions_to): Likewise.
1941 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
1942 that '#include <cstdlib>' works.
1943 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
1944 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
1945 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
1946 for the benefit of some pre-C99 compilers.
1947
b6e3facf
PE
1948 * bootstrap: Undo changes to gnulib files that autoreconf made.
1949
c66dfadd
PE
1950 Minor fixups to get 'make maintainer-check' to work.
1951 * configure.ac: Don't use -Wnested-externs, as it's incompatible
1952 with the new verify.h implementation.
1953 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
1954 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
1955 * data/yacc.c (YYUSE): Likewise.
1956 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
1957 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
1958 * src/parse-gram.y (declaration): Don't pass a string constant
1959 to a function that expects char *, since GCC might complain
1960 about the constant value.
1961 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
1962 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
1963 before #defining them.
1964 * tests/glr-regression.at
1965 (Incorrectly initialized location for empty right-hand side in GLR):
1966 In yyerror, use the msg arg.
1967 (Corrupted semantic options if user action cuts parse):
1968 (Incorrect lookahead during deterministic GLR):
1969 (Incorrect lookahead during nondeterministic GLR):
1970 Don't name a local var 'index'; it shadows string.h's 'index'.
1971
ed94ef2a
AD
19722006-01-19 Akim Demaille <akim@epita.fr>
1973
1974 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
1975 location, not just parts of it.
1976
e9ad4aec
PE
19772006-01-18 Paul Eggert <eggert@cs.ucla.edu>
1978
d6ca7905
PE
1979 * NEWS: Document the fact that multiple %unions are now allowed.
1980 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
1981 * TODO: This feature is now implemented, so remove it from
1982 the wishlist.
d6ca7905 1983
ef1b70e0
PE
1984 * Makefile.maint: Merge with coreutils Makefile.maint.
1985 (CVS_LIST): Use build-aux version if available.
1986 (VERSION_REGEXP): New macro.
1987 (syntax-check-rules): Add sc_no_if_have_config_h,
1988 sc_prohibit_assert_without_use, sc_require_config_h,
1989 sc_useless_cpp_parens.
1990 (sc_obsolete_symbols): Check for O_NDELAY.
1991 (sc_dd_max_sym_length): Track coreutils.
1992 (sc_unmarked_diagnostics): Look in all files, not just *.c.
1993 (sc_useless_cpp_parens): New rule.
1994 (news-date-check): Look for version or today's date.
1995 (changelog-check): Don't require version number near head.
1996 (copyright-check): Use current year instead of hardwiring 2005.
1997 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
1998 (announcement): Add --gpg-key-ID.
1999
2000 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
2001 with "file system".
2002
2073ce56 2003 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
2004 array. Problem reported by twlevo.
2005 * src/reader.c (packgram): Prepend a new sentinel before ritem.
2006 * src/lalr.c (build_relations): Rely on new sentinel.
2007 * src/gram.c (gram_free): Adjust to new sentinel.
2008
b7691f15
JD
20092006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
2010
2011 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
2012 yylookaheadNeeds. All uses updated.
2013 (yysplitStack): Rename local yynewLookaheadStatuses to
2014 yynewLookaheadNeeds.
2015 * data/glr-regression.at (Incorrect lookahead during nondeterministic
2016 GLR): In comments, change `lookahead status' to `lookahead need'.
2017
ddee1b06
PH
20182006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2019
2020 * data/glr.c (yysplitStack): A little stylistic rewrite.
2021
12f4614d
PH
20222006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2023
2024 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
2025
32c29292
JD
20262006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
2027
2028 * doc/bison.texinfo: Fix some typos.
2029 (GLR Semantic Actions): New subsection discussing special
2030 considerations because GLR semantic actions might be deferred.
2031 (Actions): Mention look-ahead usage of yylval.
2032 (Actions and Locations): Mention look-ahead usage of yylloc.
2033 (Special Features for Use in Actions): Add YYEOF entry and mention it
2034 in the yychar entry.
2035 In the yychar entry, remove mention of the local yychar case (pure
2036 parser) since this is irrelevant information when writing semantic
2037 actions and since it's already discussed in `Bison Symbols' where
2038 yychar is otherwise described as an external variable.
2039 In the yychar entry, don't call it the `current' look-ahead since it
2040 isn't when semantic actions are deferred.
2041 In the yychar and yyclearin entries, add note about deferred semantic
2042 actions.
2043 Add yylloc and yylval entries discussing look-ahead usage.
2044 (Look-Ahead Tokens): When discussing yychar, don't call it the
2045 `current' look-ahead, and do mention yylval and yylloc.
2046 (Error Recovery): Cross-reference `Action Features' when mentioning
2047 yyclearin.
2048 (Bison Symbols): In the yychar entry, don't call it the `current'
2049 look-ahead.
2050 In the yylloc and yylval entries, mention look-ahead usage.
2051
de366a2f 20522006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
2053
2054 * tests/glr-regression.at: Update copyright year to 2006.
2055
bf70fa87
JD
20562006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2057
2058 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
2059 use during nondeterministic operation to track which stacks have
2060 actually needed the current lookahead.
2061 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
2062 Allocate, deallocate, resize, and otherwise shuffle space for
2063 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
2064 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
2065 appropriately during nondeterministic operation.
2066 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
2067 members to store the current lookahead to be used by the deferred
2068 user action.
2069 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
2070 from which the RHS is taken. Set the lookahead members of the new
2071 yySemanticOption according to the lookahead status for stack yyk.
2072 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
2073 yyaddDeferredAction.
2074 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
2075 members of yySemanticOption before invoking yyuserAction, and then set
2076 them back to their current values afterward.
2077 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
2078 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
2079 * tests/glr-regression.at: Remove `.' from the ends of recent test case
2080 titles for consistency.
2081 (Leaked merged semantic value if user action cuts parse): In order to
2082 suppress lint warnings, use arguments in merge function, and assign
2083 char value < 128 in main.
2084 (Incorrect lookahead during deterministic GLR): New test case.
2085 (Incorrect lookahead during nondeterministic GLR): New test case.
2086
05449a2c
JD
20872006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
2088
de366a2f 2089 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
2090 !yyvaluep as signal that no semantic value is available to print.
2091 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
2092 to print a semantic value.
2093
4158e0a1 20942006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 2095
4158e0a1
JD
2096 * tests/glr-regression.at: For consistency with my newer test cases,
2097 don't thank myself.
2098
d659304d
JD
20992006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
2100
2101 * data/glr.c (yyresolveValue): When merging semantic options, if at
2102 least one user action succeeds but a later one cuts the parse, then
2103 destroy the semantic value before returning rather than leaking it.
2104 (yyresolveStates): If a user action cuts the parse and thus
2105 yyresolveValue fails, ignore the (unset) semantic value rather than
2106 corrupting the yyGLRState, and empty the semantic options list since
2107 the user actions should have called all necessary destructors.
2108 Simplify code with YYCHK.
2109 * tests/glr-regression.at (Corrupted semantic options if user action
2110 cuts parse): New test case.
2111 (Undesirable destructors if user action cuts parse): New test case.
2112 Before applying any of this patch, this test case never actually failed
2113 for me... but only because the corrupted semantic options usually
2114 masked this bug.
2115 (Leaked merged semantic value if user action cuts parse): New test
2116 case.
2117
6ec2c0f2
AD
21182006-01-05 Akim Demaille <akim@epita.fr>
2119
2120 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
2121
1b9c21fb
PE
21222006-01-04 Paul Eggert <eggert@cs.ucla.edu>
2123
2124 * data/c.m4 (b4_c_modern): New macro, with a new provision for
2125 _MSC_VER. Problem reported by Cenzato Marco.
2126 (b4_c_function_def): Use it.
2127 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
2128 b4_c_modern.
2129 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
2130 than rolling our own.
2131
84866159
AD
21322006-01-04 Akim Demaille <akim@epita.fr>
2133
2134 Also warn about non-used mid-rule values.
2135 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
2136 member.
2137 (symbol_list_new): Adjust.
2138 * src/reader.c (symbol_typed_p): New.
2139 (grammar_rule_check): Use it.
2140 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
2141 Check its rule.
2142 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
2143 Use it.
2144 * tests/actions.at (Exotic Dollars): Adjust.
2145
378f4bd8
AD
21462006-01-04 Akim Demaille <akim@epita.fr>
2147
2148 * src/reader.c (grammar_midrule_action): If $$ is set in a
2149 mid-rule, move the `used' bit to its lhs.
2150 * tests/input.at (Unused values): New.
2151 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
2152
e2a21b6f
PE
21532006-01-03 Paul Eggert <eggert@cs.ucla.edu>
2154
54662697
PE
2155 * doc/bison.texinfo (Bison Options): Say more accurately what
2156 --yacc does.
2157 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
2158 about declarations in the grammar when in Yacc mode, as POSIX does
2159 not require a diagnostic when the grammar uses extensions.
2160
2161 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2162
073f9288
PE
2163 Warn about dubious constructions like "%token T T".
2164 Reported by twlevo.
2165 * src/symtab.h (struct symbol.declared): New member.
2166 * src/symtab.c (symbol_new): Initialize it to false.
2167 (symbol_class_set): New arg DECLARING, specifying whether
2168 this is a declaration that we want to warn about, if there
2169 is more than one of them. All uses changed.
2170
1221b78a
PE
2171 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
2172 Allow multiple %union directives, whose contents concatenate.
2173 * src/parse-gram.y (grammar_declaration): Likewise.
2174 Use muscle_code_grow, so that we don't need stype_line any more.
2175 All uses changed.
2176
2177 * src/muscle_tab.c (muscle_grow): Fix comment.
2178
e2a21b6f
PE
2179 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
2180 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
2181 Update copyright year to 2006.
2182
8f7e3cf9
AD
21832006-01-03 Akim Demaille <akim@epita.fr>
2184
2185 Have glr.cc pass (some of) the calc.at tests.
2186 * data/glr.cc (b4_parse_param_orig): New.
2187 (b4_parse_param): Improve its definition, and bound it more
2188 clearly in the skeleton.
2189 (b4_epilogue): Append, instead of prepending, in order to keep
2190 #line consistency.
2191 Simplify the generation of auxiliary functions: locations and
2192 purity are mandated.
2193 (b4_global_tokens_and_yystype): Honor it.
2194 * data/location.cc (c++.m4): Don't include it.
2195 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
2196 and AT_SKEL_CC_IF.
2197 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2198 AT_LALR1_CC_IF.
2199 Be sure to initialize the first position's filename.
2200 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2201 mandated anyway.
2202 (AT_CHECK_CALC_GLR_CC): New.
2203 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2204
3953ed88
AD
22052006-01-02 Akim Demaille <akim@epita.fr>
2206
2207 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2208 c.m4.
0a96ba81 2209 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
2210 * data/glr.cc: Do not include stack.hh.
2211
9ecafbbf
AD
22122006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2213
2214 * data/glr.c: Reformat whitespace with tabs.
2215 (b4_lpure_formals): Remove this unused m4 macro.
2216 * tests/cxx-type.at: Reformat whitespace with tabs.
2217 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
2218 since it's a member. Rename type to isNterm for clarity.
2219
c4d497a0
AD
22202005-12-29 Akim <akim@sulaco.local>
2221
2222 Let glr.cc catch up with symbol_value_print.
2223 * data/glr.cc (b4_yysymprint_generate): Replace by...
2224 (b4_yy_symbol_print_generate): this.
2225 (yy_symbol_print, yy_symbol_value_print): Declare them.
2226
4517da37
PE
22272005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2228
2229 * src/location.h (boundary): Note that a line or column equal
2230 to INT_MAX indicates an overflow.
2231 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
2232 (rule_length_overflow, increment_rule_length, add_column_width):
2233 New functions.
2234 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
2235 (<SC_BRACED_CODE>"}"):
2236 Use increment_rule_length rather than incrementing it by hand.
2237 (adjust_location, handle_syncline): Diagnose overflow.
2238 (handle_action_dollar, handle_action_at):
2239 Fix bug with monstrosities like $-2147483648.
2240 Remove now-unnecessary checks.
2241 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2242 (convert_ucn_to_byte): Verify assumptions.
2243 (handle_syncline): New arg LOC. All callers changed.
2244 Don't store through a value derived from char const * pointer.
2245
2246 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2247 GCC warnings.
2248
e3233bf6
PE
22492005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2250
2251 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2252 Remove unnecessary forward static decls.
2253
8f3596a6
AD
22542005-12-27 Akim Demaille <akim@epita.fr>
2255
2256 * src/reader.c (grammar_current_rule_check): Also check that $$
2257 is used.
2258 Take the rule to check as argument, hence rename as...
2259 (grammar_rule_check): this.
2260 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2261 Rename as...
2262 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2263 (grammar_midrule_action, grammar_symbol_append): Now static.
2264 * tests/torture.at (input): Don't rely on the default action
2265 being always performed.
2266 * tests/calc.at: "Set" $$ even when the action is "cut" with
2267 YYERROR or other.
2268 * tests/actions.at (Exotic Dollars): Instead of using unused
2269 values, check that the warning is issued.
2270
721be13c
PE
22712005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2272
2273 * NEWS: Improve wording for unused-value warnings.
2274
a0af42fc
AD
22752005-12-22 Akim Demaille <akim@epita.fr>
2276
2277 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2278 (b4_yysymprint_generate): Rename as...
2279 (b4_yy_symbol_print_generate): this.
2280 Generate yy_symbol_print instead of yysymprint.
2281 Generate also yy_symbol_value_print, and use it.
2282
affac613
AD
22832005-12-22 Akim Demaille <akim@epita.fr>
2284
721be13c 2285 * NEWS: Warn about unused values.
affac613
AD
2286 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2287 a `used' member.
2288 (symbol_list_n_get, symbol_list_n_used_set): New.
2289 (symbol_list_n_type_name_get): Use symbol_list_n_get.
2290 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
2291 * src/reader.c (grammar_current_rule_check): Check that values are
2292 used.
2293 * src/symtab.c (symbol_print): Accept 0.
2294 * tests/existing.at: Remove the type information.
2295 Empty the actions.
2296 Remove useless actions (beware of mid-rule actions: perl -000
2297 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
2298 * tests/actions.at (Exotic Dollars): Use unused values.
2299 * tests/calc.at: Likewise.
2300 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2301 Likewise.
2302
2303 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
2304 rule_useful_p.
2305
9d9b8b70
PE
23062005-12-21 Paul Eggert <eggert@cs.ucla.edu>
2307
8bb4c753
PE
2308 Undo 2005-12-01 tentative license wording change. The wording is
2309 still being reviewed by the lawyers, and we don't want to wait for
2310 them before publishing a test release. For now, revert to the
2311 previous wording.
2312 * NEWS: Undo 2005-12-01 change.
2313 * data/glr.c: Revert to previous license wording.
2314 * data/glr.cc: Likewise.
2315 * data/lalr1.cc: Likewise.
2316 * data/location.cc: Likewise.
2317 * data/yacc.c: Likewise.
2318
9d9b8b70
PE
2319 * NEWS: Reword %destructor vs YYABORT etc.
2320 * data/glr.c: Use American spacing, for consistency.
2321 * data/glr.cc: Likewise.
2322 * data/lalr1.cc: Likewise.
2323 * data/yacc.c: Likewise.
2324 * data/yacc.c: Reformat comments slightly.
2325 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
2326 for consistency. Fix some spelling errors and reword recently-included
2327 text slightly.
2328 * tests/cxx-type.at: Cast results of malloc, for C++.
2329
2c3b392a
AD
23302005-12-21 Joel E. Denny <address@hidden>
2331
2332 * tests/cxx-type.at: Construct a tree, count the parents of shared
2333 nodes, and free each node once and only once. Previously, the memory
2334 for semantic values was leaked instead.
2335
d6cff4dc
AD
23362005-12-21 Joel E. Denny <address@hidden>
2337
2338 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
2339 (yylval, yylloc): If pure, #define to yystackp->yyval and
2340 yystackp->yyloc similar to yychar and yynerrs.
2341 (yyparse): If pure, remove local yylval and yylloc. Add local
2342 yystackp to accommodate pure definitions of yylval and yylloc.
2343 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
2344 yylvalp and yyllocp to &yylval and &yylloc.
2345 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
2346 namespace. Previously, nerrs and char were missing, but lval and lloc
2347 weren't necessary.
2348 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
2349 yylvalp and yyllocp parameters since, if pure, these are now always
2350 accessible through yystackp. If not pure, they are still accessible
2351 globally.
2352 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
2353 `if (YYID (N))' to pacify lint.
2354
a85284cf
AD
23552005-12-21 Akim Demaille <akim@epita.fr>
2356
2357 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
2358 destroy the RHS symbols of a rule.
2359 * data/yacc.c (yylen): Initialize to 0.
2360 Keep its value to the number of items to possibly shift.
2361 In particular, a regular successful parse that ends on YYFINAL by
2362 a (internal) YYACCEPT must not have yylen != 0.
2363 (yyerrorlab, yyreturn): Pop the RHS.
2364 Reorder a bit to emphasize the `shifting' bits of code.
2365 (YYPOPSTACK): Now accept a number of items to pop.
2366 * data/lalr1.cc: Likewise.
2367 * data/glr.c: Formatting changes.
2368 Use goto instead of fall through.
2369 * doc/bison.texinfo (Destructor Decl): Complete.
2370
d508c281
JMG
23712005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2372
2373 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
2374 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
2375 * djgpp/config.bat: Replace every occurence of the file name
2376 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
2377 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
2378 * djgpp/config.sed: Replace every occurence of the file name
2379 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
2380 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
2381 * djgpp/djunpack.bat: DJGPP specific file.
2382 * djgpp/fnchange.lst: DJGPP specific file.
2383 * djgpp/README.in: Add new information about how to unpack the bison
2384 source on MSDOS and other systems which have 8.3 file name restrictions
2385 using djunpack.bat and fnchange.lst.
2386
3e7a2cd9
PE
23872005-12-12 Paul Eggert <eggert@cs.ucla.edu>
2388
2389 * bootstrap (build_cvs_prefix): Remove; unused.
2390 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
2391 when getting gnulib.
2392
23932005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
2394
2395 * data/glr.c: Reorder typedef declarations for structs to match order
2396 of struct declarations.
2397 Rename yystack everywhere to yystackp except in yyparse where it's not
2398 a pointer.
2399 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
2400 consistency.
2401 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
2402 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
2403 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
2404 lint.
2405
877519f8
PE
24062005-12-09 Paul Eggert <eggert@cs.ucla.edu>
2407
0eca5a39
PE
2408 * tests/sets.at (Accept): Fix typos in regular expression used to
2409 sed out the final state number.
2410
2cec9080
PE
2411 Work around portability problem on Solaris 10: flex-generated
2412 files include <stdio.h> before <config.h>, which messes up
2413 because the latter defines __EXTENSIONS__. Address the problem
2414 by creating two new little files that include <config.h> first,
2415 then include the flex-generated files. Rewrite everyone else
2416 to include <config.h> first, as well.
2417 * lib/timevar.c: Always include "config.h".
2418 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
2419 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
2420 (EXTRA_bison_SOURCES): New macro.
2421 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
2422 * src/system.h: Don't include config.h.
2423 * src/LR0.c: Include <config.h> first.
2424 * src/assoc.c: Likewise.
2425 * src/closure.c: Likewise.
2426 * src/complain.c: Likewise.
2427 * src/conflicts.c: Likewise.
2428 * src/derives.c: Likewise.
2429 * src/files.c: Likewise.
2430 * src/getargs.c: Likewise.
2431 * src/gram.c: Likewise.
2432 * src/lalr.c: Likewise.
2433 * src/location.c: Likewise.
2434 * src/main.c: Likewise.
2435 * src/muscle_tab.c: Likewise.
2436 * src/nullable.c: Likewise.
2437 * src/output.c: Likewise.
2438 * src/parse-gram.y: Likewise.
2439 * src/print.c: Likewise.
2440 * src/print_graph.c: Likewise.
2441 * src/reader.c: Likewise.
2442 * src/reduce.c: Likewise.
2443 * src/relation.c: Likewise.
2444 * src/state.c: Likewise.
2445 * src/symlist.c: Likewise.
2446 * src/symtab.c: Likewise.
2447 * src/tables.c: Likewise.
2448 * src/uniqstr.c: Likewise.
2449 * src/vcg.c: Likewise.
2450
877519f8
PE
2451 * src/parse-gram.y: Fix minor problems uncovered by lint.
2452 (current_lhs, current_lhs_location): Now static.
2453 (current_assoc): Remove unused variable.
2454
2455 Cleanups so that Bison-generated parsers have less lint.
2456 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
2457 Prepend /*ARGSUSED*/, for lint's sake.
2458 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
2459 definition if 'lint' is defined.
2460 (YYID): New macro (or function, if lint).
2461 All uses of /*CONSTCOND*/0 replaced by YYID(0).
2462 * data/yacc.c: Likewise.
2463 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
2464 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
2465 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
2466 is C++ only.
2467 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
2468 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
2469 Use YYID(0) rather than 0, for lint.
2470 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
2471 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
2472
f5228370
PE
24732005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2474
2475 * tests/glr-regression.at
2476 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
2477 Close memory leak reported by twlevo.
2478
69ce078b
PE
24792005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
2480
6ff99711
PE
2481 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
2482 all stacks.
2483 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
2484 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2485 New test case.
2486 (Duplicated user destructor for lookahead): This test now is expected
2487 to succeed.
2488
af3412cd
PE
24892005-12-01 Paul Eggert <eggert@cs.ucla.edu>
2490
32b5b719 2491 * NEWS: Document the following change.
af3412cd
PE
2492 * data/yacc.c: Say "parser skeleton" rather than "file", since
2493 it's no longer just a file.
2494 * data/glr.c: Grant a special exception for C GLR parsers, that
2495 reads like the already-existing exception for C LALR(1) parsers.
2496 * data/glr.cc: Likewise.
2497 * data/lalr1.cc: Likewise.
2498 * data/location.cc: Likewise.
2499 * data/yacc.c: Reword the "written by" statement to clarify that
2500 it was the parser skeleton, not the entire output file.
2501 * data/glr.c: Written by Paul Hilfinger.
2502 * data/glr.cc: Written by Akim Demaille.
2503 * data/lalr1.cc: Likewise.
2504
035aa4a0
PE
25052005-11-18 Paul Eggert <eggert@cs.ucla.edu>
2506
d9963c85
PE
2507 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
2508 Fix typos in previous change that broke 'make check'.
2509 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
2510 supported in C.
2511 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
2512 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
2513 We can revert this once things settle down.
2514
035aa4a0
PE
2515 * src/conflicts.c (conflicts_print): Don't print file name twice
2516 when %expect fails because there were no conflicts.
2517 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
2518 change.
2519 * tests/conflicts.at (%expect not enough, %expect too much):
2520 (%expect with reduce conflicts): Adjust to new behavior.
2521
25222005-11-18 Akim Demaille <akim@epita.fr>
2523
2524 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
2525 errors.
2526 * NEWS: Document this.
2527 * doc/bison.texinfo (Expect Decl): Likewise.
2528
d1ff7a7c
AD
25292005-11-16 Akim Demaille <akim@epita.fr>
2530
2531 Generalize the display of semantic values and locations in traces.
2532 * data/glr.c (yy_reduce_print): Fix indices (again).
2533 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
2534 literal integers.
2535 * data/lalr1.cc (yyreduce_print): Rename as...
2536 (yy_reduce_print): this.
2537 Display values and locations.
2538 * data/yacc.c (yy_reduce_print): Likewise.
2539 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
2540 (yysymprint): Move higher to be visible from yy_reduce_print).
2541 (yyparse): Adjust.
2542 * tests/calc.at: Adjust the expected length of the traces.
2543
6de5398d
AD
25442005-11-14 Akim Demaille <akim@epita.fr>
2545
2546 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
2547 from 1 to N, while values and location start at 0.
2548 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
2549
a1373f55
AD
25502005-11-14 Akim Demaille <akim@epita.fr>
2551
2552 * data/glr.c (yy_reduce_print): Fix the $ number.
2553
613d8952
AD
25542005-11-14 Akim Demaille <akim@epita.fr>
2555
2556 "Use" parse parameters.
2557 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
2558 * data/glr.c, data/glr.cc: Use them.
2559 * data/glr.c (YYUSE): Have a C++ definition that supports
2560 non-pointer types.
2561
b2741627
AD
25622005-11-14 Akim Demaille <akim@epita.fr>
2563
2564 * data/glr.c (yyexpandGLRStack): Declare only if defined.
2565
5059b5c8
AD
25662005-11-14 Akim Demaille <akim@epita.fr>
2567
42249483
AD
2568 * data/glr.cc: New.
2569 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 2570
4626a15d
AD
25712005-11-12 Akim Demaille <akim@epita.fr>
2572
2573 Let position and location be PODs.
2574 * data/location.cc (position::initialize, location::initialize): New.
2575 (position::position, location::location): Define only if
2576 b4_location_constructors is defined.
2577 * data/lalr1.cc (b4_location_constructors): Define it for backward
2578 compatibility.
2579 * doc/bison.texinfo (Initial Action Decl): Use initialize.
2580
25812005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
2582
2583 * data/lalr1.cc: Move the body of the ctor and dtor into the
2584 parser file (instead of the header).
2585 Wrap the implementations in a "namespace yy".
2586
25872005-11-12 Akim Demaille <akim@epita.fr>
2588
2589 Have glr.c include its header file when created.
2590 * data/glr.c (b4_shared_declarations): New.
2591 Output them verbatim in the parser if !%defines, otherwise
2592 output then in the header file, and include it instead.
2593
1989d947
AD
25942005-11-11 Akim Demaille <akim@epita.fr>
2595
2596 * data/glr.c: Comment changes.
2597
25982005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
2599
2600 When yydebug, report semantic and location values for reductions.
2601 * data/glr.c (yy_reduce_print): Report the semantic values and the
2602 locations.
2603 (YY_REDUCE_PRINT): Adjust.
2604 (yyglrReduce): Use them.
2605 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
2606 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
2607 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
2608 traces.
2609
02998094
AD
26102005-11-10 Akim Demaille <akim@epita.fr>
2611
2612 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
2613 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
2614 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
2615
5210672f
PE
26162005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
2617
2618 * m4/cxx.m4, examples/Makefile.am: Don't build
2619 examples/calc++ if no C++ compiler is available. (trivial change)
2620
a8991a1d
AD
26212005-11-09 Akim Demaille <akim@epita.fr>
2622
2623 * src/scan-skel.l: Use a couple of asserts.
2624
36b5e963
AD
26252005-11-03 Akim Demaille <akim@epita.fr>
2626
2627 In some (weird) cases, the final state number is incorrect.
2628 Reported by Alexandre Duret-Lutz.
2629 * src/LR0.c (state_list_append): Remove the computation of
2630 final_state.
2631 (save_reductions): Do it here.
2632 (get_state): Alpha conversion.
2633 (generate_states): Use a for loop.
2634 * src/gram.h (item_number_is_rule_number)
2635 (item_number_is_symbol_number): New.
2636 * src/state.c: Use assert.
2637 * src/system.h: Include assert.h.
2638 * tests/sets.at (Accept): New.
2639
44e7ead1
PH
26402005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2641
2642 * data/glr.c (yyfill): Adjust comment.
36b5e963 2643 (yyresolveAction): Initialize default location properly
44e7ead1
PH
2644 for empty right-hand sides.
2645 (yydoAction): Ditto.
2646 Add comment explaining apparently dead code.
36b5e963
AD
2647 * tests/glr-regression.at
2648 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 2649 New test.
36b5e963 2650
e10a80ee
PE
26512005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2652
2653 * bootstrap (cleanup_gnulib): New function. Use it to clean up
2654 gnulib when interrupted. This fixes some race conditions and
2655 works around some portability problems (one noted by Paul
2656 Hilfinger).
2657
067b32ee
AD
26582005-10-22 Akim <akim@epita.fr>
2659
2660 * Makefile.cfg: Adjust to config -> build-aux.
2661 Reported by twledo.
2662
4b367315
AD
26632005-10-21 Akim Demaille <akim@epita.fr>
2664
2665 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
2666 the %parse-params.
2667 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
2668 * data/yacc.c (b4_Pure_if): Rename as...
2669 (b4_yacc_pure_if): this.
2670 (YY_SYMBOL_PRINT, yyparse): Adjust.
2671 * doc/bison.texinfo: Formatting changes.
2672
24cc23d9
AD
26732005-10-21 Akim Demaille <akim@epita.fr>
2674
2675 Finish the transition config -> build-aux.
2676 * configure.ac, Makefile.am: Use build-aux.
2677 * config/prev-version, config/announce-gen, config/Makefile.am:
2678 Move to...
2679 * build-aux/prev-version, build-aux/announce-gen,
2680 * build-aux/Makefile.am: here.
2681
d4476375
AD
26822005-10-14 Akim Demaille <akim@epita.fr>
2683
2684 * examples/calc++/test: Use set -x only when VERBOSE.
2685
302c0aee
PE
26862005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2687
2688 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
2689 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
2690
7625ec2c
AD
26912005-10-13 Akim Demaille <akim@epita.fr>
2692
2693 * src/scan-skel.l: Output the base name parts of the parser and
2694 header file names.
302c0aee 2695 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
2696 additional checks.
2697 Use this to exercise C++ outputs in subdirs.
2698 Reported by Oleg Smolsky.
2699
ba0fe3c7
PE
27002005-10-12 Paul Eggert <eggert@cs.ucla.edu>
2701
2702 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
2703 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
2704 Problem reported by John P. Hartmann.
2705 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
2706 already defined it.
2707
9b8a5ce0
AD
27082005-10-12 Akim Demaille <akim@epita.fr>
2709
2710 * src/parse-gram.y (version_check): Exit 63 to please missing
2711 (stands for "version mismatch).
2712 * tests/input.at, doc/bison.texinfo: Adjust.
2713
4f6e011e
PE
27142005-10-10 Paul Eggert <eggert@cs.ucla.edu>
2715
2716 Work around portability problems with Visual Age C compiler
2717 (xlc and xlC_r) reported by John P. Hartmann.
2718 * data/location.cc (initial_column, initial_line): Remove.
2719 All uses replaced by 0 and 1.
2720 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
2721 that xlc complains about.
2722 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 2723 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 2724 as __STDC__.
4d7aa45e
PE
2725 * data/yacc.c (YYMODERN_C): New macro, which also looks at
2726 __STDC_VERSION__. Use it everywhere instead of looking at
2727 __STDC__ and __cplusplus.
4f6e011e 2728
a1b3bf8c
AD
27292005-10-10 Akim Demaille <akim@epita.fr>
2730
2731 * examples/calc++/test: Be quiet unless VERBOSE.
2732
412e44aa
PE
27332005-10-05 Paul Eggert <eggert@cs.ucla.edu>
2734
2a4647a3
PE
2735 * data/c.m4 (yydestruct, yysymprint):
2736 Use YYUSE instead of casting to void.
2737 * data/glr.c (YYUSE): New macro.
2738 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
2739 Use it instead of rolling our own.
2740 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
2741 (YYCHK1):
2742 Use /*CONSTCOND*/ to suppress lint warnings.
2743 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
2744 (YY_STACK_PRINT): Use 'false' not '0'.
2745 (YYUSE): New macro.
2746 (yysymprint_, yydestruct_): Use it instead of rolling our own.
2747 * data/yacc.c (YYUSE): New macro.
2748 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
2749 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
2750 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
2751
2752
412e44aa
PE
2753 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
2754 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
2755
88c6637f
PE
27562005-10-04 Paul Eggert <eggert@cs.ucla.edu>
2757
2f4f028d
PE
2758 Undo the parts of the unlocked-I/O change that substituted
2759 putc or puts for printf. This might hurt performance a bit,
2760 but some people prefer the printf style.
2761 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
2762 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
2763 All uses replaced by YYFPRINTF and YYDPRINTF.
2764 * data/yacc.c: Likewise.
2765 * lib/bitset.c (bitset_print): Likewise.
2766 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
2767 putc and puts.
2768 * lib/lbitset.c (debug_lbitset): Likewise.
2769 * src/closure.c (print_firsts, print_fderives): Likewise.
2770 * src/gram.c (grammar_dump): Likewise.
2771 * src/lalr.c (look_ahead_tokens_print): Likewise.
2772 * src/output.c (escaped_output): Likewise.
2773 (user_actions_output): Break apart two printfs.
2774 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
2775 * src/reduce.c (reduce_print): Likewise.
2776 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2777 * src/system.h: Include unlocked-io.h rathe than stdio.h.
2778
88c6637f
PE
2779 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
2780 Use assignments rather than casts-to-void to suppress
2781 unused-variable warnings. This pacifies 'lint'.
2782 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
2783 unused-variable warnings.
2784
fb32e373
JMG
27852005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2786
2787 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
2788
edb8f44f
PE
27892005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2790
fb9c0b33
PE
2791 Use unlocked I/O for a minor performance improvement on hosts like
2792 GNU/Linux and Solaris that support unlocked I/O. The basic idea
2793 is to use the gnlib unlocked-io module, and to prefer putc and
2794 puts to printf when either will work (since the latter doesn't
2795 come in an unlocked flavor).
2796 * bootstrap (gnulib_modules): Add unlocked-io.
2797 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
2798 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
2799 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
2800 and similarly for puts and putc and printf.
2801 * data/yacc.c: Likewise.
2802 * lib/bitset.c (bitset_print): Likewise.
2803 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
2804 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
2805 to printf.
2806 * lib/lbitset.c (debug_lbitset): Likewise.
2807 * src/closure.c (print_firsts, print_fderives): Likewise.
2808 * src/gram.c (grammar_dump): Likewise.
2809 * src/lalr.c (look_ahead_tokens_print): Likewise.
2810 * src/output.c (escaped_output): Likewise.
2811 (user_actions_output): Coalesce two printfs.
2f4f028d 2812 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
2813 * src/reduce.c (reduce_print): Likewise.
2814 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 2815 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 2816
edb8f44f
PE
2817 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
2818 this confuses xgettext.
2819
b50d2359
AD
28202005-10-02 Akim Demaille <akim@epita.fr>
2821
2822 * bootstrap (gnulib_modules): Add strverscmp.
2823 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
2824 * m4/.cvsignore: Add strverscmp.m4.
2825 * src/parse-gram.y (%require): New token, new rule.
2826 (version_check): New.
2827 * src/scan-gram.l (%require): Adjust.
2828 * tests/input.at (AT_REQUIRE): New.
2829 Use it.
2830 * doc/bison.texinfo (Require Decl): New.
2831 (Calc++ Parser): Use %require.
2832
21667f64
AD
28332005-10-02 Akim Demaille <akim@epita.fr>
2834
2835 * data/location.cc: New.
2836
2b81e969
AD
28372005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
2838 Akim Demaille <akim@epita.fr>
2839
2840 Make sure -odir/foo.cc creates dir/location.hh etc.
2841 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
2842 (spec_file_prefix, spec_verbose_file, spec_graph_file)
2843 (spec_defines_file): Now const.
2844 (dir_prefix): New.
2845 (short_base_name): Remove.
2846 * src/files.c: Adjust.
2847 (dirname.h): Include.
2848 (base_name): Don't prototype it.
2849 (finput): Remove, duplicates gram_in.
2850 (full_base_name, short_base_name): Replace by...
2851 (all_but_ext, all_but_tab_ext): these.
2852 (compute_base_names): Rename as...
2853 (compute_file_name_parts): this.
2854 Update to compute the new variables, including dir_prefix.
2855 Adjust dependencies.
2856 * src/output.c (prepare): Output them.
2857 * src/reader.c: Adjust to use gram_in, not finput.
2858 * src/scan-skel.l (@dir_prefix@): New.
2859
ad6a9b97
JMG
28602005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2861
2862 * lib/subpipe.c: New function end_of_output_subpipe() added
2863 to allow support for non-posix systems. This is a no-op function
2864 for posix systems.
2865
2866 * lib/subpipe.h: New function end_of_output_subpipe() added
2867 to allow support for non-posix systems. This is a no-op function
2868 for posix systems.
2869
2870 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
2871 handle the lack of pipe/fork functionality on non-posix systems.
2872
2873 * djgpp/Makefile.maint: DJGPP specific file.
2874
2875 * djgpp/README.in: DJGPP specific file.
2876
2877 * djgpp/config.bat: DJGPP specific configuration file.
2878
2879 * djgpp/config.sed: DJGPP specific configuration file.
2880
2881 * djgpp/config.site: DJGPP specific configuration file.
2882
2883 * djgpp/config_h.sed: DJGPP specific configuration file.
2884
2885 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
2886
2887 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
2888
fc695704
AD
28892005-10-02 Akim Demaille <akim@epita.fr>
2890
2891 * data/location.cc: New, extract from...
2892 * data/lalr1.cc: here.
2893 (location.hh): Include it after the user prologue, in case the
2894 filename type is defined by the user.
2895 Forward declation location and position before the pre-prologue.
2896 (yyresult_): Rename as...
2897 (yyresult): this, it's a local variable, not an attribute.
2898 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
2899
29002005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
2901
2902 * examples/extexi: Restore the #line generation.
2903
fb9712a9
AD
29042005-09-30 Akim Demaille <akim@epita.fr>,
2905 Alexandre Duret-Lutz <adl@gnu.org>
2906
2907 Move the token type and YYSTYPE in the parser class.
2908 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
2909 (parser::token): New, from the moved free definition of tokens.
2910 (parser::semantic_value): Now a full definition instead of an
2911 indirection to YYSTYPE.
2912 (b4_post_prologue): No longer included in the header file, but
2913 in the implementation file.
2914 * doc/bison.texi (C+ Language Interface): Update.
2915 * src/parse-gram.y: Support unary %define.
2916 * tests/actions.at: Define global_tokens_and_yystype for backward
2917 compatibility until we update the tests.
2918 * tests/calc.at: Idem.
2919 (first_line, first_column, last_line, last_column): Define for lalr1.cc
2920 to simplify the code.
2921
55f0c7b1
PE
29222005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2923
2924 Port to SunOS 4.1.4, which lacks strtoul and strerror.
2925 Ah, the good old days! Problem reported by Peter Klein.
2926 * bootstrap (gnulib_modules): Add strerror, strtoul.
2927 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
2928 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
2929
fb9712a9 29302005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
2931
2932 * data/c.m4 (b4_error_verbose_if): New.
2933 * data/lalr1.cc: Use it.
2934 (YYERROR_VERBOSE_IF): Remove.
2935 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
2936 parser members, replaced by...
2937 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
2938 local variables.
2939 (yysyntax_error_): Takes the state number as argument.
2940 (yyreduce_print_): Use the argument yyrule, not the former
2941 attribute yyn_.
2942
8a6f72f3
PE
29432005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2944
2945 * bootstrap (gnulib_modules): Add verify.
2946 * lib/.cvsignore: Add verify.h.
2947 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
2948 * src/system.h (verify): Remove.
2949 Include verify.h instead.
2950 * src/tables.c (tables_generate): Use new API for 'verify'.
2951
0d50976f
PE
29522005-09-21 Paul Eggert <eggert@cs.ucla.edu>
2953
ebc3737e
PE
2954 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
2955 local variables whose names begin with 'yy'.
2956 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
2957 Trivial changes from Joel E. Denny.
2958
0d50976f
PE
2959 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
2960 it itself.
2961 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
2962 don't use alloca any more.
2963
2964 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
2965 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 2966 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
2967 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
2968 to match yacc.c, to test more hosts.
2969
a05b79df
PE
29702005-09-20 Paul Eggert <eggert@cs.ucla.edu>
2971
55289366
PE
2972 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
2973 doesn't affect behavior.
2974 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
2975 Solaris, AIX, MSC.
2976 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
2977 This works a bit better with glibc, if user code has already included
2978 stdlib.h.
2979 * doc/bison.texinfo (Bison Parser): Document that users can't
2980 arbitrarily use malloc and free for other purposes. Document
2981 that <alloca.h> and <malloc.h> might be included.
2982 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
2983 user must declare alloca.
2984
a05b79df
PE
2985 * HACKING (release): Forwarn the Translation Project about
2986 stable releses.
2987
3ab2ca22
AD
29882005-09-20 Akim Demaille <akim@epita.fr>
2989
2990 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
2991
a9739e7c
PE
29922005-09-19 Paul Eggert <eggert@cs.ucla.edu>
2993
a702593e
PE
2994 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
2995 (YYSTACK_ALLOC_MAXIMUM): Use it.
2996 (yysyntax_error): New function.
2997 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
2998 multiple syntax errors are reported, and alloca is being used.
2999 Instead, reallocate buffers twice as big each time, so that
3000 we waste at most half the allocated memory. Start with a small
3001 (128-byte) buffer that will suffice in most cases anyway.
3002 Use yysyntax_error to do most of the work.
3003
3004 * doc/bison.texinfo (Error Reporting, Table of Symbols):
3005 yynerrs is the number of errors reported, not the number of
3006 errors encountered.
3007
a9739e7c
PE
3008 * tests/glr-regression.at (Duplicated user destructor for lookahead):
3009 Mark it as expected to fail.
3010 Cast result of malloc; problem reported by twlevo@xs4all.nl.
3011 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
3012 Don't start user-code symbols with "yy", to avoid name space problems.
3013
f479c6c6
AD
30142005-09-19 Akim Demaille <akim@epita.fr>
3015
3016 Remove the traits, failed experiment.
3017 It never proved useful, and anyway because of the current
3018 definition, it was not possible to have several specialization of
3019 this traits, making it useless.
3020 * data/lalr1.cc (yy:traits): Remove.
3021 Inline its definitions in the parser class.
3022
e2586f82
AD
30232005-09-19 Akim Demaille <akim@epita.fr>
3024
3025 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
3026 least Mac OSX with a /usr/local install of gettext.
3027
2e8cf949
AD
30282005-09-19 Akim Demaille <akim@epita.fr>
3029
3030 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
3031 and yytoken for similarity with the other skeletons.
3032
c7fb0b90
AD
30332005-09-19 Akim Demaille <akim@epita.fr>
3034
4e26c69e 3035 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 3036
1bd0deda
PE
30372005-09-16 Paul Eggert <eggert@cs.ucla.edu>
3038
3039 * NEWS: Version 2.1.
3040
3041 * NEWS: Remove notice of yytname change, since it was never in an
3042 official release.
3043 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
3044 diagnostic.
3045 * src/output.c (prepare): Likewise.
3046 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
3047 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
3048 is not defined. This is an awful hack, but it's enough for now.
3049 All callers changed.
3050 * tests/glr-regression-at (make_value): Args are const pointers now,
3051 to avoid GCC warning.
3052 (Duplicated user destructor for lookahead): New test. Currently
3053 skipped. It fails on my host but I'm not sure it'll always fail.
3054
30552005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
3056
3057 * src/symtab.h (struct symbol): Declare the printer and destructor
3058 as const, to avoid accidental calls to free.
3059 (symbol_destructor_set, symbol_printer_set): Adjust.
3060 * src/symtab.c: Adjust.
3061
1bd0deda 30622005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
3063
3064 * data/c.m4 (b4_token_enums): New.
3065 (b4_token_defines): Rename as...
3066 (b4_token_enums_defines): this.
3067 (b4_token_defines): New, output only the #defines.
3068 * data/yacc.c, data/glr.c: Adjust.
3069 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
3070 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
3071 as default values.
3072
dbcdae2d
AD
30732005-09-16 Akim Demaille <akim@epita.fr>
3074
3075 * data/lalr1.cc (yylex_): Remove, inline its code.
3076 (yyreport_syntax_error_): Remove, replaced by...
3077 (yysyntax_error_): this which returns a string and leaves to the
3078 caller the call to the users' error function.
3079 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
3080 Move from members of the parser object...
3081 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
3082 to local variables of the parse function.
3083
70d8f291
AD
30842005-09-16 Akim Demaille <akim@epita.fr>
3085
3086 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
3087 since it's in Bison's name space.
3088
b47dbebe
PE
30892005-09-15 Paul Eggert <eggert@cs.ucla.edu>
3090
ae199bf1
PE
3091 * data/glr.c (yyresolveValue): Add default case to pacify
3092 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
3093
b47dbebe
PE
3094 * NEWS: Document when yyparse started to return 2.
3095 * doc/bison.texinfo (Parser Function): Document when yyparse
3096 returns 2.
3097
3098 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
3099 (b4_filename_type): Renamed back from b4_file_name_type. All uses
3100 changed.
3101 (class position): file_name -> filename (reverting). All uses changed.
3102
31032005-09-14 Paul Eggert <eggert@cs.ucla.edu>
3104
3105 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
3106 do anything if $@ exists. This reverts part of the 2005-07-07
3107 patch.
3108
00292f66
PE
31092005-09-11 Paul Eggert <eggert@cs.ucla.edu>
3110
3111 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
3112 contains obsolete information and isn't worth distributing as a
3113 separate file anyway.
3114 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
3115 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
3116 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
3117 (yyparse): Abort if user code uses longjmp to throw an unexpected
3118 value.
3119
a420f962
PE
31202005-09-09 Paul Eggert <eggert@cs.ucla.edu>
3121
00292f66
PE
3122 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
3123 Suggested by twlevo@xs4all.nl.
3124
127287e9
PE
3125 * data/glr.c (YYCHK1): Do not assume YYE is in range.
3126 This avoids a diagnostic from gcc -Wswitch-enum.
3127 Problem reported by twlevo@xs4all.nl.
3128
a420f962
PE
3129 * doc/bison.texinfo: Don't use "filename", as per GNU coding
3130 standards. Use "file name" or "file" or "name", depending on
3131 the context.
3132 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
3133 not to hack/foo.tab.c.
3134 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
3135 * data/glr.c: b4_filename -> b4_file_name.
3136 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
3137 All uses changed.
3138 (class position): filename -> file_name. All uses changed.
3139 * data/yacc.c: b4_filename -> b4_file_name.
3140 * lib/bitset.h: filename -> file_name in local vars.
3141 * lib/bitset_stats.c: Likewise.
3142 * src/files.c: Likewise.
3143 * src/scan-skel.l ("@output ".*\n): Likewise.
3144 * src/files.c (file_name_split): Renamed from filename_split.
3145 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
3146
31472005-09-08 Paul Eggert <eggert@cs.ucla.edu>
3148
3149 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
3150 to accommodate latest gnulib.
3151
3152 * tests/glr-regression.at (Duplicate representation of merged trees):
3153 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
3154
3155 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
3156 needed.
3157
42a6501d
PE
31582005-08-26 Paul Eggert <eggert@cs.ucla.edu>
3159
3160 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3161 All uses changed. Invoke user destructor after an error during a
3162 split parse (trivial change from Joel E. Denny).
3163
3164 * tests/glr-regression.at
3165 (User destructor after an error during a split parse): New test case.
3166 Problem reported by Joel E. Denny in:
3167 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3168
ef9a1faf
PE
31692005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3170
5b4aaf78
PE
3171 * README-cvs: Give URLs for recommended tools.
3172 Mention Gzip version problem, and bootstrapping issues.
3173 Remove troubleshooting section, as it's somewhat obsolete.
3174
b5240ba5
PE
3175 * bootstrap (no_cache): New var, to accommodate different wget
3176 variants. Use it instead of '-C off'. Problem reported by
3177 twlevo@xs4all.nl.
3178
ef9a1faf
PE
3179 * data/glr.c (yydestroyStackItem): New function.
3180 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
3181 debugging information. Problem reported by Joel E. Denny.
3182
e6efa9da
AD
31832005-08-25 Akim Demaille <akim@epita.fr>
3184
3185 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3186
adc90f13
PE
31872005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3188
3189 * data/glr.c (yyrecoverSyntaxError, yyreturn):
3190 Don't invoke destructor on unresolved entries.
3191 * tests/glr-regression.at
3192 (User destructor for unresolved GLR semantic value): New test case.
3193 Problem reported by Joel E. Denny in:
3194 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
3195
f9315de5
PE
31962005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3197
15d29c1f
PE
3198 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3199 Add strnlen.c.
3200 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3201 lib-prefix.m4, po.m4.
3202
dd5f2af2
PE
3203 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
3204 in yydestruct diagnostic, since it might not be an error.
3205 Problem reported by Joel Denny near end of
3206 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 3207 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
3208 * data/yacc.c (yyreturn): Likewise.
3209 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
3210
3211 * src/files.c: Remove obsolete FIXME comment.
3212
3213 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
3214 with the other templates, and to fix bogus run-on messages such
3215 as the one reported at the end of
3216 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3217 All callers changed to avoid the newline.
3218 (yyprocessOneStack): Output two lines rather than one, to accommodate
3219 the above change. This changes the debug output format slightly.
3220
f9315de5
PE
3221 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
3222 reported by Joel E. Denny in
3223 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
3224 (trivial change).
3225 * tests/glr-regression.at (Duplicate representation of merged trees):
3226 New test, from Joel E. Denny in:
3227 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
3228 * THANKS: Add Joel E. Denny.
3229
3230 * configure.ac (AC_INIT): Bump to 2.0c.
3231
04098407
PE
32322005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3233
3234 * NEWS: Version 2.0b.
3235
ca5d2013
PE
3236 * Makefile.am (SUBDIRS): Put examples before tests, so that
3237 "make check" doesn't finish with "All 1 tests passed".
3238
3d54b576
PE
3239 * tests/regression.at (Token definitions): Don't rely on
3240 AT_PARSER_CHECK for data that contains backslashes. It currently
3241 uses 'echo', and 'echo' isn't portable if its argument contains
3242 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3243 that the byte '\0xff' is not printable in the C locale; it is,
3244 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3245 not printable, so use '\0x81' to test.
3246
d53ae497
PE
3247 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3248 version of GCC, since the macro is used with non-GCC compilers.
3249
fc01665e
PE
3250 Fix core dump reported by Pablo De Napoli in
3251 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3252 * tests/regression.at (Invalid inputs with {}): New test.
3253 * src/parse-gram.y (token_name): Translate type before using
3254 it as an index.
3255
04098407
PE
3256 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3257 the user's name space. All uses changed to __attribute__
3258 ((__unused__)).
3259 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3260 Add __attribute__ ((__noreturn__)).
3261
3262 * etc/clcommit: Remove. We weren't using it, and it failed
3263 "make maintainer-distcheck".
3264 * Makefile.maint: Merge from coreutils.
3265 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3266 (syntax-check-rules): Change list of rules as described below.
3267 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3268 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3269 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3270 (sc_trailing_space): New rules.
3271 (sc_xalloc_h_in_src): Remove.
3272 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3273 (sc_space_tab, sc_error_exit_success, sc_changelog):
3274 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3275 (makefile-check, po-check, author_mark_check):
3276 (makefile_path_separator_check, copyright-check):
3277 Use grep -n, to make it easier to find violations.
3278 Use CVS_LIST and CVS_LIST_EXCEPT.
3279 (header_regexp, h_re): Remove.
3280 (dd_c): New macro.
3281 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3282 (my-distcheck): Use more-modern GCC flags.
3283 (signatures, %.asc): Remove.
3284 (rel-files, announcement): Remove signatures.
3285 Restore old updating code, even though we don't use it, so
3286 that we're the same as coreutils.
3287 (alpha, beta, major): Depend on news-date-check.
3288 Make the upload commands.
3289
3290 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
3291 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
3292 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
3293 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
3294 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
3295 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
3296 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
3297 * tests/sets.at: Likewise.
3298
3299 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
3300 we comment out the Autoconf version number.
3301 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
3302 it's error-prone and "make maintainer-distcheck" rejects it.
3303
3304 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
3305 Indent calls to "error" to pacify "make maintainer-distcheck",
3306 when the calls are not intended to be translated.
3307 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
3308
3309 * src/Makefile.am (DEFS): Use +=, to pacify
3310 "make maintainer-distcheck".
3311 (bison_SOURCES): Add scan-skel.h.
3312 (sc_tight_scope): New rule, from coreutils.
3313
3314 * src/files.c (src_extension, header_extension):
3315 Now static, not extern.
3316 * src/getargs.c (short_options): Likewise.
3317 * src/muscle_tab.c (muscle_table): Likewise.
3318 * src/parse-gram.y (current_class, current_type, current_prec):
3319 Likewise.
3320 * src/reader.c (grammar_end, previous_rule_end): Likewise.
3321 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
3322 * src/main.c (main): Cast bindtextdomain and textdomain calls to
3323 void, to avoid warning when NLS is disabled.
3324 * src/output.c: Include scan-skel.h.
3325 (scan_skel): Remove decl, since scan-skel.h does this.
3326 (output_skeleton):
3327 Indent calls to "error" to pacify "make maintainer-distcheck".
3328 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
3329 * src/reader.h (gram_end, gram_lineno): New decls to pacify
3330 "make maintainer-distcheck".
3331 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
3332 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
3333 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
3334 (skel_lex_destroy, scan_skel): Move these decls to...
3335 * src/scan-skel.h: New file.
3336 * src/uniqstr.c (uniqstr_assert):
3337 Indent calls to "error" to pacify "make maintainer-distcheck".
3338
3339 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
3340 not @VAR@.
3341
3342 * tests/torture.at: Revamp to avoid misuse of atoi that
3343 "make maintainer-distcheck" complained about.
3344
3345 * examples/extexi (message): Don't print a message more than once,
3346 and omit line-number decoration that makes Emacs compile think
3347 that informative messages are worth worrying about.
3348
33492005-07-22 Paul Eggert <eggert@cs.ucla.edu>
3350
3351 * configure.ac: Update version number.
3352
3353 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
3354 accidentally.
3355 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
3356 autogenerated by the maintainer.
3357 * examples/calc++/.cvsignore: Add *.yy.
3358
3359 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
3360 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3361 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3362
3363 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
3364
3365 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
3366 from maintainer-distcheck about casting the argument of 'free'.
3367
3368 * NEWS: Mention recent yytname changes.
3369 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
3370
3371 * bootstrap: For translations that have not yet been upgraded to
3372 the new runtime-po domain, prime the pump by extracting the
3373 relevant strings from the obsolete translations. This code can be
3374 removed once the bison-runtime domain has been translated by each
3375 team.
3376
3377 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
3378 now that token names are already quoted.
3379
3380 Fix problem reported by Anthony Heading.
3381 * data/glr.c (YYTOKEN_TABLE): New macro.
3382 (yytname): Define if YYTOKEN_TABLE.
3383 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
3384 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
3385 (YYERROR_VERBOSE): Define the same way the other skeletons do.
3386 * src/output.c (prepare_symbols): Output token_table_flag.
3387
0ffda363
PE
33882005-07-21 Paul Eggert <eggert@cs.ucla.edu>
3389
3390 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
3391 again if the first call fails.
3392
3393 * data/glr.c (yytnamerr): New function.
3394 (yyreportSyntaxError): Use it to dequote most string literals.
3395 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
3396 with other skeletons. All uses changed.
3397 (yytnameerr_): New function.
3398 (yyreport_syntax_error): Use it to dequote most string literals.
3399 * data/yacc.c (yytnamerr): New function.
3400 (yyerrlab): Use it to decode most string literals.
3401 * doc/bison.texinfo (Decl Summary, Calling Convention):
3402 Clarify quoting convention of yytname.
3403 * src/output.c (prepare_symbols): Quote all names. This undoes
3404 the 2005-04-17 change, which is now accomplished (mostly) via
3405 changes in the parsers as described above.
3406 * tests/regression.at (Token definitions, Web2c Actions):
3407 Undo most 2005-04-17 change here, too.
3408
34092005-07-20 Paul Eggert <eggert@cs.ucla.edu>
3410
3411 Fix more problems reported by twlevo@xs4all.nl.
3412 * tests/cxx-type.at: Don't pipe output of ./types through sed to
3413 remove trailing spaces. This loses the exit status of ./types,
3414 and isn't needed since ./types shouldn't be emitting trailing
3415 spaces.
3416 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
3417 as the stack isn't valid in that case.
3418
3419 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3420 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3421 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3422 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
3423 is used.
3424 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
3425 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3426 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3427 Likewise.
3428
3429 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
3430 overly-picky compilers that reject 'char *foo = "bar";'.
3431
3432 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
3433 to FILE * parameter, not to stderr. This fixes a typo introduced
3434 in the 2005-07-12 change.
3435
3436 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
3437 warnings from GCC 4.
3438
3439 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
3440 (yyglrShiftDefer, yysplitStack):
3441 Remove unused parameters b4_pure_formals. All uses changed.
3442 (yyglrShift): Remove unused parameters b4_user_formals.
3443 All uses changed.
3444 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
3445
6100a9aa
PE
34462005-07-18 Paul Eggert <eggert@cs.ucla.edu>
3447
258b75ca
PE
3448 Destructor cleanups and regularization among the three skeletons.
3449 * NEWS: Document the behavior changes.
3450 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
3451 stack before failing, as the cleanup code will do it for us now.
3452 * data/lalr1.cc (yyerrlab): Likewise.
3453 * data/glr.c (yyparse): Pop everything off the stack before
3454 freeing it, so that destructors get called properly.
3455 * data/lalr1.cc (yyreturn): Likewise.
3456 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
3457 This is more consistent.
3458 * doc/bison.texinfo (Destructor Decl): Mention more reasons
3459 why destructors might be called. 1.875 -> 2.1.
3460 (Destructor Decl, Decl Summary, Table of Symbols):
3461 Some English-language cleanups for %destructor.
3462 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
3463 Add output line for destructor of start symbol.
3464 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
3465 because of that same extra output line.
3466
1a059451
PE
3467 * NEWS: Document minor wording changes in diagnostics of
3468 Bison-generated parsers.
3469 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
3470 Remove unused formals. All uses changed.
3471 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
3472 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
3473 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
3474 Rename yyoverflowab to yyexhaustedlab.
3475 When memory exhaustion occurs during syntax-error reporting,
3476 report it separately rather than in a single diagnostic; this
3477 eases translation.
3478 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
3479 (Memory Exhausted): Renamed from Parser Stack Overflow.
3480 Revamp wording slightly to prefer "memory exhaustion".
3481 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
3482
97460c78
PE
3483 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
3484
30757c8c
PE
3485 Add i18n support to the GLR skeleton. Partially fix the C++
3486 skeleton; a C++ expert needs to finish this. Remove debugging
3487 msgids; there's little point to having them translated, since they
3488 can be understood only by someone who can read the
3489 (English-language) source code.
3490
3491 Generate runtime-po/bison-runtime.pot automatically, so that we
3492 don't have to worry about garbage getting in that file. We'll
3493 make sure after the next official release that old msgids don't
3494 get lost. See
3495 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
3496
3497 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
3498 Now auto-generated.
3499 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
3500 Fix typos in explanations of the runtime file.
3501 * bootstrap: Change gettext keyword from YYI18N to YY_.
3502 Use standard Makefile.in.in in runtime-po, since we'll arrange
3503 for backward-compatible bison-runtime.po files in a different way.
3504 * data/glr.c (YY_): New macro, from yacc.c.
3505 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
3506 Translate messages intended for users.
3507 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
3508 the wording in the other skeletons. We don't know that the memory
3509 is virtual.
3510 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
3511 Use same method that yacc.c uses.
3512 Don't translate debugging messages.
3513 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
3514 it doesn't work (yet), and requires C++ expertise to fix.
3515 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
3516 Move defn to a more logical place, to be consistent with other
3517 skeletons.
3518 Don't translate debugging messages.
3519 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
3520 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
3521 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
3522 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
3523
ac8c5689
PE
3524 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
3525 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
3526 void, not int.
3527 * tests/glr-regression.at (Badly Collapsed GLR States):
3528 Likewise.
3529 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3530 yylex should return 0 at EOF rather than aborting.
3531
6100a9aa
PE
3532 Improve tests for stack overflow in GLR parser.
3533 Problem reported by twlevo@xs4all.nl.
3534 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
3535 All uses removed.
3536 (yyStackOverflow): Just longjmp, but with value 2 so that caller
3537 can handle the problem.
3538 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
3539 (yyparse): New local variable yyresult to record the result.
3540 Use result of setjmp to set it, rather than storing itinto
3541 struct.
3542 (yyDone): Remove label.
3543 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
3544 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
3545 if YYABORT is used).
3546 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
3547 yyparse status; put status > 1 into diagnostic.
3548 Check that status==2 works.
3549 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
3550 Use exit status 3 for failure to open (which shouldn't happen).
3551
15f40952
PE
35522005-07-17 Paul Eggert <eggert@cs.ucla.edu>
3553
67fd79c4
PE
3554 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
3555 1 on syntax error; just let yyparse do its thing.
3556 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
3557 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
3558 (Exploding the Stack Size with Alloca):
3559 (Exploding the Stack Size with Malloc):
3560 Expect exit status 2, not 1, since the parser is supposed to blow
3561 its stack. Problem reported by twlevo@xs4all.nl.
3562
15f40952
PE
3563 * data/glr.c (yyparse): Don't assume that the initial calls
3564 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
3565 Print a stack-overflow message and fail instead.
3566 Initialize the line-number information before creating the stack,
3567 so that the stack-overflow message can report line zero safely.
3568
f32c66b5
PE
35692005-07-14 Paul Eggert <eggert@cs.ucla.edu>
3570
a22ff96f 3571 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
3572 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
3573 (yyuserMerge): Provide a default case if b4_mergers is empty.
3574 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
3575 * tests/glr-regression.at
3576 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 3577 Add casts to pacify C++ compilers.
1beb0b24
PE
3578 * tests/glr-regression.at (Improper merging of GLR delayed action
3579 sets): Declare yylex before using it.
f32c66b5 3580 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
3581 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
3582 test for valgrind; valgrind is independent of g++.
3583 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
3584 for compatibility with POSIX 1003.1-2001 (if running coreutils).
3585 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
3586 Use a destructor, so that we can expand the stack. Change
3587 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 3588
d741bd1b
PE
35892005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3590
3591 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
3592 a valgrind failure. Problem reported by twlevo@xs4all.nl.
3593
0410a6e0
PE
35942005-07-13 Paul Eggert <eggert@cs.ucla.edu>
3595
3596 * PACKAGING: New file, suggested by Bruno Haible and taken from
3597 similar wording in gettext's PACKAGING file.
3598 * NEWS: Mention PACKAGING.
3599 * Makefile.am (EXTRA_DIST): Add PACKAGING.
3600
f7ab6a50
PE
36012005-07-12 Paul Eggert <eggert@cs.ucla.edu>
3602
baf785db 3603 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
3604 * bootstrap: Get runtime translations into runtime-po.
3605 Create runtime-po files automatically, if possible.
3606 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
3607 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
3608 does not infringe on the user's name space.
3609 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
3610 * doc/bison.texinfo (Internationalization): Revamp the English
3611 and Texinfo syntax a bit, to try to make it clearer.
3612 (Bison Options, Option Cross Key): Mention --print-localedir.
3613 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
3614 YYENABLE_NLS. Quote a bit more.
3615 * runtime-po/.cvsignore: New file.
3616 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
3617 * runtime-po/Rules-quot: Remove; now created by bootstrap.
3618 * runtime-po/quot.sed: Likewise.
3619 * runtime-po/boldquot.sed: Likewise.
3620 * runtime-po/en@quot.header: Likewise.
3621 * runtime-po/en@boldquot.header: Likewise.
3622 * runtime-po/insert-header.sin: Likewise.
3623 * runtime-po/remove-potcdate.sin: Likewise.
3624 * runtime-po/Makevars: Likewise.
3625 * runtime-po/LINGUAS: Likewise.
3626 * runtime-po/de.po: Likewise; we will rely on the translation project
3627 to maintain this, so "bootstrap" should get it.
0410a6e0 3628 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
3629 its value.
3630 * src/main.c (main): Bind the bison-runtime domain, too.
3631
36322005-07-12 Bruno Haible <bruno@clisp.org>
3633
3634 * data/yacc.c: Include <libintl.h> when NLS is enabled.
3635 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
3636 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
3637 * runtime-po: New directory.
3638 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
3639 $(DOMAIN).pot-update rule, so that old messages are never dropped.
3640 * runtime-po/Rules-quot: New file, copied from po/.
3641 * runtime-po/quot.sed: Likewise.
3642 * runtime-po/boldquot.sed: Likewise.
3643 * runtime-po/en@quot.header: Likewise.
3644 * runtime-po/en@boldquot.header: Likewise.
3645 * runtime-po/insert-header.sin: Likewise.
3646 * runtime-po/remove-potcdate.sin: Likewise.
3647 * runtime-po/Makevars: New file.
3648 * runtime-po/POTFILES.in: New file.
3649 * runtime-po/LINGUAS: New file.
3650 * runtime-po/bison-runtime.pot: New file.
3651 * runtime-po/de.po: New file.
3652 * m4/bison.m4: New file.
3653 * Makefile.am (SUBDIRS): Add runtime-po.
3654 (aclocaldir, aclocal_DATA): New variables.
3655 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
3656 Define aclocaldir.
3657 * src/getargs.c (usage): Document --print-localedir option.
3658 (PRINT_LOCALEDIR_OPTION): New enum item.
3659 (long_options): Add --print-localedir option.
3660 (getargs): Handle --print-localedir option.
3661 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
3662 (Internationalization): New section.
3663
22dda0f0
AD
36642005-07-12 Akim Demaille <akim@epita.fr>
3665
3666 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
3667 for consistency with the rest of the code.
3668 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
3669 Add separators.
3670
82b248ad
AD
36712005-07-12 Akim Demaille <akim@epita.fr>
3672
3673 * src/parse-gram.y: Use %printer instead of YYPRINT.
3674
fa0e9314
AD
36752005-07-12 Akim Demaille <akim@epita.fr>
3676
867a3e00
AD
3677 * src/symtab.h, src/symtab.c (symbol_print): New.
3678 * src/symlist.h, src/symlist.c (symbol_list_print): New.
3679 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
3680
36812005-07-12 Akim Demaille <akim@epita.fr>
3682
3683 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
3684 b4_at_dollar and b4_dollar_dollar.
3685
e054b190
PE
36862005-07-11 Paul Eggert <eggert@cs.ucla.edu>
3687
3688 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
3689 and Pennello's paper.
3690
34160ec4
PE
36912005-07-09 Paul Eggert <eggert@cs.ucla.edu>
3692
407d4a75
PE
3693 * data/yacc.c (yyparse): Undo previous patch. Instead,
3694 set yylsp[0] and yyvsp[0] only if the initial action
3695 sets yylloc and yylval, respectively.
3696
34160ec4
PE
3697 * data/yacc.c (yyparse): In the initial action, set
3698 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
3699 This avoids the use of undefined variables if the initial
3700 action does not set yylloc and/or yylval.
3701
c3d5a4a7
PE
37022005-07-07 Paul Eggert <eggert@cs.ucla.edu>
3703
b34d96c1
PE
3704 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
3705 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
3706 Remove from CVS. These files are automatically generated.
3707 * examples/extexi: Clarify that this file is now part of Bison,
3708 not GNU M4, and that it works with any POSIX-compatible Awk.
3709 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
3710 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
3711 so that we also get calc++-parser.yy. Geneate it.
3712 Use $(AWK), not gawk, since any conforming Awk will do.
3713 Put comment before action, since older 'make' can't handle comment
3714 in action.
3715 $(BUILT_SOURCES): List all built sources, not just some of them.
3716 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
3717 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
3718 $($(calc_sources_generated)): Remove unnecessary test for existence
3719 of target. (This had a shell syntax error anyway; a stray "x".)
3720 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
3721 calc++-parser.yy.
3722 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
3723
c3d5a4a7
PE
3724 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
3725 implied by the other modules.
3726
828c373b
AD
37272005-07-06 Akim Demaille <akim@epita.fr>
3728
3729 Bind examples/calc++ to the package.
3730 * examples/calc++/Makefile: Remove, replaced by...
3731 * examples/calc++/Makefile.am: ... this new file.
3732 * examples/calc++/test: Remove input.
3733 * examples/calc++/compile: Remove.
3734 * examples/Makefile.am: New.
3735 * configure.ac, Makefile.am: Adjust.
3736 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
3737
63cb01d6
PE
37382005-07-05 Paul Eggert <eggert@cs.ucla.edu>
3739
fd2df2ed
PE
3740 * data/glr.c (yyFail): Drastically simplify; since the format argument
3741 never had any % directives, we can simply pass it to yyerror.
3742 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
3743 be modified later, as that is the usual style in glr.c.
3744 Problems reported by Paul Hilfinger.
3745
63cb01d6
PE
3746 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
3747 and size overflow errors.
3748 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
3749 in case the user prolog sets feature-test macros like _GNU_SOURCE.
3750 (YYSIZEMAX): New macro.
3751 (yystpcpy): New function, taken from yacc.c.
3752 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
3753 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
3754 so that we don't have to maintain their signatures.
3755 (yyFail): Check for buffer overflow, by using vsnprintf rather
3756 than vsprintf. Allocate a bigger buffer if possible.
3757 Report an error if buffer allocation fails.
3758 (yyStackOverflow): New function.
3759 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
3760 the initialization was successful. It might fail if storage was
3761 exhausted.
3762 (yyexpandGLRStack): Add more checks for storage allocation failure.
3763 Use yyStackOverflow to report failures.
3764 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
3765 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
3766 Don't assume stack number fits in int.
3767 (yysplitStack): Check for storage allocation failure.
3768 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
3769 can print diagnostics on storage allocation failure. All callers
3770 changed.
3771 (yyresolveValue): Use yybool for boolean.
3772 (yyreportSyntaxError): Check for size-calculation overflow.
3773 This code is taken from yacc.c.
3774 (yyparse): Check for storage allocation errors when allocating
3775 the initial stack.
3776
1c59e0a1
AD
37772005-07-05 Akim Demaille <akim@epita.fr>
3778
3779 Extract calc++ from the documentation.
3780 * doc/bison.texinfo (Calc++): Add the extraction marks.
3781 * examples/extexi: New, from the aborted GNU Programming 2E.
3782 Separate the different paragraph of a file with empty lines.
3783 * examples/Makefile: Use it to extract the whole calc++ example.
3784
8a0adb01
AD
37852005-06-24 Akim Demaille <akim@epita.fr>
3786
3787 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
3788 class typedefs.
3789
12545799
AD
37902005-06-22 Akim Demaille <akim@epita.fr>
3791
3792 * doc/bison.texinfo (C++ Language Interface): First stab.
3793 (C++ Parsers): Remove.
3794
99be0235
AD
37952005-06-22 Akim Demaille <akim@epita.fr>
3796
3797 * data/lalr1.cc (yylex_): Honor %lex-param.
3798
0ffd4fd1
AD
37992005-06-22 Akim Demaille <akim@epita.fr>
3800
3801 Start a set of simple examples.
3802 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
3803 * examples/calc++/calc++-driver.hh,
3804 * examples/calc++/calc++-parser.yy,
3805 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
3806 * examples/calc++/compile, examples/calc++/test: New.
3807
0925ebb4
PE
38082005-06-09 Paul Eggert <eggert@cs.ucla.edu>
3809
3810 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
3811 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
3812 which stems from the 2005-05-27 patch.
3813
43d3b664
PH
38142005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3815
3816 * data/glr.c: Modify treatment of unused parameters to permit use
3817 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
3818
3062864d
PE
38192005-05-30 Paul Eggert <eggert@cs.ucla.edu>
3820
3821 Fix infringement on user name space reported by Janos Zoltan Szabo.
3822 * data/yacc.c (yyparse): strlen -> yystrlen.
3823
989b5b8e
AD
38242005-05-30 Akim Demaille <akim@epita.fr>
3825
3826 * data/lalr1.cc (_): New.
3827 Translate the various messages.
3828
bedf57f5
PE
38292005-05-27 Paul Eggert <eggert@cs.ucla.edu>
3830
3831 Fix infringement on user name space reported by Bruno Haible.
3832 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
3833 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
3834 the user's name space.
3835 (alloca): Include <stdlib.h> to get it, if it's not built in.
3836 (YYMALLOC, YYFREE): Define only if needed.
3837 (malloc, free): Declare, but only if needed, as this infringes on
3838 the user name space.
3839
4d1801f1
PE
38402005-05-25 Paul Eggert <eggert@cs.ucla.edu>
3841
3842 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
3843 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
3844 with %d format.
3845 * lib/ebitset.c (min, max): Undef before defining.
3846 * lib/vbitset.c (min, max): Likewise.
3847 * lib/subpipe.c (create_subpipe): Save local variables in case
3848 vfork clobbers them.
3849
38502005-05-24 Bruno Haible <bruno@clisp.org>
3851
3852 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
3853 error message syntax used by gcc-4.0.
3854
b94a9e1e
PE
38552005-05-23 Paul Eggert <eggert@cs.ucla.edu>
3856
85ac3861
PE
3857 * README: Mention m4 1.4.3. Remove obsolete advice about
3858 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
3859
b94a9e1e
PE
3860 * bootstrap: Remove workaround for problem I encountered with
3861 gettext 0.14.1; it seems to be fixed now.
3862
51c30d21
PE
38632005-05-22 Paul Eggert <eggert@cs.ucla.edu>
3864
009ce67d
PE
3865 * NEWS: Version 2.0a.
3866
f2a97c62
PE
3867 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
3868 the previous change.
3869
c8775f93
PE
3870 Various maintainer cleanups.
3871 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
3872 conftest*, for benefit of CVS commands run at the same time as
3873 "configure". Add build-aux, since "bootstrap" now creates it and
3874 its subfiles.
3875 * Makefile.cfg (move_if_change): Remove.
3876 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
3877 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
3878 (po_repo, do-po-update, po-update, wget_files, get-targets):
3879 (config.guess-url_prefix, config.sub-url_prefix):
3880 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
3881 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
3882 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
3883 Remove.
3884 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
3885 this is now the recommended name.
3886 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
3887 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
3888 ylwrap. These files now go into build-aux.
3889 * config/move-if-change: Remove.
3890 * config/prev-version.txt: Bump from 1.75 to 2.0.
3891
3ea5f0ec
PE
3892 * bootstrap: Add stdio-safer, unistd-safer modules.
3893 Remove m4/glibc2.m4 (introduced by latest gnulib, but
3894 we don't need it).
3895 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
3896 fopen-safer.c, stdio-safer.h, unistd-safer.h.
3897 * lib/subpipe.c: Include "unistd-safer.h".
3898 (create_subpipe): Make sure all the newly-created
3899 file descriptors are > 2, so that diagnostics don't
3900 get sent down them (which might cause Bison to hang, in theory).
3901 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
3902 * src/files.c (xfopen): Use fopen_safer, not fopen.
3903
51c30d21
PE
3904 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
3905 yesterday's yacc.c fix.
3906
cea1469d
PE
39072005-05-21 Paul Eggert <eggert@cs.ucla.edu>
3908
3ea5f0ec
PE
3909 * data/glr.c, data/lalr1.cc: Update copyright date.
3910
cea1469d
PE
3911 Fix a destructor bug reported by Wolfgang Spraul in
3912 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
3913 * data/yacc.c (yyabortlab): Don't call destructor, and
3914 don't set yychar to EMPTY.
3915 (yyoverflowlab): Don't call destructor.
3916 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
3917 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
3918 since we no longer output the message "discarding lookahead token
3919 end of input ()".
3920
5e6f62f2
PH
39212005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3922
3923 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
3924 fix a small glitch in debugging output.
3925 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
3926 after YY_SYMBOL_PRINT where needed.
3927
3928 (struct yyGLRState): Add some comments.
3929 (struct yySemanticOption): Add some comments.
3930 (union yyGLRStackItem): Add comment.
3931
3932 (yymergeOptionSets): Correct this to properly perform the union,
3933 avoiding infinite reported by Michael Rosien.
3934 Update comment.
3935
3936 * tests/glr-regression.at: Add test for GLR merging error reported
3937 by M. Rosien.
cea1469d 3938
0fb669f9
PE
39392005-05-13 Paul Eggert <eggert@cs.ucla.edu>
3940
3941 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
3942 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
3943 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
3944 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
3945 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
3946 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
3947 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
3948 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
3949 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
3950 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
3951 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
3952 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
3953 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
3954 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
3955 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
3956 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
3957 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
3958 src/derives.h, src/files.c, src/files.h, src/getargs.c,
3959 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
3960 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
3961 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
3962 src/output.h, src/parse-gram.c, src/parse-gram.h,
3963 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
3964 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
3965 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
3966 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
3967 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
3968 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
3969 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
3970 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
3971 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
3972 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
3973 tests/reduce.at, tests/regression.at, tests/sets.at,
3974 tests/synclines.at, tests/testsuite.at, tests/torture.at:
3975 Update FSF postal mail address.
3976
51f4735e
PE
39772005-05-11 Paul Eggert <eggert@cs.ucla.edu>
3978
3979 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
3980 Problem reported by Ralf Menzel.
3981
80ce3401
PE
39822005-05-01 Paul Eggert <eggert@cs.ucla.edu>
3983
3984 * tests/actions.at: Test that stack overflow invokes destructors.
3985 From Marcus Holland-Moritz.
3986 * data/yacc.c (yyerrlab): Move the code that destroys the stack
3987 from here....
3988 (yyreturn): to here. That way, destructors are called properly
3989 even if the stack overflows, or the user calls YYACCEPT or
3990 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
3991 (yyoverflowlab): Destroy the lookahead.
3992
39932005-04-24 Paul Eggert <eggert@cs.ucla.edu>
3994
3995 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
3996
72f000b0
PE
39972005-04-17 Paul Eggert <eggert@cs.ucla.edu>
3998
3999 * NEWS: Bison-generated C parsers no longer quote literal strings
4000 associated with tokens.
4001 * src/output.c (prepare_symbols): Don't escape strings,
4002 since users don't want to see C escapes.
4003 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
4004 in diagnostics.
c19683bb 4005 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
4006 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
4007
1094323f
PE
40082005-04-16 Paul Eggert <eggert@cs.ucla.edu>
4009
4010 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
4011 the data size is known to be too small and we can't increase it.
4012 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
4013
ca407bdf
PE
40142005-04-15 Paul Eggert <eggert@cs.ucla.edu>
4015
4016 * src/parse-gram.y: Include quotearg.h.
4017 (string_as_id): Quote $1 before using it as a key, since the
4018 lexer no longer quotes it for us.
4019 (string_content): Don't strip quotes, since lexer no longer
4020 quotes it for us.
4021 * src/scan-gram.l: Include quotearg.h.
4022 ("\""): Omit quote.
4023 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
4024 a key, since the rest of the lexer doesn't quote it.
4025 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
4026 * tests/regression.at (Token definitions): Check for backslashes
4027 in token strings.
4028
4029 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
4030 (YYSIZE_T): Define to unsigned long int when using an older compiler.
4031 (yyparse): Revamp code to generate long syntax error message, to
4032 make it easier to translate, and to avoid problems with arithmetic
4033 overflow. Change "virtual memory" to "memory" in diagnostic, since
4034 we don't know whether the memory is virtual.
4035
1ce59070
PE
40362005-04-13 Paul Eggert <eggert@cs.ucla.edu>
4037
4038 * NEWS: Bison-generated C parsers now use the _ macro to
4039 translate strings.
4040 * data/yacc.c (_) [!defined _]: New macro.
4041 All English strings wrapped inside this macro.
4042 * doc/bison.texinfo (Bison Parser): Document _.
4043 * po/POTFILES.in: Include src/parse-gram.c, since it now
4044 includes translateable strings that parse-gram.y doesn't.
4045
a749a695
PE
40462005-04-12 Paul Eggert <eggert@cs.ucla.edu>
4047
4048 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
4049 reverting the 2004-10-11 change to this function.
4050 (symbol_check_alias_consistency): Don't call symbol_type_set
4051 if the type name is already correct.
4052 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
4053
8fb1053b
PE
40542005-03-25 Paul Eggert <eggert@cs.ucla.edu>
4055
4056 * tests/regression.at (Token definitions): Don't use a token named
4057 c, as that generates a "#define c ..." that runs afoul of buggy
4058 stdlib.h that uses the identifier c as a member of struct
4059 drand48_data. Problem reported by Horst Wente.
4060
ff498c4a
PE
40612005-03-21 Paul Eggert <eggert@cs.ucla.edu>
4062
4063 * bootstrap: Change translation URL from
4064 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
4065 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
4066 redirection glitches. Problem reported by twlevo@xs4all.nl.
4067
65211d70
PE
40682005-03-20 Paul Eggert <eggert@cs.ucla.edu>
4069
4070 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
4071 after operands; POSIX says this isn't portable for the c99 command.
4072
9577fb1f
PE
40732005-03-18 Paul Eggert <eggert@cs.ucla.edu>
4074
4075 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
4076 immediately if a data overrun has occurred; this may help us track
4077 down what may be a spurious failure on MacOS.
4078
78b178f7
PE
40792005-03-17 Paul Eggert <eggert@cs.ucla.edu>
4080
a2599d0f
PE
4081 Respond to problems reported by twlevo@xs4all.nl.
4082
4083 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
4084
78b178f7
PE
4085 * src/vcg.h: Comment fix.
4086 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
4087 (G_CMAX): Change to -1 instead of INT_MAX.
4088
4089 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 4090
7296e729
PE
40912005-03-15 Paul Eggert <eggert@cs.ucla.edu>
4092
4093 * src/tables.c (state_number_to_vector_number): Put it inside an
4094 "#if 0", since it's not currently used. Problem reported by
4095 Roland McGrath.
4096
05ac60f3
PE
40972005-03-06 Paul Eggert <eggert@cs.ucla.edu>
4098
4099 * src/output.c (escaped_output): Renamed from
4100 escaped_file_name_output, since we now use it for symbol tags as
4101 well. All uses changed.
4102 (symbol_destructors_output, symbol_printers_output):
4103 Escape symbol tags too.
4104 Problem reported by Matyas Forstner in
4105 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
4106
4107 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
4108 not needed.
4109 * src/output.c (user_actions_output, token_definitions_output,
4110 symbol_destructors_output, symbol_printers_output): Likewise.
4111 * src/reader.c (prologue_augment): Likewise.
4112 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
4113
4114 * src/vcg.c (output_edge): Don't quote linestyle arg.
4115 Problem reported by twlevo@xs4all.nl.
4116
7eb453ac
PE
41172005-02-28 Paul Eggert <eggert@cs.ucla.edu>
4118
4119 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
4120 example, reported by Derek M Jones. Also, make the example even
4121 more outrageous, to better illustrate how bad the problem is.
4122
4c04c52a
PE
41232005-02-24 Paul Eggert <eggert@cs.ucla.edu>
4124
4125 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
4126 putsym. Typo reported by Sebastian Piping.
4127
a61e1620
PE
41282005-02-23 Paul Eggert <eggert@cs.ucla.edu>
4129
4130 * doc/bison.texinfo (Language and Grammar): some -> same
4131 (Epilogue): int he -> in the
4132 Typos reported by Sebastian Piping via Justin Pence.
4133
9ec93868
PE
41342005-02-07 Paul Eggert <eggert@cs.ucla.edu>
4135
4136 * tests/glr-regression.at (Improper handling of embedded actions
4137 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
4138 embedded actions and $-N in GLR parsers", work around an Autoconf bug
4139 with dollar signs in test names.
4140 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
4141 for a similar reason.
4142
73ce7e7e
PE
41432005-01-28 Paul Eggert <eggert@cs.ucla.edu>
4144
4145 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
4146 wants to redefine G_VIEW.
4147
2e72b98e
PE
41482005-01-27 Paul Eggert <eggert@cs.ucla.edu>
4149
4150 * src/vcg.c (get_view_str): Remove case for normal_view.
4151 Problem reported by twlevo@xs4all.nl.
4152
e0d634e5
PE
41532005-01-24 Paul Eggert <eggert@cs.ucla.edu>
4154
ccf830a4
PE
4155 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
4156 Problem reported by twlevo@xs4all.nl.
4157
e0d634e5
PE
4158 * doc/bison.texinfo: Change @dircategory from "GNU programming
4159 tools" to "Software development". Requested by Richard Stallman
4160 via Karl Berry.
4161
7bbc8cb0
PE
41622005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4163
4164 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4165 Problem reported by twlevo@xs4all.nl.
4166
08b770bc
PE
41672005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4168
4169 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
4170 keyword; it's not needed with modern compilers, and it doesn't
4171 affect correctness with older compilers. Suggested by
4172 twlevo@xs4all.nl.
4173
95f22ad2
PE
41742005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4175
4176 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
4177 gcc -Wswitch-default.
4178 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4179 * data/yacc.c (yyparse): Likewise.
4180
d229d15c
PE
41812005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4182
4183 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4184 already. Let config.h define any nonstandard values.
4185
ecadd90f
PE
41862005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4187
4188 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4189 for the benefit of slower hosts. Problem reported by
4190 Nelson H. F. Beebe.
4191
213744b5
PE
41922005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4193
4194 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
4195 being defined and not used.
4196 * data/lalr1.cc (yyparse): Likewise.
4197 Use "if (false)" rather than "if (0)".
4198
249d3236
PE
41992005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4200
4201 * TODO: Mention that we should allow NUL bytes in tokens.
4202
987cc1fb
PE
42032005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4204
4205 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4206 Problem reported by Hans Aberg.
4207
08fe02d9
PE
42082005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4209
4210 * src/getargs.c (version): Happy new year; update overall
4211 program copyright date from 2004 to 2005.
4212
4213 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
4214 Problem reported by Hans Aberg.
4215 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
4216 (Output file names.): Add a test for the case when standard output
4217 is closed.
4218
010c0266
PE
42192004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4220
4221 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4222 to fix an oversight in the Bison 2.0 manual.
4223
da12206a
PE
42242004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4225
4226 * NEWS: Version 2.0. Reformat the existing news items since
4227 1.875, so that related items are grouped together.
3a4734aa 4228 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
4229 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
4230
c935d934
PE
4231 * tests/torture.at (Exploding the Stack Size with Alloca): Set
4232 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
4233 otherwise, we're not testing alloca. Unfortunately there's no
4234 simple way to consult HAVE_ALLOCA here.
4235
da12206a
PE
4236 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4237 for yymsg, too.
4238
4239 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
4240 hand. This avoids a warning about comparing int to size_t when
4241 GCC warnings are enabled.
4242
0a2c5137
PE
42432004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4244
d7e14fc0
PE
4245 * NEWS: Bison-generated parsers no longer default to using the
4246 alloca function (when available) to extend the parser stack, due
4247 to widespread problems in unchecked stack-overflow detection.
4248 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4249 responsibility to set it to a positive value. This lets the user
4250 specify a value that is not a preprocessor constant.
4251 * data/yacc.c (YYMAXDEPTH): Likewise.
4252 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4253 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4254 to be a compile-time constant. However, explain the constraints on it.
4255 Also, explain the constraints on YYINITDEPTH.
4256 (Table of Symbols): Explain that alloca is no longer the default.
4257 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4258 to 1.
4259
0a2c5137
PE
4260 * doc/bison.texinfo (Location Default Action): Mention that n must
4261 be zero when k is zero. Suggested by Frank Heckenbach.
4262
e019c247
AD
42632004-12-22 Akim Demaille <akim@epita.fr>
4264
4265 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4266 (parser::state_type, parser::semantic_type, parser::location_type):
4267 Private, not public.
4268 (parser::parse): Return ints, not bool.
4269 Returning a bool introduces a problem: 0 corresponds to false, and
4270 it seems weird to return false on success. Returning true changes
4271 the conventions for yyparse.
4272 Alternatively we could return void and send an exception.
4273 There is no clear consensus (yet?).
4274 (state_stack, semantic_stack, location_stack): Rename as...
4275 (state_stack_type, semantic_stack_type, location_stack_type): these.
4276 Private, not public.
4277 * tests/c++.at: New.
4278 * tests/testsuite.at, tests/Makefile.am: Adjust.
4279
72731bb7
AD
42802004-12-21 Akim Demaille <akim@epita.fr>
4281
4282 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4283
9a0d8bec
AD
42842004-12-21 Akim Demaille <akim@epita.fr>
4285
4286 Don't impose std::string for filenames.
4287
4288 * data/lalr1.cc (b4_filename_type): New.
4289 (position::filename): Use it.
4290 (parser.hh): Move the inclusion of stack.hh and location.hh below
4291 the user code, so that needed headers for the filename type can be
4292 included first.
72731bb7
AD
4293 Forward declare them before the user code.
4294 * tests/Makefile.am (check-local, installcheck-local): Pass
4295 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 4296
99880de5
AD
42972004-12-20 Akim Demaille <akim@epita.fr>
4298
4299 Use more STL like names: my_class instead of MyClass.
4300
4301 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
4302 (SemanticStack, SemanticType, StateStack, StateType)
4303 (TokenNumberType, Stack, Slice, Traits, Parser::location)
4304 (Parser::value): Rename as...
4305 (location_stack, location_type, rhs_number_type, semantic_stack)
4306 (semantic_type, state_stack, state_type, token_number_type, stack)
4307 (slice, traits, parser::yylloc, parser::yylval): these.
4308
4309 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
4310
9bec482e
PE
43112004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4312
4313 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
4314 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4315
f6fbd3da
PE
43162004-12-17 Paul Eggert <eggert@cs.ucla.edu>
4317
4318 Remove uses of 'short int' and 'unsigned short int'. This raises
4319 some arbitrary limits. It uses more memory but nowadays that's
4320 not much of an issue.
4321
4322 This change does not affect the generated parsers; that's a different
4323 task, as some users will want to conserve memory there.
4324
4325 Ideally we should use size_t to represent all object counts, and
4326 something like ptrdiff_t to represent signed differences of object
4327 counts; but that will require more code-cleanup than I have the
4328 time to do right now.
4329
4330 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
4331 Use size_t, not int or short int, to count objects.
4332 * src/closure.c (nritemset, closure): Likewise.
4333 * src/closure.h (nritemset, closure): Likewise.
4334 * src/nullable.c (nullable_compute): Likewise.
4335 * src/print.c (print_core): Likewise.
4336 * src/print_graph.c (print_core): Likewise.
4337 * src/state.c (state_compare, state_hash): Likewise.
4338 * src/state.h (struct state): Likewise.
4339 * src/tables.c (default_goto, goto_actions): Likewise.
4340
4341 * src/gram.h (rule_number, rule): Use int, not short int.
4342 * src/output.c (prepare_rules): Likewise.
4343 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
4344 errs, reductions): Likewise.
4345 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
4346 Likewise.
4347 * src/tables.c (vector_number, tally, action_number,
4348 ACTION_NUMBER_MINIMUM): Likewise.
4349 * src/output.c (muscle_insert_short_int_table): Remove.
4350
efeed023
AD
43512004-12-17 Akim Demaille <akim@epita.fr>
4352
4353 * data/lalr1.cc: Extensive Doxygenation.
4354 (error_): Rename as...
4355 (error): this, since it is visible to the user.
4356 Adjust callers.
4357 (Parser::message): Now an automatic variable from...
4358 (Parser::yyreport_syntax_error_): here.
4359 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
4360 Parser::error.
4361 * tests/input.at: Escape $.
4362
bc82c5a5
PE
43632004-12-16 Paul Eggert <eggert@cs.ucla.edu>
4364
4365 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
4366 Parenthesize rhs to avoid obscure problems with mistakes like
4367 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
4368 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
4369 b4_rhs_location): Likewise.
4370 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
4371 b4_rhs_location): Likewise.
4372
fd19f271
AD
43732004-12-16 Akim Demaille <akim@epita.fr>
4374
4375 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
4376 yacc.c: be sure to stay within yycheck_.
4377 * tests/actions.at: Re-enable C++ tests.
4378
10454ea4
AD
43792004-12-16 Akim Demaille <akim@epita.fr>
4380
4381 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
4382 real.
4383
c5b95ccf
AD
43842004-12-16 Akim Demaille <akim@epita.fr>
4385
4386 Use #define to handle the %name-prefix.
4387
4388 * data/glr.c, data/yacc.c: Comment changes.
4389 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
4390 so that one can refer to yylex in the parser file, and have it
4391 renamed, as is the case with other skeletons.
4392
617a8f12
AD
43932004-12-16 Akim Demaille <akim@epita.fr>
4394
4395 Move lalr1.cc internals into yy*.
4396
4397 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
4398 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
4399 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
4400 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
4401 (empty_, final_, terror_, errcode_, ntokens_)
4402 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
4403 (looka_, ilooka_, error_range_, nerrs_):
4404 Rename as...
4405 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
4406 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
4407 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
4408 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
4409 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
4410 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
4411 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
4412 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
4413 these.
4414
1e547e6e
PE
44152004-12-15 Paul Eggert <eggert@cs.ucla.edu>
4416
4417 Fix some problems reported by twlevo at xs4all.
4418 * src/symtab.c (symbol_new): Report an error if the input grammar
4419 contains too many symbols. This is better than calling abort() later.
4420 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
4421 (struct node, struct graph):
4422 Rename member expand to stretch. All uses changed.
4423 (struct graph): Remove member layoutalgorithm. All uses removed.
4424 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
4425 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
4426 All uses changed.
4427 (N_STRETCH): Rename from N_EXPAND. All uses changed.
4428
735d6bd4
AD
44292004-12-15 Akim Demaille <akim@epita.fr>
4430
4431 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
4432 Add more Doxygen comments.
4433 (symprint_, stack_print_, reduce_print_, destruct_, pop)
4434 (report_syntax_error_, translate_): Rename as...
4435 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
4436 (yypop_, yyreport_syntax_error_, yytranslate_): this.
4437
2e1f5829
AD
44382004-12-15 Akim Demaille <akim@epita.fr>
4439
4440 * data/lalr1.cc (lex_): Rename as...
4441 (yylex_): this.
4442 Move the trace here.
4443 Take the %name-prefix into account.
4444 Reported by Alexandre Duret-Lutz.
4445
a3cb6248
AD
44462004-12-15 Akim Demaille <akim@epita.fr>
4447
4448 Simplify the C++ parser constructor.
4449
4450 * data/lalr1.cc (debug_): Rename as...
4451 (yydebug_): so that the parser's internals are always in the yy*
4452 pseudo namespace.
4453 Adjust uses.
4454 (b4_parse_param_decl): Remove the leading comma as it is now only
4455 called as unique argument list.
4456 (Parser::Parser): Remove the constructor accepting a location and
4457 an initial debugging level.
4458 Remove from the other ctor the argument for the debugging level.
4459 (debug_level_type, debug_level, set_debug_level): New.
4460
4461 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
4462 constructor calls.
4463
07fed891
AD
44642004-12-15 Akim Demaille <akim@epita.fr>
4465
4466 Remove b4_root related material: failure experiment
a3cb6248 4467 (which goal was to allow to derive from a class).
07fed891
AD
4468
4469 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
4470 definitions and uses.
4471
e603eaa5
PE
44722004-12-14 Paul Eggert <eggert@cs.ucla.edu>
4473
4474 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
4475 not 2, since it's not portable to subtract 1 from the start of an
4476 array. The new item 0 is never set or used. All uses changed.
4477
4478 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
4479 the default definition of YYLLOC_DEFAULT. Problem reported
4480 by Frank Heckenbach.
4481
fafb007d
PE
44822004-12-12 Paul Eggert <eggert@cs.ucla.edu>
4483
4484 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
4485 the normal case and one for the error case. Just use the
4486 first one uniformly. Problem reported by Frank Heckenbach.
4487 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
4488 use exactly the same macro in both places.
4489 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
4490 so that the normal-case YYRHSLOC works for the error case too.
4491 All uses changed.
4492 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
4493 (YYLLOC_DEFAULT): Use the same macro as glr.c.
4494 * doc/bison.texinfo (Location Default Action): Don't claim that
4495 we have an array of locations. Use the same macro for both glr
4496 and lalr parsers. Mention YYRHSLOC. Mention what happens when
4497 the index is 0.
4498
48814dcd
PE
44992004-12-10 Paul Eggert <eggert@cs.ucla.edu>
4500
a4e1a53b
PE
4501 * HACKING: Update email addresses to send announcements to.
4502
48814dcd
PE
4503 * configure.ac (AC_INIT): Bump version to 1.875f.
4504
337116ba
PE
45052004-12-10 Paul Eggert <eggert@cs.ucla.edu>
4506
4507 * NEWS: Version 1.875e.
4508 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
4509
4510 * src/scan-skel.l: Include "complain.h", for "fatal".
4511
4512 * src/relation.h (relation_print, relation_digraph):
4513 Relation sizes are of type relation_node, not size_t (this is
4514 merely a doc fix, since the two types are equivalent).
4515 (relation_transpose): Relation sizes are of type relation_node,
4516 not int.
4517 * src/relation.c: Likewise.
4518 (top, infinity): Now of type relation_node, not int.
4519 (traverse, relation_transpose): Use relation_node, not int.
4520
4521 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
4522 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
4523 (yyparse): Remove unused local introduced in 2004-10-25 patch.
4524
4525 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 4526 specifying whether the test should be skipped. Use it tp
337116ba 4527 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 4528 fail on some hosts, and should be skipped.
337116ba 4529
da2a7671
PE
45302004-12-08 Paul Eggert <eggert@cs.ucla.edu>
4531
4532 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
4533 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
4534 unless otherwise specified below.
4535
4536 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
4537 to allocate kernel_base, kernel_items, kernel_size, since
4538 they needn't be initialized to 0.
4539 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
4540 * src/closure.c (new_closure): Likewise, for itemset.
4541 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
4542 * src/lalr.c (set_goto_map): Likewise, for temp_map.
4543 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
4544 (build_relations): Likewise for edge, states1, includes.
4545 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
4546 * src/reader.c (packgram): Likewise, for ritem, rules.
4547 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
4548 * src/relation.c (relation_digraph): Likewise for VERTICES.
4549 (relation_transpose): Likewise for new_R, end_R.
4550 * src/symtab.c (symbols_token_translations_init): Likewise for
4551 token_translations.
4552 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
4553 (token_actions): Likewise for yydefact, actrow, conflrow,
4554 conflict_list.
4555 (save_column): Likewise for froms[symno], tos[symno].
4556 (goto_actions): Likewise for state_count.
4557 (pack_table): Likewise for base, pos, check.
4558 (tables_generate): Likewise for width.
4559
4560 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
4561 for initial core. Just have a separate core, so we needn't worry
4562 about whether kernel_size and kernel_base are initialized.
4563
4564 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
4565 kernel_size, kernel_items): Remove unnecessary initialization.
4566 * src/conflicts.c (conflicts): Likewise.
4567 * src/derives.c (derives): Likewise.
4568 * src/muscle_tablc (muscle_insert): Likewise.
4569 * src/relation.c (relation_digraph): Likewise.
4570 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
4571 conflrow, conflict_table, conflict_list, table, check):
4572 Likewise.
4573
4574 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
4575 This is because all callers pass unsigned int.
4576 * src/closure.h (new_closure): Likewise.
4577
4578 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
4579 (build_relations): Initialize includes[i] in all cases.
4580 * src/reader.c (packgram): Always initialize rules[ruleno].prec
4581 and rules[ruleno].precsym. Initialize members in order.
4582 * src/relation.c (relation_transpose): Always initialize new_R[i]
4583 and end_R[i].
4584 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
4585
4586 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
4587 conflict_list[0] was always 0, but now it isn't initialized.
4588
4589 * src/table.c (table_grow): When conflict_table grew, the grown
4590 area wasn't cleared. Fix this.
4591
4592 * lib/.cvsignore: Add strdup.c, strdup.h.
4593 * m4/.cvsignore: Add strdup.m4.
4594
00baeeac
PE
45952004-12-07 Paul Eggert <eggert@cs.ucla.edu>
4596
4597 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
4598 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
4599 GOTO_NUMBER_MAXIMUM, since we occasionally compute
4600 ngotos + 1 without checking for overflow.
4601 (build_relations): Use END_NODE, not -1, to denote end of edges.
4602 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
4603 build_relations): Use goto_number, not int, for goto numbers.
4604 * src/tables.c (save_column, default_goto): Likewise.
4605
be3d9d42
AD
46062004-11-23 Akim Demaille <akim@epita.fr>
4607
4608 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
4609 of #defining from yystype.
4610 Don't typedef yystype, C++ does not need it.
4611 This lets it possible to forward declare it as union.
4612
78e526d5
PE
46132004-11-23 Paul Eggert <eggert@cs.ucla.edu>
4614
4615 * bootstrap (gnulib_modules): Add extensions.
4616 Problem reported by Jim Meyering.
4617
afbb696d
PE
46182004-11-22 Paul Eggert <eggert@cs.ucla.edu>
4619
4620 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
4621 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
4622 src/system.h, src/tables.c: XFREE -> free, to accommodate
4623 recent change to gnulib xalloc.h.
78e526d5 4624 Problem reported by Jim Meyering.
afbb696d 4625
c1f8f16a
AD
46262004-11-17 Akim Demaille <akim@epita.fr>
4627
4628 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
4629
db7e5eb5 46302004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
4631 Alexandre Duret-Lutz <adl@gnu.org>
4632
4633 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
4634 changes.
4635 (YYCDEBUG): Adjust.
4636 Use it instead of cdebug_.
4637 (Parser::debug_stream, Parser::set_debug_stream): New.
4638 (Parser::symprint_): Define cdebug_ for temporary backward
4639 compatibility.
4640 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
4641 debug_stream ().
4642
68e11668
AD
46432004-11-17 Akim Demaille <akim@epita.fr>
4644
4645 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
4646 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
4647 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
4648 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
4649
97cbc73e
PE
46502004-10-27 Paul Eggert <eggert@cs.ucla.edu>
4651
4652 * data/glr.c (yyloc_default): Remove; not used.
4653 Problem reported by Frank Heckenbach.
4654
e342c3be
AD
46552004-10-25 Akim Demaille <akim@epita.fr>
4656
4657 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
4658 Introduce another definition to address simple location arrays.
4659 (yyGLRStack): New member: yyerror_range.
4660 (yyrecoverSyntaxError, yyparse): Update it.
4661 (yyrecoverSyntaxError): Use it when shifting the error token to
4662 have an accurate range, equivalent to the one computed by both
4663 yacc.c and lalr1.cc.
4664 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
4665 that column numbers start at column 0, as per GNU Coding
4666 Standards, the others tests, and the doc.
4667 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
4668 Adjust to the above change (first column is 0).
4669 And adjust the location of the "<error>", now covering the whole
4670 line.
4671
93602feb 46722004-10-22 Akim Demaille <akim@epita.fr>
04098407 4673 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
4674
4675 Remove some arbitrary limits on goto numbers and relations.
4676 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
4677 initial values, since they're never used.
4678 (set_goto_map): ngotos is now unsigned, so test for overflow
4679 by seeing whether it wraps around to zero.
4680 * src/lalr.h (goto_number): Now size_t, not short int.
4681 (GOTO_NUMBER_MAXIMUM): Remove.
4682 * src/relation.c (relation_print, traverse, relation_transpose):
4683 Check for END_NODE rather than looking at sign.
4684 * src/relation.h (END_NODE): New macro.
4685 (relation_node): Now size_t, not short int.
4686
dba08b04
PE
46872004-10-22 Paul Eggert <eggert@cs.ucla.edu>
4688
4689 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
4690 keyword, not an identifier. Problem reported by Baron Schwartz in
4691 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
4692
df09ef2e
AD
46932004-10-11 Akim Demaille <akim@epita.fr>
4694
4695 * src/symtab.c (symbol_check_alias_consistency): Also check
4696 type names, destructors, and printers.
4697 Reported by Alexandre Duret-Lutz.
4698 Recode the handling of associativity and precedence in terms
4699 of symbol_precedence_set.
4700 Accept no redeclaration at all, not even equal to the previous
4701 value.
4702 (redeclaration): New.
4703 Use it to factor redeclaration complaints.
4704 (symbol_make_alias): Don't set the type of the alias, let
4705 symbol_check_alias_consistency do it as for other features.
4706 * src/symtab.h (symbol): Add new member prec_location, and
4707 type_location.
4708 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
4709 * tests/input.at (Incompatible Aliases): New.
4710
146bc99d
PE
47112004-10-09 Paul Eggert <eggert@cs.ucla.edu>
4712
4713 .cvsignore fixes to accommodate gnulib changes,
4714 and the practice of naming build directories "_build".
4715 * .cvsignore: Add "_*". Sort.
4716 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
4717 * m4/.cvsignore: Add "*_gl.m4".
4718
e503aa60
AD
47192004-10-06 Akim Demaille <akim@epita.fr>
4720
4721 * src/parse-gram.y (add_param): Fix the truncation of trailing
4722 spaces.
4723
b4a20338
AD
47242004-10-05 Akim Demaille <akim@epita.fr>
4725
4726 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
4727 whether the reducion was empty or not. This leaves room to
4728 improve the use of YYLLOC_DEFAULT in such a case.
4729 lalr1.cc is still experimental, so changing this is acceptable.
4730 And finally, there are probably not many users who changed the
4731 handling of locations in GLR, so changing is admissible too.
4732
4733 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
4734 empty reduction, set @$ to an empty location ending the previously
4735 stacked symbol.
4736 Adjust uses to make sure the code is triggered on empty
4737 reductions.
4738 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
4739 expected output: empty reductions have empty locations.
4740
f85a5e6f
AD
47412004-09-29 Akim Demaille <akim@epita.fr>
4742
4743 * data/lalr1.cc: Move towards a more standard C++ coding style
4744 for templates: Class < T > -> Class<T>.
4745
b203fc2c
AD
47462004-09-29 Akim Demaille <akim@epita.fr>
4747
4748 * data/lalr1.cc: Reinstall the former ctor, for sake of
4749 compatibility, but warn it will be removed.
4750 Move towards a more standard C++ coding style (i.e., type *var ->
4751 type* var).
4752
5b7e1e73
PE
47532004-09-27 Paul Eggert <eggert@cs.ucla.edu>
4754
3fee967f
PE
4755 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
4756 since it's less likely to work if NULs are involved in the future.
5b7e1e73 4757
0dcca5c2
AD
47582004-09-27 Akim Demaille <akim@epita.fr>
4759
4760 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
4761
6dde1c82
AD
47622004-09-27 Akim Demaille <akim@epita.fr>
4763
4764 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 4765 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
4766 and argument names.
4767 (b4_cc_constructor_call): Likewise.
4768
b233d555
AD
47692004-09-24 Akim Demaille <akim@epita.fr>
4770
4771 * src/parse-gram.y (add_param): Strip the leading and trailing
4772 blanks from a formal argument declaration.
4773 (YY_LOCATION_PRINT): New.
4774
619404e3
AD
47752004-09-24 Akim Demaille <akim@epita.fr>
4776
4777 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
4778 after the location.
4779
dd8d9022
AD
47802004-09-24 Akim Demaille <akim@epita.fr>
4781
4782 * doc/bison.texinfo (Table of Symbols): Sort.
4783
0092f063
AD
47842004-09-21 Akim Demaille <akim@epita.fr>
4785
4786 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
4787 the useless parentheses.
4788 Suggested by Paul Eggert.
4789
451364ed
AD
47902004-09-20 Akim Demaille <akim@epita.fr>
4791
4792 Let the initial-action act on the look-ahead, and use it for the
4793 "initial push" (corresponding to an hypothetical beginning-of-file).
4794 And let lalr1.cc honor %initial-action.
4795
4796 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
4797 example.
4798 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
4799 (Parser::Parser): Remove the ctor that used to initialize it.
4800 (Parser::parse): Like in the other skeletons, issue the "starting
4801 parse" message before any action.
4802 Honor %initial-action.
4803 Initialize the stacks with the lookahead.
4804 * data/yacc.c: Let $$ and @$ in %initial-action designate the
4805 look-ahead.
4806 Push them in the stacks.
4807 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
4808
18d192f0
AD
48092004-09-20 Akim Demaille <akim@epita.fr>
4810
4811 * doc/bison.texinfo (Initial Action Decl): New.
4812
b8458aa5
AD
48132004-09-20 Akim Demaille <akim@epita.fr>
4814
4815 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
4816 clearer criterion to define it.
4817 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
4818 When reducing on an empty RHS, use the latest stacked location as
4819 location.
4820 yylloc is not always available.
4821 * data/glr.c: Likewise.
4822 Also, honor initial-actions.
4823
3fc16193
AD
48242004-09-20 Akim Demaille <akim@epita.fr>
4825
4826 * data/yacc.c (YY_LOCATION_PRINT): New.
4827 Define when we know YYLTYPE's structure, i.e., when the default
4828 YYLLOC_DEFAULT is used.
4829 * data/c.m4 (b4_yysymprint_generate): Use it.
4830 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
4831 value of the result.
4832 (error_start_): Replace with...
4833 (error_range_): this location array.
4834 This allows to replace code relying on the implementation of
4835 locations by portable code.
4836 * data/yacc.c (yylerrsp): Replace with...
4837 (yyerror_range): this.
4838 Every time a token is popped, update yyerror_range[0], to have an
4839 accurate location for the error token.
4840 * data/glr.c (YY_LOCATION_PRINT): New.
4841 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
4842 deference a pointer.
4843 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
4844 report the location in %printers.
4845
4846 * src/scan-skel.l: Instead of abort, report error messages to ease
4847 understanding skeleton scanning failures.
4848
ecfe33e7
AD
48492004-09-16 Akim Demaille <akim@epita.fr>
4850
4851 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
4852 (iterator, const_iterator): these, to be more in the C++ spirit.
4853 Also, return reverse iterators so that when displaying the stack
4854 we display its bottom first.
4855 (Parser::stack_print_, Parser::reduce_print_): Match the messages
4856 from yacc.c.
4857 We should probably use vector here though.
4858
1576d44d
AD
48592004-09-16 Akim Demaille <akim@epita.fr>
4860
4861 Have more complete shift traces.
4862
4863 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
4864 to report Shifts instead of ad hoc YYDPRINTF invocations,
4865 including for the error token.
4866 * data/lalr1.cc (symprint_): Output the location.
4867 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
4868 output the location within the %printer.
4869 Activate GLR tests, at least to make sure they compile properly.
4870 They still don't pass though.
4871 * tests/calc.at: Adjust expect verbose output, since now "Entering
4872 state..." is on a different line than the "Shifting" message.
4873
9c66f418
AD
48742004-09-08 Akim Demaille <akim@epita.fr>
4875
4876 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
4877 Bison directive from the Bison file to the invocation of this
4878 macro, so that these directives are passed to
4879 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
4880 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
4881 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
4882 the extra Bison directives instead of the whole series.
4883 Change the grammar so that there are recoverable errors, and
4884 unrecoverable errors. Now we can have the parser give up before
4885 consuming the whole input. As a result we now can observe that
4886 the lookahead is freed when needed.
4887 Change the parser source to parse argv[1] instead of a hard coded
4888 string.
4889 Simplify yylex, and give a value and location to EOF.
4890 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
4891 passed directives already coded in the file.
4892 Add some tests to check the location of "error".
4893 For some tests, the C++ parser is correct, and not yacc.c.
4894 For other tests, they provide different, but unsatisfying, values,
4895 so keep the C++ value so that at least one parser is "correct"
4896 according to the test suite.
4897 (Actions after errors): Remove, this is subsumed by the
4898 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
4899
52d5733f
AD
49002004-09-06 Akim Demaille <akim@epita.fr>
4901
4902 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 4903 (Parser::pop): New.
52d5733f
AD
4904 Use it.
4905
a0e68930
AD
49062004-09-06 Akim Demaille <akim@epita.fr>
4907
4908 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
4909 argument, an informative message.
4910 Call YY_SYMBOL_PRINT.
4911 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
4912 * data/lalr1.cc (destruct_): Likewise.
4913 In addition, no longer depend on b4_yysymprint_generate and
4914 b4_yydestruct_generate to generate these functions, do it "by
4915 hand".
4916
e757bb10
AD
49172004-09-03 Akim Demaille <akim@epita.fr>
4918
4919 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
4920 invoked, yydestruct the lookahead.
4921 * tests/calc.at (Calculator $1): Update the expected lengths of
4922 traces: there is an added line for the discarded lookahead.
4923 * doc/bison.texinfo (Destructor Decl): Some rewording.
4924 Define "discarded" symbols.
4925
0fe1f06d
AD
49262004-09-02 Akim Demaille <akim@epita.fr>
4927
4928 * data/lalr1.cc (translate_, destruct_): No reason to be static.
4929
284acc8b
AD
49302004-09-02 Akim Demaille <akim@epita.fr>
4931
4932 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
4933 (YYDSYMPRINTF): Rename as...
4934 (YY_SYMBOL_PRINT): this.
4935 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
4936 two.
4937 Use it instead of direct symprint_ calls.
4938 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
4939 one.
4940
a5eb1ed2
AD
49412004-09-02 Akim Demaille <akim@epita.fr>
4942
b7c72fe1
AD
4943 * data/lalr1.cc (b4_yysymprint_generate): New.
4944 (symprint_): New member function, defined when YYDEBUG.
4945 Use it consistently instead of token/nterm debugging output by
4946 hand.
a5eb1ed2
AD
4947 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
4948 %printer calls to use cdebug_ when using lalr1.cc.
4949
417141dd
AD
49502004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
4951
4952 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
4953 with #ifdef YYDEBUG.
4954
2fa09258
AD
49552004-08-26 Akim Demaille <akim@epita.fr>
4956
4957 * doc/bison.texinfo (Implementing Loops): Rename as...
4958 (Implementing Gotos/Loops): this.
4959
9378b508
PE
49602004-08-13 Paul Eggert <eggert@cs.ucla.edu>
4961
4962 Adjust to latest gnulib.
4963 * bootstrap (gnulib_modules): Add xalloc-die.
4964 Set LC_ALL=C so that file names sort consistently.
4965 Prefer the gnulib copies of gettext.m4, glibc21.m4,
4966 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
4967 uintmax_t.m4, ulonglong.m4.
4968 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
4969 po.m4 since we are now using _gl.m4 instead.
4970
87a8ad5c
PE
49712004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
4972
4973 * src/scan-action.l: Remove. Scanning of semantic actions is
4974 handled in scan-gram.l.
4975
dca81a78
PE
49762004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
4977
4978 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
4979
4980 * src/location.h (struct): The file member is a uniqstr.
4981 (equal_boundaries): Use UNIQSTR_EQ for comparison.
4982
c9cbf7c5
PE
49832004-07-22 Paul Eggert <eggert@cs.ucla.edu>
4984
4985 Fix bug with non-%union parsers that have printers or destructors,
4986 which led to a Bison core dump. Reported by Peter Fales in
4987 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 4988
c9cbf7c5
PE
4989 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
4990 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
4991 not to our own type.
4992 * src/output.c (symbol_destructors_output, symbol_printers_output):
4993 Don't assume %union.
4994 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
4995 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
4996 UNION-FLAG. All callers changed.
4997 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
4998 Use type char, not unsigned int, when declaring an array of char;
4999 this lets us remove a cast.
5000 (Printers and Destructors): Add non-%union test cases.
5001
fa7e68c3
PE
50022004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5003
5004 * doc/bison.texinfo: Minor editorial changes, mostly to the new
5005 GLR writeups. E.g., avoid frenchspacing and the future tense,
5006 change "lookahead" to "look-ahead", and change "wrt" to "with
5007 respect to".
2fa09258 5008
fa7e68c3
PE
50092004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5010
5011 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
5012 New sections, split off from the GLR Parsers section. Put the new
5013 Simple GLR Parser near the start of the GLR section, for clarity.
5014 Rewrite connective text.
5015
99a9344e
PE
50162004-06-21 Frank Heckenbach <frank@g-n-u.de>
5017
5018 * doc/bison.texinfo (Simple GLR Parsers): New section.
5019
8dd162d3
PE
50202004-06-21 Paul Eggert <eggert@cs.ucla.edu>
5021
5022 * NEWS, TODO, doc/bison.texinfo:
5023 Use "look-ahead" instead of "lookahead", to be consistent.
5024 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
5025 while we're fixing "look-ahead".
5026 * src/conflicts.c (shift_set): Renamed from shiftset.
5027 (look_ahead_set): Renamed from lookaheadset.
5028 * src/print.c: Likewise.
5029 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
5030 name for "lookahead".
5031 (report_types, usage): Likewise.
5032 * src/getargs.h (report_look_ahead_tokens): Renamed from
5033 report_lookaheads.
5034 * src/lalr.c (compute_look_ahead_tokens): Renamed from
5035 compute_lookaheads.
5036 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
5037 (look_ahead_tokens_print): Renamed from lookaheads_print.
5038 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
5039 state_rule_lookaheads_print.
5040 * src/state.h: Likewise.
5041 (reductions.look_ahead_tokens): Renamed from lookaheads.
5042 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
5043 AT_DATA_LOOKAHEADS_GRAMMAR.
5044
57a90331
PE
50452004-06-03 Paul Eggert <eggert@cs.ucla.edu>
5046
5047 * README: Update location of patched M4 distribution.
5048
8ed3234a
PE
50492004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
5050
5051 Don't assume the C++ compiler takes the same arguments as the C compiler
5052 (trivial change).
5053 * configure.ac (O0CXXFLAGS): New var.
5054 * tests/atlocal.in (CXXFLAGS): Use it.
5055
07971983
PE
50562004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5057
5058 Fix some "make check" problems with C++ reported by
5059 Albert Chin-A-Young for Tru64 C++ in this thread:
5060 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
5061
5062 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
5063 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5064 Output to a .cc file for C++, not to a .c file.
5065 * tests/calc.at (AT_CHECK_CALC): Likewise.
5066 * tests/regression.at (AT_CHECK_DANCER): Likewise.
5067 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
5068
29058652
PE
50692004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
5070
5071 * tests/calc.at, tests/actions.at: Workaround for SGI
5072 C++ compiler. (trivial change)
5073
62cb8a99
PE
50742004-05-27 Paul Eggert <eggert@cs.ucla.edu>
5075
fd418816
PE
5076 Spent a few hours checking out which prerequisite versions the
5077 current sources actually require. I went all the way back to
5078 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
5079 a seemingly endless set of combinations of versions more recent
5080 than that. The bottom line is that the current sources require
5081 fairly recent versions of the build tools, and it'll be some work
5082 to change this.
5083 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
5084 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
5085 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
5086 Add comments explaining why those particular versions are
5087 currently needed.
2fa09258 5088
62cb8a99
PE
5089 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
5090 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 5091 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
5092
5093 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
5094 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
5095
caa52c10
PE
50962004-05-26 Paul Eggert <eggert@cs.ucla.edu>
5097
5098 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
5099 0.11.5. Suggested by Bruno Haible.
5100 * bootstrap: Remove gettext version checking.
5101
5102 * doc/bison.texinfo (Decl Summary): Also mention that %union
5103 can depend on prerequisite types. Problem reported by Tim
5104 Van Holder.
5105
4bfd5e4e
PE
51062004-05-25 Paul Eggert <eggert@cs.ucla.edu>
5107
2cef3017
PE
5108 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
5109 * README-alpha: Don't tell people not to package this.
5110
b9c85d5c
PE
5111 * bootstrap: Don't assume $(...) works; use `...` instead.
5112 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
5113 gettext better.
5114
4bfd5e4e
PE
5115 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
5116 put into the -d output file, and mention what to do if YYSTYPE is
5117 defined as a macro.
5118
6a36ff94
PE
51192004-05-24 Paul Eggert <eggert@cs.ucla.edu>
5120
6712933e
PE
5121 Undo change made earlier today: it caused autopoint to not bring
5122 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
5123 autopoint's.
5124
5125 * bootstrap: Check that gettext version matches what's in
5126 configure.ac. Warn users to ignore robots.txt ERROR 404.
5127 * bootstrap: Undo today's earlier change (logged below).
5128 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 5129
6a36ff94
PE
5130 The gettext version checking is causing more trouble than it's
5131 curing; remove it. Problem reported by Paul Hilfinger.
5132
5133 * bootstrap: Issue a warning that one can expect a message
5134 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
5135 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
5136
209ea708
PE
51372004-05-23 Paul Eggert <eggert@cs.ucla.edu>
5138
5139 Ensure that the C++ compiler used for testing actually works on a
5140 simple test program; if not, skip the C++-related tests. Problem
5141 reported by Vin Shelton in:
161a71f3 5142 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
5143
5144 * m4/cxx.m4: New file.
5145 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
5146 * tests/atlocal.in (BISON_CXX_WORKS): Add.
5147 * tests/local.at (AT_COMPILE_CXX): Use it.
5148
41ca2549
PE
51492004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5150
383e69dc
PE
5151 * data/glr.c (yylloc): Output this macro even if locations are not
5152 being generated, as the GLR parser needs it even in that case.
5153 Problem reported by Troy A. Johnson
5154 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
5155
41ca2549
PE
5156 * configure.ac (AC_INIT): Update to 1.875e.
5157
e476c87d
PE
51582004-05-21 Paul Eggert <eggert@cs.ucla.edu>
5159
5160 * NEWS: Version 1.875d.
5161 * configure.ac (AC_INIT): Likewise.
5162 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5163
5164 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5165 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5166 lalr1.cc runs afoul of the first, and the last two are no longer
5167 supported by GCC 3.4.0.
5168 * README: Mention GNU m4 1.4 or later; mention m4 patches.
5169 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
5170
233a88ad
PE
51712004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5172
5173 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
5174 unsigned int, for compatibility with latest gnulib hash module.
5175 * src/state.c (state_hash, state_hasher): Likewise.
5176 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
5177 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 5178
12ffdd28
PE
51792004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5180
5181 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5182
5183 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
5184 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
5185 character and string literals.
5186 (unexpected_end): New function.
5187 (unexpected_eof): Use it.
5188 (unexpected_newline): New function.
5189 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
5190 actions.
e476c87d 5191
12ffdd28
PE
5192 * NEWS: Document %expect-rr.
5193
5194 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
5195 Fix typo by replacing $1 with $option.
5196 Remove more 'intl'-related files.
9668e2be 5197 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
5198
5199 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5200 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5201 strtoul.c.
5202 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
5203 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
5204 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
5205 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
5206 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
5207 * src/.cvsignore: Add *.output.
5208
5209 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5210 gets copied to the output file.
e476c87d 5211
1f65350a
PE
52122004-04-28 Paul Eggert <eggert@twinsun.com>
5213
5214 Get files from the gnulib and po repositories, instead of relying
5215 on them being in our CVS. Upgrade to latest versions of gnulib
5216 and Automake.
5217
5218 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
5219 * bootstrap: Bootstrap from gnulib and po repositories.
5220 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
5221 * README-cvs: Document these changes. Remove version numbers from
5222 mentions of build tools, since they change so often. Mention Flex.
5223
5224 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
5225 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
5226 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
5227 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 5228 does this for us.
12ffdd28
PE
5229 (AC_ISC_POSIX): Remove; we no longer support this
5230 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
5231 (AC_HEADER_STDC): Remove: we now assume C89 or better.
5232 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
5233 Do not check for C89 headers, except for locale.h which is used
5234 by the Yacc library and must port to K&R hosts.
5235 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
5236 Do not check for C89 functions, except for setlocale which is
5237 used by the Yacc library.
5238 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
5239 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
5240 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
5241 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5242 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5243 AM_GNU_GETTEXT): Remove; now done by:
5244 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5245 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5246 for us.
5247
5248 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5249 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5250 Define to empty, as gnulib.mk will do the rest for us.
5251 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5252 for us.
5253 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5254 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5255
5256 * src/files.c: Include gnulib's xstrndup.h.
5257
5258 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5259 (REALLOC): Use xnrealloc, for likewise.
5260 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5261 (strnlen, memrchr): Remove decls; functions no longer used.
5262 Include <stpcpy.h>.
5263
5264 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5265 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5266 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5267 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5268 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5269 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5270 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5271 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5272 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5273 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5274 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5275 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5276 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5277 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5278 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5279 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5280 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5281 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5282 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5283 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
5284 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
5285 Remove, as these files are now generated automatically
5286 by bootstrap or automake.
5287
5288 * po/ChangeLog: Remove: all but one entry was a duplicate
5289 of this file, and I moved that 2000-11-02 entry here.
5290
5291 * config/.cvsignore: Add Makefile, depcomp, install-sh.
5292 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
5293 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
5294 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
5295 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
5296 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
5297 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
5298 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
5299 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
5300 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
5301 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
5302 xstrndup.h.
5303 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
5304 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
5305 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
5306 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
5307 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
5308 * src/.cvsignore: Remove *_.c.
5309
5310
5311 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
5312 support it. (The latest stable gzip doesn't.)
5313
53142004-04-27 Paul Eggert <eggert@twinsun.com>
5315
5316 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
5317 case, as stos_ is now used by destructors due to the 2004-02-09
5318 change.
5319
5320 Remove more K&R C support.
5321 * lib/libiberty.y (PARAMS): Remove. All uses removed.
5322 * lib/subpipe.c (errno): Remove decl.
5323 Include <stdlib.h> unconditionally.
5324 (EXIT_FAILURE): Remove macro.
5325 * src/complain.c (vfprintf, strerror): Remove.
5326 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
5327 unconditionally.
5328 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
5329 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
5330 (strchr, strspn, memchr): Remove decls.
5331 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
5332 unconditionally. Do not declare perror.
5333 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
5334 unconditionally.
5335
5336 * src/complain.c (_): Remove useless defn, as system.h defines this.
5337
5338 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
5339 with latest obstack.h.
5340 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
5341 to procedure types, as obstack.h now does that for us.
5342 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
5343
5344 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
5345 so that this include file can stand alone.
5346 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
5347 does this now. Include subpipe.h first after config.h, to
5348 test whether it can stand alone.
5349
5350 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
5351 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
5352 unused declaration.
5353
5354 * tests/synclines.at (%union synch line): Put a dummy member in
5355 the union, because empty unions aren't allowed in C. Caught
5356 by GCC 3.4.0.
5357
4f16766c
PE
53582004-04-13 Jim Meyering <jim@meyering.net>
5359
5360 * src/conflicts.c (conflicts_print): Correct format string typo:
5361 use `%%' to produce literal `%'. (trivial change)
5362
779e7ceb
PE
53632004-03-30 Paul Eggert <eggert@twinsun.com>
5364
5365 * src/getargs.c (version): Update copyright year to 2004.
5366
5367 * data/c.m4 (b4_int_type): Use 'short int' rather than
5368 'short', and similarly for 'long', 'unsigned', etc.
5369 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
5370 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
5371 yy_yypstack, yydumpstack): Likewise.
5372 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
5373 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
5374 Likewise.
5375 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
5376 yy_stack_print, yyparse): Likewise.
5377 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
5378 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
5379 * lib/bitset.c (bitset_print): Likewise.
5380 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
5381 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
5382 * lib/bitsetv.c (bitsetv_dump): Likewise.
5383 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
5384 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
5385 Likewise.
5386 * src/LR0.c (allocate_itemsets): Likewise.
5387 * src/gram.h (rule_number, rule): Likewise.
5388 * src/lalr.h (goto_number): Likewise.
5389 * src/nullable.c (nullable_compute): Likewise.
5390 * src/output.c (prepare_rules): Likewise.
5391 * src/relation.c (relation_print, relation_digraph): Likewise.
5392 * src/relation.h (relation_node): Likewise.
5393 * src/state.h (state_number, transitions, errs, reductions,
5394 struct state): Likewise.
5395 * src/symtab.h (symbol_number, struct symbol): Likewise.
5396 * src/tables.c (vector_number, tally, action_number,
5397 default_goto, goto_actions): Likewise.
5398 * tests/existing.at (GNU Cim Grammar): Likewise.
5399 * tests/regression.at (Web2c Actions): Likewise.
5400
5401 * src/output.c (muscle_insert_short_int_table): Renamed from
5402 muscle_insert_short_table. All uses changed.
5403
d6328241
PH
54042004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5405
5406 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
5407 (declaration): Replace expected_conflicts with expected_sr_conflicts.
5408 Add %expect-rr rule.
4f16766c 5409
d6328241
PH
5410 * src/scan-gram.l: Recognize %expect-rr.
5411
4f16766c 5412 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 5413 expected_conflicts.
4f16766c 5414 (expected_rr_conflicts): Declare.
d6328241
PH
5415
5416 * src/conflicts.c (expected_sr_conflicts): Rename from
5417 expected_conflicts.
5418 (expected_rr_conflicts): Define.
5419 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
5420 for GLR parsers.
5421 Use expected_sr_conflicts in place of expected_conflicts.
5422 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 5423
d6328241 5424 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 5425
1452af69
PE
54262004-03-08 Paul Eggert <eggert@gnu.org>
5427
5428 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 5429 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
5430
5431 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
5432 in lalr1.cc.
5433 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
5434 * src/scan-gram.l (scan_integer): New function.
5435 ({int}): Use it.
5436 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
5437 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
5438 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
5439 Say "long int", not "long", for uniformity with GNU style.
5440
006d217d
PE
54412004-02-25 Paul Eggert <eggert@twinsun.com>
5442
5443 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
5444 compilers. This fixes a problem with Intel's C++ compiler being
5445 chatty, reported by Guido Trentalancia in
161a71f3 5446 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 5447
c2729758
ADL
54482004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
5449
5450 Support %destructor and merge error locations in lalr1.cc.
5451
5452 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
5453 (Parser::stos_): Define unconditionally.
5454 (Parser::destruct_): New method. Generate its body with
5455 b4_yydestruct_generate.
5456 (Parser::error_start_): New attribute.
5457 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
5458 token which are discarded.
5459 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
5460 error_start_ when erroneous token are discarded.
5461 (Parser::parse) <yyerrlab1>: Compute the location of the error
5462 token so that it covers all the discarded tokens.
5463 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
5464 it can be called with `%skeleton "lalr1.cc"', and do that.
5465
dd0e0635
PE
54662004-02-02 Paul Eggert <eggert@twinsun.com>
5467
5468 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
5469 $(top_srcdir)/lib and ../lib. This fixes a bug reported
5470 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
5471 There's no need to mention top_builddir since Automake does that
5472 for us.
5473 (INCLUDES): Remove, as Automake says it's obsolescent.
5474 Contents migrated into AM_CPPFLAGS as described above.
5475 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
5476
54772004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5478
5479 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
5480 (yyreportSyntaxError): Handle case where lookahead token is
5481 YYEMPTY.
5482
be16239b
PH
54832004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5484
5485 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
5486 resulting parsers are compilable with C++.
5487
5fa90832
PE
54882003-12-23 Paul Eggert <eggert@twinsun.com>
5489
5490 * config/depcomp, config/install-sh: Sync with Automake 1.8.
5491 * src/output.c (output_skeleton): Rename local var.
5492 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
5493 Bison tokens, as this runs afoul of the 2003-10-07 change that
5494 disallowed NUL bytes in character constants or string literals.
5495
5496 * tests/local.at: Require Autoconf 2.59's Autotest.
5497 * tests/testsuite.at: Don't include local.at, since we now assume
5498 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
5499 including it.
5500 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
5501 multiple inclusion warnings.
dd0e0635 5502
b165c324
AD
55032003-12-02 Akim Demaille <akim@epita.fr>
5504
5505 * doc/bison.texinfo (How Can I Reset the Parser): More about start
5506 conditions.
5507 From Bruno Haible.
5508
26e06a21
ADL
55092003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
5510
5511 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
5512
92ac3705
PE
55132003-10-07 Paul Eggert <eggert@twinsun.com>
5514
6a5ecb38
PE
5515 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
5516 if testsuite doesn't exist.
5517
92ac3705
PE
5518 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
5519 literals, unfortunately.
5520 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
5521 Complain about NUL bytes in character constants or string literals.
5522
91d2c560
PE
55232003-10-05 Paul Eggert <eggert@twinsun.com>
5524
5525 * NEWS: Don't document %no-default-prec, as it's still
5526 too experimental.
5527 * doc/bison.texinfo: Document %no-default-prec only if
5528 the defaultprec flag is set. Normally it's not.
5529
0cc3da3a
PE
55302003-10-04 Paul Eggert <eggert@twinsun.com>
5531
5532 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
5533 non-modifiable lvalue, instead of a modifiable one.
5534 * doc/bison.texinfo (Actions): Document that $$ can
5535 be assigned to. Do not claim that $$ and $N are
5536 array element references: user code should not rely on this.
5537
22fccf95
PE
55382003-10-01 Paul Eggert <eggert@twinsun.com>
5539
5540 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
5541 (grammar_declaration): Use it.
5542 * src/scan-gram.l: New token %no-default-prec.
5543 * tests/conflicts.at: Revamp tests to use %no-default-prec.
5544 * NEWS, doc/bison.texinfo: Document the above.
5545
fc8f2965
AD
55462003-10-01 Akim Demaille <akim@epita.fr>
5547
5548 VCG no longer supports long_straight_phase.
5549
5550 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
5551 * src/print_graph.c (print_graph): Adjust.
5552
39a06c25
PE
55532003-09-30 Frank Heckenbach <frank@g-n-u.de>
5554 and Paul Eggert <eggert@twinsun.com>
5555
5556 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
5557 Table of Symbols): Document %default-prec.
5558 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
5559 (grammar_declaration): Set default_prec on %default-prec.
5560 * src/scan-gram.l (%default-prec): New token.
5561 * src/reader.h (default_prec): New flag.
5562 * src/reader.c: Likewise.
5563 (packgram): Handle it.
5564 * tests/conflicts.at (%default-prec without %prec,
5565 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 5566
39a06c25
PE
55672003-09-30 Paul Eggert <eggert@twinsun.com>
5568
5569 * tests/testsuite.at: Include local.at, not input.at, fixing
5570 a typo in the 2003-08-25 patch.
5571
62b6aef9
AD
55722003-08-27 Akim Demaille <akim@epita.fr>
5573
5574 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
5575 GCC warnings.
5576
89e1cc61
AD
55772003-08-26 Akim Demaille <akim@epita.fr>
5578
5579 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
5580 "<\#" to avoid magic from Gnus when posting parts of this script.
5581
a08460b0
AD
55822003-08-26 Akim Demaille <akim@epita.fr>
5583
5584 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
5585 (Parser::parse): here.
5586 Adjust: nerrs and errstatus is now replaced by...
5587 (Parser::nerrs_, Parser::errstatus_): New.
5588
603f1cfd
AD
55892003-08-25 Akim Demaille <akim@epita.fr>
5590
5591 * config/announce-gen, Makefile.cfg: New.
5592 * Makefile.am: Adjust.
5593 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
5594 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
5595
cd3684cf
AD
55962003-08-25 Akim Demaille <akim@epita.fr>
5597
5598 When reducing initial empty rules, Bison parser read an initial
5599 location that is not defined. This results in garbage, and that
5600 affects Bison's own parser. Therefore we need (i) to extend Bison
5601 to support a means to initialize this location, and (ii) to use
5602 this CVS Bison to fix CVS Bison's parser.
5603
5604 * src/reader.h, reader.c (epilogue_augment): Remove, replace
5605 with...
5606 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
5607 * src/parse-gram.y: Adjust.
5608 (%initial-action): New.
5609 (%error-verbose): Since we require CVS Bison, there is no reason
5610 not to use it.
5611 * src/scan-gram.l: Adjust.
5612 * src/Makefile.am (YACC): New, to make sure we use our own parser.
5613 * data/yacc.c (yyparse): Use b4_initial_action.
5614
4e03e201
AD
56152003-08-25 Akim Demaille <akim@epita.fr>
5616
5617 * doc/bison.texinfo: Don't promote stdout for error messages.
5618
8c182d05
AD
56192003-08-25 Akim Demaille <akim@epita.fr>
5620
5621 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
5622 From Alexandre Duret-Lutz.
5623
6a60c4cf
PE
56242003-08-25 Akim Demaille <akim@epita.fr>
5625
5626 Version 1.875c.
5627
25f66e1a
AD
56282003-08-25 Akim Demaille <akim@epita.fr>
5629
5630 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
5631 Use them.
5632
5348bfbe
AD
56332003-08-25 Akim Demaille <akim@epita.fr>
5634
5635 * data/lalr1.cc (Parser::reduce_print_): New.
5636 Use it.
5637
47301314
AD
56382003-08-25 Akim Demaille <akim@epita.fr>
5639
5640 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
5641 error recovery loops. This patch is based on
161a71f3 5642 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
5643 Also, augment the similarity between lalr1.cc and yacc.c.
5644 Note: the locations of error recovery rules are not correct yet.
5645
5646 * data/lalr1.cc: Comment changes to augment the similarity between
5647 lalr1.cc and yacc.c.
5648 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
5649 (yyerrlab1): Remove, but where it used to be (now the bottom part of
5650 yyerrlab), when hitting EOF, pop the whole stack here instead of
5651 merely falling thru the default error handling mechanism.
5652 (yyerrorlab): New label, with the old contents of YYERROR,
5653 plus the following change: pop the stack of rhs corresponding
5654 to the production that invoked YYERROR. That is how Yacc
5655 behaves (required by POSIX).
5656 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
5657 fail.
5658
1f7a61ff
AD
56592003-08-25 Akim Demaille <akim@epita.fr>
5660
5661 Tune local.at so that people can "autom4te -l autotest calc.at -o
5662 calc" for instance, to extract a sub test suite.
5663
5664 * tests/testsuite.at: Move the initialization, Autotest version
5665 requirement, and AT_TESTED invocation into...
5666 * tests/local.at: here.
5667 * tests/testsuite.at: Include it for compatibility with Autoconf
5668 2.57.
5669 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
5670 be ignore.
5671
327b5b56
PE
56722003-08-04 Paul Eggert <eggert@twinsun.com>
5673
5674 Rework code slightly to avoid gcc -Wtraditional warnings.
5675 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
5676 The returned value is now stored in *YY0. All callers changed.
5677 * src/output.c (merge_output): Adjust to the above change.
5678
0051e3ed
PE
56792003-07-26 Paul Eggert <eggert@twinsun.com>
5680
5681 * data/glr.c (YYASSERT): New macro.
5682 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
5683 yyresolveStates, yyprocessOneStack):
5684 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
5685 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 5686
137437c6
PE
56872003-07-25 Paul Eggert <eggert@twinsun.com>
5688
5b620e06
PE
5689 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
5690 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 5691 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
5692 by Frank Heckenbach, though I have omitted the structure-initialization
5693 part of his glr-knr.diff patch since I recall that the Portable
5694 C Compiler didn't require that change.
5695
137437c6
PE
5696 Let the user specify how to allocate and free memory.
5697 Derived from a suggestion by Frank Heckenbach in
161a71f3 5698 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
5699 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
5700 All uses of free, malloc, realloc changed to use these macros,
5701 and unnecessary casts removed.
5702 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
5703
ddb85ca5
PE
57042003-07-06 Matthias Mann <MatthiasMann@gmx.de>
5705
5706 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
5707 use s.empty() rather than s == "" to test for empty string; see
161a71f3 5708 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
5709 (trivial change)
5710
39910e09
AD
57112003-06-25 Akim Demaille <akim@epita.fr>
5712
5713 * config/depcomp, config/install-sh: Update from masters.
5714
0ae99356
PE
57152003-06-20 Paul Eggert <eggert@twinsun.com>
5716
5717 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
5718 and return properly parenthesized result.
5719 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
5720 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5721 Remove unnecessary parentheses from uses.
5722 * doc/bison.texinfo (Location Default Action): Describe the
5723 conventions for parentheses.
5724
cd05d13c
PE
57252003-06-19 Paul Eggert <eggert@twinsun.com>
5726
81fd08ca
PE
5727 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
5728 yyreportTree): Do not assume that size_t is the same width as int,
5729 when printing sizes. Print sizes using an unsigned format.
5730 Problem reported by Frank Heckenbach in
161a71f3 5731 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 5732
cd05d13c
PE
5733 Port to Forte Developer 7 C compiler.
5734 * data/glr.c (struct YYLTYPE): If locations are not being used,
5735 declare a single dummy member, as empty structs do not conform
5736 to the C standard.
5737 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
5738 the Forte Developer 7 C compiler complains that end-of-loop
5739 code is not reached.
5740
4dcf140b
PE
57412003-06-17 Paul Eggert <eggert@twinsun.com>
5742
5743 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
5744 avoid warnings from picky compilers about redefinition of PARAMS.
5745
8dd76bee
PE
57462003-06-17 Paul Eggert <eggert@twinsun.com>
5747
5748 Version 1.875b.
5749
5750 * NEWS: Document 1.875b.
5751
5752 * lib/bbitset.h: Do not include config.h; that's the includer's job.
5753 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
5754 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
5755 Don't use 'index' in comments, as it's a builtin fn on some hosts.
5756 * lib/bitset_stats.c: Include gettext.h unconditionally, as
5757 per recent gettext manual's suggestion.
5758 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
5759 Use prototypes, not old-style definitions.
5760 * lib/lbitset.c (lbitset_unused_clear): Likewise.
5761 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
5762 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
5763 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
5764 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
5765 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
5766 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
5767 vbitset_or_and_cmp, vbitset_copy): Likewise.
5768
5769 * lib/libiberty.h: Do not include config.h; that's the includer's job.
5770 Do not include <stdlib.h>.
5771 (PARAMS): Define unconditionally for C89.
5772 (ATTRIBUTE_NORETURN): Remove.
5773 (ATTRIBUTE_UNUSED): Define unconditionally.
5774
5775 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 5776 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
5777 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
5778 * lib/vbitset.c, lib/vbitset.h: New files.
5779 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
5780 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
5781 from libbitset.
5782
5783 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
5784 `How Can I Reset @code{yyparse}', since texinfo does not allow
5785 arbitrary @ in node names.
5786
5787 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
5788 shouldn't be needed according to the gettext 0.12.1 documentation
5789 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 5790 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 5791 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 5792 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 5793
8dd76bee
PE
5794 * lib/.cvsignore: Add stdbool.h.
5795 * m4/.cvsignore: Add nls.m4, po.m4.
5796
5797 Upgrade to CVS gnulib.
5798 * stdbool_.h: File renamed from stdbool.h.in.
5799 * configure.ac (AM_STDBOOL_H): Invoke this instead of
5800 AC_HEADER_STDBOOL.
5801 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
5802 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
5803 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
5804 (MOSTLYCLEANFILES): New var.
5805 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
5806 (stdbool.h): New rule.
5807 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
5808 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
5809 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
5810 m4/quote.m4: Upgrade to today's gnulib.
5811
5812 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
5813 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
5814 the tests right now.
5815 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
5816 yyerror are declared before use; C99 requires this.
5817
25005f6a
PH
58182003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5819
5820 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
5821 first.
5822 (yyrecoverSyntaxError): Correct the logic for setting and testing
5823 yyerrState.
5824 Correct comment on handling EOF.
5825 Allow states with only a default reduction, rather than failing
8dd76bee 5826 (I can't quite reconstruct why these were not allowed before).
25005f6a 5827
137437c6 5828 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 5829 buffer overruns, corrupting state.
8dd76bee
PE
5830
5831 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
5832 definition.
5833 * src/reader.h (max_left_semantic_context): New variable declaration.
5834 * src/scan-gram.l (max_left_semantic_context): Define.
5835 (handle_action_dollar): Update max_left_semantic_context.
5836 * data/glr.c (YYMAXLEFT): New definition.
5837 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
5838 (yyresolveAction): Ditto.
5839
5840 Fixes to problems with location handling in GLR parsers reported by
5841 Frank Heckenbach (2003/06/05).
5842
5843 * data/glr.c (YYLTYPE): Make trivial if locations not used.
5844 (YYRHSLOC): Add parentheses, and define only if locations used.
5845 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
5846 locations not used.
5847 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
5848 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 5849
25005f6a
PH
5850 * tests/cxx-type.at: Exercise location information; update tests
5851 to differentiate output with and without locations.
8dd76bee 5852 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
5853 because default YYLTYPE not yet defined.
5854 Change semantic actions to compute strings, rather than printing
5855 them directly (to test proper passing of semantics values). Change
5856 output to prefix notation and update test data and expected results.
5857 (yylex): Track locations.
5858 (stmtMerge): Return value rather than printing, and include arguments
5859 in value.
8dd76bee 5860
711f40b7
PE
58612003-06-03 Paul Eggert <eggert@twinsun.com>
5862
5863 Avoid warnings generated by GCC 2.95.4 when Bison is
5864 configured with --enable-gcc-warnings.
5865 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
5866 yy::]b4_parser_class_name[::translate_,
5867 yy::Stack::operator[] (unsigned),
5868 yy::Stack::operator[] (unsigned) const,
5869 yy::Slice::operator[] (unsigned),
5870 yy::Slice::operator[] (unsigned) const):
5871 Rename local vars to avoid warnings.
5872 * tests/glr-regression.at (Improper handling of embedded actions
5873 and $-N in GLR parsers): Remove unused local variable from yylex.
5874 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
5875 (void) as arg when not pure, since we now assume C89 when building
5876 Bison. Pacify GCC by using parameter.
5877
ac695f7d
PE
58782003-06-02 Paul Eggert <eggert@twinsun.com>
5879
5880 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
5881 yy::Location::lines, yy::Location::columns): Rename arguments
5882 to avoid shadowing; this removes a warning generated by GCC 3.3.
5883
26ec81e0
PE
58842003-06-01 Paul Eggert <eggert@twinsun.com>
5885
5886 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
5887 to g++, as GCC 3.3 complains if you do it.
5888 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
5889 everything that WARNING_CFLAGS has, except omit warnings
5890 not suitable for C++.
5891 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
5892 * tests/atlocal.in (CXXFLAGS): New var.
5893 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
5894
5895 Fix a GLR parser bug I reported in February; see
161a71f3 5896 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
5897 The problem was that GLR parsers did not conform to the C standard,
5898 because actions like { $1 = $2 + $3; } expanded to expressions
5899 that invoked YYFILL in separate subexpressions, and YYFILL assigned
5900 to a local variable. The C standard says that expressions
5901 like (var = f ()) + (var = f ()) have undefined behavior.
5902 Another problem was that GCC sometimes issues warnings that
5903 yyfill and its parameters are unused.
5904
5905 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
5906 as possibly unused.
5907 (yyfill): New function.
5908 (YYFILL): Use it.
5909 (yyuserAction): Change type of yynormal to bool, so that it matches
5910 the new yyfill signature. Mark it as possibly unused.
5911
5912
5913 Follow up on a bug I reported in February, where a Bison-generated
5914 parser can loop. Provide a test case and a fix for yacc.c. I
5915 don't have a fix for lalr1.cc or for glr.c, unfortunately.
5916 The original bug report is in:
161a71f3 5917 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
5918
5919 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
5920 macro's size was becoming unwieldy.
5921 (yyerrlab): Do not discard an empty lookahead symbol, as this
5922 might destroy garbage.
5923 (yyerrorlab): New label, with the old contents of YYERROR,
5924 plus the following change: pop the stack of rhs corresponding
5925 to the production that invoked YYERROR. That is how Yacc
5926 behaves, and POSIX requires this behavior.
5927 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
5928 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
5929 Define 'alarm' to do nothing if unistd.h is not available.
5930 Add a new rule "exp: '-' error;" to test the above change to
5931 data/yacc.c. Use 'alarm' to abort any test taking longer than
5932 10 seconds, as it's probably looping.
5933 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
5934 Also, the new yacc.c generates two fewer diagnostics for an
5935 existing test.
5936
d0829076
PE
59372003-05-24 Paul Eggert <eggert@twinsun.com>
5938
c6ae27df
PE
5939 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
5940 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
5941 This fixes a problem reported by John Bowman when the Compaq/HP
5942 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
5943 -ansi -Wall -gall).
5944 * data/yacc.c (union yyalloc): Likewise.
5945 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 5946
d0829076
PE
5947 Switch from 'int' to 'bool' where that makes sense.
5948
5949 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
5950 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
5951 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
5952 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
5953 Return or accept bool, not int. All callers changed.
5954 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
5955 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
5956 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
5957 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
5958 bitset_or_and_cmp_): Likewise.
5959 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
5960 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
5961 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
5962 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
5963 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
5964 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
5965 bitset_stats_or_and_cmp): Likewise.
5966 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
5967 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
5968 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
5969 ebitset_xor_cmp): Likewise.
5970 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
5971 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
5972 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
5973 lbitset_xor_cmp): Likewise.
5974 * lib/bbitset.h: Include <stdbool.h>.
5975 (struct bitset_vtable): The following members now return bool, not
5976 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
5977 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
5978 or_and_cmp).
5979 * src/conflicts.c (count_rr_conflicts): Likewise.
5980 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
5981 All uses changed.
5982 * lib/ebitset.c (ebitset_obstack_init): Likewise.
5983 * lib/lbitset.c (lbitset_obstack_init): Likewise.
5984 * src/getargs.c (debug_flag, defines_flag, locations_flag,
5985 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
5986 graph_flag): Likewise.
5987 * src/getargs.h (debug_flag, defines_flag, locations_flag,
5988 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
5989 graph_flag): Likewise.
5990 * src/output.c (error_verbose): Likewise.
5991 * src/output.h (error_verbose): Likewise.
5992 * src/reader.c (start_flag, typed): Likewise.
5993 * src/reader.h (typed): Likewise.
5994 * src/getargs.c (LOCATIONS_OPTION): New constant.
5995 (long_options, getargs): Use it.
5996 * src/lalr.c (build_relations): Use bool, not int.
5997 * src/nullable.c (nullable_compute): Likewise.
5998 * src/print.c (print_reductions): Likewise.
5999 * src/tables.c (action_row, pack_vector): Likewise.
6000 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
6001 * src/output.c (prepare): Use it.
6002 * src/output.c (token_definitions_output,
6003 symbol_destructors_output, symbol_destructors_output): Use string,
6004 not boolean integer, to keep track of whether to output separator.
6005 * src/print_graph.c (print_core): Likewise.
6006 * src/state.c (state_rule_lookaheads_print): Likewise.
6007
6008 * config/install-sh: Sync from automake 1.7.5.
6009
6b2584b7
PE
60102003-05-14 Paul Eggert <eggert@twinsun.com>
6011
6012 * src/parse-gram.y (rules_or_grammar_declaration): Require a
6013 semicolon after a grammar declaration, in the interest of possible
6014 future changes to the Bison input language.
6015 Do not allow a stray semicolon at the start of the grammar.
6016 (rhses.1): Allow one or more semicolons after any rule, including
6017 just before "|" as required by POSIX.
6018 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
6019 grammar.
6020
caf37a36
ADL
60212003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
6022
6023 %parse-param support for lalr1.cc.
6024
6025 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
6026 b4_cc_constructor_calls, b4_cc_constructor_call,
6027 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
6028 definitions.
6029 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
6030 parse-param arguments.
6031 (yy::b4_parser_class_name): Declare instance variables to
6032 hold parse-param arguments.
6033 * tests/calc.at: s/value/semantic_value/ because value clashes
6034 with a member of yy::b4_parser_class_name. Adjust C++ code
6035 to handle %parse-param. Enable %parse-param test in C++.
6036
3ab37077
PE
60372003-05-12 Paul Eggert <eggert@twinsun.com>
6038
6039 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
6040 English a bit. Fix fclose typo. Change "const char" to "char
6041 const", and use ANSI C rather than K&R for "main". Suggest
6042 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
6043 and suggest yy_switch_to_buffer.
6044
60452003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
6046
6047 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
6048 C89. This avoids a diagnostic on compilers that define __STDC__
6049 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 6050 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 6051
e743727f
PE
60522003-05-03 Paul Eggert <eggert@twinsun.com>
6053
6054 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
6055 Do not overrun array bounds.
6056 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 6057 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 6058
916708d5
AD
60592003-04-29 Akim Demaille <akim@epita.fr>
6060
6061 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
6062 * src/getargs.c, src/getargs.h: here, as bool, not int.
6063 (nondeterministic_parser): New.
6064 * src/parse-gram.y, src/scan-gram.l: Support
6065 %nondeterministic-parser.
6066 * src/output.c (prepare): Use nondeterministic_parser instead
6067 of glr_parser where appropriate.
6068 * src/tables.c (conflict_row, action_row, save_row)
6069 (token_actions, token_actions, pack_vector): Ditto.
6070
a06ea4aa
AD
60712003-04-29 Akim Demaille <akim@epita.fr>
6072
6073 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
6074
211074ca
AD
60752003-04-29 Akim Demaille <akim@epita.fr>
6076
6077 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
6078 with %pure-parser and %locations to exercise the patch from Yakov
6079 Markovitch below.
6080
6175ffe3
PE
60812003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
6082
6083 * data/yacc.c: (b4_lex_param): Corrected for the case where
6084 %lex-param is provided and %pure-parser isn't.
6085
b1e95857
PE
60862003-04-27 Paul Eggert <eggert@twinsun.com>
6087
6088 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 6089 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
6090 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
6091 if it is not defined.
6092 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
6093
acda9df6
PE
60942003-04-26 Paul Eggert <eggert@twinsun.com>
6095
3470c57b
PE
6096 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
6097 Declare to be of type suitable for the ninf value itself, not of
6098 type suitable for the corresponding table, since the latter might
6099 be unsigned but the ninf value might be negative. This fixes a
6100 bug reported by Alexandre Duret-Lutz in
161a71f3 6101 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 6102
acda9df6
PE
6103 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
6104 invokes it. We shouldn't invoke it twice because it will attempt
6105 to put error.o in the archive twice. This fixes a glitch reported
6106 by Martin Mokrejs in
161a71f3 6107 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 6108
b5250f26
PE
61092003-04-21 Paul Eggert <eggert@twinsun.com>
6110
6111 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
6112 to gnulib.
6113
089ac0f1
PE
61142003-04-21 Yakov Markovitch <Markovitch@iso.ru>
6115
6116 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
6117 Fix obvious typo that results in uncompilable GLR parsers
6118 when both %pure-parser and %locations are used. (trivial change)
6119
5ededac6
PE
61202003-04-17 Paul Eggert <eggert@twinsun.com>
6121
1b8f2fff
PE
6122 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
6123 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
6124 Do not insert the expected token via unput, as this runs afoul
6125 of a POSIX-compatibility bug in flex 2.5.31.
6126 All uses changed to BEGIN the parent state,
6127 since we no longer insert the expected token via unput.
6128 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
6129 that is no longer emitted after the above change.
6130
5ededac6
PE
6131 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
6132 the first one. This change is from Paul Hilfinger, and it fixes
6133 regression reported by Werner Lemberg in
161a71f3 6134 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
6135
6136 (resolve_sr_conflict): Don't invoke state_errs_set
6137 unless one or more tokens have been explicitly made errors.
6138 Otherwise, the above change causes Bison to abort.
6139
6140 * tests/existing.at (GNU pic Grammar): New test case, taken from
6141 Lemberg's email.
6142
b8be9132
AD
61432003-03-31 Akim Demaille <akim@epita.fr>
6144
6145 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
6146
d423d460
AD
61472003-03-31 Akim Demaille <akim@epita.fr>
6148
6149 * src/output.c (prepare_symbols): Avoid trailing spaces in the
6150 output.
6151
c7e441b4
AD
61522003-03-31 Akim Demaille <akim@epita.fr>
6153
6154 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
6155 From Paul Hilfinger.
6156
231897ad
AD
61572003-03-29 Akim Demaille <akim@epita.fr>
6158
6159 * m4/error.m4: Do not put under dynamic conditions some code which
6160 expansion is under static control.
6161
5b066063
AD
61622003-03-29 Akim Demaille <akim@epita.fr>
6163
6164 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6165
22a74fec
AD
61662003-03-29 Akim Demaille <akim@epita.fr>
6167
6168 * doc/bison.texinfo (Strings are Destroyed): New.
6169
0eee27e7
PE
61702003-03-13 Paul Eggert <eggert@twinsun.com>
6171
6172 * .cvsignore: Add configure.lineno.
6173 * src/.cvsignore: Add yacc.
6174 * tests/.cvsignore: Add testsuite.log.
6175 * doc/fdl.texi: Sync with latest FSF version.
6176
f61aad93
PE
61772003-03-12 Paul Eggert <eggert@twinsun.com>
6178
537636c7
PE
6179 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
6180 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
6181 cursor, instead of leaving it undefined. This fixes a bug
6182 reported by Tim Van Holder in
161a71f3 6183 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
6184 * tests/input.at (Torturing the Scanner): Test the scanner on
6185 an empty input file, which was Tim Van Holder's test case.
6186
6187 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
6188 <sys/resource.h> can be included, include sys/time.h and
6189 sys/times.h first, if available. This works around the SunOS
6190 4.1.4 porting bug reported by Bruce Becker in
161a71f3 6191 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
6192
6193 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6194 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6195 AC_HEADER_SYS_WAIT.
6196
f61aad93
PE
6197 Merge changes from gnulib. This was prompted because the CVS
6198 snapshot didn't build on Solaris 7 due to strnlen problems.
6199
6200 These changes need to be merged back into gnulib:
6201 * lib/hash.c: Include <stdbool.h> unconditionally.
6202 * m4/onceonly.m4 (m4_quote): New macro.
6203 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
6204 Quote AC_FOREACH variable-expansions properly.
6205 The 2003-01-03 obstack.h change also needs merging.
6206 {end of changes requiring merging}
5b066063 6207
f61aad93
PE
6208 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6209 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
6210 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
6211 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
6212 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
6213 New files, imported from gnulib.
6214 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
6215 above.
6216
6217 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
6218 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
6219 gnulib sources.
6220
6221 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6222 Add.
6223 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
6224 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
6225 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
6226 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
6227 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
6228 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
6229 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
6230 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
6231 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
6232 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
6233 (jm_PREREQ_ARGMATCH): Remove.
6234 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
6235 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
6236
6237 * src/system.h: Include <stdbool.h> unconditionally.
6238
6239 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6240 assuming at least C89 in the bitset code for some time now.
6241
d2ffe116
AD
62422003-03-03 Akim Demaille <akim@epita.fr>
6243
6244 * ro.po: New.
6245
052826fd
AD
62462003-03-02 Akim Demaille <akim@epita.fr>
6247
6248 * doc/bison.texinfo (Table of Symbols): Reactivate the
6249 documentation for %lex-param, and %parse-param.
6250
c4749565
AD
62512003-03-02 Akim Demaille <akim@epita.fr>
6252
6253 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6254 generate verbose error messages.
6255 Use the number of tokens as an upper bound in yytname, as it
6256 cannot be a non terminal.
6257
d5286af1
AD
62582003-03-02 Akim Demaille <akim@epita.fr>
6259
6260 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6261 message.
6262
22e304a6
AD
62632003-03-02 Akim Demaille <akim@epita.fr>
6264
22e304a6
AD
6265 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6266 Use them to exercise yycheck overrun.
6267 Based on Andrew Suffield's grammar.
6268
67a25fed
AD
62692003-03-02 Akim Demaille <akim@epita.fr>
6270
6271 Create tests/local.at for Bison generic testing macros.
6272
6273 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6274 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6275 This new file.
6276 * tests/calc.at (AT_CHECK_CALC): Adjust.
6277 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6278 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6279 * tests/local.at: here.
6280 (AT_COMPILE_CXX): Tags the tests using it as c++.
6281 Ignore the test if CXX is not functional.
6282
9c2b381f
PE
62832003-03-01 Paul Eggert <eggert@twinsun.com>
6284
6285 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
6286 not loc->end, since loc->end might contain garbage and this leads
6287 to undefined behavior on some platforms.
6288 (id_loc, token_start): Use (IF_LINTed) initial values that do not
6289 depend on *loc, so that the reader doesn't give the the false
6290 impression that *loc is initialized.
6291 (<INITIAL>"%%"): Do not bother setting code_start, since its value
6292 does not survive the return.
6293
0433ba88
AD
62942003-03-01 Akim Demaille <akim@epita.fr>
6295
6296 * src/scan-gram.l (code_start): Always initialize it when entering
6297 into yylex, as SC_EPILOGUE is activated *before* the corresponding
6298 yylex invocation. An alternative would be making it static, but
6299 then it starts with the second %%'s beginning, instead of its end.
6300
b305ea69
PE
63012003-02-28 Paul Eggert <eggert@twinsun.com>
6302
6303 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
6304 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 6305 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 6306
c3d25e01
PE
63072003-02-26 Paul Eggert <eggert@twinsun.com>
6308
6309 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
6310 Remove Sequent/Pyramid discussion (nobody uses them any more).
6311 Merge VMS and MS-DOS discussion; these ports may well be dead
6312 but let's keep mentioning them for now. Put <> around email
6313 addresses. Add copyright notice.
6314
c267ffbc
PE
63152003-02-24 Paul Eggert <eggert@twinsun.com>
6316
6317 * data/glr.c (yy_reduce_print): yylineno -> yylno,
6318 to avoid collision with flex use of yylineno.
6319 Problem reported by Bruce Lilly in
161a71f3 6320 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
6321 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6322 * data/yacc.c (yy_reduce_print): Likewise.
6323
6324 * config/depcomp: Sync with Automake 1.7.3.
6325
f939fc12
AD
63262003-02-21 Akim Demaille <akim@epita.fr>
6327
6328 * data/lalr1.cc: Use temporary variables instead of casts to
6329 change integer types.
6330 Suggested by Paul Eggert.
6331
95923bd6
AD
63322003-02-21 Akim Demaille <akim@epita.fr>
6333
6334 * doc/bison.texinfo: Use "location" consistently to refer to @n,
6335 to avoid confusions with lalr1.cc's notion of Position.
6336 Suggested by Paul Eggert.
6337
2cdc240e
AD
63382003-02-20 Akim Demaille <akim@epita.fr>
6339
6340 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
6341 before initial_columns.
6342 (location.hh): Use consistent variable names when defining the
6343 operator<<.
6344 Use "last" so that we subtract from Positions, not from unsigned.
6345
5d003116
AD
63462003-02-20 Akim Demaille <akim@epita.fr>
6347
6348 * data/lalr1.cc (position.hh): New subfile, including the extended
6349 and Doxygen'ed documentation of class Position.
6350 (location.hh): Use it.
6351 Document a` la Doxygen.
ba1ecc07 6352 With the help of Benoit Perrot.
5d003116 6353
d02b25f9
AD
63542003-02-20 Akim Demaille <akim@epita.fr>
6355
6356 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
6357 AT_YACC_IF.
6358 Redefine AT_YYERROR_SEES_LOC_IF using it.
6359 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
6360 not defined.
6361 Don't use the location in yy::Parser::error_ and
6362 yy::Parser::print_ when not %locations.
6363 Activate more lalr1.cc tests.
6364
0d1c3a04
AD
63652003-02-19 Akim Demaille <akim@epita.fr>
6366
6367 * data/lalr1.cc: When displaying a line number, be sure to make it
6368 an int.
6369
60a777aa
AD
63702003-02-19 Akim Demaille <akim@epita.fr>
6371
6372 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
6373 Remove, useless.
6374 (YYABORT, YYACCEPT, YYERROR): New.
6375 * tests/calc.at: Renable the lalr1.cc test.
6376
0b86fc41
AD
63772003-02-19 Akim Demaille <akim@epita.fr>
6378
6379 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
6380 error recovery, mixing with/without pops and discarding of the
6381 lookahead.
6382 Exercise YYERROR.
6383 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
6384
da99a5dc
PE
63852003-02-17 Paul Eggert <eggert@twinsun.com>
6386
6387 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
6388 * tests/testsuite.at (AT_COMPILE): Use them.
6389 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 6390 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 6391
93b8c255
PE
63922003-02-12 Paul Eggert <eggert@twinsun.com>
6393
6394 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
6395 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 6396 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
6397 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
6398 Check for malloc failure, for consistency with yacc.c.
6399 (yytname_size): Remove, for consistency with yacc.c.
6400
6401 The bug still remains in data/lalr1.cc, as I didn't have time
6402 to fix it there.
6403
7548fed2
AD
64042003-02-06 Akim Demaille <akim@epita.fr>
6405
6406 * configure.ac (GXX): Rename as...
6407 (CXX): this, to keep the original Autoconf semantics.
6408 Require 2.57.
6409 * data/lalr1.cc: Fix b4_copyright invocations.
6410 If YYDEBUG is not defined, don't depend upon name_ being defined.
6411 (location.hh): Include string and iostream.
6412 (Position::filename): New member.
6413 (Position::Position ()): New.
6414 (operator<< (Position)): New.
6415 (operator- (Position, int)): New.
6416 (Location::first, Location::last): Rename as...
6417 (Location::begin, Location::end): these, to mock the conventional
6418 iterator names.
6419 (operator<< (Location)): New.
6420 * tests/atlocal.in (CXX): New.
6421 * tests/testsuite.at (AT_COMPILE_CXX): New.
6422 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
6423 locations in a more synthetic way.
6424 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
6425 lalr1.cc is used.
6426 Adjust the C locations to match those from Emacs: first column is
6427 column 0.
6428 Change all the expected results.
6429 Conform to the GCS: simplify the locations when applicable.
6430 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
6431 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
6432 these CPP macros with the m4 macros new defined by...
6433 (AT_CHECK_PUSHDEFS): this, i.e.:
6434 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 6435 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
6436 New macros.
6437 (AT_CHECK_POPDEFS): Undefine them.
6438 (AT_CHECK_CALC_LALR1_CC): New.
6439 Use it for the first lalr1.cc test.
6440
43a176ef
AD
64412003-02-04 Akim Demaille <akim@epita.fr>
6442
6443 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
6444 Location as is defined.
6445
fc049e9c
AD
64462003-02-04 Akim Demaille <akim@epita.fr>
6447
6448 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
6449 name_ being defined.
6450
a737b216
PE
64512003-02-03 Paul Eggert <eggert@twinsun.com>
6452
6453 * src/gram.h (start_symbol): Remove unused decl.
6454
6455 Use more-consistent naming conventions for local vars.
6456
6457 * src/derives.c (derives_compute): Change type of local var from
6458 int to rule_number.
6459 * src/gram.c (grammar_rules_partial_print): Likewise.
6460 * src/print.c (print_core): Likewise.
6461 * src/reduce.c (reduce_grammar_tables): Likewise.
6462
6463 * src/gram.c (grammar_dump): Change name of item_number *
6464 local var from r to rp.
6465 * src/nullable.c (nullable_compute): Likewise.
6466
6467 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
6468
6469 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
6470 for symbol or symbol_number var.
6471 * src/reader.c (grammar_start_symbol_set): Likewise.
6472 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
6473 Likewise.
6474 * src/state.c (transitions_to): Likewise.
6475 * src/state.h: Likewise.
6476 * src/tables.c (symbol_number_to_vector_number): Likewise.
6477
6478 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
6479 char * var.
6480
6481 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
6482 var.
6483
6484 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
6485 var.
6486
6487 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
6488 Use str, not s, for char * var. Use ch, not c, for character var.
6489 Use size for size var.
6490
6491 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
6492 char * var.
6493 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
6494 uniqstr var.
6495 * src/uniqstr.h: Likewise.
6496
6497 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
6498 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
6499 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
6500 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
6501 param to have same name as that of enum, so that we don't use
6502 "s" to stand for a non-state.
6503
68e93ad5
AD
65042003-02-02 Akim Demaille <akim@epita.fr>
6505
6506 * src/scan-skel.l: Scan more than one inert character per yylex
6507 invocation.
6508
92898986
PE
65092003-02-01 Paul Eggert <eggert@twinsun.com>
6510
6511 Version 1.875a.
6512
1d9d5d71
PE
6513 * po/LINGUAS: Add ms.
6514
0435d061
AD
65152003-01-30 Akim Demaille <akim@epita.fr>
6516
6517 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
6518
6029a57f
PH
65192003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6520
6521 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
6522 of $1.
0435d061
AD
6523
6524 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 6525 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 6526 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 6527
6029a57f
PH
6528 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
6529 (b4_rhs_location): Ditto.
0435d061 6530 (yyfill): New function to copy from stack tree into array
6029a57f 6531 incrementally.
0435d061
AD
6532 (yyuserAction): Modify to allow incremental move of semantic values
6533 to rhs array when in GLR mode.
6534 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
6535 as needed.
6536 Remove dummy use of yystack, as there is now a guaranteed use.
6537 (yydoAction): Modify to allow incremental move of semantic values
6538 to rhs array when in GLR mode.
6539 (yyresolveAction): Ditto.
6540 (yyglrShiftDefer): Update comment.
0435d061 6541 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
6542 (yyglrReduce): Ditto.
6543 (yydoAction): Ditto
0435d061 6544
6029a57f
PH
6545 * tests/glr-regr1.at: Rename to ...
6546 * tests/glr-regression.at: Add new regression test for the problems
6547 described above (adapted from S. Eken).
6548 Update copyright notice.
6549 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
6550 * tests/Makefile.am: Ditto.
6551
6cee6297
PE
65522003-01-28 Paul Eggert <eggert@twinsun.com>
6553
6554 * data/lalr1.cc: Do not use @output_header_name@ unless
6555 b4_defines_flag is set. This fixes two bugs reported by
6556 Tim Van Holder in
161a71f3
PE
6557 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
6558 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 6559
b2a836b5
PE
65602003-01-21 Paul Eggert <eggert@twinsun.com>
6561
6562 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
6563 we don't need to worry about yyerrlab1 being reported as an
6564 "unused label" by non-GCC C compilers. The downside is that if
6565 locations are used then a couple of statements are duplicated each
6566 time YYERROR is invoked, but the upside is that the warnings
6567 should vanish.
6568 (yyerrlab1): Move code to YERROR.
6569 (yyerrlab2): Remove. Change uses back to yyerrlab1.
6570 This reverts some of the 2002-12-27 change.
6571
4196b931
PE
65722003-01-17 Paul Eggert <eggert@twinsun.com>
6573
6574 * src/output.c (symbol_printers_output): Fix typo that led
6575 to core dump. Problem reported by Antonio Rus in
161a71f3 6576 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 6577
3ae831b4
AD
65782003-01-13 Akim Demaille <akim@epita.fr>,
6579 Quoc Peyrot <chojin@lrde.epita.fr>,
6580 Robert Anisko <anisko_r@lrde.epita.fr>
6581
6582 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
6583 when the stacks contain one element, as the loop would otherwise
6584 free the last state, and then use the top state (the one we just
6585 popped). This means that the initial elements will not be freed
6586 explicitly, as is the case in yacc.c; it is not a problem, as
6587 these elements have fake values.
6588
e3aa65c5
PE
65892003-01-11 Paul Eggert <eggert@twinsun.com>
6590
6591 * NEWS: %expect-violations are now just warnings, reverting
6592 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
6593 bootstrapping problem reported by Matthias Klose; see
161a71f3 6594 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
6595 * src/conflicts.c (conflicts_print): Likewise.
6596 * tests/conflicts.at (%expect not enough, %expect too much,
6597 %expect with reduce conflicts): Likewise.
6598 * doc/bison.texinfo (Expect Decl): Document this. Also mention
6599 that the warning is enabled if the number of conflicts changes
6600 (not necessarily increases).
6601
6602 * src/getargs.c (version): Update copyright year.
6603
f0057011
AD
66042003-01-09 Akim Demaille <akim@epita.fr>
6605
6606 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
6607
1ee6d2a0
PE
66082003-01-08 Paul Eggert <eggert@twinsun.com>
6609
6610 * Makefile.maint (WGETFLAGS):
6611 New macro, containing "-C off" to disable proxy caches.
6612 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
6613 (rel-check): Use $(WGET) instead of wget.
6614
d4fd77c4
PE
66152003-01-06 Paul Eggert <eggert@twinsun.com>
6616
6617 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
6618 the GLR paper of Scott, Johnstone and Hussain.
6619
464c6927
PE
66202003-01-04 Paul Eggert <eggert@twinsun.com>
6621
d600ee67
PE
6622 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
6623 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
6624 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
6625 (EXTRA_LIBRARIES): New var, for liby.a.
6626 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
6627 (EXTRA_SCRIPTS): New var, for yacc.
6628
464c6927
PE
6629 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
6630 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
6631 Problem reported by Nelson H. F. Beebe.
6632
66332003-01-03 Paul Eggert <eggert@twinsun.com>
6634
6635 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
6636 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
6637 when compiling Bison 1.875's `bitset bset = obstack_alloc
6638 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
6639
6640 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
6641 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
6642 grow to a huge size with typical invocation.
d600ee67 6643
464c6927
PE
6644 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
6645 Use the pattern recommended by Autoconf 2.57, except also protect
6646 against double-definition.
6647 * src/system.h: Likewise.
6648 Portability issues reported by Nelson H. F. Beebe.
d600ee67 6649
464c6927
PE
6650 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
6651 All uses changed. Provide a definition in both C and C++.
6652 (yytrue, yyfalse): Define even if defined (__cplusplus).
6653
6654 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
6655 Reported by Nelson H. F. Beebe.
d600ee67 6656
464c6927
PE
6657 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
6658
0f42c7d5
PE
66592003-01-02 Paul Eggert <eggert@twinsun.com>
6660
6661 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
6662 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
6663 Bug reported by Nelson H. F. Beebe.
6664
dc546b0f
PE
66652003-01-01 Paul Eggert <eggert@twinsun.com>
6666
6667 * Version 1.875.
6668
2c09b6a7
PE
66692002-12-30 Paul Eggert <eggert@twinsun.com>
6670
6671 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
6672 Moved here from...
6673 (<INITIAL>","): Here. This causes stray "," to be treated
6674 more uniformly.
6675
dc546b0f 6676 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
6677 last brace in braced code when not in Yacc mode, for compatibility
6678 with Bison 1.35. This resurrects the 2001-12-15 patch to
6679 src/reader.c.
6680
6681 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
6682 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
6683
535c0f63
PE
66842002-12-28 Paul Eggert <eggert@twinsun.com>
6685
6686 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
6687 that of SYM's type. This fixes Debian bug 168069, reported by
6688 Thomas Olsson.
d600ee67 6689
963fcc17
PE
66902002-12-28 Paul Eggert <eggert@twinsun.com>
6691
6692 Version 1.75f.
6693
6694 Switch back to the Yacc style of conflict reports, undoing some
6695 of the 2002-07-30 change.
6696 * doc/bison.texinfo (Understanding): Use Yacc style for
6697 conflict reports. Also, use new way of locating rules.
6698 * src/conflicts.c (conflict_report):
6699 Renamed from conflict_report_yacc, removing the old
6700 'conflict_report'. Translate the entire conflict report at once,
6701 so that we don't assume that "," has the same interpretation in
6702 all languages.
6703 (conflicts_output): Use Yacc-style conflict report for each state,
6704 instead of our more-complicated style.
6705 (conflicts_print): Use Yacc-style conflict report, except print
6706 the input file name when not emulating Yacc.
6707 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
6708 Conflicted Reduction, %expect not enough, %expect too much,
6709 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
6710 * tests/existing.at (GNU Cim Grammar): Likewise.
6711 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
6712
6713 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
6714 fatal): Don't invoke fflush; it's not needed and it might even be
6715 harmful for stdout, as stdout might not be open.
6716 * src/reduce.c (reduce_print): Likewise.
6717
b1efe548
PE
67182002-12-27 Paul Eggert <eggert@twinsun.com>
6719
6720 Fix a bug where error locations were not being recorded correctly.
6721 This problem was originally reported by Paul Hilfinger in
161a71f3 6722 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
6723
6724 * data/yacc.c (yyparse): New local var yylerrsp, to record the
6725 top of the location stack's error locations.
6726 (yyerrlab): Set it. When discarding a token, push its location
6727 onto yylerrsp so that we don't lose track of the error's end.
6728 (yyerrlab1): Now is only the target of YYERROR, so that we can
6729 properly record the location of the action that failed. For GCC
6730 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
6731 GCC warning about yyerrlab1 being unused if YYERROR is unused.
6732 (yyerrlab2): New label, which yyerrlab now falls through to.
6733 Compute the error's location by applying YYLLOC_DEFAULT to
6734 the locations of all the symbols that went into the error.
6735 * doc/bison.texinfo (Location Default Action): Mention that
6736 YYLLOC_DEFAULT is also invoked for syntax errors.
6737 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6738 Error locations include the locations of all the tokens that were
6739 discarded, not just the last token.
d600ee67 6740
983c5c2c
PE
67412002-12-26 Paul Eggert <eggert@twinsun.com>
6742
b1efe548
PE
6743 * src/files.c: Include quote.h.
6744 (compute_output_file_names): Warn if we detect conflicting
6745 outputs to the same file. This should catch the misunderstanding
6746 exemplified by Debian Bug 165349, reported by Bruce Stephens..
6747
6748 * src/conflicts.c (conflicts_print): If the user specifies
6749 "%expect N", report an error if there are any reduce/reduce
6750 conflicts. This is what the manual says should happen.
6751 This fixes Debian bug 130890, reported by Anthony DeRobertis.
6752 * tests/conflicts.at (%expect with reduce conflicts): New test.
6753
983c5c2c
PE
6754 Don't use m4_include on relative file names, as it doesn't work as
6755 desired if there happens to be a file with that name under ".".
d600ee67 6756
983c5c2c
PE
6757 * m4sugar/version.m4: Remove; it was included but it wasn't used.
6758 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
6759 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
6760 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
6761 * src/output.c (output_skeleton): Use full path names when
6762 specifying a file to include; don't rely on include path, as
6763 it's unreliable when the working file contains a file with
6764 that name.
d600ee67 6765
983c5c2c
PE
67662002-12-25 Paul Eggert <eggert@twinsun.com>
6767
6768 Remove obsolete references to bison.simple and bison.hairy.
6769 Problem mentioned by Aubin Mahe in
161a71f3 6770 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
6771 * data/glr.c: Comment fix.
6772 * doc/bison.1: Remove references. Also, mention "yacc".
6773
6774 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
6775 with -g option.
6776
6777 * src/parse-gram.y (declaration): Use enum "report_states" rather
6778 than its numeric value 1.
6779
6780 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
6781 opening a new one. This fixes Debian bug 165349, reported by
6782 Bruce Stephens.
6783
23f2d9dc
PE
67842002-12-24 Paul Eggert <eggert@twinsun.com>
6785
6786 Version 1.75e.
6787
6788 * Makefile.maint (cvs-update): Don't assume that the shell
6789 supports $(...), as Solaris sh doesn't.
6790
6791 * src/parse-gram.y (lloc_default): Remove test for empty
6792 nonterminals at the end, since it didn't change the result.
6793
67942002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
6795
6796 If the user does not define YYSTYPE as a macro, Bison now declares it
6797 using typedef instead of defining it as a macro. POSIX requires this.
6798 For consistency, YYLTYPE is also declared instead of defined.
6799
6800 %union directives can now have a tag before the `{', e.g., the
6801 directive `%union foo {...}' now generates the C code
6802 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
6803 The default union tag is `YYSTYPE', for compatibility with Solaris 9
6804 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
6805 instead of `yyltype'.
6806
6807 `yystype' and `yyltype' are now obsolescent macros instead of being
6808 typedefs or tags; they are no longer documented and will be
6809 withdrawn in a future release.
6810
6811 * data/glr.c (b4_location_type): Remove.
6812 (YYSTYPE): Renamed from yystype.
6813 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
6814 (struct YYLTYPE): Renamed from struct yyltype.
6815 (YYLTYPE): Renamed from yyltype.
6816 (yyltype, yystype): New (and obsolescent) macros,
6817 for backward compatibility.
6818 * data/yacc.c: Likewise.
6819
6820 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
6821 does not specify a union tag. This is for compatibility with
6822 Solaris 9 yacc.
6823
6824 * src/parse-gram.y (add_param): 2nd arg is now char * not char
6825 const *, since it is now modified by stripping surrounding { }.
6826 (current_braced_code): Remove.
6827 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
6828 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
6829 trailing " {...}". Now of type <chars>.
6830 (grammar_declaration): Adjust to bundled tokens.
6831 (code_content): Remove; stripping is now done by add_param.
6832 (print_token_value): Print contents of bundled tokens.
6833 (token_name): New function.
6834
6835 * src/reader.h (braced_code, current_braced_code): Remove.
6836 (token_name): New decl.
6837
6838 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
6839 token_type, not braced_code code_kind. All uses changed.
6840 (SC_PRE_CODE): New state, for scanning after a keyword that
6841 has (or usually has) an immediately-following braced code.
6842 (token_type): New local var, to keep track of which token type
6843 to return when scanning braced code.
6844 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 6845 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
6846 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
6847 instead of returning a token type immediately.
6848 (<INITIAL>"{"): Set token type.
6849 (<SC_BRACED_CODE>"}"): Use it.
6850 (handle_action_dollar, handle_action_at): Now returns bool
6851 indicating success. Fail if ! current_rule; this prevents a core dump.
6852 (handle_symbol_code_dollar, handle_symbol_code_at):
6853 Remove; merge body into caller.
6854 (handle_dollar, handle_at): Complain in invalid contexts.
6855
6856 * NEWS, doc/bison.texinfo: Document the above.
6857 * NEWS: Fix years and program names in copyright notice.
6858
879ca4f8
PE
68592002-12-17 Paul Eggert <eggert@twinsun.com>
6860
6861 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
6862 Reporting, Table of Symbols): Omit mentions of %lex-param and
6863 %parse-param from the documentation for now.
6864
1c5fe69d
PE
68652002-12-15 Paul Eggert <eggert@twinsun.com>
6866
6867 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
6868 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
6869 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
6870 disagreed with the Bison documentation. Bug
6871 reported by Andrew Walrond.
d600ee67 6872
1c5fe69d
PE
6873 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
6874 as the caller now does that.
6875 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
6876 (YYEMPTY): Parenthesize right hand side, since others use it.
6877 (yyparse): Don't assume that our generated code is the only code
6878 that sets yychar.
6879
d1de5372
PE
68802002-12-13 Paul Eggert <eggert@twinsun.com>
6881
6882 Version 1.75d.
6883
6884 POSIX requires a "yacc" command.
6885 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
6886 (MOSTLYCLEANFILES): Add yacc.
6887 (yacc): New rule.
1c5fe69d 6888 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
6889 as an alias for bison y.
6890
6891 * po/LINGUAS: Add da.
d600ee67 6892
d1de5372
PE
6893 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
6894 problem with latest <getopt.h>.
6895 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
6896
6897 * doc/fdl.texi: Upgrade to 1.2.
6898 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
6899 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
6900 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
6901 gnulib.
6902 * config/install-sh: Sync with autotools.
6903
6904 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 6905 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
6906 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
6907 locations are requested.
6908 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
6909 locations are requested.
6910
d0f3fe23
PE
69112002-12-12 Paul Eggert <eggert@twinsun.com>
6912
6913 Remove unportable casts and storage allocation tricks.
6914 While we're at it, remove almost all casts, since they
6915 usually aren't needed and are a sign of trouble.
6916
6917 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
6918
6919 * src/derives.c (derives_compute): Do not subtract NTOKENS from
6920 the pointer DSET returned by malloc; this isn't portable.
6921 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
6922 Similarly for DERIVES.
6923 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
6924 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
6925 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
6926
6927 * src/derives.c (derives_compute): Do not bother invoking
6928 int_of_rule_number, since rule numbers are integers.
6929
6930 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
6931 rather than XMALLOC (char, N).
6932
6933 * src/files.c (filename_split): Rewrite to avoid cast.
6934
6935 * src/gram.h (symbol_number_as_item_number,
6936 item_number_as_symbol_number, rule_number_as_item_number,
6937 item_number_as_rule_number):
6938 Now inline functions rather than macros, to avoid casts.
6939 * src/state.h (state_number_as_int): Likewise.
6940 * src/tables.c (state_number_to_vector_number,
6941 symbol_number_to_vector_number): Likewise.
6942
6943 * src/gram.h (int_of_rule_number): Remove; no longer used.
6944
6945 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
6946 since the resulting storage is always stored into.
6947
6948 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
6949 where it's needed.
6950
6951 * src/muscle_tab.c (muscle_m4_output):
6952 Now inline. Return bool, not int.
6953 * src/state.c (state_compare): Likewise.
6954 * src/symtab.c (symbol_check_defined,
6955 symbol_check_alias_consistency, symbol_pack, symbol_translation,
6956 hash_compare_symbol, hash_symbol):
6957 Likewise.
6958 * src/uniqstr.c (uniqstr_print): Likewise.
6959 * src/muscle_tab.c (muscle_m4_output_processor):
6960 New function, to avoid casts.
6961 * src/state.c (state_comparator, stage_hasher): Likewise.
6962 * src/symtab.c (symbol_check_defined_processor,
6963 symbol_check_alias_consistency_processor, symbol_pack_processor,
6964 symbol_translation_processor, hash_symbol_comparator,
6965 hash_symbol_hasher): Likewise.
6966 * src/uniqstr.c (uniqstr_print_processor): Likewise.
6967 * src/muscle_tab.c (muscles_m4_output):
6968 Use new functions instead of casting old functions unportably.
6969 * src/state.c (state_hash_new): Likewise.
6970 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
6971 symbols_token_translations_init):
6972 Likewise.
6973 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
6974
6975 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
6976 var instead of casting to long, to avoid casts.
6977 (prepare_states): Use MALLOC rather than alloca, so that we don't
6978 have to worry about alloca.
6979 * src/state.c (state_hash_lookup): Likewise.
6980
6981 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
6982 local var instead of casting to unsigned char, to avoid casts.
6983
6984 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
6985 STATE_ALLOC): Remove.
6986 (transitions_new, errs_new, reductions_new, state_new): Use malloc
6987 rather than calloc, and use offsetof to avoid allocating slightly
6988 too much storage.
6989 (state_new): Initialize all members.
6990
6991 * src/state.c (state_hash): Use unsigned accumulator, not signed.
6992
6993 * src/symtab.c (symbol_free): Remove; unused.
6994 (symbol_get): Remove cast in lhs of assignment.
6995 (symbols_do): Now static. Accept generic arguments, not
6996 hashing-related ones.
6997
6998 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
6999 (symbol_processor): Remove.
7000 (symbols_do): Remove decl; now static.
7001
7002 * src/system.h (alloca): Remove; decl no longer needed.
7003 (<stddef.h>): Include, for offsetof.
7004 (<inttypes.>, <stdint.h>): Include if available.
7005 (uintptr_t): New type, if system lacks it.
7006 (CALLOC, MALLOC, REALLOC): New macros.
7007 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
7008 new macros.
7009
7010 * src/tables.c (table_size): Now int, to pacify GCC.
7011 (table_grow, table_ninf_remap): Use signed table size.
7012 (save_row): Don't bother initializing locals when not needed.
7013 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
7014 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
7015
7016 * src/vcg.h: Correct misspellings.
7017
7018 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
7019
7020
7021 * src/getargs.c (getargs): Don't assume EOF == -1.
7022
26b4a969
PE
70232002-12-09 Paul Eggert <eggert@twinsun.com>
7024
7025 Change identifier spellings to avoid collisions with names
7026 that are reserved by POSIX.
7027
7028 Don't use names ending in _t, since POSIX reserves them.
7029 For consistency, remove _e and _s endings -- they're weren't
7030 needed to remove ambiguity. All uses changed.
7031 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
7032 turn was just renamed from struniq_t.
7033 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
7034 which in turn was just renamed from struniq_processor_t.
7035 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
7036 in turn was renamed from hash_compare_struniq_t.
7037 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
7038 (state_list): Renamed from state_list_t.
7039 * src/assoc.h (assoc): Renamed from assoc_t.
7040 * src/conflicts.c (enum conflict_resolution): Renamed from
7041 enum conflict_resolution_e.
7042 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
7043 (rule_list): Renamed from rule_list_t.
7044 * src/getargs.h (enum trace): Renamed from enum trace_e.
7045 (enum report): Renamed from enum report_e.
7046 * src/gram.h (item_number): Renamed from item_number_t.
7047 (rule_number): Renamed from rule_number_t.
7048 (struct rule_s): Remove the "rule_s" part; not used.
7049 (rule): Renamed from rule_t.
7050 (rule_filter): Renamed from rule_filter_t.
7051 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
7052 (goto_list): Renamed from goto_list_t.
7053 * src/lalr.h (goto_number): Renamed from goto_number_t.
7054 * src/location.h (location): Renamed from location_t.
7055 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
7056 and moved here from:
7057 * src/muscle_tab.h (muscle_entry_t): here.
7058 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
7059 (rule_list): Renamed from rule_list_t.
7060 * src/print_graph.c (static_graph): Renamed from graph.
7061 * src/reader.h (braced_code): Renamed from braced_code_t.
7062 Remove brace_code_e tag.
7063 * src/relation.h (relation_node): Renamed from relation_node_t.
7064 (relation_nodes): Renamed from relation_nodes_t.
7065 (relation): Renamed from relation_t.
7066 * src/state.h (state_number): Renamed from state_number_t.
7067 (struct state): Renamed from struct state_s.
7068 (state): Renamed from state_t.
7069 (transitions): Renamed from transitions_t. Unused (and
7070 misspelled) transtion_s tag removed.
7071 (errs): Renamed from errs_t. Unused errs_s tag removed.
7072 (reductions): Renamed from reductions_t. Unused tag
7073 reductions_s removed.
7074 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
7075 (struct symbol_list): Renamed from struct symbol_list_s.
7076 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
7077 (struct symbol): Renamed from struct symbol_s.
7078 (symbol): Renamed from symbol_t.
7079 * src/tables.c (vector_number): Renamed from vector_number_t.
7080 (action_number): Renamed from action_t.
7081 * src/tables.h (base_number): Renamed from base_t.
7082 * src/vcg.h (enum color): Renamed from enum color_e.
7083 (enum textmode): Renamed from enum textmode_e.
7084 (enum shape): Renamed from enum shape_e.
7085 (struct colorentry): Renamed from struct colorentry_s.
7086 (struct classname): Renamed from struct classname_s.
7087 (struct infoname): Renamed from struct infoname_s.
7088 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
7089 (enum decision): Renamed from enum decision_e.
7090 (enum orientation): Renamed from enum orientation_e.
7091 (enum alignment): Renamed from enum alignment_e.
7092 (enum arrow_mode): Renamed from enum arrow_mode_e.
7093 (enum crossing_type): Renamed from enum crossing_type_e.
7094 (enum view): Renamed from enum view_e.
7095 (struct node): Renamed from struct node_s.
7096 (node): Renamed from node_t.
7097 (enum linestyle): Renamed from enum linestyle_e.
7098 (enum arrowstyle): Renamed from enum arrowstyle_e.
7099 (struct edge): Renamed from struct edge.
7100 (edge): Renamed from edge_t.
7101 (struct graph): Renamed from struct graph_s.
7102 (graph): Renamed from graph_t.
7103 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
7104 Rename value_t -> value.
7105 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
7106 value_t_as_yystype -> value_as_yystype.
7107
7108 Don't include <errno.h> in the mainstream code, since it
7109 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
7110 * lib/get-errno.c, lib/get-errno.h: New files.
7111 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
7112 get-errno.c.
7113 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
7114 * src/output.c (output_skeleton): Likewise.
7115 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
7116 instead of errno.
7117 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
7118 Likewise.
7119 (handle_action_dollar, handle_action_at): Likewise.
7120 * src/system.h: Do not include <errno.h>.
7121 (TAB_EXT): Renamed from EXT_TAB.
7122 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
7123
7124 Avoid str[a-z]*, since <string.h> reserves that name space.
7125 Change all instances of "struniq" in names to "uniqstr", and
7126 likewise for "STRUNIQ" and "UNIQSTR".
7127 * src/uniqstr.c: Renamed from src/struniq.c.
7128 * src/uniqstr.h: Renamed from src/struniq.h.
7129 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
7130 * src/files.c (strsuffix): Remove; unused.
7131 (concat2): Renamed from stringappend. Now static.
7132 * src/files.h (strsuffix, stringappend): Remove; unused.
7133 * src/parse-gram.y (<chars>): Renamed from <string>.
7134 (<uniqstr>): Renamed from <struniq>.
7135 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
7136 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
7137 (struct graph_s.expand): Renamed from struct graph_s.stretch.
7138 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
7139 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
7140 (N_EXPAND): Renamed from N_STRETCH.
7141
7142 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
7143 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
7144 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
7145 Remove; unused.
7146 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
7147 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
7148 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
7149 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
7150 (BASE_MAXIMUM): Renamed from BASE_MAX.
7151 (BASE_MINIMUM): Renamed from BASE_MIN.
7152 (ACTION_MAX): Remove; unused.
7153 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
7154 Unnecessary casts removed from above defines.
7155
7156
7157 Fix misspelling in names.
7158 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
7159 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7160 G_NODE_ALIGNEMENT.
7161
7162
7163 * lib/timevar.c (timevar_report): Renamed from time_report,
7164 for consistency with other names.
7165 * lib/timevar.h (timevar_report): New decl.
7166 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7167
7168
7169 Sort include-file uses.
7170
7171 Reorder all include files under src to be in the order "system.h".
7172 then the ../lib include files in angle brackets (alphabetized),
7173 then the . include files in double-quotes (alphabetized). Fix
7174 dependency breakages encountered in this process, as follows:
7175 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
7176 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
7177 * src/state.h: Include "symtab.h".
7178
996b1c7e
PE
71792002-12-08 Paul Eggert <eggert@twinsun.com>
7180
7181 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
7182 since this causes problems when __file__ contains character
7183 sequences like "@" that are treated specially by src/scan-skel.l.
7184 Instead, just use the file's basename. This fixes the bug
7185 reported by Martin Mokrejs in
161a71f3 7186 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 7187
e19c4e5d
PE
71882002-12-06 Paul Eggert <eggert@twinsun.com>
7189
7190 Add support for rules that do not have trailing semicolons, as
7191 POSIX requires. Improve the quality of locations in Bison
7192 diagnostics.
26b4a969 7193
e19c4e5d
PE
7194 * src/location.c: Include <quotearg.h>.
7195 (empty_location): Now const.
7196 (location_print): New function. Follow the recommendation of the
7197 GNU Coding Standards for locations that span file boundaries.
7198 * src/location.h: Do not include <quotearg.h>; no longer needed.
7199 (boundary): New type.
7200 (location_t): Use it. This allows locations to span file boundaries.
7201 All member uses changed: file -> start.file or end.file (as needed),
7202 first_line -> start.line, first_column -> start.column,
7203 last_line -> end.line, last_column -> end.column.
7204 (equal_boundaries): New function.
7205 (LOCATION_RESET, LOCATION_STEP): Remove.
7206 (LOCATION_PRINT): Remove. All callers changed to use location_print.
7207 (empty_location): Now const.
7208 (location_print): New decl.
7209 * src/parse-gram.y (lloc_default): New function, which handles
7210 empty locations more accurately.
7211 (YYLLOC_DEFAULT): Use it.
7212 (%token COLON): Remove.
7213 (%token ID_COLON): New token.
26b4a969 7214 (rules): Use it.
e19c4e5d
PE
7215 (declarations, rules): Remove trailing semicolon.
7216 (declaration, rules_or_grammar_declaration):
7217 Allow empty (";") declaration.
7218 (symbol_def): Remove empty actions; no longer needed.
7219 (rules_or_grammar_declaration): Remove trailing semicolon.
7220 (semi_colon.opt): Remove.
7221 * src/reader.h: Include location.h.
7222 (scanner_cursor): New decl.
7223 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
7224 rolling our own.
7225 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7226 of *loc.
7227 (STEP): Remove. No longer needed, now that adjust_location does
7228 the work. All uses removed.
7229 (scanner_cursor): New var.
7230 (adjust_location): Renamed from extend_location. It now sets
7231 *loc and adjusts the scanner cursor. All uses changed.
7232 Don't bother testing for CR.
7233 (handle_syncline): Remove location arg; now updates scanner cursor.
7234 All callers changed.
7235 (unexpected_end_of_file): Now accepts start boundary of token or
7236 comment, not location. All callers changed. Update scanner cursor,
7237 not the location.
7238 (SC_AFTER_IDENTIFIER): New state.
7239 (context_state): Renamed from c_context. All uses changed.
7240 (id_loc, code_start, token_start): New local vars.
7241 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7242 processing of Yacc white space and equivalents here.
7243 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7244 instead of returning ID immediately, since we need to search for
7245 a subsequent colon.
7246 (<INITIAL>"'", "\""): Save token_start.
7247 (<INITIAL>"%{", "{", "%%"): Save code_start.
7248 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7249 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7250 BEGIN context_state at end, not INITIAL.
7251 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7252 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7253 Return correct token start.
7254 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7255 the start of a character, string or multiline comment is found.
7256 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7257 Reduction): Adjust reported locations to match the more-precise
7258 results now expected.
7259 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7260 * tests/reduce.at (Useless Rules, Reduced Automaton,
7261 Underivable Rules): Likewise.
7262 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7263 or "|"' now that so many other tokens are allowed by the new grammar.
7264
7265 * src/complain.h (current_file): Remove duplicate decl;
7266 current_file is now owned by files.h.
7267 * src/complain.c, src/scan-gram.l: Include files.h.
7268
72692002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 7270
e19c4e5d
PE
7271 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7272 promotes to int; it might be unsigned int.
7273 * data/yacc.c (yy_reduce_print): Likewise.
7274
7275 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7276 be #defined in the prologue, not in the Bison declarations.
7277 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 7278
b64755e3
PE
72792002-12-02 Paul Eggert <eggert@twinsun.com>
7280
7281 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7282 * lib/strtoul.c: New file, from gnulib.
7283 This fixes a porting bug reported by Peter Klein in
161a71f3 7284 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 7285
6e746484
PE
72862002-11-30 Paul Eggert <eggert@twinsun.com>
7287
b64755e3
PE
7288 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
7289 and put only a forward declaration in the prologue. This is for
7290 consistency with the other scanner helper functions.
7291
6ba55592
PE
7292 Type clashes now generate warnings, not errors, since it
7293 appears that POSIX may allow some grammars with type clashes.
7294 * src/reader.c (grammar_current_rule_check): Warn about
7295 type clashes instead of complaining.
7296 * tests/input.at (Type Clashes): Expect warnings, not complaints.
7297
6e746484
PE
7298 Add Yacc library, since POSIX requires it.
7299 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
7300 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
7301 * lib/main.c, lib/yyerror.c: New files.
7302
7303 gram_error can be static; it need not be extern.
7304 * src/reader.h (gram_error): Remove decl.
7305 * src/parse-gram.y (gram_error): Now static. Add static decl.
7306 (print_token_value): Omit parameter names from forward decl,
7307 for consistency.
7308
88510f9c
PE
73092002-11-29 Paul Eggert <eggert@twinsun.com>
7310
6e746484
PE
7311 * doc/bison.texinfo: Emphasize that yylex and yyerror must
7312 be declared before being used. E.g., one should typically
7313 declare them in the prologue. Use GNU coding style in examples.
7314 Put "const" consistently after the type it modifies. Mention
7315 that C99 supports "inline". Mention that yyerror traditionally
7316 returns "int".
7317
88510f9c
PE
7318 %parse-param and %lex-param now take just one argument, the
7319 declaration; the argument name is deduced from the declaration.
7320
7321 * doc/bison.texinfo (Parser Function, Pure Calling, Error
7322 Reporting, Table of Symbols): Document this.
7323 * src/parse-gram.y (add_param): New function.
7324 (COMMA): Remove.
7325 (declaration): Implement new rule for %parse-param and %lex-param.
7326 * src/scan-gram.l: "," now elicits a warning, rather than being
7327 a token; this is more compatible with byacc.
7328 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
7329
bb92250c
PE
73302002-11-27 Paul Eggert <eggert@twinsun.com>
7331
7332 Rename identifiers to avoid real and potential collisions.
7333
7334 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
7335 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 7336 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
7337 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7338 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
7339 * src/parse-gram.y (print_token_value): Renamed from yyprint.
7340 All uses changed.
7341 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
7342 The name "yycontrol" violates the name space rules, and this stuff
7343 wasn't being used anyway.
7344 (input): Remove action; this stuff wasn't being used.
7345 (gram_error): Rename local variable yylloc -> loc.
7346 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
7347 (YY_DECL): Don't use "yy" at start of local variables.
7348 All uses changed, e.g., yylloc -> loc.
7349 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
7350 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
7351 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
7352 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
7353
7354 * src/parse-gram.y (gram_error): loc is now const *.
7355 * src/reader.h (gram_error): Likewise.
7356
3af4feb2
PE
73572002-11-24 Paul Eggert <eggert@twinsun.com>
7358
7359 Version 1.75c.
7360
7361 * tests/actions.at (Actions after errors): Use an output format
7362 more similar to that of the Printers and Destructors test.
7363 Test the position of the ';' token too.
7364 (Printers and Destructors): Likewise.
7365 (Printers and Destructors: %glr-parser): Remove for now, to avoid
7366 unnecessarily alarming people when the test fails.
7367
7368 * data/yacc.c (yyerrlab1): Move this label down, so that the
7369 parser does not discard the lookahead token if the user code
7370 invokes YYERROR. This change is required for POSIX conformance.
7371
7372 * lib/error.c: Sync with gnulib.
7373
73742002-11-22 Paul Eggert <eggert@twinsun.com>
7375
7376 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
7377 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
7378 * lib/xmalloc.c: Likewise.
26b4a969 7379
58004308
PE
73802002-11-20 Paul Eggert <eggert@twinsun.com>
7381
7382 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
7383
73842002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 7385
58004308
PE
7386 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
7387 should use `if (! x) abort ();' rather than `assert (x);', and
7388 anyway it's one less thing to worry about configuring.
7389
7390 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
7391 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
7392 and replace all instances of assert with abort.
7393 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7394 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
7395
7396 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
7397 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
7398 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
7399 hash_find_entry, hash_rehash, hash_insert): Likewise.
7400 * src/conflicts.c (resolve_sr_conflict): Likewise.
7401 * src/lalr.c (set_goto_map, map_goto): Likewise.
7402 * src/nullable.c (nullable_compute): Likewise.
7403 * src/output.c (prepare_rules, token_definitions_output): Likewise.
7404 * src/reader.c (packgram, reader): Likewise.
7405 * src/state.c (state_new, state_free, state_transitions_set,
7406 state_reduction_find): Likewise.
7407 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
7408 symbol_pack): Likewise.
7409 * src/tables.c (conflict_row, pack_vector): Likewise.
7410 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7411 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7412 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
7413 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
7414
7415 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
7416 (ARGMATCH_CONSTRAINT): New macro.
7417 (ARGMATCH_ASSERT): Use it.
7418
7419 * src/system.h (verify): New macro.
7420 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
7421 rather than assert.
7422 * src/tables.c (tables_generate): Likewise.
7423
7424 * src/struniq.c (struniq_assert): Now returns void, and aborts
7425 if the assertion is false.
7426 (struniq_assert_p): Remove.
7427 * src/struniq.h: Likewise.
7428
76ae8198
PE
74292002-11-18 Paul Eggert <eggert@twinsun.com>
7430
7431 * data/glr.c (yygetLRActions): Replace `yyindex' with
7432 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
7433 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 7434 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 7435
d3c4e709
AD
74362002-11-18 Akim Demaille <akim@epita.fr>
7437
7438 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
7439 space.
7440 From Tim Van Holder.
7441
8d8a7238
PE
74422002-11-17 Paul Eggert <eggert@twinsun.com>
7443
7444 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
7445 to "SyntaxError" for consistency with my 2002-11-15 change.
7446
7447 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
7448 not define to {}, since this breaks the common use of `YYDPRINTF
7449 ((...));' if a single statement is desired (e.g. before `else').
7450 Work around GCC warnings by surrounding corresponding calls with
7451 {} if needed.
7452 (yyhasResolvedValue): Remove unused function.
7453 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
7454 loop body.
7455 (yyreportSyntaxError): Renamed from yyreportParseError.
7456 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
7457 All uses changed.
7458 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
7459 extern when possible. Remove unused initializations.
7460
b0937b22
AD
74612002-11-16 Akim Demaille <akim@epita.fr>
7462
7463 Augment the similarity between GLR and LALR traces.
7464
7465 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
7466 (YY_REDUCE_PRINT): New.
7467 (yyparse): Use them.
7468 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
7469 YYDPRINT here.
7470 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
7471 state reached after the reduction/recovery, since...
7472 (yyparse, yyprocessOneStack): Report the state we are entering in.
7473
c5e3e510
AD
74742002-11-16 Akim Demaille <akim@epita.fr>
7475
7476 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
7477 Add support for --trace=skeleton.
7478 * src/scan-skel.l: %option debug.
7479 Scan strings of non-@ or \n instead of character by character.
7480 (scan_skel): Handle trace_skeleton.
7481 (QPUTS): New.
7482 (@output_parser_name@, @output_header_name@): ``Restore'' their
7483 support (used to be M4 macros).
7484 * data/yacc.c: Quote larger chunks, a la glr.c.
7485 * data/lalr1.cc: Likewise.
7486 The header guards are no longer available, so use some other
7487 string than `YYLSP_NEEDED'.
7488
4c6cc1db
AD
74892002-11-16 Akim Demaille <akim@epita.fr>
7490
7491 Make the ``Printers and Destructors'' test more verbose, taking
7492 `yacc.c''s behavior as (possibly wrong) reference.
7493
7494 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
7495 instead of fprint on stdout.
7496 Set and report the last_line of the symbols.
7497 Consistently display values and locations.
7498
6d9e8019
PE
74992002-11-16 Paul Eggert <eggert@twinsun.com>
7500
7501 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
7502
6e649e65
PE
75032002-11-15 Paul Eggert <eggert@twinsun.com>
7504
b25d88f6
PE
7505 * tests/actions.at (Actions after errors): New test case.
7506
6e649e65
PE
7507 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
7508 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
7509 tests/action.at, tests/calc.at, tests/conflicts.at,
7510 tests/cxx-type.at, tests/regression.at:
7511 "parse error" -> "syntax error" for POSIX compatibility.
7512 "parsing stack overflow..." -> "parser stack overflow" so
7513 that code matches Bison documentation.
7514
0f39aab9
AD
75152002-11-15 Akim Demaille <akim@epita.fr>
7516
7517 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
7518 take two BRACED_CODE, not two string_content.
7519 Free the scanner's obstack when we are done.
7520 (code_content): New.
7521 * tests/calc.at: Adjust.
7522 * doc/bison.texinfo: Adjust.
7523 Also, make sure to include the `,' for these declarations.
7524
761c1926
AD
75252002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
7526
7527 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
7528 definition; avoids potential autoreconf problems.
7529
b0f98b10
AD
75302002-11-15 Akim Demaille <akim@epita.fr>
7531
7532 Always check the value returned by yyparse.
7533
7534 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
7535 returned by yyparse.
7536 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
7537 Adjust calls.
7538 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
7539 returned by yyparse.
7540
970785f1
PH
75412002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7542
7543 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
7544 on input.at test.
7545
8fcc7db1
PE
75462002-11-14 Paul Eggert <eggert@twinsun.com>
7547
7ec1b48e
PE
7548 * src/output.c (output_skeleton): Call xfopen instead of
7549 duplicating xfopen's body.
7550
cfff7583 7551 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 7552 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 7553
8fcc7db1
PE
7554 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
7555 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
7556 Group compiler. Instead, use "$CC -E bar.c". Include the .h
7557 file twice in the grammar, as an extra check.
7558
7559 * tests/input.at (Torturing the Scanner): Surround the
7560 backslash-newline tests with "#if 0", to make it less likely that
7561 we'll run into compiler bugs. Bring back solitary \ inside
7562 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 7563 test backslash-newline in C character constant.
8fcc7db1 7564
4e8d992c
AD
75652002-11-14 Akim Demaille <akim@epita.fr>
7566
7567 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
7568 status of the compiler.
f32b346d 7569 Calling `exit 1' is no longer needed.
4e8d992c
AD
7570 Reported by Nelson H. F. Beebe.
7571
9501dc6e
AD
75722002-11-14 Akim Demaille <akim@epita.fr>
7573
7574 * tests/atlocal.in (CPPFLAGS): We have config.h.
7575 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
7576 New.
7577 * tests/actions.at, tests/calc.at, tests/conflicts.at,
7578 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
7579 * tests/regression.at, tests/torture.at: Use them for all the
7580 grammars that are to be compiled.
7581 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
7582 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
7583 * doc/bison.texinfo (GLR Parsers): Document `inline'.
7584
18b519c0
AD
75852002-11-14 Akim Demaille <akim@epita.fr>
7586
7587 * doc/bison.texinfo: Various formatting changes (alignments in
7588 samples, additional @group/@end group, GCS in samples.
7589 Use @deffn instead of simple @table to define the directives,
7590 macros, variables etc.
7591
9a86cdb9
PE
75922002-11-13 Paul Eggert <eggert@twinsun.com>
7593
daa33def 7594 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 7595 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 7596
daa33def 7597 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 7598 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
7599 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
7600 * tests/headers.at (export YYLTYPE): Likewise.
7601
7602 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 7603 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 7604
9a86cdb9
PE
7605 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
7606 comments, since they're not portable. Use GNU coding style.
7607
9c1e26bd
AD
76082002-11-13 Akim Demaille <akim@epita.fr>
7609
7610 * data/yacc.c: Leave bigger chunks of quoted text.
7611 (YYDSYMPRINTF): New.
7612 Use it to report symbol activities.
7613 * data/glr.c (YYDSYMPRINTF): New.
7614 Use it.
7615
87f721cc
PE
76162002-11-12 Paul Eggert <eggert@twinsun.com>
7617
7618 Version 1.75b.
7619
7620 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
7621 (yyglrReduce): Return yyok, not 0.
7622 This should avoid the enumerated-type warnings reported
464c6927 7623 by Nelson H. F. Beebe in
161a71f3 7624 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
7625
7626 * lib/bbitset.h (BITSET_INLINE): Remove.
7627 * lib/bitset.h [! BITSET_INLINE]: Remove.
7628 (bitset_set, bitset_reset, bitset_test): Rename local vars
7629 to avoid shadowing warnings by GCC.
7630
7631 * data/glr.c (inline): Remove #define. It's the user's
7632 responsibility to #define it away, just like 'const'.
464c6927 7633 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 7634 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 7635
87f721cc
PE
7636 * Makefile.maint (po-check): Scan .l and .y files instead of the
7637 .c and the .h files that they generate. This fixes the bug
7638 reported by Tim Van Holder in:
161a71f3 7639 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
7640 Look for N_ as well as for _. Try to avoid matching #define for
7641 N_ and _.
7642 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
7643 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
7644 * src/scan-gram.l: Revamp regular expressions so that " and '
7645 do not confuse xgettext.
7646
7647 * src/struniq.h (struniq_new): Do not declare the return type
7648 to be 'const'; this violates the C standard.
7649 * src/struniq.c (struniq_new): Likewise.
7650
be14ade5
AD
76512002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
7652
7653 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
7654 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
7655 linker.
7656
05291fbc
AD
76572002-11-12 Akim Demaille <akim@epita.fr>
7658
7659 * Makefile.maint: Sync with Autoconf:
7660 (local_updates): New.
7661
1f5fd52e
AD
76622002-11-12 Akim Demaille <akim@epita.fr>
7663
7664 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
7665
283f1e64
AD
76662002-11-12 Akim Demaille <akim@epita.fr>
7667
7668 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
7669 locations.
7670
886b69d1
AD
76712002-11-12 Akim Demaille <akim@epita.fr>
7672
7673 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
7674 not yyvalue.
7675
3df37415
AD
76762002-11-12 Akim Demaille <akim@epita.fr>
7677
7678 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
7679 Use it to test the GLR parser.
7680
7bd6c77e
AD
76812002-11-12 Akim Demaille <akim@epita.fr>
7682
7683 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
7684 defines it.
7685 * data/glr.c (yystos): New.
7686 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
7687 (YYDSYMPRINT): New.
7688 (yyval): Don't define it, it is handled via M4.
7689 (yyrecoverParseError): Free verbosely the discarded symbols.
7690 * data/yacc.c (yysymprint): Remove, rather...
7691 (b4_yysymprint_generate): invoke.
7692 * data/c.m4 (b4_yysymprint_generate): New.
7693 Accept pointers as arguments, as opposed to the version from
7694 yacc.c.
7695 (b4_yydestruct_generate): Likewise.
7696 * tests/cations.at (Printers and Destructors): Use Bison directives
7697 instead of CPP macros.
7698 Don't rely on internal details.
7699
b0400cc6
AD
77002002-11-12 Akim Demaille <akim@epita.fr>
7701
7702 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
7703 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
7704 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
7705 it against YYEMPTY and so forth), work on yytoken (i.e., set
7706 it to YYEMPTY etc.).
7707 (yydestruct): Replace with a b4_yydestruct_generate invocation.
7708 (b4_symbol_actions): Remove.
7709 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
7710 for 0, end-of-input.
7711
72f889cc
AD
77122002-11-12 Akim Demaille <akim@epita.fr>
7713
7714 * doc/bison.texinfo (Destructor Decl): New.
7715
b1ae9233
AD
77162002-11-12 Akim Demaille <akim@epita.fr>
7717
7718 * src/tables.c (tables_generate): Use free for pointers that
7719 cannot be NULL, not XFREE.
7720 (pack_vector): Use assert, not fatal, for bound violations.
7721 * src/state.c (state_new): Likewise.
7722 * src/reader.c (reader): Likewise.
7723 * src/lalr.c (set_goto_map): Likewise.
72f889cc 7724 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
7725 the file name.
7726
7ec2d4cd
AD
77272002-11-12 Akim Demaille <akim@epita.fr>
7728
7729 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
7730 Restore.
7731 * src/scan-gram.l (last_string): Is global to the file, not to
7732 yylex.
7733 * src/parse-gram.y (input): Don't append the epilogue here,
7734 (epilogue.opt): do it here, and free the scanner's obstack.
7735 * src/reader.c (epilogue_set): Rename as...
7736 (epilogue_augment): this.
7737 * data/c.m4 (b4_epilogue): Defaults to empty.
7738
573a6cd3
AD
77392002-11-12 Akim Demaille <akim@epita.fr>
7740
7741 * src/getargs.c (long_options): Remove duplicates.
7742 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
7743 Remove.
7744 * doc/bison.rnh: Remove.
7745 * doc/bison.texinfo (VMS Invocation): Remove.
7746
95612cfa
AD
77472002-11-12 Akim Demaille <akim@epita.fr>
7748
7749 * src/struniq.h, src/struniq.c (struniq_t): Is const.
7750 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
7751
7752 Use struniq for symbols.
7753
7754 * src/symtab.h (symbol_t): The tag member is a struniq.
7755 (symbol_type_set): Adjust.
7756 * src/symtab.c (symbol_new): Takes a struniq.
7757 (symbol_free): Don't free the tag member.
7758 (hash_compare_symbol_t, hash_symbol_t): Rename as...
7759 (hash_compare_symbol, hash_symbol): these.
7760 Use the fact that tags as struniqs.
7761 (symbol_get): Use struniq_new.
7762 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
7763 Returns a strniq.
7764 * src/reader.h (merger_list, grammar_currentmerge_set): The name
7765 and type members are struniqs.
7766 * src/reader.c (get_merge_function)
7767 (grammar_current_rule_merge_set): Adjust.
7768 (TYPE, current_type): Are struniq.
7769
7770 Use struniq for file names.
7771
7772 * src/files.h, src/files.c (infile): Split into...
7773 (grammar_file, current_file): these.
7774 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
7775 * src/reduce.c (reduce_print): Likewise.
7776 * src/getargs.c (getargs): Likewise.
7777 * src/complain.h, src/complain.c: Likewise.
7778 * src/main.c (main): Call struniqs_new early enough to use it for
7779 file names.
7780 Don't free the input file name.
7781
3e6656f9
AD
77822002-11-12 Akim Demaille <akim@epita.fr>
7783
7784 * src/symtab.c (symbol_free): Remove dead deactivated code:
7785 type_name are properly removed.
7786 Don't use XFREE to free items that cannot be NULL.
7787 * src/struniq.h, src/struniq.c: New.
7788 * src/main.c (main): Initialize/free struniqs.
7789 * src/parse-gram.y (%union): Add astruniq member.
7790 (yyprint): Adjust.
7791 * src/scan-gram.l (<{tag}>): Return a struniq.
7792 Free the obstack bit that used to store it.
7793 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
7794
7672019c
PE
77952002-11-11 Paul Eggert <eggert@twinsun.com>
7796
7797 Revamp to fix many (but not all) of the C- and M4-related quoting
7798 problems. Among other things, this fixes the Bison bug reported
7799 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 7800 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
7801
7802 Use new @ escapes consistently. Represent brackets with @{ and @}
7803 rather than @<:@ and @:>@, since this works a bit better with dumb
7804 editors like vi. Represent @ with @@, since @ is now consistently
7805 an escape. Use @oline@ and @ofile@ rather than __oline__ and
7806 __ofile__, to avoid unexpected expansions. Similarly, use @output
7807 rather than #output.
7808
7809 * data/c.m4 (b4_copyright): Omit file name from comment, since
7810 the file name could contain "*/".
7811 (b4_synclines_flag): Don't quote the 2nd argument; it should already
7812 be quoted. All uses changed.
7813
7814 * data/glr.c: Use new @ escapes consistently.
7815 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
7816 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
7817 Remove, since they couldn't handle arbitrary characters in file
7818 names.
7819 * data/lalr1.cc: Likewise.
7820 * data/yacc.c: Likewise.
7821
7822 * src/files.c (output_infix): Remove; all uses removed.
7823 * src/files.h: Likewise.
7824
7825 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
7826 mishandled funny characters in file names, and anyway it isn't
7827 needed any more.
7828 * data/yacc.c: Likewise.
7829 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
7830
7831 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
7832 * data/yacc.c: Likewise.
7833
7834 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
7835 strings now.
7836 (muscle_init): Quote filename as a C string.
7837 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
7838 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
7839 * src/output.c (escaped_file_name_output): New function.
7840 (prepare_symbols): Quote tokens for M4.
7841 (prepare): Don't insert output_infix, output_prefix,
7842 output_parser_name, output_header_name; this is now down by scan-skel.
7843 Insert skeleton as a C string.
7844
7845 * src/output.c (user_actions_output, symbol_destructors_output,
7846 symbol_printers_output): Quote filenames for C and M4.
7847 * src/reader.c (prologue_augment, epilogue_set): Likewise.
7848
7849 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
7850 escapes other than \\ and \'; this simplifies the code.
7851 (<SC_STRING>): Likewise, for \\ and \".
7852 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
7853 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
7854 Use new escapes @{ and @} for [ and ].
7855
7856 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
7857 them with auto vars.
7858 Switch to new escape scheme, where @ is the escape character uniformly.
7859 Abort if a stray escape character is found. Avoid unbounded input
7860 buffer when parsing non-escaped text.
7861
7862 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
7863 __oline__, #output, $@, and @{ do not have unintended meanings.
7864
acea4f3b
PE
78652002-11-09 Paul Eggert <eggert@twinsun.com>
7866
7867 Fix the test failure due to GCC warnings described in
161a71f3 7868 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
7869 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
7870 evaluate to 0 if it's impossible for NINF to be in the respective
7871 table.
7872 (yygetLRActions, yyrecoverParseError): Use them.
7873
7874 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
7875 counted in the token inserted at end of file. Now takes
7876 location_t *, not location_t, so that the location can be
7877 adjusted. All uses changed.
7878
7879 * tests/regression.at (Invalid inputs): Adjust wording in
7880 diagnostic to match the new behavior.
7881
7882 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
7883 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
7884 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
7885 abort ();'. This reduces the runtime of the "Many lookaheads"
7886 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
7887 GCC 3.2.
7888
20ef1ad5
PE
78892002-11-07 Paul Eggert <eggert@twinsun.com>
7890
7891 * src/parse-gram.y (CHARACTER): Remove unused token.
7892 All uses removed.
7893
7894 * src/scan-gram.l: Remove stack option. We no longer use the
7895 stack, since the stack was never deeper than 1; instead, use the
7896 new auto var c_context to record the stacked value.
7897
7898 Remove nounput option. At an unexpected end of file, we now unput
7899 the minimal input necessary to end cleanly; this simplifies the
7900 code.
7901
7902 Avoid unbounded token sizes where this is easy.
7903
7904 (unexpected_end_of_file): New function.
7905 Use it to systematize the error message on unexpected EOF.
7906 (last-string): Now auto, not static.
7907 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
7908 (scanner_last_string_free): Remove; not used.
7909 (percent_percent_count): Move decl to just before use.
7910 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
7911 not the (never otherwised-used) CHARACTER.
7912
93724f13
AD
79132002-11-07 Akim Demaille <akim@epita.fr>
7914
7915 Let yyerror always receive the msg as last argument, so that
7916 yyerror can be variadic.
7917
7918 * data/yacc.c (b4_yyerror_args): New.
7919 Use it when calling yyerror.
7920 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
7921 Use it when calling yyerror.
7922 * doc/bison.texinfo (Error Reporting): Adjust.
7923 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
7924 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
7925
6e40b4eb
AD
79262002-11-06 Akim Demaille <akim@epita.fr>
7927
7928 #line should have quoted strings.
7929 Ideally, this should be done by m4_quotearg.
7930
7931 * src/scan-skel.l: Include quotearg.h.
7932 Quote __ofile__.
7933 * src/output.c (symbol_printers_output)
7934 (symbol_destructors_output): Quote the file name.
7935
2dfbfc12
AD
79362002-11-06 Akim Demaille <akim@epita.fr>
7937
7938 * tests/regression.at (Invalid inputs): Adjust to the recent
7939 messages.
7940
437c2d80
AD
79412002-11-06 Akim Demaille <akim@epita.fr>
7942
7943 Restore --no-lines.
7944 Reported by Jim Kent.
7945
7946 * data/c.m4 (b4_syncline): New.
7947 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
7948 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
7949 * src/output.c (user_actions_output): Likewise.
7950 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 7951 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 7952
900c5db5
AD
79532002-11-06 Akim Demaille <akim@epita.fr>
7954
7955 * src/main.c (main): Free `infile'.
7956 * src/scan-gram.l (handle_syncline): New.
7957 Recognize `#line'.
7958 * src/output.c (user_actions_output, symbol_destructors_output)
7959 (symbol_printers_output): Use the location's file name, not
7960 infile.
7961 * src/reader.c (prologue_augment, epilogue_set): Likewise.
7962
e183b123 79632002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 7964
e183b123 7965 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 7966 either has GLR conflict entries.
e183b123 7967
193eb6b7
PE
79682002-11-05 Paul Eggert <eggert@twinsun.com>
7969
e183b123
PE
7970 * src/scan-gram.l: Use more accurate diagnostics, e.g.
7971 "integer out of range" rather than "invalid value".
7972 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
7973 accordingly.
7974
193eb6b7
PE
7975 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
7976 Also, remove one static variable in the scanner.
7977
7978 * src/scan-gram.l (braces_level): Now auto, not static.
7979 Initialize to zero if the compiler is being picky.
7980 (INITIAL): Clear braces_level instead of incrementing it.
7981 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
7982 as POSIX 1003.1-2001 requires.
7983 * src/system.h (IF_LINT): New macro, taken from coreutils.
7984 * configure.ac: Define "lint" if --enable-gcc-warnings.
7985
29c01725
AD
79862002-11-05 Akim Demaille <akim@epita.fr>
7987
7988 * src/scan-gram.l: When it starts with `%', complain about the
7989 whole directive, not just that `invalid character: %'.
7990
8aeac3ca
AD
79912002-11-04 Akim Demaille <akim@epita.fr>
7992
7993 * Makefile.maint: Update from Autoconf.
7994 (update, cvs-update, po-update, do-po-update): New.
7995
793a58bb
AD
79962002-11-04 Akim Demaille <akim@epita.fr>
7997
7998 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
7999 and yyerror.
8000 Have yyerror `use' its arguments.
8001 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
8002 returns true when location & yacc & pure & parse-param.
8003 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
8004
c4d720cd
AD
80052002-11-04 Akim Demaille <akim@epita.fr>
8006
8007 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
8008 clashes.
8009 * src/scan-gram.l: Use [\'] instead of ['] to pacify
8010 font-lock-mode.
8011 Use complain_at.
8012 Use quote, not quote_n since LOCATION_PRINT no longer uses the
8013 slot 0.
8014
613a0dc5
PE
80152002-11-03 Paul Eggert <eggert@twinsun.com>
8016
8017 * src/reader.c (get_merge_function, grammar_current_rule_check):
8018 Use consistent diagnostics for reporting type name clashes.
8019 Quote the types with <>, for consistency with Yacc.
8020 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
8021
2a8d363a
AD
80222002-11-03 Akim Demaille <akim@epita.fr>
8023
8024 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
8025 New.
8026 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
8027 (b4_parse_param): Remove.
8028 Use b4_identification.
8029 Propagate b4_pure_args where needed to pass them to yyerror.
8030 * data/glr.m4 (b4_parse_param): Remove.
8031 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
8032 (b4_lpure_formals): New.
8033 Use b4_identification.
8034 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
8035 b4_user_formals and b4_user_args.
8036 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
8037 (yyreportAmbiguity): When using a pure parser, also need
8038 the location, and the parse-params.
8039 Adjust callers.
8040 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
8041 When using a pure parser, also need the parse-params.
8042 Adjust callers.
8043 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
8044 (%pure-parser + %parse-param) LALR and GLR parsers.
8045 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
8046 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
8047 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
8048 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
8049 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
8050 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
8051 * doc/bison.texinfo: Untabify the whole file.
8052 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
8053 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
8054 (Error Reporting): Adjust to these new directives.
8055 Document %error-verbose, deprecate YYERROR_VERBOSE.
8056
9e32add8
AD
80572002-11-03 Akim Demaille <akim@epita.fr>
8058
8059 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
8060 AT_CHECK_CALC_GLR invocations to use % directives, instead of
8061 command line options.
8062 * tests/cxx-type.at: Formatting changes.
8063
b02d90a5
PE
80642002-11-03 Paul Eggert <eggert@twinsun.com>
8065
8066 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
8067 to count columns correctly, and to check for invalid inputs.
9e32add8 8068
b02d90a5
PE
8069 Use mbsnwidth to count columns correctly. Account for tabs, too.
8070 Include mbswidth.h.
8071 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
8072 (extend_location): New function.
8073 (YY_LINES): Remove.
8074
8075 Handle CRLF in C code rather than in Lex code.
8076 (YY_INPUT): New macro.
8077 (no_cr_read): New function.
8078
8079 Scan UCNs, even though we don't fully handle them yet.
8080 (convert_ucn_to_byte): New function.
8081
8082 Handle backslash-newline correctly in C code.
8083 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
8084 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
8085 all uses changed.
8086 (tag, splice): New EREs. Do not allow NUL or newline in tags.
8087 Use {splice} wherever C allows backslash-newline.
8088 YY_STEP after space, newline, vertical-tab.
8089 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 8090
b02d90a5
PE
8091 (letter, id): Don't assume ASCII; e.g., spell out a-z.
8092
8093 ({int}, handle_action_dollar, handle_action_at): Check for integer
8094 overflow.
9e32add8 8095
b02d90a5
PE
8096 (YY_STEP): Omit trailing semicolon, so that it's more like C.
8097
8098 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
8099 as well as \000. Check for UCHAR_MAX, not 255.
8100 Allow \x with an arbitrary positive number of digits, as in C.
8101 Check for overflow here.
8102 Allow \? and UCNs, for compatibility with C.
8103
8104 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
8105 with quote slot used by complain_at.
8106
8107 * tests/input.at: Add tests for backslash-newline, m4 quotes
8108 in symbols, long literals, and funny escapes in strings.
8109
8110 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
8111 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
8112 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
8113 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
8114 * m4/mbswidth.m4: New file, from GNU coreutils.
8115
8116 * doc/bison.texinfo (Grammar Outline): Document // comments.
8117 (Symbols): Document that trigraphs have no special meaning in Bison,
8118 nor is backslash-newline allowed.
8119 (Actions): Document that trigraphs have no special meaning.
8120
8121 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
8122 no longer used.
8123
81242002-11-02 Paul Eggert <eggert@twinsun.com>
8125
8126 * src/reader.c: Don't include quote.h; not needed.
8127 (get_merge_function): Reword warning to be consistent with
8128 type clash diagnostic in grammar_current_rule_check.
8129
8130 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
8131 bug in trigraph handling.
8132
8133 * src/output.c (prepare_symbols): When printing token names,
8134 escape "[" as "@<:@" and likewise for "]".
8135
8136 * src/system.h (errno): Remove declaration, as we are now
8137 assuming C89 or better, and C89 guarantees errno.
8138
762b212b
PE
81392002-10-30 Paul Eggert <eggert@twinsun.com>
8140
8141 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
8142 Check for close failures.
8143 * src/files.h (xfclose): Return void, not int, since it always
8144 returned zero.
8145 * src/files.c (xfclose): Likewise. Report I/O error if ferror
8146 indicates one.
8147 * src/output.c (output_skeleton): Use xfclose rather than fclose
8148 and ferror. xfclose now checks ferror.
8149
8150 * data/glr.c (YYLEFTMOST_STATE): Remove.
8151 (yyreportTree): Use a stack-based leftmost state. This avoids
8152 our continuing battles with bogus warnings about initializers.
8153
56100c60
AD
81542002-10-30 Akim Demaille <akim@epita.fr>
8155
8156 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
8157 #if.
8158
51b4a04c
PH
81592002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8160
8161 * tests/glr-regr1.at: New test for reported regressions.
8162 * tests/testsuite.at: Add glr-regr1.at test.
8163 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 8164
bf1ebda2
PE
81652002-10-24 Paul Eggert <eggert@twinsun.com>
8166
5c16c6b1
PE
8167 Version 1.75a.
8168
bf1ebda2
PE
8169 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
8170 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
8171 we use malloc. Don't assume 'A' through 'Z' are contiguous.
8172 Don't assume strdup exists; POSIX says its an XSI extension.
8173 Check for buffer overflow on input.
8174
b526ee61
AD
81752002-10-24 Akim Demaille <akim@epita.fr>
8176
8177 * src/output.c (output_skeleton): Don't disable M4sugar comments
8178 too soon: it results in comments being expanded.
8179 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
8180 first output.
8181
f1886bb2
AD
81822002-10-24 Akim Demaille <akim@epita.fr>
8183
8184 * data/yacc.c (m4_int_type): New.
8185 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
8186 char' as only yacc.c wants K&R portability.
8187 * data/glr.c (yysigned_char): Remove.
8188 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8189 Reported by Quoc Peyrot.
8190
c5576256
PE
81912002-10-23 Paul Eggert <eggert@twinsun.com>
8192
8193 * src/main.c (main): With --trace=time, report times even if a
8194 non-fatal error occurs. Formerly, the times were reported in some
8195 such cases but not in others.
8196 * src/reader.c (reader): Just return if a complaint has been issued,
8197 instead of exiting, so that 'main' can report times.
8198
27b0ffea
AD
81992002-10-22 Akim Demaille <akim@epita.fr>
8200
8201 * src/system.h: Include sys/types.
8202 Reported by Bert Deknuydt.
8203
223a7883
PE
82042002-10-23 Paul Eggert <eggert@twinsun.com>
8205
8206 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8207 Suggested by Art Haas.
8208
82092002-10-22 Paul Eggert <eggert@twinsun.com>
8210
8211 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
8212 decl; not needed any more.
8213 * src/main.c (main): Use return to exit, undoing yesterday's change.
8214 The last OS that we could find where this wouldn't work is
8215 SunOS 3.5, and that's too old to worry about now.
8216
8217 * data/glr.c (struct yyltype): Define members even when not
8218 doing locations. This is more consistent with yacc.c, and it
8219 works around the following bug reports:
161a71f3
PE
8220 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
8221 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 8222
223a7883
PE
8223 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
8224 @acronym consistently. Standardize on "Yacc" instead of "YACC",
8225 "Algol" instead of "ALGOL". Give a bit more history about BNF.
8226
8b76775a
AD
82272002-10-22 Akim Demaille <akim@epita.fr>
8228
8229 * data/README: New.
8230
6db10d14
PE
82312002-10-21 Paul Eggert <eggert@twinsun.com>
8232
8233 Be consistent about 'bool'; the old code used an enum in one
8234 module and an int in another, and this violates the C standard.
8235 * m4/stdbool.m4: New file, from coreutils 4.5.3.
8236 * configure.ac (AC_HEADER_STDBOOL): Add.
8237 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
8238 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
8239 * src/symtab.c (hash_compare_symbol_t): Likewise.
8240 * src/system.h (bool, false, true): Use a definition consistent
8241 with ../lib/hash.c. All uses changed.
8242
8243 * src/complain.c (warning_issued): Renamed from warn_message_count,
8244 so that we needn't worry about integer overflow (!).
8245 Now of type bool. All uses changed.
8246 (complaint_issued): Renamed from complain_message_count; likewise.
8247
8248 * src/main.c (main): Use exit to exit with failure.
27b0ffea 8249
6db10d14
PE
8250 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8251 rather than 1 and 0.
8252 * src/main.c (main): Likewise.
8253 * src/getargs.c (getargs): Likewise.
8254 * src/reader.c (reader): Likewise.
8255
8256 * src/getarg.c (getargs): Remove duplicate code for
8257 "Try `bison --help'".
8258
8259 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8260 What was that "2" for?
8261
8262 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8263 * src/getargs.c (usage): Likewise.
8264
8265 * src/getargs.c (getargs): When there are too few operands, report
8266 the last one. When there are too many, report the first extra
8267 one. This is how diffutils does it.
8268
92a060fd
PE
82692002-10-20 Paul Eggert <eggert@twinsun.com>
8270
8271 Remove K&R vestiges.
8272 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8273 * src/complain.c (VA_START): Remove. Assume prototypes.
8274 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8275 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8276 fatal): Assume prototypes.
8277 * src/complain.h: Assume prototypes.
8278 * src/system.h (PARAMS): Remove.
8279 Include <limits.h> unconditionally, since it's guaranteeed even
8280 for a freestanding C89 compiler.
8281 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8282 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 8283
e7cb57c0
AD
82842002-10-20 Akim Demaille <akim@epita.fr>
8285
8286 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
8287 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
8288 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
8289 (yyresolveStates, yyresolveAction, yyresolveStack)
8290 (yyprocessOneStack): Use them.
8291 (yy_reduce_print): New.
8292 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
8293
0245f82d
AD
82942002-10-20 Akim Demaille <akim@epita.fr>
8295
8296 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
8297 arguments and output `void'.
8298 (b4_c_function): Rename as...
8299 (b4_c_function_def): this.
8300 (b4_c_function_decl, b4_c_ansi_function_def)
8301 (b4_c_ansi_function_decl): New.
8302 Change the interpretation of the arguments: before `int, foo', now
8303 `int foo, foo'.
8304 * data/yacc.c (yyparse): Prototype and define thanks to these.
8305 Adjust b4_c_function_def uses.
8306 * data/glr.c (yyparse): Likewise, but ANSI only.
8307
39912f52
AD
83082002-10-20 Akim Demaille <akim@epita.fr>
8309
8310 * src/output.c (prepare): Move the definition of `tokens_number',
8311 `nterms_number', `undef_token_number', `user_token_number_max'
8312 to...
8313 (prepare_tokens): Here.
8314 (prepare_tokens): Rename as...
8315 (prepare_symbols): this.
8316 (prepare): Move the definition of `rules_number' to...
8317 (prepare_rules): here.
8318 (prepare): Move the definition of `last', `final_state_number',
8319 `states_number' to...
8320 (prepare_states): here.
8321 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
8322
20c1e2ad
AD
83232002-10-20 Akim Demaille <akim@epita.fr>
8324
8325 * src/tables.h, src/tables.c, src/output.c: Comment changes.
8326
21964f43
AD
83272002-10-20 Akim Demaille <akim@epita.fr>
8328
8329 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
8330 * data/c.m4: here.
8331
66d30cd4
AD
83322002-10-20 Akim Demaille <akim@epita.fr>
8333
8334 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
8335 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
8336 `pair'.
8337 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
8338 `name' to...
8339 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
8340 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
8341 These.
8342
95f2c9fe
PE
83432002-10-19 Paul Eggert <eggert@twinsun.com>
8344
8345 Do not create a temporary file, as that involves security and
8346 cleanup headaches. Instead, use a pair of pipes.
8347 Derived from a suggestion by Florian Krohm.
8348 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
8349 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
8350 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
8351 (BISON_PREREQ_SUBPIPE): Add.
8352 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
8353 Add subpipe.h, subpipe.c.
8354 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
8355 * po/POTFILES.in: Add lib/subpipe.c.
8356 * src/output.c: Include "subpipe.h".
8357 (m4_invoke): Remove decl.
8358 (scan_skel): New decl.
8359 (output_skeleton): Use pipe rather than temporary file for m4 input.
8360 Check that m4sugar.m4 is readable, to avoid deadlock.
8361 Check for pipe I/O error.
8362 * src/scan-skel.l (readpipe): Remove decl.
8363 (scan_skel): New function, to be used in place of m4_invoke.
8364 Read from stream rather than file.
66d30cd4 8365
95f2c9fe
PE
8366 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
8367 float, as this generates a warning on Solaris 8 + GCC 3.2 with
8368 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
8369 this generates a more-accurate value anyway.
8370
8371 * lib/timevar.c (timervar_accumulate): Rename locals to
8372 avoid confusion with similarly-named more-global.
8373 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
8374
8375 * src/output.c (prepare): Use xstrdup to convert char const *
8376 to char *, to avoid GCC warning.
8377
c19988b7
AD
83782002-10-19 Akim Demaille <akim@epita.fr>
8379
8380 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
8381 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
8382 Use them to have `calc.y' ready for %pure-parser.
8383 * data/yacc.c (YYLEX): Pass a yylex return type to
8384 b4_c_function_call.
8385
ae7453f2
AD
83862002-10-19 Akim Demaille <akim@epita.fr>
8387
8388 Prototype support of %lex-param and %parse-param.
8389
8390 * src/parse-gram.y: Add the definition of the %lex-param and
8391 %parse-param tokens, plus their rules.
8392 Drop the `_' version of %glr-parser.
8393 Add the "," token.
8394 * src/scan-gram.l (INITIAL): Scan them.
8395 * src/muscle_tab.c: Comment changes.
8396 (muscle_insert, muscle_find): Rename `pair' as `probe'.
8397 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
8398 (muscle_entry_s): The `value' member is no longer const.
8399 Adjust all dependencies.
8400 * src/muscle_tab.c (muscle_init): Adjust: use
8401 MUSCLE_INSERT_STRING.
8402 Initialize the obstack earlier.
8403 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
8404 (muscle_pair_list_grow): New.
8405 * data/c.m4 (b4_c_function_call, b4_c_args): New.
8406 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
8407 * tests/calc.at: Use %locations, not --locations.
8408 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
8409
0e575721
AD
84102002-10-19 Akim Demaille <akim@epita.fr>
8411
8412 * src/getargs.c (usage): Take status as argument and exit
8413 accordingly.
8414 Report the traditional `Try ... --help' message when status != 0.
8415 (usage, version): Don't take a FILE * as arg, it is pointless.
8416 (getargs): When there is an incorrect number of arguments, make it
8417 an error, and report it GNUlically thanks to `usage ()'.
8418
724ce7f5
PE
84192002-10-18 Paul Eggert <eggert@twinsun.com>
8420
3a781eb2
PE
8421 * data/glr.c (yyreportParseError): Don't assume that sprintf
8422 yields the length of the printed string, as this is not true
8423 on SunOS 4.1.4. Reported by Peter Klein.
8424
724ce7f5
PE
8425 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
8426 * tests/conflicts.at (%nonassoc and eof): Likewise.
8427 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
8428
473d0a75
AD
84292002-10-17 Akim Demaille <akim@epita.fr>
8430
8431 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
8432 * src/getargs.c (trace_types, trace_args): Adjust.
8433 * src/reader.c (grammar_current_rule_prec_set)
8434 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
8435 Standardize error messages.
8436 And s/@prec/%prec/!
8437 (reader): Use trace_flag to enable scanner/parser debugging,
8438 instead of an adhoc scheme.
8439 * src/scan-gram.l: Remove trailing debugging code.
8440
e76d2469
PE
84412002-10-16 Paul Eggert <eggert@twinsun.com>
8442
93e2236a
PE
8443 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
8444 MUSCLE_TAB_H.
8445
e76d2469
PE
8446 * NEWS: Officially drop support for building Bison with K&R C,
8447 since it didn't work anyway and it's not worth worrying about.
8448 * Makefile.maint (wget_files): Remove ansi2knr.c.
8449 (ansi2knr.c-url_prefix): Remove.
8450 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
8451 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8452 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8453
5bd1c419
PE
84542002-10-15 Paul Eggert <eggert@twinsun.com>
8455
8456 Stop using the "enum_" trick for K&R-style function definitions;
8457 it confused me, and I was the author! Instead, assume that people
8458 who want to use K&R C compilers (when using these modules in GCC,
8459 perhaps?) will run ansi2knr.
8460
8461 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
8462 All uses of "enum_" changed to "enum ".
8463 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
8464 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 8465
5bd1c419
PE
8466 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
8467 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
8468 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
8469 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
8470 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
8471 abitset_not, abitset_ones, abitset_or, abitset_or_and,
8472 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
8473 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
8474 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
8475 Use function prototypes; this removes the need for declaring
8476 static functions simply to provide their prototypes.
8477 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
8478 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
8479 bitset_count_, bitset_create, bitset_dump, bitset_first,
8480 bitset_free, bitset_init, bitset_last, bitset_next,
8481 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
8482 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
8483 bitset_print, bitset_release_memory, bitset_toggle_,
8484 bitset_type_choose, bitset_type_get, bitset_type_name_get,
8485 debug_bitset): Likewise.
8486 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
8487 * lib/bitset_stats.c (bitset_log_histogram_print,
8488 bitset_percent_histogram_print, bitset_stats_and,
8489 bitset_stats_and_cmp, bitset_stats_and_or,
8490 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
8491 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
8492 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
8493 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
8494 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
8495 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
8496 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
8497 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
8498 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
8499 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
8500 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
8501 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
8502 bitset_stats_zero): Likewise.
8503 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
8504 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
8505 bitsetv_dump, debug_bitsetv): Likewise.
8506 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
8507 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
8508 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
8509 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
8510 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
8511 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
8512 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
8513 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
8514 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
8515 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
8516 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
8517 Likewise.
8518 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
8519 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
8520 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
8521 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
8522 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
8523 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
8524 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
8525 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
8526 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
8527 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
8528 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 8529
ae26e1f0
AD
85302002-10-14 Akim Demaille <akim@epita.fr>
8531
8532 Version 1.75.
8533
d43baf71
AD
85342002-10-14 Akim Demaille <akim@epita.fr>
8535
8536 * tests/Makefile.am (maintainer-check-posix): New.
8537
7ebc83e3
AD
85382002-10-14 Akim Demaille <akim@epita.fr>
8539
8540 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
8541 member.
8542
05846dae
AD
85432002-10-14 Akim Demaille <akim@epita.fr>
8544
8545 * src/tables.c (table_ninf_remap): base -> tab.
8546 Reported by Matt Rosing.
8547
1318e37d
PE
85482002-10-14 Paul Eggert <eggert@twinsun.com>
8549
447fbb17
PE
8550 * tests/action.at, tests/calc.at, tests/conflicts.at,
8551 tests/cxx-type.at, tests/headers.at, tests/input.at,
8552 tests/regression.at, tests/synclines.at, tests/torture.at:
8553 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
8554 so that the tests still work even if POSIXLY_CORRECT is set.
8555 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 8556
1318e37d
PE
8557 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
8558 for portability to K&R hosts. Fix typo: signed char is guaranteed
8559 only to 127, not to 128.
8560 * data/glr.c (yysigned_char): New type.
8561 * data/yacc.c (yysigned_char): Likewise.
8562 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
8563
cc0f0794
PE
85642002-10-13 Paul Eggert <eggert@twinsun.com>
8565
5038f418
PE
8566 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
8567 true due to limited range of data type" warning from GCC.
8568
cc0f0794
PE
8569 * data/c.m4 (b4_token_defines): Protect against double-inclusion
8570 by wrapping enum yytokentype's definition inside #ifndef
8571 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
8572
6fed0802
AD
85732002-10-13 Akim Demaille <akim@epita.fr>
8574
8575 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
8576 Un yy- yyrhs to avoid the name clash with the global YYRHS.
8577
32f0598d
AD
85782002-10-13 Akim Demaille <akim@epita.fr>
8579
8580 * Makefile.maint: Update from Autoconf 2.54.
8581 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
8582
7ea9a33f
AD
85832002-10-13 Akim Demaille <akim@epita.fr>
8584
8585 * src/print.c (print_state): Separate the list of solved conflicts
8586 from the other items.
8587 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
8588
ea99527d
AD
85892002-10-13 Akim Demaille <akim@epita.fr>
8590
8591 Let nondeterministic skeletons be usable with deterministic
8592 tables.
8593
8594 With the patch, GAWK compiled by GCC without -O2 passes its test
8595 suite using a GLR parser driven by LALR tables. It fails with -O2
8596 because `struct stat' gives two different answers on my machine:
8597 88 (definition of an auto var) and later 96 (memset on this var).
8598 Hence the stack is badly corrumpted. The headers inclusion is to
8599 blame: if I move the awk.h inclusion before GLR's system header
8600 inclusion, the two struct stat have the same size.
8601
8602 * src/tables.c (pack_table): Always create conflict_table.
8603 (token_actions): Always create conflict_list.
8604 * data/glr.c (YYFLAG): Remove, unused.
8605
f377f69f
AD
86062002-10-13 Akim Demaille <akim@epita.fr>
8607
8608 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
8609 (O0FLAGS): New.
8610 (VALGRIND, GXX): New.
8611 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
8612 * tests/bison.in: Run $PREBISON a pre-command.
8613 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
8614 (maintainer-check-g++): New.
8615 * Makefile.am (maintainer-check): New.
8616
2a1fe6ed
AD
86172002-10-13 Akim Demaille <akim@epita.fr>
8618
8619 * data/glr.c: Formatting changes.
8620 Tweak some trace messages to match yacc.c's.
8621
f50adbbd
AD
86222002-10-13 Akim Demaille <akim@epita.fr>
8623
8624 GLR parsers sometimes raise parse errors instead of performing the
8625 default reduction.
8626 Reported by Charles-Henry de Boysson.
8627
8628 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 8629 check the length of the traces when %glr.
f50adbbd
AD
8630 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
8631 GLR's traces.
8632 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
8633 Test GLR parsers.
8634 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
8635 (yyltype): Remove the yy prefix from the member names.
8636 (yytable): Complete its comment.
8637 (yygetLRActions): Map error action number from YYTABLE from
8638 YYTABLE_NINF to 0.
8639 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
8640 (which was a bug: it should have been YYTABEL_NINF, and yet it was
8641 not satisfying as we could compare an YYACTION computed from
8642 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
8643 only value for error actions.
8644 (yyreportParseError): In verbose parse error messages, don't issue
8645 `error' in the list of expected tokens.
8646 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
8647 next action to perform to match glr.c's decoding.
8648 (yytable): Complete its comment.
8649
bcbad5b9
PE
86502002-10-13 Paul Eggert <eggert@twinsun.com>
8651
8652 Fix problem reported by Henrik Grubbstroem in
161a71f3 8653 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
8654 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
8655 because the Bison parser reads the second action before reducing
8656 the first one.
8657 * src/scan-gram.l (rule_length): New static var.
8658 Use it to keep track of the rule length in the scanner, since
8659 we can't expect the parser to be in lock-step sync with the scanner.
8660 (handle_action_dollar, handle_action_at): Use this var.
8661 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 8662
14904b89
PE
86632002-10-12 Paul Eggert <eggert@twinsun.com>
8664
1fe611e5
PE
8665 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
8666 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
8667 Include <sys/time.h> when checking for clock_t and struct tms.
8668 Use same include order as source.
8669 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 8670 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 8671
1fe611e5
PE
8672 * lib/timevar.c: Update copyright date and clarify comments.
8673 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 8674
1fe611e5
PE
8675 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
8676 GCC version as of today, then merge Bison's changes.
8677 Change "GCC" to "Bison" in copyright notice. timevar.def's
8678 author is Akim, so change that too.
8679
98194095
PE
8680 * src/reader.c (grammar_current_rule_check):
8681 Don't worry about the default action if $$ is untyped.
8682 Prevents bogus warnings reported by Jim Gifford in
161a71f3 8683 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 8684
14904b89
PE
8685 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
8686 * data/glr.c, data/lalr1.cc, data/yacc.c:
8687 Output token definitions before the first part of user declarations.
8688 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 8689 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 8690
ff6dca18
PE
86912002-10-11 Paul Eggert <eggert@twinsun.com>
8692
8693 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
8694 (yyparse): here. This undoes some of the 2002-07-25 change.
8695 Compatibility problem reported by Ralf S. Engelschall with
8696 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
8697
eb714592
AD
86982002-10-11 Akim Demaille <akim@epita.fr>
8699
8700 * tests/regression.at Characters Escapes): New.
8701 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
8702 characters.
8703 Reported by Jan Nieuwenhuizen.
8704
b7195100
AD
87052002-10-11 Akim Demaille <akim@epita.fr>
8706
8707 * po/id.po: New.
8708
f28a0f2d
PE
87092002-10-10 Paul Eggert <eggert@twinsun.com>
8710
8711 Portability fixes for bitsets; this also avoids several GCC
8712 warnings.
8713
8714 * lib/abitset.c: Include <stddef.h>, for offsetof.
8715 * lib/lbitset.c: Likewise.
8716
8717 * lib/abitset.c (abitset_bytes): Return a size that is aligned
8718 properly for vectors of objects. Do not assume that adding a
8719 header size to a multiple of a word size yields a value that is
8720 properly aligned for the whole union.
8721 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8722
8723 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
8724 unique names for structures.
8725 * lib/ebitset.c (ebitset_bytes): Likewise.
8726 * lib/lbitset.c (lbitset_bytes): Likewise.
8727
8728 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
8729 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
8730 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
8731 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
8732 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
8733 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
8734 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
8735 to improve the type-checking that GCC can do.
8736 * lib/bitset.c (bitset_op4_cmp): Likewise.
8737 * lib/bitset_stats.c (bitset_stats_count,
8738 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
8739 bitset_stats_copy, bitset_stats_disjoint_p,
8740 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
8741 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
8742 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
8743 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
8744 bitset_stats_and_or_cmp, bitset_stats_andn_or,
8745 bitset_stats_andn_or_cmp, bitset_stats_or_and,
8746 bitset_stats_or_and_cmp): Likewise.
8747 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
8748 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
8749 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
8750 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
8751
8752 * lib/abitset.h: Include bitset.h, not bbitset.h.
8753 * lib/ebitset.h: Likewise.
8754 * lib/lbitset.h: Likewise.
8755
8756 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
8757 All instances of parameters of type enum bitset_opts are now of
8758 type enum_bitset_opts, to conform to the C Standard, and similarly
8759 for enum_bitset_type.
8760 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
8761 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
8762
8763 Do not use "struct bitset_struct" to mean different things in
8764 different modules. Not only is this confusing, it violates
8765 the C Standard, which requires that structure types in different
8766 modules must be compatible if one is to be passed to the other.
8767 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
8768 All instances of "struct bitset_struct *" replaced with "bitset".
8769 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
8770 (union bitset_union, struct abitset_struct, struct ebitset_struct,
8771 struct lbitset_struct, struct bitset_stats_struct): New types.
8772 All uses of struct bitset_struct changed to union bitset_union,
8773 etc.
ba0fe3c7 8774 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
8775 struct bitset_struct): Remove.
8776 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
8777 struct bitset_struct): Remove.
8778 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
8779 bitset_struct): Remove.
8780 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
8781 Likewise.
8782
8783 Do not call a function of type T using a call that assumes the
8784 function is of a different type U. Standard C requires that a
8785 function must be called with a type that is compatible with its
8786 definition.
8787 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
8788 New decls.
8789 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
8790 New functions.
8791 * lib/ebitset.c (PFV): Remove.
8792 * lib/lbitset.c (PFV): Likewise.
8793 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
8794 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
8795 decls.
8796 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
8797 (ebitset_vtable): Use them.
8798 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
8799 lbitset_xor): New functions.
8800 (lbitset_vtable): Use them.
8801
8802 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
8803 Declare.
8804
8805 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
8806 GCC warning.
8807 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
8808 Use offsetof, for simplicity.
8809
6fbe4984
PE
88102002-10-06 Paul Eggert <eggert@twinsun.com>
8811
8812 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
8813 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 8814 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
8815 which was inadvertently undone by the 2002-09-30 patch.
8816 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
8817 the same width as int.
8818
420f93c8
PE
88192002-10-04 Paul Eggert <eggert@twinsun.com>
8820
8821 Version 1.50.
8822
8823 * configure.ac (AC_INIT), NEWS: Increment version number.
8824
8825 * doc/bison.texinfo: Minor spelling, grammar, and white space
8826 fixes.
8827 (Symbols): Mention that any negative value returned from yylex
8828 signifies end-of-input. Warn about negative chars. Mention
8829 the portable Standard C character set.
8830
8831 The GNU coding standard says CFLAGS and YFLAGS are reserved
8832 for the installer to set.
8833 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
8834 * src/Makefile.am (AM_CFLAGS): Likewise.
8835 (AM_YFLAGS): Renamed from YFLAGS.
8836
8837 Fix some MAX and MIN problems.
8838 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
8839 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
8840 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
8841 * src/reader.c (reader): Use it.
8842
8843 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
8844 POSIX 1003.1-2001 has removed fgrep.
8845
88462002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
8847
8848 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
8849 interpreted as signed.
8850 * lib/ebitset.c (ebitset_list): Fix bug.
8851
ff68026d
PE
88522002-10-01 Paul Eggert <eggert@twinsun.com>
8853
8854 More fixes for 64-bit hosts and large bitsets.
8855
8856 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
8857 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
8858 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
8859 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
8860 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
8861 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
8862 bitset_count_): Likewise.
8863 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
8864 bitset_first, bitset_last): Likewise.
8865 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
8866 bitset_stats_list_reverse, bitset_stats_size,
8867 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
8868 Likewise.
8869 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8870 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
8871 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
8872 bitsetv_reflexive_transitive_closure): Likewise.
8873 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
8874 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
8875 Likewise.
8876 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
8877 Likewise.
420f93c8 8878
ff68026d
PE
8879 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
8880 Use size_t, not unsigned int, to count bytes.
8881 * lib/abitset.h (abitset_bytes): Likewise.
8882 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
8883 Likewise.
8884 * lib/bitset.h (bitset_bytes): Likewise.
8885 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
8886 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
8887 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8888 * lib/ebitset.c (ebitset_bytes): Likewise.
8889 * lib/ebitset.h (ebitset_bytes): Likewise.
8890 * lib/lbitset.c (lbitset_bytes): Likewise.
8891 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 8892
ff68026d
PE
8893 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
8894 abitset_subset_p, abitset_disjoint_p, abitset_and,
8895 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
8896 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
8897 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
8898 abitset_or_and, abitset_or_and_cmp):
8899 Use bitset_windex instead of unsigned int.
8900 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
8901 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
8902 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
8903 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
8904 Likewise.
8905 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 8906
ff68026d
PE
8907 * lib/bitset.c (bitset_print):
8908 Use proper printf formats for widths of integer types.
8909 * lib/bitset_stats.c (bitset_percent_histogram_print,
8910 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
8911 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8912 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
8913 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 8914
ff68026d
PE
8915 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
8916 BITSET_SIZE_MAX): New macros.
8917 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
8918 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
8919 to BITSET_WINDEX_MAX.
8920
8921 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
8922 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
8923 since we now return the bitset_bindex type (not int).
8924
8925 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
8926 when computing sizes.
8927 * lib/ebitset.c (ebitset_elts_grow): Likewise.
8928
8929 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
8930 and avoid cast to unsigned.
8931
6aa452a6
AD
89322002-09-30 Akim Demaille <akim@epita.fr>
8933
8934 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8935 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
8936 Updates from Michael Hayes.
8937
927f7817
AD
89382002-09-30 Art Haas <ahaas@neosoft.com>
8939
8940 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
8941 invocations.
8942 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
8943 defined.
8944
9738f41e
AD
89452002-09-27 Akim Demaille <akim@epita.fr>
8946
8947 Version 1.49c.
8948
a5c75d7f
AD
89492002-09-27 Akim Demaille <akim@epita.fr>
8950
8951 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
8952 (Because of AC_LIBSOURCE).
8953
8280e179
AD
89542002-09-27 Akim Demaille <akim@epita.fr>
8955
8956 Playing with Autoscan.
8957
8958 * configure.ac: Remove the old LIBOBJ tweaks.
8959 (AC_REPLACE_FUNCS): Add strrchr and strtol.
8960 * lib/strrchr.c: New.
8961 * lib/strtol.c: New, from the Coreutils 4.5.1.
8962
ae64af35
AD
89632002-09-27 Akim Demaille <akim@epita.fr>
8964
8965 Playing with Autoscan.
8966
8967 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
8968 * lib/Makefile.am (libbison_a_SOURCES): No longer include
8969 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
8970 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
8971 Coreutils 4.5.1.
8972
d1a1114f
AD
89732002-09-24 Akim Demaille <akim@epita.fr>
8974
8975 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
8976 (Frequently Asked Questions, Parser Stack Overflow): New.
8977
b906441c
AD
89782002-09-13 Akim Demaille <akim@epita.fr>
8979
8980 Playing with autoscan.
8981
8982 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
8983 * src/files.c (skeleton_find): Remove, unused.
8984 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
8985 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
8986
bd701811
AD
89872002-09-13 Akim Demaille <akim@epita.fr>
8988
8989 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
8990 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
8991
e0a13e7b
AD
89922002-09-13 Akim Demaille <akim@epita.fr>
8993
8994 * configure.ac: Require 2.54.
8995 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
8996 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
8997 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
8998 Remove, provided by Autoconf macros.
8999
c97011bf
AD
90002002-09-12 Akim Demaille <akim@epita.fr>
9001
9002 * m4/prereq.m4: Update, from Coreutils 4.5.1.
9003
d862b1be
AD
90042002-09-12 Akim Demaille <akim@epita.fr>
9005
9006 * m4/prereq.m4: Update, from Fileutils 4.1.5.
9007 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
9008 Reported by Martin Mokrejs.
9009
3d38c03a
AD
90102002-09-10 Akim Demaille <akim@epita.fr>
9011
9012 * src/parse-gram.y: Associate a human readable string to each
9013 token type.
9014 * tests/regression.at (Invalid inputs): Adjust.
9015
b6347355
AD
90162002-09-10 Gary V. Vaughan <gary@gnu.org>
9017
9018 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
9019 with an Autoconf-2.5x style configure.ac.
9020
09ba4ab2
PE
90212002-09-06 Paul Eggert <eggert@twinsun.com>
9022
9023 * doc/bison.texinfo (Conditions): Make explicit that the GPL
9024 exception applies only to yacc.c. This is a modification of a
9025 patch originally suggested by Akim Demaille.
9026
21846f69
AD
90272002-09-06 Akim Demaille <akim@epita.fr>
9028
09ba4ab2
PE
9029 * data/c.m4 (b4_copyright): Move the GPL exception comment from
9030 here to...
9031 * data/yacc.c: here.
9032
21846f69
AD
9033 * data/lalr1.cc (struct yyltype): Don't define it, since we use
9034 LocationType.
9035 (b4_ltype): Default to yy::Location from location.hh.
9036
c0ad8bf3
AD
90372002-09-04 Jim Meyering <jim@meyering.net>
9038
9039 * data/yacc.c: Guard the declaration of yytoknum also with
9040 `#ifdef YYPRINT', so it is declared only when used.
9041
3a93251e
AD
90422002-09-04 Akim Demaille <akim@epita.fr>
9043
9044 * configure.in: Rename as...
9045 * configure.ac: this.
9046 Bump to 1.49c.
9047
427c0dda
AD
90482002-09-04 Akim Demaille <akim@epita.fr>
9049
9050 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
9051 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
9052 translate maintainer only messages.
9053
6a254321
PE
90542002-08-12 Paul Eggert <eggert@twinsun.com>
9055
645e30d1
PE
9056 Version 1.49b.
9057
6a254321
PE
9058 * Makefile.am (SUBDIRS): Remove intl.
9059 (DISTCLEANFILES): Remove.
9060 * NEWS: Mention that GNU M4 is now required. Clarify what is
9061 meant by "larger grammars". Mention the pt_BR translation.
9062 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
9063 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
9064 Bump version from 0.11.2 to 0.11.5.
9065 (BISON_PREREQ_STAGE): Remove.
9066 (AM_GNU_GETTEXT): Use external gettext.
9067 (AC_OUTPUT): Remove intl/Makefile.
9068
9069 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
9070
9071 * data/glr.c: Include string.h, for strlen.
9072 (yyreportParseError): Use size_t for yysize.
9073 (yy_yypstack): No longer nested inside yypstates, as nested
9074 functions are not portable. Do not assume size_t is the
9075 same width as int.
9076 (yypstates): Do not assume that ptrdiff_t is the same width
9077 as int, and similarly for yyposn and YYINDEX.
9078
9079 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
9080
9081 * lib/Makefile.am (INCLUDES): Do not include from the intl
9082 directory, which has been removed.
9083 * src/Makefile.am (INCLUDES): Likewise.
9084
9085 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
9086 (bitsets_sources, additional_bitsets_sources, timevars_sources):
9087 New vars.
9088
9089 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
9090 * tests/Makefile.am (EXTRA_DIST): Likewise.
9091
9092 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
9093 Do not assume that bitset_windex is the same width as unsigned.
9094
9095 * lib/abitset.c (abitset_unused_clear): Do not assume that
9096 bitset_word is the same width as int.
9097 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
9098 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
9099 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
9100 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
9101 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
9102
9103 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
9104 portability to one's complement hosts!).
9105 * lib/ebitset.c (ebitset_op1): Likewise.
9106 * lib/lbitset.c (lbitset_op1): Likewise.
9107
9108 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
9109 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
9110 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
9111 Sync with fileutils.
9112 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9113 lib/gettext.h: Sync with diffutils.
9114
9115 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
9116 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
9117
9118 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
9119 PROTOTYPES to check for prototypes, and "defined __STDC__" to
9120 check for void *.
9121
9122 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
9123 size_t; the old version tried to do this but casted improperly.
9124 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
9125 (bitset_test): Now returns int, not unsigned long.
9126
9127 * lib/bitset_stats.c: Include "gettext.h".
9128 (_): New macro.
9129 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
9130 name locals "index", as it generates unnecessary warnings on some
9131 hosts that have an "index" function.
9132
9133 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
9134 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
9135 they need translation.
9136 * src/LR0.c (state_list_append, new_itemsets, get_state,
9137 append_states, generate_states): Likewise.
9138 * src/assoc.c (assoc_to_string): Likewise.
9139 * src/closure.c (print_closure, set_firsts, closure): Likewise.
9140 * src/gram.c (grammar_dump): Likewise.
9141 * src/injections.c (injections_compute): Likewise.
9142 * src/lalr.c (lookaheads_print): Likewise.
9143 * src/relation.c (relation_transpose): Likewise.
9144 * src/scan-gram.l: Likewise.
9145 * src/tables.c (table_grow, pack_vector): Likewise.
9146
9147 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
9148 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
9149 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
9150 * m4/mbstate_t.m4: Sync with fileutils.
9151 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
9152
9153 * po/LINGUAS: Add pt_BR.
9154 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
9155 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
9156 lib/timevar.c.
9157 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
9158 manual recommends.
9159 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9160
9161 * src/complain.c (strerror_r): Remove decl; not needed.
9162 (strerror): Use same pattern as ../lib/error.c.
9163
9164 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9165
9166 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9167
9168 * src/main.c (main): Cast result of bindtextdomain and textdomain
9169 to void, to avoid a GCC warning when --disable-nls is in effect.
9170
9171 * src/scan-gram.l: Use strings rather than escapes when possible,
9172 to minimize the number of warnings from xgettext.
9173 (handle_action_dollar, handle_action_at): Don't use isdigit,
9174 as it mishandles negative chars and it may not work as expected
9175 outside the C locale.
9176
9177 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
9178 this is a GCC extension and is not portable to other compilers.
9179
9180 * src/system.h (alloca): Use same pattern as ../lib/error.c.
9181 Do not include <ctype.h>; no longer needed.
9182 Do not include <malloc.h>; no longer needed (and generates
9183 warnings on OpenBSD 3.0).
9184
9185 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9186 it's not portable.
9187
9188 * tests/regression.at: Do not use 'cc -c input.c -o input';
9189 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
9190
9191 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
9192 exit status as failure, not just exit status 1. Sun C exits
9193 with status 2 sometimes.
9194
9195 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9196 Use it for the two large tests.
9197
c8f002c7
AD
91982002-08-02 Akim Demaille <akim@epita.fr>
9199
9200 * src/conflicts.c (conflicts_output): Don't output rules never
9201 reduced here, since anyway that computation doesn't work.
9202 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
9203 (rule_useless_p, rule_never_reduced_p): New.
9204 (grammar_rules_partial_print): Use a filter instead of a range.
9205 Display the title only if needed.
9206 (grammar_rules_print): Adjust.
9207 (grammar_rules_never_reduced_report): New.
9208 * src/tables.c (action_row): Move the computation of rules never
9209 reduced to...
9210 (token_actions): here.
9211 * src/main.c (main): Make the parser before making the report, so
9212 that rules never reduced are computed.
9213 Call grammar_rules_never_reduced_report.
9214 * src/print.c (print_results): Report rules never reduced.
9215 * tests/conflicts.at, tests/reduce.at: Adjust.
9216
cd08e51e
AD
92172002-08-01 Akim Demaille <akim@epita.fr>
9218
9219 Instead of attaching lookaheads and duplicating the rules being
9220 reduced by a state, attach the lookaheads to the reductions.
9221
9222 * src/state.h (state_t): Remove the `lookaheads',
9223 `lookaheads_rule' member.
9224 (reductions_t): Add a `lookaheads' member.
9225 Use a regular array for the `rules'.
9226 * src/state.c (reductions_new): Initialize the lookaheads member
9227 to 0.
9228 (state_rule_lookaheads_print): Adjust.
9229 * src/state.h, src/state.c (state_reductions_find): New.
9230 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
9231 (count_rr_conflicts): Adjust.
9232 * src/lalr.c (LArule): Remove.
9233 (add_lookback_edge): Adjust.
9234 (state_lookaheads_count): New.
9235 (states_lookaheads_initialize): Merge into...
9236 (initialize_LA): this.
9237 (lalr_free): Adjust.
9238 * src/main.c (main): Don't free nullable and derives too early: it
9239 is used by --verbose.
9240 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
9241
bb0027a9
AD
92422002-08-01 Akim Demaille <akim@epita.fr>
9243
9244 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9245 `rule_number_t**'.
9246 (set_derives, free_derives): Rename as...
9247 (derives_compute, derives_free): this.
9248 Adjust all dependencies.
9249 * src/nullable.c (set_nullable, free_nullable): Rename as...
9250 (nullable_compute, nullable_free): these.
9251 (rule_list_t): Store rule_t *, not rule_number_t.
9252 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9253 pointers, instead of their numbers.
9254 * src/main.c (main): Call nullable_free, and derives_free earlier,
9255 as they were lo longer used.
9256
3325ddc4
AD
92572002-08-01 Akim Demaille <akim@epita.fr>
9258
9259 * lib/timevar.c (get_time): Include children time.
9260 * src/lalr.h (LA, LArule): Don't export them: used with the
9261 state_t.
9262 * src/lalr.c (LA, LArule): Static.
9263 * src/lalr.h, src/lalr.c (lalr_free): New.
9264 * src/main.c (main): Call it.
9265 * src/tables.c (pack_vector): Check whether loc is >= to the
9266 table_size, not >.
9267 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9268 (tables_generate): do it, since that's also it which allocates
9269 them.
9270 Don't free LA and LArule, main does.
9271
c6f1a33c
AD
92722002-07-31 Akim Demaille <akim@epita.fr>
9273
9274 Separate parser tables computation and output.
9275
9276 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9277 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9278 (yydefgoto, yydefact, high): Move to...
9279 * src/tables.h, src/tables.c: here.
9280 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9281 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9282 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9283 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
9284 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
9285 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
9286 (action_row, save_row, token_actions, save_column, default_goto)
9287 (goto_actions, sort_actions, matching_state, pack_vector)
9288 (table_ninf_remap, pack_table, prepare_actions): Move to...
9289 * src/tables.c: here.
9290 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
9291 * src/output.c (token_actions, output_base, output_conflicts)
9292 (output_check): Merge into...
9293 (prepare_actions): this.
9294 (actions_output): Rename as...
9295 (user_actions_output): this.
9296 * src/main.c (main): Call tables_generate and tables_free.
9297
1509d42f
AD
92982002-07-31 Akim Demaille <akim@epita.fr>
9299
9300 Steal GCC's --time-report support.
9301
9302 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
9303 stolen/adjusted from GCC.
9304 * m4/stage.m4: Remove time related checks.
9305 * m4/timevar.m4: New.
9306 * configure.in: Adjust.
9307 * src/system.h: Adjust to using timevar.h.
9308 * src/getargs.h, src/getargs.c: Support trace_time for
9309 --trace=time.
9310 * src/main.c (stage): Remove.
9311 (main): Replace `stage' invocations with timevar calls.
9312 * src/output.c: Insert pertinent timevar calls.
9313
273a74fa
AD
93142002-07-31 Akim Demaille <akim@epita.fr>
9315
9316 Let --trace have arguments.
9317
9318 * src/getargs.h (enum trace_e): New.
9319 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
9320 (long_options, short_options): --trace/-T takes an optional
9321 argument.
9322 Change all the uses of trace_flag to reflect the new flags.
9323 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
9324
9325 Strengthen `stage' portability.
9326
9327 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
9328 * configure.in: Use it.
9329 Don't check for malloc.h and sys/times.h.
9330 * src/system.h: Include them when appropriate.
9331 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
9332 times and struct tms are available.
9333
217598da
AD
93342002-07-30 Akim Demaille <akim@epita.fr>
9335
9336 In verbose parse error message, don't report `error' as an
9337 expected token.
9338 * tests/actions.at (Printers and Destructors): Adjust.
9339 * tests/calc.at (Calculator $1): Adjust.
9340 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
9341 error message, do not report the parser accepts the error token in
9342 that state.
9343
52489d44
AD
93442002-07-30 Akim Demaille <akim@epita.fr>
9345
9346 Normalize conflict related messages.
9347
9348 * src/complain.h, src/complain.c (warn, complain): New.
9349 * src/conflicts.c (conflicts_print): Use them.
9350 (conflict_report_yacc): New, extracted from...
9351 (conflicts_print): here.
9352 * tests/conflicts.at, tests/existing.at: Adjust.
9353
e8832397
AD
93542002-07-30 Akim Demaille <akim@epita.fr>
9355
9356 Report rules which are never reduced by the parser: those hidden
9357 by conflicts.
9358
9359 * src/LR0.c (save_reductions): Don't make the final state too
9360 different: save its reduction (accept) instead of having a state
9361 without any action (no shift or goto, no reduce).
9362 Note: the final state is now a ``regular'' state, i.e., the
9363 parsers now contain `reduce 0' as default reduction.
9364 Nevertheless, since they decide to `accept' when yystate =
9365 final_state, they still will not reduce rule 0.
9366 * src/print.c (print_actions, print_reduction): Adjust.
9367 * src/output.c (action_row): Track reduced rules.
9368 (token_actions): Report rules never reduced.
9369 * tests/conflicts.at, tests/regression.at: Adjust.
9370
caf23d24
AD
93712002-07-30 Akim Demaille <akim@epita.fr>
9372
9373 `stage' was accidently included in a previous patch.
9374 Initiate its autoconfiscation.
9375
9376 * configure.in: Look for malloc.h and sys/times.h.
9377 * src/main.c (stage): Adjust.
9378 Report only when trace_flag.
9379
640748ee
AD
93802002-07-29 Akim Demaille <akim@epita.fr>
9381
9382 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
9383 state_number_t.
9384 (errs_t): symbol_t*, not symbol_number_t.
9385 (reductions_t): rule_t*, not rule_number_t.
9386 (FOR_EACH_SHIFT): New.
9387 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
9388 * src/print.c, src/print_graph.c: Adjust.
9389
88bce5a2
AD
93902002-07-29 Akim Demaille <akim@epita.fr>
9391
9392 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
9393
9394 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
9395 (endtoken, accept): these.
9396 * src/reader.c (reader): Set endtoken's default tag to "$end".
9397 Set undeftoken's tag to "$undefined" instead of "$undefined.".
9398 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
9399 Adjust.
9400
1bfb97db
AD
94012002-07-29 Akim Demaille <akim@epita.fr>
9402
9403 * src/reduce.c (reduce_grammar): When the language is empty,
9404 complain about the start symbol, not the axiom.
9405 Use its location.
9406 * tests/reduce.at (Empty Language): New.
9407
fc5734fe
AD
94082002-07-26 Akim Demaille <akim@epita.fr>
9409
9410 * src/reader.h, src/reader.c (gram_error): ... can't get
9411 yycontrol without making too strong assumptions on the parser
9412 itself.
9413 * src/output.c (prepare_tokens): Use the real 0th value of
9414 token_translations instead of `0'.
9415 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
9416 visible here.
9417 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
9418 for the time being: %locations ought to provide it to yyerror.
9419
3650b4b8
AD
94202002-07-25 Akim Demaille <akim@epita.fr>
9421
9422 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
9423 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
9424 * tests/regression.at (Web2c Actions): Adjust.
9425
4b3d3a8e
AD
94262002-07-25 Akim Demaille <akim@epita.fr>
9427
9428 Stop storing rules from 1 to nrules + 1.
9429
9430 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
9431 * src/nullable.c, src/output.c, src/print.c, src/reader.c
9432 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
9433 Iterate from 0 to nrules.
9434 Use rule_number_as_item_number and item_number_as_rule_number.
9435 Adjust to `derive' now containing possibly 0.
9436 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
9437 Handle the `- 1' part in rule numbers from/to item numbers.
9438 * src/conflicts.c (log_resolution): Fix the message which reversed
9439 shift and reduce.
9440 * src/output.c (action_row): Initialize default_rule to -1.
9441 (token_actions): Adjust.
9442 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
9443 expected output.
9444 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
9445
4a2a22f4
AD
94462002-07-25 Akim Demaille <akim@epita.fr>
9447
9448 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
9449 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
9450 (b4_c_knr_arg_decl): New.
9451 * data/yacc.c: Use it to define yysymprint, yydestruct, and
9452 yyreport_parse_error.
9453
b8df3223
AD
94542002-07-25 Akim Demaille <akim@epita.fr>
9455
9456 * data/yacc.c (yyreport_parse_error): New, extracted from...
9457 (yyparse): here.
9458 (yydestruct, yysymprint): Move above yyparse.
9459 Be K&R compliant.
9460
a762e609
AD
94612002-07-25 Akim Demaille <akim@epita.fr>
9462
9463 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
9464 replace...
9465 (b4_sint_type, b4_uint_type): these.
9466 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
9467 * tests/regression.at (Web2c Actions): Adjust.
9468
12b0043a
AD
94692002-07-25 Akim Demaille <akim@epita.fr>
9470
9471 * src/gram.h (TIEM_NUMBER_MAX): New.
9472 (item_number_of_rule_number, rule_number_of_item_number): Rename
9473 as...
9474 (rule_number_as_item_number, item_number_as_rule_number): these.
9475 Adjust dependencies.
9476 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9477 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9478 (symbol_number_to_vector_number): New.
9479 (order): Of vector_number_t* type.
9480 (base_t, BASE_MAX, BASE_MIN): New.
9481 (froms, tos, width, pos, check): Of base_t type.
9482 (action_number_t, ACTION_MIN, ACTION_MAX): New.
9483 (actrow): Of action_number_t type.
9484 (conflrow): Of unsigned int type.
9485 (table_ninf, base_ninf): New.
9486 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
9487 (muscle_insert_int_table, muscle_insert_base_table)
9488 (muscle_insert_rule_number_table): New.
9489 (prepare_tokens): Output `toknum' as int_table.
9490 (action_row): Returns a rule_number_t.
9491 Use ACTION_MIN, not SHRT_MIN.
9492 (token_actions): yydefact is rule_number_t*.
9493 (table_ninf_remap): New.
9494 (pack_table): Use it for `base' and `table'.
9495 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
9496 replaced with...
9497 (YYPACT_NINF, YYTABLE_NINF): these.
9498 (yypact, yytable): Compute their types instead of hard-coded
9499 `short'.
9500 * tests/regression.at (Web2c Actions): Adjust.
9501
5dde258a
AD
95022002-07-19 Akim Demaille <akim@epita.fr>
9503
9504 * src/scan-gram.l (id): Can start with an underscore.
9505
a945ec39
AD
95062002-07-16 Akim Demaille <akim@epita.fr>
9507
9508 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
9509 Adjust all former `associativity' dependencies.
9510 * src/symtab.c (symbol_new): Default associativity is `undef', not
9511 `right'.
9512 (symbol_check_alias_consistence): Adjust.
9513
fae437e8
AD
95142002-07-09 Akim Demaille <akim@epita.fr>
9515
9516 * doc/bison.texinfo: Properly set the ``header'' part.
9517 Use @dircategory ``GNU programming tools'' as per Texinfo's
9518 documentation.
9519 Use @copying.
9520
1a715ef2
AD
95212002-07-09 Akim Demaille <akim@epita.fr>
9522
9523 * lib/quotearg.h: Protect against multiple inclusions.
9524 * src/location.h (location_t): Add a `file' member.
9525 (LOCATION_RESET, LOCATION_PRINT): Adjust.
9526 * src/complain.c (warn_at, complain_at, fatal_at): Drop
9527 `error_one_per_line' support.
9528
a5d50994
AD
95292002-07-09 Akim Demaille <akim@epita.fr>
9530
9531 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
9532 * src/reader.c (lineno): Remove.
9533 Adjust all dependencies.
9534 (get_merge_function): Take a location and use complain_at.
9535 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
9536 * tests/regression.at (Invalid inputs, Mixing %token styles):
9537 Adjust.
9538
b275314e
AD
95392002-07-09 Akim Demaille <akim@epita.fr>
9540
9541 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
9542 recovery rule, and forbid extensions when --yacc.
9543 (gram_error): Use complain_at.
9544 * src/reader.c (reader): Exit if there were parse errors.
9545
865b9df1
AD
95462002-07-09 Akim Demaille <akim@epita.fr>
9547
9548 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
9549 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
9550 Reported by R Blake <blakers@mac.com>.
9551
c76e14da
AD
95522002-07-09 Akim Demaille <akim@epita.fr>
9553
9554 * data/yacc.c: Output the copyright notive in the header.
9555
7db2ed2d
AD
95562002-07-03 Akim Demaille <akim@epita.fr>
9557
9558 * src/output.c (froms, tos): Are state_number_t.
9559 (save_column): sp, sp1, and sp2 are state_number_t.
9560 (prepare): Rename `final' as `final_state_number', `nnts' as
9561 `nterms_number', `nrules' as `rules_number', `nstates' as
9562 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
9563 unused.
9564 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
9565 * data/lalr1.cc (nsym_): Remove, unused.
9566
e68e0410
AD
95672002-07-03 Akim Demaille <akim@epita.fr>
9568
9569 * src/lalr.h, src/lalr.c (goto_number_t): New.
9570 * src/lalr.c (goto_list_t): New.
9571 Propagate them.
9572 * src/nullable.c (rule_list_t): New.
9573 Propagate.
9574 * src/types.h: Remove.
9575
e1a4f3a4
AD
95762002-07-03 Akim Demaille <akim@epita.fr>
9577
9578 * src/closure.c (print_fderives): Use rule_rhs_print.
9579 * src/derives.c (print_derives): Use rule_rhs_print.
9580 (rule_list_t): New, replaces `shorts'.
9581 (set_derives): Add comments.
9582 * tests/sets.at (Nullable, Firsts): Adjust.
9583
536545f3
AD
95842002-07-03 Akim Demaille <akim@epita.fr>
9585
9586 * src/output.c (prepare_actions): Free `tally' and `width'.
9587 (prepare_actions): Allocate and free `order'.
9588 * src/symtab.c (symbols_free): Free `symbols'.
9589 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
9590 * src/output.c (m4_invoke): Move to...
9591 * src/scan-skel.l: here.
9592 (<<EOF>>): Close yyout, and free its name.
9593
8b752b00
AD
95942002-07-03 Akim Demaille <akim@epita.fr>
9595
9596 Fix some memory leaks, and fix a bug: state 0 was examined twice.
9597
9598 * src/LR0.c (new_state): Merge into...
9599 (state_list_append): this.
9600 (new_states): Merge into...
9601 (generate_states): here.
9602 (set_states): Don't ensure a proper `errs' state member here, do it...
9603 * src/conflicts.c (conflicts_solve): here.
9604 * src/state.h, src/state.c: Comment changes.
9605 (state_t): Rename member `shifts' as `transitions'.
9606 Adjust all dependencies.
9607 (errs_new): For consistency, also take the values as argument.
9608 (errs_dup): Remove.
9609 (state_errs_set): New.
9610 (state_reductions_set, state_transitions_set): Assert that no
9611 previous value was assigned.
9612 (state_free): New.
9613 (states_free): Use it.
9614 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
9615 temporary storage: use `errs' and `nerrs' as elsewhere.
9616 (set_conflicts): Allocate and free this `errs'.
9617
613f5e1a
AD
96182002-07-02 Akim Demaille <akim@epita.fr>
9619
9620 * lib/libiberty.h: New.
9621 * lib: Update the bitset implementation from upstream.
9622 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
9623 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
9624 * src/main.c: Adjust bitset stats calls.
9625
26e0cadc
PE
96262002-07-01 Paul Eggert <eggert@twinsun.com>
9627
9628 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
9629 char, so that negative chars don't collide with $.
9630
1154cced
AD
96312002-06-30 Akim Demaille <akim@epita.fr>
9632
9633 Have the GLR tests be `warning' checked, and fix the warnings.
9634
9635 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
9636 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
9637 (yyremoveDeletes): `yyi' and `yyj' are size_t.
9638 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
9639 (yyaddDeferredAction): static.
9640 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
9641 (yyreportParseError): yyprefix is const.
9642 yytokenp is used only when verbose.
9643 (yy__GNUC__): Replace with __GNUC__.
9644 (yypdumpstack): yyi is size_t.
9645 (yypreference): Un-yy local variables and arguments, to avoid
9646 clashes with `yyr1'. Anyway, we are not in the user name space.
9647 (yytname_size): be an int, as is compared with ints.
9648 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
9649 Use them.
9650 * tests/cxx-gram.at: Use quotation to protect $1.
9651 Use AT_COMPILE to enable warnings hunts.
9652 Prototype yylex and yyerror.
9653 `Use' argc.
9654 Include `string.h', not `strings.h'.
9655 Produce and prototype stmtMerge only when used.
9656 yylex takes a location.
9657
97650f4e
AD
96582002-06-30 Akim Demaille <akim@epita.fr>
9659
9660 We spend a lot of time in quotearg, in particular when --verbose.
9661
9662 * src/symtab.c (symbol_get): Store a quoted version of the key.
9663 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
9664 Adjust all callers.
9665
d2576365
AD
96662002-06-30 Akim Demaille <akim@epita.fr>
9667
9668 * src/state.h (reductions_t): Rename member `nreds' as num.
9669 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
9670 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
9671
ccaf65bc
AD
96722002-06-30 Akim Demaille <akim@epita.fr>
9673
9674 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
9675 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
9676 (shifts_to): Rename as...
9677 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
9678 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
9679 (TRANSITION_IS_DISABLED, transitions_to): these.
9680
87675353
AD
96812002-06-30 Akim Demaille <akim@epita.fr>
9682
9683 * src/print.c (print_shifts, print_gotos): Merge into...
9684 (print_transitions): this.
9685 (print_transitions, print_errs, print_reductions): Align the
9686 lookaheads columns.
9687 (print_core, print_transitions, print_errs, print_state,
9688 print_grammar): Output empty lines separator before, not after.
9689 (state_default_rule_compute): Rename as...
9690 (state_default_rule): this.
9691 * tests/conflicts.at (Defaulted Conflicted Reduction),
9692 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
9693 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
9694
ce4ccb4b
AD
96952002-06-30 Akim Demaille <akim@epita.fr>
9696
9697 Display items as we display rules.
9698
9699 * src/gram.h, src/gram.c (rule_lhs_print): New.
9700 * src/gram.c (grammar_rules_partial_print): Use it.
9701 * src/print.c (print_core): Likewise.
9702 * tests/conflicts.at (Defaulted Conflicted Reduction),
9703 (Unresolved SR Conflicts): Adjust.
9704 (Unresolved SR Conflicts): Adjust and rename as...
9705 (Resolved SR Conflicts): this, as was meant.
9706 * tests/regression.at (Web2c Report): Adjust.
9707
bc933ef1
AD
97082002-06-30 Akim Demaille <akim@epita.fr>
9709
9710 * src/print.c (state_default_rule_compute): New, extracted from...
9711 (print_reductions): here.
9712 Pessimize, but clarify the code.
9713 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
9714
53d4308d
AD
97152002-06-30 Akim Demaille <akim@epita.fr>
9716
9717 * src/output.c (action_row): Let default_rule be always a rule
9718 number.
9719
574fb2d5
AD
97202002-06-30 Akim Demaille <akim@epita.fr>
9721
9722 * src/closure.c (print_firsts, print_fderives, closure):
9723 Use BITSET_EXECUTE.
9724 * src/lalr.c (lookaheads_print): Likewise.
9725 * src/state.c (state_rule_lookaheads_print): Likewise.
9726 * src/print_graph.c (print_core): Likewise.
9727 * src/print.c (print_reductions): Likewise.
9728 * src/output.c (action_row): Likewise.
9729 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
9730
05811fd7
AD
97312002-06-30 Akim Demaille <akim@epita.fr>
9732
9733 * src/print_graph.c: Use report_flag.
9734
0e4d5753
AD
97352002-06-30 Akim Demaille <akim@epita.fr>
9736
9737 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
9738 to...
9739 * src/relation.h, src/relation.c (traverse, relation_digraph)
9740 (relation_print, relation_transpose): New.
9741
24c7d800
AD
97422002-06-30 Akim Demaille <akim@epita.fr>
9743
9744 * src/state.h, src/state.c (shifts_to): New.
9745 * src/lalr.c (build_relations): Use it.
9746
9222837b
AD
97472002-06-30 Akim Demaille <akim@epita.fr>
9748
9749 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
9750 (item_number_of_rule_number, rule_number_of_item_number): New.
9751 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
9752 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
9753 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
9754 Propagate their use.
9755 Much remains to be done, in particular wrt `shorts' from types.h.
9756
260008e5
AD
97572002-06-30 Akim Demaille <akim@epita.fr>
9758
9759 * src/symtab.c (symbol_new): Initialize the `printer' member.
9760
8a731ca8
AD
97612002-06-30 Akim Demaille <akim@epita.fr>
9762
9763 * src/LR0.c (save_reductions): Remove, replaced by...
9764 * src/state.h, src/state.c (state_reductions_set): New.
9765 (reductions, errs): Rename as...
9766 (reductions_t, errs_t): these.
9767 Adjust all dependencies.
9768
32e1e0a4
AD
97692002-06-30 Akim Demaille <akim@epita.fr>
9770
9771 * src/LR0.c (state_list_t, state_list_append): New.
9772 (first_state, last_state): Now symbol_list_t.
9773 (this_state): Remove.
9774 (new_itemsets, append_states, save_reductions): Take a state_t as
9775 argument.
9776 (set_states, generate_states): Adjust.
9777 (save_shifts): Remove, replaced by...
9778 * src/state.h, src/state.c (state_shifts_set): New.
9779 (shifts): Rename as...
9780 (shifts_t): this.
9781 Adjust all dependencies.
9782 * src/state.h (state_t): Remove the `next' member.
9783
e5fb6710
AD
97842002-06-30 Akim Demaille <akim@epita.fr>
9785
9786 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
9787 escaped in slot 0.
9788
c7ca99d4
AD
97892002-06-30 Akim Demaille <akim@epita.fr>
9790
9791 Use hash.h for the state hash table.
9792
9793 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
9794 (allocate_storage): Use state_hash_new.
9795 (free_storage): Use state_hash_free.
9796 (new_state, get_state): Adjust.
9797 * src/lalr.h, src/lalr.c (states): Move to...
9798 * src/states.h (state_t): Remove the `link' member, no longer
9799 used.
9800 * src/states.h, src/states.c: here.
9801 (state_hash_new, state_hash_free, state_hash_lookup)
9802 (state_hash_insert, states_free): New.
9803 * src/states.c (state_table, state_compare, state_hash): New.
9804 * src/output.c (output_actions): Do not free states now, since we
9805 still need to know the final_state number in `prepare', called
9806 afterwards. Do it...
9807 * src/main.c (main): here: call states_free after `output'.
9808
df0e7316
AD
98092002-06-30 Akim Demaille <akim@epita.fr>
9810
9811 * src/state.h, src/state.c (state_new): New, extracted from...
9812 * src/LR0.c (new_state): here.
9813 * src/state.h (STATE_ALLOC): Move to...
9814 * src/state.c: here.
9815 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
9816 * src/state.h, src/state.c: here.
9817
39f41916
AD
98182002-06-30 Akim Demaille <akim@epita.fr>
9819
9820 * src/reader.c (gensym): Rename as...
9821 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
9822 (getsym): Rename as...
9823 (symbol_get): this.
9824
d57650a5
AD
98252002-06-30 Akim Demaille <akim@epita.fr>
9826
9827 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
9828 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
9829 * src/output.c, src/print.c, src/print_graph.c: Propagate.
9830 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
9831
5a08f1ce
AD
98322002-06-30 Akim Demaille <akim@epita.fr>
9833
9834 Make the test suite pass with warnings checked.
9835
9836 * tests/actions.at (Printers and Destructors): Improve.
9837 Avoid unsigned vs. signed issues.
9838 * tests/calc.at: Don't exercise the scanner here, do it...
9839 * tests/input.at (Torturing the Scanner): here.
9840
720623af
PH
98412002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9842
88e7e941 9843 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
9844 reorganize first lines parallel to yacc.c.
9845
fb8135fa
AD
98462002-06-28 Akim Demaille <akim@epita.fr>
9847
9848 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
9849 (b4_token_enum, b4_token_defines): New, factored from...
9850 * data/lalr1.cc, data/yacc.c, glr.c: here.
9851
41442480
AD
98522002-06-28 Akim Demaille <akim@epita.fr>
9853
9854 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
9855 unused variables.
9856 * src/output.c (merger_output): static.
9857
e0e5bf84
AD
98582002-06-28 Akim Demaille <akim@epita.fr>
9859
ba0fe3c7 9860 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
9861 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
9862 pacify GCC.
9863 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 9864
676385e2
PH
98652002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9866
9867 Accumulated changelog for new GLR parsing features.
9868
6a254321 9869 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
9870 conflicts_total_count.
9871 * src/conflicts.h: Ditto.
9872 * src/output.c (token_actions): Use the new name.
9873 (output_conflicts): Change conflp => conflict_list_heads, and
9874 confl => conflict_list for better readability.
9875 * data/glr.c: Use the new names.
9876 * NEWS: Add self to GLR announcement.
e0e5bf84 9877
676385e2
PH
9878 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
9879
9880 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
9881 Akim Demaille.
9882
9883 * data/bison.glr: Change name to glr.c
9884 * data/glr.c: Renamed from bison.glr.
9885 * data/Makefile.am: Add glr.c
e0e5bf84
AD
9886
9887 * src/getargs.c:
9888
676385e2 9889 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 9890 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 9891
676385e2
PH
9892 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9893
9894 * data/bison.glr: Be sure to restore the
9895 current #line when returning to the skeleton contents after having
9896 exposed the input file's #line.
9897
9898 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9899
9900 * data/bison.glr: Bring up to date with changes to bison.simple.
9901
9902 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9903
9904 * data/bison.glr: Correct definitions that use b4_prefix.
9905 Various reformatting.
9906 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
9907 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
9908 yytokenp argument; now part of stack.
9909 (yychar): Define to behave as documented.
9910 (yyclearin): Ditto.
e0e5bf84 9911
676385e2
PH
9912 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9913
9914 * src/reader.h: Add declaration for free_merger_functions.
9915
9916 * src/reader.c (merge_functions): New variable.
9917 (get_merge_function): New function.
9918 (free_merger_functions): New function.
9919 (readgram): Check for %prec that is not followed by a symbol.
9920 Handle %dprec and %merge declarations.
9921 (packgram): Initialize dprec and merger fields in rules array.
9922
9923 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
9924 conflict_list_cnt, conflict_list_free): New variables.
9925 (table_grow): Also grow conflict_table.
e0e5bf84 9926 (prepare_rules): Output dprec and merger tables.
676385e2 9927 (conflict_row): New function.
e0e5bf84 9928 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
9929 default reduction in conflicted states for GLR parser so that there
9930 are spaces for the conflict lists.
9931 (save_row): Also save conflict information.
9932 (token_actions): Allocate conflict list.
9933 (merger_output): New function.
9934 (pack_vector): Pack conflict table, too.
9935 (output_conflicts): New function to output yyconflp and yyconfl.
9936 (output_check): Allocate conflict_tos.
9937 (output_actions): Output conflict tables, also.
9938 (output_skeleton): Output b4_mergers definition.
9939 (prepare): Output b4_max_rhs_length definition.
9940 Use 'bison.glr' as default skeleton for GLR parsers.
9941
9942 * src/gram.c (glr_parser): New flag.
9943 (grammar_free): Call free_merger_functions.
9944
9945 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
9946 all pairs of conflicting reductions, rather than just all tokens
9947 causing conflicts. Needed to size conflict tables.
e0e5bf84 9948 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
9949 interface.
9950 (conflicts_print): Ditto.
9951 (count_total_conflicts): New function.
9952
9953 * src/reader.h (merger_list): New type.
9954 (merge_functions): New variable.
9955
9956 * src/lex.h (tok_dprec, tok_merge): New token types.
9957
9958 * src/gram.h (rule_s): Add dprec and merger fields.
9959 (glr_parser): New flag.
9960
9961 * src/conflicts.h (count_total_conflicts): New function.
9962
9963 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
9964
9965 * doc/bison.texinfo (Generalized LR Parsing): New section.
9966 (GLR Parsers): New section.
9967 (Language and Grammar): Mention GLR parsing.
9968 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
9969 Correct typo ("tge" -> "the").
9970
9971 * data/bison.glr: New skeleton for GLR parsing.
9972
9973 * tests/cxx-gram.at: New tests for GLR parsing.
9974
9975 * tests/testsuite.at: Include cxx-gram.at.
9976
9977 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 9978
676385e2
PH
9979 * src/parse-gram.y:
9980
9981 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
9982
9983 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 9984
b5480d74 99852002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
9986
9987 * src/options.h, src/options.c: Remove.
9988 * src/getargs.c (short_options, long_options): New.
9989
60491a94
AD
99902002-06-27 Akim Demaille <akim@epita.fr>
9991
9992 * data/bison.simple, data/bison.c++: Rename as...
9993 * data/yacc.c, data/lalr1.cc: these.
9994 * doc/bison.texinfo (Environment Variables): Remove.
9995
9be0c25b
AD
99962002-06-25 Raja R Harinath <harinath@cs.umn.edu>
9997
9998 * src/getargs.c (report_argmatch): Initialize strtok().
9999
1ae72863
AD
100002002-06-20 Akim Demaille <akim@epita.fr>
10001
10002 * data/bison.simple (b4_symbol_actions): New, replaces...
10003 (b4_symbol_destructor, b4_symbol_printer): these.
10004 (yysymprint): Be sure to call YYPRINT only for tokens, and using
10005 user token numbers.
10006
87542d29
AD
100072002-06-20 Akim Demaille <akim@epita.fr>
10008
10009 * data/bison.simple (yydestructor): Rename as...
10010 (yydestruct): this.
10011
1a31ed21
AD
100122002-06-20 Akim Demaille <akim@epita.fr>
10013
10014 * src/symtab.h, src/symtab.c (symbol_type_set)
10015 (symbol_destructor_set, symbol_precedence_set): The location is
10016 the last argument.
10017 Adjust all callers.
10018
e776192e
AD
100192002-06-20 Akim Demaille <akim@epita.fr>
10020
10021 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
10022 internals.
10023 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
10024 Takes a location.
10025 * src/symtab.h, src/symtab.c (symbol_class_set)
10026 (symbol_user_token_number_set): Likewise.
10027 Adjust all callers.
10028 Promote complain_at.
10029 * tests/input.at (Type Clashes): Adjust.
10030
5c1180b3
AD
100312002-06-20 Akim Demaille <akim@epita.fr>
10032
10033 * data/bison.simple (YYLEX): Fix the declaration when
10034 %pure-parser.
10035
e3170060
AD
100362002-06-20 Akim Demaille <akim@epita.fr>
10037
10038 * data/bison.simple (yysymprint): Don't print the token number,
10039 just its name.
10040 * tests/actions.at (Destructors): Rename as...
10041 (Printers and Destructors): this.
10042 Also exercise %printer.
10043
253862fd
AD
100442002-06-20 Akim Demaille <akim@epita.fr>
10045
10046 * data/bison.simple (YYDSYMPRINT): New.
10047 Use it to remove many of the #if YYDEBUG/if (yydebug).
10048
366eea36
AD
100492002-06-20 Akim Demaille <akim@epita.fr>
10050
10051 * src/symtab.h, src/symtab.c (symbol_t): printer and
10052 printer_location are new members.
10053 (symbol_printer_set): New.
10054 * src/parse-gram.y (PERCENT_PRINTER): New token.
10055 Handle its associated rule.
10056 * src/scan-gram.l: Adjust.
10057 (handle_destructor_at, handle_destructor_dollar): Rename as...
10058 (handle_symbol_code_at, handle_symbol_code_dollar): these.
10059 * src/output.c (symbol_printers_output): New.
10060 (output_skeleton): Call it.
10061 * data/bison.simple (yysymprint): New. Cannot be named yyprint
10062 since there are already many grammar files with a user `yyprint'.
10063 Replace the calls to YYPRINT to calls to yysymprint.
10064 * tests/calc.at: Adjust.
10065 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
10066 taking advantage of parser very internal details (stack size!).
10067
4f25ebb0
AD
100682002-06-20 Akim Demaille <akim@epita.fr>
10069
10070 * src/scan-gram.l: Complete the scanner with the missing patterns
10071 to pacify Flex.
10072 Use `quote' and `symbol_tag_get' where appropriate.
10073
93b68a0e
AD
100742002-06-19 Akim Demaille <akim@epita.fr>
10075
10076 * tests/actions.at (Destructors): Augment to test locations.
10077 * data/bison.simple (yydestructor): Pass it the current location
10078 if locations are enabled.
10079 Prototype only when __STDC__ or C++.
10080 Change the argument names to move into the yy name space: there is
10081 user code here.
10082
58612f1d
AD
100832002-06-19 Akim Demaille <akim@epita.fr>
10084
74310291
AD
10085 * data/bison.simple (b4_pure_if): New.
10086 Use it instead of #ifdef YYPURE.
10087
100882002-06-19 Akim Demaille <akim@epita.fr>
10089
10090 * data/bison.simple (b4_location_if): New.
58612f1d
AD
10091 Use it instead of #ifdef YYLSP_NEEDED.
10092
f25bfb75
AD
100932002-06-19 Akim Demaille <akim@epita.fr>
10094
10095 Prepare @$ in %destructor, but currently don't bind it in the
10096 skeleton, as %location use is not cleaned up yet.
10097
10098 * src/scan-gram.l (handle_dollar, handle_destructor_at)
10099 (handle_action_at): New.
10100 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
10101 a braced_code_t and a location as additional arguments.
10102 (handle_destructor_dollar): Instead of requiring `b4_eval', just
10103 unquote one when outputting `b4_dollar_dollar'.
10104 Adjust callers.
10105 * data/bison.simple (b4_eval): Remove.
10106 (b4_symbol_destructor): Adjust.
10107 * tests/input.at (Invalid @n): Adjust.
10108
c732d2c6
AD
101092002-06-19 Zack Weinberg <zack@codesourcery.com>
10110
10111 * doc/bison.texinfo: Document ability to have multiple
10112 prologue sections.
10113
8c165d89
AD
101142002-06-18 Akim Demaille <akim@epita.fr>
10115
10116 * src/files.c (compute_base_names): When computing the output file
10117 names from the input file name, strip the directory part.
10118
ca98bf57
AD
101192002-06-18 Akim Demaille <akim@epita.fr>
10120
10121 * data/bison.simple.new: Comment changes.
10122 Reported by Andreas Schwab.
10123
0bfb02ff
AD
101242002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
10125
10126 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
10127 there are no `label `yyoverflowlab' defined but not used' warnings
10128 when yyoverflow is defined.
10129
24c0aad7
AD
101302002-06-18 Akim Demaille <akim@epita.fr>
10131
10132 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
10133 new member.
10134 (symbol_destructor_set): Adjust.
10135 * src/output.c (symbol_destructors_output): Output the destructor
10136 locations.
10137 Output the symbol name.
10138 * data/bison.simple (b4_symbol_destructor): Adjust.
10139
5719c109
AD
101402002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
10141 and Akim Demaille <akim@epita.fr>
10142
10143 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
10144 what's left on the stack when the error recovery hits EOF.
10145 * tests/actions.at (Destructors): Complete to exercise this case.
10146
9280d3ef
AD
101472002-06-17 Akim Demaille <akim@epita.fr>
10148
10149 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
10150 arguments is really empty, not only equal to `[]'.
10151 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
10152 member.
10153 (symbol_destructor_set): New.
10154 * src/output.c (symbol_destructors_output): New.
10155 * src/reader.h (brace_code_t, current_braced_code): New.
10156 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
10157 (handle_dollar): Rename as...
10158 (handle_action_dollar): this.
10159 (handle_destructor_dollar): New.
10160 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10161 (grammar_declaration): Use it.
10162 * data/bison.simple (yystos): Is always defined.
10163 (yydestructor): New.
10164 * tests/actions.at (Destructors): New.
10165 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10166
dafdc66f
AD
101672002-06-17 Akim Demaille <akim@epita.fr>
10168
10169 * src/symlist.h, src/symlist.c (symbol_list_length): New.
10170 * src/scan-gram.l (handle_dollar, handle_at): Compute the
10171 rule_length only when needed.
10172 * src/output.c (actions_output, token_definitions_output): Output
10173 the full M4 block.
10174 * src/symtab.c: Don't access directly to the symbol tag, use
10175 symbol_tag_get.
10176 * src/parse-gram.y: Use symbol_list_free.
10177
56c47203
AD
101782002-06-17 Akim Demaille <akim@epita.fr>
10179
10180 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
10181 (symbol_list_prepend, get_type_name): Move to...
10182 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
10183 (symbol_list_prepend, symbol_list_n_type_name_get): here.
10184 Adjust all callers.
10185 (symbol_list_free): New.
10186 * src/scan-gram.l (handle_dollar): Takes a location.
10187 * tests/input.at (Invalid $n): Adjust.
10188
1e0bab92
AD
101892002-06-17 Akim Demaille <akim@epita.fr>
10190
10191 * src/reader.h, src/reader.c (symbol_list_new): Export it.
10192 (symbol_list_prepend): New.
10193 * src/parse-gram.y (%union): `list' is a new member.
10194 (symbols.1): New, replaces...
10195 (terms_to_prec.1, nterms_to_type.1): these.
10196 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
10197 Take a location as additional argument.
10198 Adjust all callers.
10199
04e60654
AD
102002002-06-15 Akim Demaille <akim@epita.fr>
10201
10202 * src/parse-gram.y: Move %token in the declaration section so that
10203 we don't depend upon CVS Bison.
10204
10e5b8bd
AD
102052002-06-15 Akim Demaille <akim@epita.fr>
10206
10207 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10208 * src/print.c (print_core): Use it.
10209
9801d40c
AD
102102002-06-15 Akim Demaille <akim@epita.fr>
10211
10212 * src/conflicts.c (log_resolution): Accept the rule involved in
10213 the sr conflicts instead of the lookahead number that points to
10214 that rule.
10215 (flush_reduce): Accept the current lookahead vector as argument,
10216 instead of the index in LA.
10217 (resolve_sr_conflict): Accept the current number of lookahead
10218 bitset to consider for the STATE, instead of the index in LA.
10219 (set_conflicts): Adjust.
10220 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
10221
c0263492
AD
102222002-06-15 Akim Demaille <akim@epita.fr>
10223
10224 * src/state.h (state_t): Replace the `lookaheadsp' member, a
10225 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
10226 Adjust all dependencies.
10227 * src/lalr.c (initialize_lookaheads): Split into...
10228 (states_lookaheads_count, states_lookaheads_initialize): these.
10229 (lalr): Adjust.
10230
9757c359
AD
102312002-06-15 Akim Demaille <akim@epita.fr>
10232
10233 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10234 out of...
10235 (grammar_rules_print): here.
10236 * src/reduce.c (reduce_output): Use it.
10237 * tests/reduce.at (Useless Rules, Reduced Automaton)
10238 (Underivable Rules): Adjust.
10239
6b98e4b5
AD
102402002-06-15 Akim Demaille <akim@epita.fr>
10241
10242 Copy BYacc's nice way to report the grammar.
10243
10244 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10245 New.
10246 Don't print the rules' location, it is confusing and useless.
10247 (rule_print): Use grammar_rhs_print.
10248 * src/print.c (print_grammar): Use grammar_rules_print.
10249
6b98e4b5
AD
102502002-06-15 Akim Demaille <akim@epita.fr>
10251
10252 Complete and rationalize `useless thing' warnings.
10253
10254 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10255 (symbol_tag_print): New.
10256 Use them everywhere in place of accessing directly the tag member.
10257 * src/gram.h, src/gram.c (rule_print): New.
10258 Use it where a rule used to be printed `by hand'.
10259 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10260 (reduce_grammar_tables): Report the useless rules.
10261 (reduce_print): Useless things are a warning, not an error.
10262 Report it as such.
10263 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10264 (Reduced Automaton, Underivable Rules): Adjust.
10265 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10266 * tests/conflicts.at (Unresolved SR Conflicts)
10267 (Solved SR Conflicts): Adjust.
10268
ee000ba4
AD
102692002-06-15 Akim Demaille <akim@epita.fr>
10270
10271 Let symbols have a location.
10272
10273 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10274 (getsym): Adjust.
10275 Adjust all callers.
10276 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10277 Use location_t, not int.
10278 * src/symtab.c (symbol_check_defined): Take advantage of the
10279 location.
10280 * tests/regression.at (Invalid inputs): Adjust.
10281
8efe435c
AD
102822002-06-15 Akim Demaille <akim@epita.fr>
10283
10284 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10285 (input): Don't try to initialize yylloc here, do it in the
10286 scanner.
10287 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
10288 * src/gram.h (rule_t): Change line and action_line into location
10289 and action_location, of location_t type.
10290 Adjust all dependencies.
10291 * src/location.h, src/location.c (empty_location): New.
10292 * src/reader.h, src/reader.c (grammar_start_symbol_set)
10293 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
10294 (grammar_current_rule_symbol_append)
10295 (grammar_current_rule_action_append): Expect a location as argument.
10296 * src/reader.c (grammar_midrule_action): Adjust to attach an
10297 action's location as dummy symbol location.
10298 * src/symtab.h, src/symtab.c (startsymbol_location): New.
10299 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
10300 the line numbers.
10301
1921f1d7
AD
103022002-06-14 Akim Demaille <akim@epita.fr>
10303
10304 Grammar declarations may be found in the grammar section.
10305
10306 * src/parse-gram.y (rules_or_grammar_declaration): New.
10307 (declarations): Each declaration may end with a semicolon, not
10308 just...
10309 (grammar_declaration): `"%union"'.
10310 (grammar): Branch to rules_or_grammar_declaration.
10311
4515534c
AD
103122002-06-14 Akim Demaille <akim@epita.fr>
10313
10314 * src/main.c (main): Invoke scanner_free.
10315
f958596b
AD
103162002-06-14 Akim Demaille <akim@epita.fr>
10317
10318 * src/output.c (m4_invoke): Extracted from...
10319 (output_skeleton): here.
10320 Free tempfile.
10321
2c569025
AD
103222002-06-14 Akim Demaille <akim@epita.fr>
10323
10324 * src/parse-gram.y (directives, directive, gram)
10325 (grammar_directives, precedence_directives, precedence_directive):
10326 Rename as...
10327 (declarations, declaration, grammar, grammar_declaration)
10328 (precedence_declaration, precedence_declarator): these.
10329 (symbol_declaration): New.
10330
592e8d4d
AD
103312002-06-14 Akim Demaille <akim@epita.fr>
10332
10333 * src/files.c (action_obstack): Remove, unused.
10334 (output_obstack): Remove it, and all its dependencies, as it is no
10335 longer needed.
10336 * src/reader.c (epilogue_set): Build the epilogue in the
10337 muscle_obstack.
10338 * src/output.h, src/output.c (muscle_obstack): Move to...
10339 * src/muscle_tab.h, src/muscle_tab.h: here.
10340 (muscle_init): Initialize muscle_obstack.
10341 (muscle_free): New.
10342 * src/main.c (main): Call it.
10343
0c15323d
AD
103442002-06-14 Akim Demaille <akim@epita.fr>
10345
10346 * src/location.h: New, extracted from...
10347 * src/reader.h: here.
10348 * src/Makefile.am (noinst_HEADERS): Merge into
10349 (bison_SOURCES): this.
10350 Add location.h.
10351 * src/parse-gram.y: Use location_t instead of Bison's.
10352 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
10353 Use location_t instead of ints.
10354
e96c9728
AD
103552002-06-14 Akim Demaille <akim@epita.fr>
10356
10357 * data/bison.simple, data/bison.c++: Be sure to restore the
10358 current #line when returning to the skeleton contents after having
10359 exposed the input file's #line.
10360
75d1fe16
AD
103612002-06-12 Akim Demaille <akim@epita.fr>
10362
10363 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
10364 eager.
10365 * tests/actions.at (Exotic Dollars): New.
10366
6c35d22c
AD
103672002-06-12 Akim Demaille <akim@epita.fr>
10368
10369 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
10370 ['"/] too eagerly.
10371 * tests/input.at (Torturing the Scanner): New.
10372
1d6412ad
AD
103732002-06-11 Akim Demaille <akim@epita.fr>
10374
10375 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
10376 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
10377 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
10378 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
10379 * src/reader.c (reader): Use it.
10380
4cdb01db
AD
103812002-06-11 Akim Demaille <akim@epita.fr>
10382
10383 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
10384 Adjust all callers.
10385 (scanner_last_string_free): New.
10386
44995b2e
AD
103872002-06-11 Akim Demaille <akim@epita.fr>
10388
10389 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
10390 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
10391 (last_string, YY_OBS_FREE): New.
10392 Use them when returning an ID.
10393
e9955c83
AD
103942002-06-11 Akim Demaille <akim@epita.fr>
10395
10396 Have Bison grammars parsed by a Bison grammar.
10397
10398 * src/reader.c, src/reader.h (prologue_augment): New.
10399 * src/reader.c (copy_definition): Remove.
10400
10401 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
10402 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
10403 (grammar_current_rule_prec_set, grammar_current_rule_check)
10404 (grammar_current_rule_symbol_append)
10405 (grammar_current_rule_action_append): Export.
10406 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
10407 (symbol_list_action_append): Remove.
10408 Hook the routines from reader.
10409 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
10410 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
10411
10412 * src/reader.c (read_declarations): Remove, unused.
10413
10414 * src/parse-gram.y: Handle the epilogue.
10415 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
10416 (grammar_start_symbol_set): this.
10417 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
10418 * src/reader.c (readgram): Remove, unused.
10419 (reader): Adjust to insert eoftoken and axiom where appropriate.
10420
10421 * src/reader.c (copy_dollar): Replace with...
10422 * src/scan-gram.h (handle_dollar): this.
10423 * src/parse-gram.y: Remove `%thong'.
10424
10425 * src/reader.c (copy_at): Replace with...
10426 * src/scan-gram.h (handle_at): this.
10427
10428 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
10429 New.
10430
10431 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
10432 time being.
10433
10434 * src/reader.h, src/reader.c (grammar_rule_end): New.
10435
10436 * src/parse.y (current_type, current_class): New.
10437 Implement `%nterm', `%token' support.
10438 Merge `%term' into `%token'.
10439 (string_as_id): New.
10440 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
10441 type name.
10442
10443 * src/parse-gram.y: Be sure to handle properly the beginning of
10444 rules.
10445
10446 * src/parse-gram.y: Handle %type.
10447 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
10448
10449 * src/parse-gram.y: More directives support.
10450 * src/options.c: No longer handle source directives.
10451
10452 * src/parse-gram.y: Fix %output.
10453
10454 * src/parse-gram.y: Handle %union.
10455 Use the prologue locations.
10456 * src/reader.c (parse_union_decl): Remove.
10457
10458 * src/reader.h, src/reader.c (epilogue_set): New.
10459 * src/parse-gram.y: Use it.
10460
10461 * data/bison.simple, data/bison.c++: b4_stype is now either not
10462 defined, then default to int, or to the contents of %union,
10463 without `union' itself.
10464 Adjust.
10465 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
10466
10467 * src/output.c (actions_output): Don't output braces, as they are
10468 already handled by the scanner.
10469
10470 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
10471 characters to themselves.
10472
10473 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
10474 that the epilogue has a proper #line.
10475
10476 * src/parse-gram.y: Handle precedence/associativity.
10477
10478 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
10479 a terminal.
10480 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
10481 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
10482 at all to define terminals that cannot be emitted.
10483
10484 * src/scan-gram.l: Escape M4 characters.
10485
10486 * src/scan-gram.l: Working properly with escapes in user
10487 strings/characters.
10488
10489 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
10490 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
10491 grammar.
10492 Use more modest sizes, as for the time being the parser does not
10493 release memory, and therefore the process swallows a huge amount
10494 of memory.
10495
10496 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
10497 stricter %token grammar.
10498
10499 * src/symtab.h (associativity): Add `undef_assoc'.
10500 (symbol_precedence_set): Do nothing when passed an undef_assoc.
10501 * src/symtab.c (symbol_check_alias_consistence): Adjust.
10502
10503 * tests/regression.at (Invalid %directive): Remove, as it is now
10504 meaningless.
10505 (Invalid inputs): Adjust to the new error messages.
10506 (Token definitions): The new grammar doesn't allow too many
10507 eccentricities.
10508
10509 * src/lex.h, src/lex.c: Remove.
10510 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
10511 (copy_character, copy_string2, copy_string, copy_identifier)
10512 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
10513 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
10514 (parse_action): Remove.
10515 * po/POTFILES.in: Adjust.
10516
2e047461
AD
105172002-06-11 Akim Demaille <akim@epita.fr>
10518
cd05d13c 10519 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
10520 rule's action member: return the action as a string.
10521 Don't require `rule_length' as an argument: compute it.
10522 (grammar_current_rule_symbol_append)
10523 (grammar_current_rule_action_append): New, eved out from
10524 (readgram): here.
10525 Remove `action_flag', `rulelength', unused now.
10526
9af3fbce
AD
105272002-06-11 Akim Demaille <akim@epita.fr>
10528
10529 * src/reader.c (grammar_current_rule_prec_set).
10530 (grammar_current_rule_check): New, eved out from...
10531 (readgram): here.
10532 Remove `xaction', `first_rhs': useless.
10533 * tests/input.at (Type clashes): New.
10534 * tests/existing.at (GNU Cim Grammar): Adjust.
10535
1485e106
AD
105362002-06-11 Akim Demaille <akim@epita.fr>
10537
10538 * src/reader.c (grammar_midrule_action): New, Eved out from
10539 (readgram): here.
10540
da4160c3
AD
105412002-06-11 Akim Demaille <akim@epita.fr>
10542
10543 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
10544 New.
10545 (readgram): Use them as replacement of inlined code, crule and
10546 crule1.
10547
f6d0f937
AD
105482002-06-11 Akim Demaille <akim@epita.fr>
10549
10550 * src/reader.c (grammar_end, grammar_symbol_append): New.
10551 (readgram): Use them.
10552 Make the use of `p' as local as possible.
10553
69078d4b
AD
105542002-06-10 Akim Demaille <akim@epita.fr>
10555
10556 GCJ's parser requires the tokens to be defined before the prologue.
10557
10558 * data/bison.simple: Output the token definition before the user's
10559 prologue.
10560 * tests/regression.at (Braces parsing, Duplicate string)
10561 (Mixing %token styles): Check the output from bison.
10562 (Early token definitions): New.
10563
5e424082
AD
105642002-06-10 Akim Demaille <akim@epita.fr>
10565
10566 * src/symtab.c (symbol_user_token_number_set): Don't complain when
10567 assigning twice the same user number to a token, so that we can
10568 use it in...
10569 * src/lex.c (lex): here.
10570 Also use `symbol_class_set' instead of hand written code.
10571 * src/reader.c (parse_assoc_decl): Likewise.
10572
44536b35
AD
105732002-06-10 Akim Demaille <akim@epita.fr>
10574
10575 * src/symtab.c, src/symtab.c (symbol_class_set)
10576 (symbol_user_token_number_set): New.
10577 * src/reader.c (parse_token_decl): Use them.
10578 Use a switch instead of ifs.
10579 Use a single argument.
10580
8b9f2372
AD
105812002-06-10 Akim Demaille <akim@epita.fr>
10582
10583 Remove `%thong' support as it is undocumented, unused, duplicates
10584 `%token's job, and creates useless e-mail traffic with people who
10585 want to know what it is, why it is undocumented, unused, and
10586 duplicates `%token's job.
10587
10588 * src/reader.c (parse_thong_decl): Remove.
10589 * src/options.c (option_table): Remove "thong".
10590 * src/lex.h (tok_thong): Remove.
10591
3ae2b51f
AD
105922002-06-10 Akim Demaille <akim@epita.fr>
10593
10594 * src/symtab.c, src/symtab.c (symbol_type_set)
10595 (symbol_precedence_set): New.
10596 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
10597 (value_components_used): Remove, unused.
10598
2f1afb73
AD
105992002-06-09 Akim Demaille <akim@epita.fr>
10600
10601 Move symbols handling code out of the reader.
10602
10603 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
10604 (axiom): Move to...
10605 * src/symtab.h, src/symtab.c: here.
10606
10607 * src/gram.c (start_symbol): Remove: use startsymbol->number.
10608 * src/reader.c (startval): Rename as...
10609 * src/symtab.h, src/symtab.c (startsymbol): this.
10610 * src/reader.c: Adjust.
10611
10612 * src/reader.c (symbol_check_defined, symbol_make_alias)
10613 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
10614 (token_translations_init)
10615 Move to...
10616 * src/symtab.c: here.
10617 * src/reader.c (packsymbols): Move to...
10618 * src/symtab.h, src/symtab.c (symbols_pack): here.
10619 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
10620 argument.
10621
e9bca3ad
AD
106222002-06-03 Akim Demaille <akim@epita.fr>
10623
10624 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
10625 then statements.
10626
86eff183
AD
106272002-06-03 Akim Demaille <akim@epita.fr>
10628
10629 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
10630 structs with non literals.
10631 * src/scan-skel.l: never-interactive.
10632 * src/conflicts.c (enum conflict_resolution_e): No trailing
10633 comma.
10634 * src/getargs.c (usage): Split long literal strings.
10635 Reported by Hans Aberg.
10636
717be197
AD
106372002-05-28 Akim Demaille <akim@epita.fr>
10638
10639 * data/bison.c++: Use C++ ostreams.
10640 (cdebug_): New member.
10641
670ddffd
AD
106422002-05-28 Akim Demaille <akim@epita.fr>
10643
10644 * src/output.c (output_skeleton): Be sure to allocate enough room
10645 for `/' _and_ for `\0' in full_skeleton.
10646
769b430f
AD
106472002-05-28 Akim Demaille <akim@epita.fr>
10648
10649 * data/bison.c++: Catch up with bison.simple:
10650 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10651 and Paul Eggert <eggert@twinsun.com>: `error' handing.
10652 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
10653 and popping traces.
10654
7067cb36
PH
106552002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10656
10657 * src/output.c (output_skeleton): Put an explicit path in front of
10658 the skeleton file name, rather than relying on the -I directory,
10659 to partially alleviate effects of having a skeleton file lying around
10660 in the current directory.
769b430f 10661
4a713ec2
PH
106622002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10663
769b430f 10664 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
10665 obstack_printf should be obstack_fgrow1.
10666
b408954b
AD
106672002-05-26 Akim Demaille <akim@epita.fr>
10668
10669 * src/state.h (state_t): `solved_conflicts' is a new member.
10670 * src/LR0.c (new_state): Set it to 0.
10671 * src/conflicts.h, src/conflicts.c (print_conflicts)
10672 (free_conflicts, solve_conflicts): Rename as...
10673 (conflicts_print, conflicts_free, conflicts_solve): these.
10674 Adjust callers.
10675 * src/conflicts.c (enum conflict_resolution_e)
10676 (solved_conflicts_obstack): New, used by...
10677 (log_resolution): this.
10678 Adjust to attach the conflict resolution to each state.
10679 Complete the description with the precedence/associativity
10680 information.
10681 (resolve_sr_conflict): Adjust.
10682 * src/print.c (print_state): Output its solved_conflicts.
10683 * tests/conflicts.at (Unresolved SR Conflicts)
10684 (Solved SR Conflicts): Exercise --report=all.
10685
a49aecd5
AD
106862002-05-26 Akim Demaille <akim@epita.fr>
10687
10688 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
10689 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
10690 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
10691 (token_number_t, item_number_as_token_number)
10692 (token_number_as_item_number, muscle_insert_token_number_table):
10693 Rename as...
10694 (symbol_number_t, item_number_as_symbol_number)
10695 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
10696 these, since it is more appropriate.
10697
5504898e
AD
106982002-05-26 Akim Demaille <akim@epita.fr>
10699
10700 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
10701 `Error:' lines.
10702 * data/bison.simple (yystos) [YYDEBUG]: New.
10703 (yyparse) [YYDEBUG]: Display the symbols which are popped during
10704 error recovery.
10705 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
10706
ec3bc396
AD
107072002-05-25 Akim Demaille <akim@epita.fr>
10708
10709 * doc/bison.texinfo (Debugging): Split into...
10710 (Tracing): this new section, its former contents, and...
10711 (Understanding): this new section.
10712 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
10713 by...
10714 (report_flag): this.
10715 Adjust all dependencies.
10716 (report_args, report_types, report_argmatch): New.
10717 (usage, getargs): Report/support -r, --report.
10718 * src/options.h
10719 (struct option_table_struct): Rename as..,
10720 (struct option_table_s): this.
10721 Rename the `set_flag' member to `flag' to match with getopt_long's
10722 struct.
10723 * src/options.c (option_table): Split verbose into an entry for
10724 %verbose, and another for --verbose.
10725 Support --report/-r, so remove -r from the obsolete --raw.
10726 * src/print.c: Attach full item sets and lookaheads reports to
10727 report_flag instead of trace_flag.
10728 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
10729
78df8250
PE
107302002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10731 and Paul Eggert <eggert@twinsun.com>
769b430f 10732
78df8250
PE
10733 * data/bison.simple (yyparse): Correct error handling to conform to
10734 POSIX and yacc. Specifically, after syntax error is discovered,
10735 do not reduce further before shifting the error token.
10736 Clean up the code a bit by removing the labels yyerrdefault,
10737 yyerrhandle, yyerrpop.
10738 * NEWS: Document the above.
10739
c0c9ea05
PH
107402002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10741
10742 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
10743 type; it isn't always big enough, since it doesn't necessarily
10744 include non-terminals.
769b430f 10745 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
10746 the latter can be removed.
10747 (yy_token_number_type): Remove, only one use.
10748 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
10749 don't use TokenNumberType as element type.
769b430f 10750
c0c9ea05
PH
10751 * tests/regression.at: Modify expected output to agree with change
10752 to yyr1 and yytranslate.
769b430f 10753
6390a83f
FK
107542002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
10755
10756 * src/reader.c (parse_action): Use copy_character instead of
10757 obstack_1grow.
10758
db7c8e9a
AD
107592002-05-13 Akim Demaille <akim@epita.fr>
10760
10761 * tests/regression.at (Token definitions): Prototype yylex and
10762 yyerror.
10763
fcc61800
PH
107642002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10765
158c687b 10766 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
10767 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
10768 32-bit arithmetic.
10769 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
10770
5683e9b2
AD
107712002-05-07 Akim Demaille <akim@epita.fr>
10772
10773 * tests/synclines.at: Be sure to prototype yylex and yyerror to
10774 avoid GCC warnings.
10775
0c2d3f4c
AD
107762002-05-07 Akim Demaille <akim@epita.fr>
10777
10778 Kill GCC warnings.
10779
10780 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
10781 over the RHS of each rule.
10782 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
10783 * src/state.h (state_t): Member `nitems' is unsigned short.
10784 * src/LR0.c (get_state): Adjust.
10785 * src/reader.c (packgram): Likewise.
10786 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
10787 `Type'.
10788 (muscle_insert_int_table): Remove, unused.
10789 (prepare_rules): Remove `max'.
10790
1565b720
AD
107912002-05-06 Akim Demaille <akim@epita.fr>
10792
10793 * src/closure.c (print_firsts): Display of the symbol tags.
10794 (bitmatrix_print): Move to...
10795 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
10796 here.
10797 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
10798
cfaee611
AD
107992002-05-06 Akim Demaille <akim@epita.fr>
10800
10801 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
10802 hash_do_for_each.
10803
458be8e0
AD
108042002-05-06 Akim Demaille <akim@epita.fr>
10805
10806 * src/LR0.c (new_state, get_state): Instead of using the global
10807 `kernel_size' and `kernel_base', have two new arguments:
10808 `core_size' and `core'.
10809 Adjust callers.
10810
a900a624
AD
108112002-05-06 Akim Demaille <akim@epita.fr>
10812
10813 * src/reader.c (packgram): No longer end `ritem' with a 0
10814 sentinel: it is not used.
10815
d4e7d3a1
AD
108162002-05-05 Akim Demaille <akim@epita.fr>
10817
10818 New experimental feature: display the lookaheads in the report and
10819 graph.
10820
10821 * src/print (print_core): When --trace-flag, display the rules
10822 lookaheads.
10823 * src/print_graph.c (print_core): Likewise.
10824 Swap the arguments.
10825 Adjust caller.
10826
39ceb25b
AD
108272002-05-05 Akim Demaille <akim@epita.fr>
10828
10829 * tests/torture.at (Many lookaheads): New test.
10830
5372019f
AD
108312002-05-05 Akim Demaille <akim@epita.fr>
10832
10833 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
10834 (GENERATE_MUSCLE_INSERT_TABLE): this.
10835 (output_int_table, output_unsigned_int_table, output_short_table)
10836 (output_token_number_table, output_item_number_table): Replace with...
10837 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
10838 (muscle_insert_short_table, muscle_insert_token_number_table)
10839 (muscle_insert_item_number_table): these.
10840 Adjust all callers.
10841 (prepare_tokens): Don't free `translations', since...
10842 * src/reader.h, src/reader.c (grammar_free): do it.
10843 Move to...
10844 * src/gram.h, src/gram.c (grammar_free): here.
10845 * data/bison.simple, data/bison.c++: b4_token_number_max is now
10846 b4_translate_max.
10847
5df5f6d5
AD
108482002-05-05 Akim Demaille <akim@epita.fr>
10849
10850 * src/output.c (output_unsigned_int_table): New.
10851 (prepare_rules): `i' is unsigned.
10852 `prhs', `rline', `r2' are unsigned int.
10853 Rename muscle `rhs_number_max' as `rhs_max'.
10854 Output muscles `prhs_max', `rline_max', and `r2_max'.
10855 Free rline and r1.
10856 * data/bison.simple, data/bison.c++: Adjust to use these muscles
10857 to compute types instead of constant types.
10858 * tests/regression.at (Web2c Actions): Adjust.
10859
b87f8b21
AD
108602002-05-04 Akim Demaille <akim@epita.fr>
10861
10862 * src/symtab.h (SALIAS, SUNDEF): Rename as...
10863 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
10864 Adjust dependencies.
10865 * src/output.c (token_definitions_output): Be sure not to output a
10866 `#define 'a'' when fed with `%token 'a' "a"'.
10867 * tests/regression.at (Token definitions): New.
10868
8bb936e4
PE
108692002-05-03 Paul Eggert <eggert@twinsun.com>
10870
10871 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
10872 for K&R C.
10873
108742002-05-03 gettextize <bug-gnu-gettext@gnu.org>
10875
10876 * Makefile.am (SUBDIRS): Remove intl.
10877 (EXTRA_DIST): Add config/config.rpath.
10878
53c71a12
AD
108792002-05-03 Akim Demaille <akim@epita.fr>
10880
10881 * data/bison.simple (m4_if): Don't output empty enums.
10882 And actually, output valid enum definitions :(.
10883
289dd0cf
AD
108842002-05-03 Akim Demaille <akim@epita.fr>
10885
10886 * configure.bat: Remove, completely obsolete.
10887 * Makefile.am (EXTRA_DIST): Adjust.
10888 Don't distribute config.rpath...
10889 * config/Makefile.am (EXTRA_DIST): Do it.
10890
db85e524
AD
108912002-05-03 Akim Demaille <akim@epita.fr>
10892
10893 * configure.in (GETTEXT_VERSION): New.
10894 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
10895
83ccf991
AD
108962002-05-03 Akim Demaille <akim@epita.fr>
10897
10898 * data/bison.simple (b4_token_enum): New.
10899 (b4_token_defines): Use it to output tokens both as #define and
10900 enums.
10901 Suggested by Paul Eggert.
10902 * src/output.c (token_definitions_output): Don't output spurious
10903 white spaces.
10904
1f418995
AD
109052002-05-03 Akim Demaille <akim@epita.fr>
10906
10907 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
10908
45119f04
RA
109092002-05-02 Robert Anisko <robert@lrde.epita.fr>
10910
10911 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
10912 Update the stack class, give a try to deque as the default container.
10913
b2d52318
AD
109142002-05-02 Akim Demaille <akim@epita.fr>
10915
10916 * data/bison.simple (yyparse): Do not implement @$ = @1.
10917 (YYLLOC_DEFAULT): Adjust to do it.
10918 * doc/bison.texinfo (Location Default Action): Fix.
10919
3a8b4109
AD
109202002-05-02 Akim Demaille <akim@epita.fr>
10921
10922 * src/reader.c (parse_braces): Merge into...
10923 (parse_action): this.
10924
84614e13
AD
109252002-05-02 Akim Demaille <akim@epita.fr>
10926
10927 * configure.in (ALL_LINGUAS): Remove.
10928 * po/LINGUAS, hr.po: New.
10929
fdbcd8e2
AD
109302002-05-02 Akim Demaille <akim@epita.fr>
10931
10932 Remove the so called hairy (semantic) parsers.
10933
10934 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
10935 * src/gram.h, src/gram.c (semantic_parser): Remove.
10936 (rule_t): Remove the guard and guard_line members.
10937 * src/lex.h (token_t): remove tok_guard.
10938 * src/options.c (option_table): Remove %guard and %semantic_parser
10939 support.
10940 * src/output.c, src/output.h (guards_output): Remove.
10941 (prepare): Adjust.
10942 (token_definitions_output): Don't output the `T'
10943 tokens (???).
10944 (output_skeleton): Don't output the guards.
10945 * src/files.c, src/files.c (attrsfile): Remove.
10946 * src/reader.c (symbol_list): Remove the guard and guard_line
10947 members.
10948 Adjust dependencies.
10949 (parse_guard): Remove.
10950 * data/bison.hairy: Remove.
10951 * doc/bison.texinfo (Environment Variables): Remove occurrences of
10952 BISON_HAIRY.
10953
82b6cb3f
AD
109542002-05-02 Akim Demaille <akim@epita.fr>
10955
10956 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
10957 (parse_guard): Rename the formal argument `stack_offset' as
10958 `rule_length', which is more readable.
10959 Adjust callers.
10960 (copy_at, copy_dollar): Instead of outputting the hard coded
10961 values of $$, $n and so forth, output invocation to b4_lhs_value,
10962 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
10963 Note: this patch partially drops `semantic-parser' support: it
10964 always does `rule_length - n', where semantic parsers ought to
10965 always use `-n'.
82b6cb3f
AD
10966 * data/bison.simple, data/bison.c++ (b4_lhs_value)
10967 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
10968
6cbfbcc5
AD
109692002-05-02 Akim Demaille <akim@epita.fr>
10970
10971 * configure.in (AC_INIT): Bump to 1.49b.
10972 (AM_INIT_AUTOMAKE): Short invocation.
10973
b8548114
AD
109742002-05-02 Akim Demaille <akim@epita.fr>
10975
10976 Version 1.49a.
10977
c20cd1fa
AD
109782002-05-01 Akim Demaille <akim@epita.fr>
10979
10980 * src/skeleton.h: Remove.
10981
8a9566d4
AD
109822002-05-01 Akim Demaille <akim@epita.fr>
10983
10984 * src/skeleton.h: Fix the #endif.
10985 Reported by Magnus Fromreide.
10986
8c6d399a
PE
109872002-04-26 Paul Eggert <eggert@twinsun.com>
10988
10989 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
10990 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 10991 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 10992
2b7ed18a
RA
109932002-04-25 Robert Anisko <robert@lrde.epita.fr>
10994
10995 * src/scan-skel.l: Postprocess quadrigraphs.
10996
10997 * src/reader.c (copy_character): New function, used to output
10998 single characters while replacing `[' and `]' with quadrigraphs, to
10999 avoid troubles with M4 quotes.
11000 (copy_comment): Output characters with copy_character.
11001 (read_additionnal_code): Likewise.
11002 (copy_string2): Likewise.
11003 (copy_definition): Likewise.
11004
11005 * tests/calc.at: Exercise M4 quoting.
11006
34a89c50
AD
110072002-04-25 Akim Demaille <akim@epita.fr>
11008
11009 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
11010 between `!' and the command.
11011 Reported by Paul Eggert.
11012
0dd1580a
RA
110132002-04-24 Robert Anisko <robert@lrde.epita.fr>
11014
11015 * tests/calc.at: Exercise prologue splitting.
11016
11017 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
11018 `b4_post_prologue' instead of `b4_prologue'.
11019
11020 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
11021 muscles.
11022 (output): Free pre_prologue_obstack and post_prologue_obstack.
11023 * src/files.h, src/files.c (attrs_obstack): Remove.
11024 (pre_prologue_obstack, post_prologue_obstack): New.
11025 * src/reader.c (copy_definition): Add a parameter to specify the
11026 obstack to fill, instead of using attrs_obstack unconditionally.
11027 (read_declarations): Pass pre_prologue_obstack to copy_definition if
11028 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
11029
83c1796f
PE
110302002-04-23 Paul Eggert <eggert@twinsun.com>
11031
11032 * data/bison.simple: Remove unnecessary commentary and white
11033 space differences from 1_29-branch.
11034 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
11035
11036 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
11037 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
11038 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
11039 constructors or destructors.
11040
11041 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
11042
1207eeac
AD
110432002-04-23 Akim Demaille <akim@epita.fr>
11044
11045 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
11046 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
11047 location with columns.
11048 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
11049 All reported by Paul Eggert.
11050
78ab8f67
AD
110512002-04-22 Akim Demaille <akim@epita.fr>
11052
11053 * src/reduce.c (dump_grammar): Move to...
11054 * src/gram.h, src/gram.c (grammar_dump): here.
11055 Be sure to separate long item numbers.
11056 Don't read the members of a rule's prec if its nil.
11057
133c20e2
AD
110582002-04-22 Akim Demaille <akim@epita.fr>
11059
11060 * src/output.c (table_size, table_grow): New.
11061 (MAXTABLE): Remove, replace uses with table_size.
11062 (pack_vector): Instead of dying when the table is too big, grow it.
11063
9515e8a7
AD
110642002-04-22 Akim Demaille <akim@epita.fr>
11065
11066 * data/bison.simple (yyr1): Its type is that of a token number.
11067 * data/bison.c++ (r1_): Likewise.
11068 * tests/regression.at (Web2c Actions): Adjust.
11069
23c5a174
AD
110702002-04-22 Akim Demaille <akim@epita.fr>
11071
11072 * src/reader.c (token_translations_init): 256 is now the default
11073 value for the error token, i.e., it will be assigned another
11074 number if the user assigned 256 to one of her tokens.
11075 (reader): Don't force 256 to error.
11076 * doc/bison.texinfo (Symbols): Adjust.
11077 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
11078 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
11079 etc. instead of 10, 20, 30 (which was used to `jump' over error
11080 (256) and undefined (2)).
11081
5fbb0954
AD
110822002-04-22 Akim Demaille <akim@epita.fr>
11083
11084 Propagate more token_number_t.
11085
11086 * src/gram.h (token_number_as_item_number)
11087 (item_number_as_token_number): New.
11088 * src/output.c (GENERATE_OUTPUT_TABLE): New.
11089 Use it to create output_item_number_table and
11090 output_token_number_table.
11091 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
11092 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
11093 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
11094 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
11095
4f940944
AD
110962002-04-22 Akim Demaille <akim@epita.fr>
11097
11098 * src/output.h, src/output.c (get_lines_number): Remove.
11099
3ded9a63
AD
111002002-04-19 Akim Demaille <akim@epita.fr>
11101
11102 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
11103 as Lex/Flex'.
11104 (Debugging): More details about enabling the debugging features.
11105 (Table of Symbols): Describe $$, $n, @$, and @n.
11106 Suggested by Tim Josling.
11107
e0c471a9
AD
111082002-04-19 Akim Demaille <akim@epita.fr>
11109
11110 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
11111
fecc10cd
AD
111122002-04-10 Akim Demaille <akim@epita.fr>
11113
11114 * src/system.h: Rely on HAVE_LIMITS_H.
11115 Suggested by Paul Eggert.
11116
51dec47b
AD
111172002-04-09 Akim Demaille <akim@epita.fr>
11118
11119 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
11120 full stderr, and strip it according to the bison options, instead
11121 of composing the error message from different bits.
11122 This makes it easier to check for several error messages.
11123 Adjust all the invocations.
11124 Add an invocation exercising the error token.
11125 Add an invocation demonstrating a stupid error message.
11126 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
11127 Adjust the tests.
11128 Error message are for stderr, not stdout.
11129
007a50a4
AD
111302002-04-09 Akim Demaille <akim@epita.fr>
11131
11132 * src/gram.h, src/gram.c (error_token_number): Remove, use
11133 errtoken->number.
11134 * src/reader.c (reader): Don't specify the user token number (2)
11135 for $undefined, as it uselessly prevents using it.
11136 * src/gram.h (token_number_t): Move to...
11137 * src/symtab.h: here.
11138 (state_t.number): Is a token_number_t.
11139 * src/print.c, src/reader.c: Use undeftoken->number instead of
11140 hard coded 2.
11141 (Even though this 2 is not the same as above: the number of the
11142 undeftoken remains being 2, it is its user token number which
11143 might not be 2).
11144 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
11145 `user_token_number_max'.
11146 Output `undef_token_number'.
11147 * data/bison.simple, data/bison.c++: Use them.
11148 Be sure to map invalid yylex return values to
11149 `undef_token_number'. This saves us from gratuitous SEGV.
11150
11151 * tests/conflicts.at (Solved SR Conflicts)
11152 (Unresolved SR Conflicts): Adjust.
11153 * tests/regression.at (Web2c Actions): Adjust.
11154
06446ccf
AD
111552002-04-08 Akim Demaille <akim@epita.fr>
11156
11157 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
11158 Adding #line.
11159 Remove the duplicate `typedefs'.
11160 (RhsNumberType): Fix the declaration and various other typos.
11161 Use __ofile__.
11162 * data/bison.simple: Use __ofile__.
11163 * src/scan-skel.l: Handle __ofile__.
11164
62a3e4f0
AD
111652002-04-08 Akim Demaille <akim@epita.fr>
11166
11167 * src/gram.h (item_number_t): New, the type of item numbers in
11168 RITEM. Note that it must be able to code symbol numbers as
11169 positive number, and the negation of rule numbers as negative
11170 numbers.
11171 Adjust all dependencies (pretty many).
11172 * src/reduce.c (rule): Remove this `short *' pointer: use
11173 item_number_t.
11174 * src/system.h (MINSHORT, MAXSHORT): Remove.
11175 Include `limits.h'.
11176 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
11177 (shortcpy): Remove.
11178 (MAXTABLE): Move to...
11179 * src/output.c (MAXTABLE): here.
11180 (prepare_rules): Use output_int_table to output rhs.
11181 * data/bison.simple, data/bison.c++: Adjust.
11182 * tests/torture.at (Big triangle): Move the limit from 254 to
11183 500.
11184 * tests/regression.at (Web2c Actions): Ajust.
11185
11186 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
11187 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
11188 passes, but produces negative #line number, once fixed, GCC is
11189 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
11190 C), it passes.
11191 * src/state.h (state_h): Code input lines on ints, not shorts.
11192
bb88b0fc
AD
111932002-04-08 Akim Demaille <akim@epita.fr>
11194
11195 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11196 and then the grammar.
11197
9a636f47
AD
111982002-04-08 Akim Demaille <akim@epita.fr>
11199
11200 * src/system.h: No longer using strndup.
11201
680e8701
AD
112022002-04-07 Akim Demaille <akim@epita.fr>
11203
11204 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
11205 * src/output.c (output_table_data): Return the longest number.
11206 (prepare_tokens): Output `token_number_max').
11207 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
11208 New.
11209 Use them to define yy_token_number_type/TokenNumberType.
11210 Use this type for yytranslate.
11211 * tests/torture.at (Big triangle): Push the limit from 124 to
11212 253.
11213 * tests/regression.at (Web2c Actions): Adjust.
11214
817e9f41
AD
112152002-04-07 Akim Demaille <akim@epita.fr>
11216
11217 * tests/torture.at (Big triangle): New.
11218 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11219 * tests/existing.at: here.
11220
5123689b
AD
112212002-04-07 Akim Demaille <akim@epita.fr>
11222
11223 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11224 nritems.
11225 Adjust dependencies.
11226
f3849179
AD
112272002-04-07 Akim Demaille <akim@epita.fr>
11228
11229 * src/reader.c: Normalize increments to prefix form.
11230
bd02036a
AD
112312002-04-07 Akim Demaille <akim@epita.fr>
11232
11233 * src/reader.c, symtab.c: Remove debugging code.
11234
db8837cb
AD
112352002-04-07 Akim Demaille <akim@epita.fr>
11236
11237 Rename all the `bucket's as `symbol_t'.
11238
11239 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
11240 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
11241 * src/symtab.c, src/symtab.h (bucket): Rename as...
11242 (symbol_t): this.
11243 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11244 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11245 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11246 (buckets_new, buckets_free, buckets_do): Rename as...
11247 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11248 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11249 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11250 (symbols_new, symbols_free, symbols_do): these.
11251
72a23c97
AD
112522002-04-07 Akim Demaille <akim@epita.fr>
11253
11254 Use lib/hash for the symbol table.
11255
11256 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11257 EOF.
11258 * src/lex.c (lex): Set the `number' member of new terminals.
11259 * src/reader.c (bucket_check_defined, bucket_make_alias)
11260 (bucket_check_alias_consistence, bucket_translation): New.
11261 (reader, grammar_free, readgram, token_translations_init)
11262 (packsymbols): Adjust.
11263 (reader): Number the predefined tokens.
11264 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11265 for predefined tokens.
11266 * src/symtab.h (bucket): Remove all the hash table related
11267 members.
11268 * src/symtab.c (symtab): Replace by...
11269 (bucket_table): this.
11270 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11271 (buckets_new, buckets_do): New.
11272
280a38c3
AD
112732002-04-07 Akim Demaille <akim@epita.fr>
11274
11275 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11276 (start_symbol, max_user_token_number, semantic_parser)
11277 (error_token_number): Initialize.
11278 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11279 Initialize.
11280 (reader): Don't.
11281 (errtoken, eoftoken, undeftoken, axiom): Extern.
11282
03b31c0c
AD
112832002-04-07 Akim Demaille <akim@epita.fr>
11284
11285 * src/gram.h (rule_s): prec and precsym are now pointers
11286 to the bucket giving the priority/associativity.
11287 Member `associativity' removed: useless.
11288 * src/reduce.c, src/conflicts.c: Adjust.
11289
8b3df748
AD
112902002-04-07 Akim Demaille <akim@epita.fr>
11291
11292 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
11293 Properly escape the symbols' TAG when outputting them.
11294
e601aa1d
AD
112952002-04-07 Akim Demaille <akim@epita.fr>
11296
11297 * src/lalr.h (LA): Is a bitsetv, not bitset*.
11298
b0299a2e
AD
112992002-04-07 Akim Demaille <akim@epita.fr>
11300
11301 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
11302 (LArule): this, which is an array to rule_t*.
11303 * src/print.c, src/conflicts.c: Adjust.
11304
d7e1f00c
AD
113052002-04-07 Akim Demaille <akim@epita.fr>
11306
11307 * src/gram.h (rule_t): Rename `number' as `user_number'.
11308 `number' is a new member.
11309 Adjust dependencies.
11310 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
11311
cc9305dd
AD
113122002-04-07 Akim Demaille <akim@epita.fr>
11313
11314 As a result of the previous patch, it is no longer needed
11315 to reorder ritem itself.
11316
11317 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
11318
b0940840
AD
113192002-04-07 Akim Demaille <akim@epita.fr>
11320
11321 Be sure never to walk through RITEMS, but use only data related to
11322 the rules themselves. RITEMS should be banished.
11323
11324 * src/output.c (output_token_translations): Rename as...
11325 (prepare_tokens): this.
11326 In addition to `translate', prepare the muscles `tname' and
11327 `toknum', which were handled by...
11328 (output_rule_data): this.
11329 Remove, and move the remainder of its outputs into...
11330 (prepare_rules): this new routines, which also merges content from
11331 (output_gram): this.
11332 (prepare_rules): Be sure never to walk through RITEMS.
11333 (output_stos): Rename as...
11334 (prepare_stos): this.
11335 (output): Always invoke prepare_states, after all, just don't use it
11336 in the output if you don't need it.
11337
643a5994
AD
113382002-04-07 Akim Demaille <akim@epita.fr>
11339
11340 * src/LR0.c (new_state): Display `nstates' as the name of the
11341 newly created state.
11342 Adjust to initialize first_state and last_state if needed.
11343 Be sure to distinguish the initial from the final state.
11344 (new_states): Create the itemset of the initial state, and use
11345 new_state.
11346 * src/closure.c (closure): Now that the initial state has its
11347 items properly set, there is no need for a special case when
11348 creating `ruleset'.
11349
11350 As a result, now the rule 0, reducing to $axiom, is visible in the
11351 outputs. Adjust the test suite.
11352
11353 * tests/conflicts.at (Solved SR Conflicts)
11354 (Unresolved SR Conflicts): Adjust.
11355 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
11356 * tests/conflicts.at (S/R in initial): New.
11357
b4c4ccc2
AD
113582002-04-07 Akim Demaille <akim@epita.fr>
11359
11360 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
11361 the RHS of the rules.
11362 * src/output.c (output_gram): Likewise.
11363
bba97eb2
AD
113642002-04-07 Akim Demaille <akim@epita.fr>
11365
11366 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
11367 bucket.
11368 Adjust all dependencies.
11369 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
11370 `number' of the buckets too.
11371 * src/gram.h: Include `symtab.h'.
11372 (associativity): Move to...
11373 * src/symtab.h: here.
11374 No longer include `gram.h'.
11375
c3b407f4
AD
113762002-04-07 Akim Demaille <akim@epita.fr>
11377
11378 * src/gram.h, src/gram.c (rules_rhs_length): New.
11379 (ritem_longest_rhs): Use it.
11380 * src/gram.h (rule_t): `number' is a new member.
11381 * src/reader.c (packgram): Set it.
11382 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
11383 the end of `rules', and count them out of `nrules'.
11384 (reduce_output, dump_grammar): Adjust.
11385 * src/print.c (print_grammar): It is no longer needed to check for
11386 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
11387 * tests/reduce.at (Reduced Automaton): New test.
11388
11652ab3
AD
113892002-04-07 Akim Demaille <akim@epita.fr>
11390
11391 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
11392 lacking `+ 1' to nrules, Bison reported as useless a token if it
11393 was used solely to set the precedence of the last rule...
11394
26b23c1a
AD
113952002-04-07 Akim Demaille <akim@epita.fr>
11396
11397 * data/bison.c++, data/bison.simple: Don't output the current file
11398 name in #line, to avoid useless diffs between two identical
11399 outputs under different names.
11400
18bcecb0
AD
114012002-04-07 Akim Demaille <akim@epita.fr>
11402
11403 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
11404 Normalize loops to using `< nrules + 1', not `<= nrules'.
11405
fa770c86
AD
114062002-04-07 Akim Demaille <akim@epita.fr>
11407
11408 * TODO: Update.
11409
d9b739c3
AD
114102002-04-07 Akim Demaille <akim@epita.fr>
11411
11412 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
11413 bucket.value as bucket.number.
11414
99013900
AD
114152002-04-07 Akim Demaille <akim@epita.fr>
11416
11417 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
11418 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11419 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
11420 RHS, instead of being an index in RITEMS.
11421
e966383b
PE
114222002-04-04 Paul Eggert <eggert@twinsun.com>
11423
11424 * doc/bison.texinfo: Update copyright date.
11425 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
11426 (Symbols): Warn about running Bison in one character set,
11427 but compiling and/or running in an incompatible one.
11428 Warn about character code 256, too.
11429
114302002-04-03 Paul Eggert <eggert@twinsun.com>
11431
11432 * src/bison.data (YYSTACK_ALLOC): Depend on whether
11433 YYERROR_VERBOSE is nonzero, not whether it is defined.
11434
11435 Merge changes from bison-1_29-branch.
c307773e 11436
8d6c48b9
PE
114372002-03-20 Paul Eggert <eggert@twinsun.com>
11438
11439 Merge fixes from Debian bison_1.34-1.diff.
11440
11441 * configure.in (AC_PREREQ): 2.53.
11442
e53c6322
AD
114432002-03-20 Akim Demaille <akim@epita.fr>
11444
11445 * src/conflicts.c (log_resolution): Argument `resolution' is const.
11446
9ffbeca7
PE
114472002-03-19 Paul Eggert <eggert@twinsun.com>
11448
21db0b2a
PE
11449 * src/bison.simple (YYCOPY): New macro.
11450 (YYSTACK_RELOCATE): Use it.
11451 Remove Type arg; no longer needed. All callers changed.
11452 (yymemcpy): Remove; no longer needed.
11453
9ffbeca7
PE
11454 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
11455 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11456
642cb8f8
AD
114572002-03-19 Akim Demaille <akim@epita.fr>
11458
11459 Test and fix the #line outputs.
11460
11461 * tests/atlocal.at (GCC): New.
11462 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 11463 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
11464 (Action synch line, Epilogue synch line): New tests.
11465 * src/reader.c (parse_union_decl): Define the muscle stype_line.
11466 * data/bison.simple, data/bison.c++: Use it.
11467
3c31a486
AD
114682002-03-19 Akim Demaille <akim@epita.fr>
11469
11470 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
11471 (Solved SR Conflicts, %expect not enough, %expect right)
11472 (%expect too much): Move to...
11473 * tests/conflicts.at: this new file.
11474
0d8bed56
AD
114752002-03-19 Akim Demaille <akim@epita.fr>
11476
11477 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11478 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
11479 that we can move to enums for instance.
11480 * src/output.c (token_definitions_output): Output a list of
11481 `token-name, token-number' instead of the #define.
11482 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
11483
9208d17f
AD
114842002-03-14 Akim Demaille <akim@epita.fr>
11485
11486 Use Gettext 0.11.1.
11487
af27eacb
RA
114882002-03-09 Robert Anisko <robert@lrde.epita.fr>
11489
11490 * data/bison.c++: Make the user able to add members to the generated
11491 parser by subclassing.
11492
9101a310
RA
114932002-03-05 Robert Anisko <robert@lrde.epita.fr>
11494
11495 * src/reader.c (read_additionnal_code): `c' should be an integer, not
11496 a character.
11497 Reported by Nicolas Tisserand and Nicolas Burrus.
11498
fff9bf0b
RA
114992002-03-04 Robert Anisko <robert@lrde.epita.fr>
11500
11501 * src/reader.c: Warn about lacking semi-colons, do not complain.
11502
64dba31e
RA
115032002-03-04 Robert Anisko <robert@lrde.epita.fr>
11504
11505 * data/bison.c++: Remove a debug line.
11506
374f5a14
RA
115072002-03-04 Robert Anisko <robert@lrde.epita.fr>
11508
11509 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
11510 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
11511 provide a default implementation.
11512
bfcf1f3a
AD
115132002-03-04 Akim Demaille <akim@epita.fr>
11514
11515 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
11516 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
11517 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
11518 * tests/semantic.at (Parsing Guards): Similarly.
11519 * src/reader.at (readgram): Complain if the last rule is not ended
11520 with a semi-colon.
11521
65ccf9fc
AD
115222002-03-04 Akim Demaille <akim@epita.fr>
11523
11524 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
11525 * src/closure.c: here.
11526 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
11527 RTC.
11528 * src/warshall.h, src/warshall.c: Remove.
11529 * tests/sets.at (Broken Closure): Adjust.
11530
d0039cbc
AD
115312002-03-04 Akim Demaille <akim@epita.fr>
11532
11533 * src/output.c (output_skeleton): tempdir is const.
11534 bytes_read is unused.
11535
345cea78
AD
115362002-03-04 Akim Demaille <akim@epita.fr>
11537
11538 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
11539 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
11540 Update.
11541 From Michael Hayes.
11542
564801f7
AD
115432002-03-04 Akim Demaille <akim@epita.fr>
11544
11545 * src/closure.c (closure): `r' is unused.
11546
e5352bc7
AD
115472002-03-04 Akim Demaille <akim@epita.fr>
11548
11549 * tests/sets.at (Broken Closure): Add the ending `;'.
11550 * src/reader.at (readgram): Complain if a rule is not ended with a
11551 semi-colon.
11552
914feea9
AD
115532002-03-04 Akim Demaille <akim@epita.fr>
11554
11555 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
11556 (count_sr_conflicts): Use bitset_count.
11557 * src/reduce.c (inaccessable_symbols): Ditto.
11558 (bits_size): Remove.
11559 * src/warshall.h, src/warshall.c: Convert to bitsetv.
11560
f0250de6
AD
115612002-03-04 Akim Demaille <akim@epita.fr>
11562
11563 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
11564 * src/reduce.c: Remove the `bitset_zero's following the
11565 `bitset_create's, as now it is performed by the latter.
11566
ef017502
AD
115672002-03-04 Akim Demaille <akim@epita.fr>
11568
11569 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
11570 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
11571 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
11572 latest sources from Michael.
11573
76514394
AD
115742002-03-04 Akim Demaille <akim@epita.fr>
11575
11576 * src/output.c (output): Don't free the grammar.
11577 * src/reader.c (grammar_free): New.
11578 * src/main.c (main): Call it and don't free symtab here.
11579
55024580
AD
115802002-03-04 Akim Demaille <akim@epita.fr>
11581
11582 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
11583 before returning.
11584 Reported by Benoit Perrot.
11585
f9abaa2c
AD
115862002-03-04 Akim Demaille <akim@epita.fr>
11587
11588 Use bitset operations when possible, not loops over bits.
11589
11590 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
11591 bitset_or.
11592 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
11593 * src/reduce.c (useless_nonterminals): Formatting changes.
11594 * src/warshall.c (TC): Use bitset_or.
11595
0e721e75
AD
115962002-03-04 Akim Demaille <akim@epita.fr>
11597
11598 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
11599 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
11600 Ditto.
11601
0fb1ffb1
AD
116022002-03-04 Akim Demaille <akim@epita.fr>
11603
11604 * src/lalr.c (F): Now a bitset*.
11605 Adjust all dependencies.
11606
b86796bf
AD
116072002-03-04 Akim Demaille <akim@epita.fr>
11608
11609 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
11610 Adjust all dependencies.
11611
602bbf31
AD
116122002-03-04 Akim Demaille <akim@epita.fr>
11613
11614 * src/L0.c, src/LR0.h (nstates): Be size_t.
11615 Adjust comparisons (signed vs unsigned).
11616 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
11617 bitset*.
11618 Adjust all dependencies.
11619
d8a0245c
AD
116202002-03-04 Akim Demaille <akim@epita.fr>
11621
11622 * src/closure.c (firsts): Now, also a bitset.
11623 Adjust all dependencies.
11624 (varsetsize): Remove, now unused.
11625 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
11626
34ba9743
AD
116272002-03-04 Akim Demaille <akim@epita.fr>
11628
11629 * src/print.c: Convert to use bitset.h, not hand coded iterations
11630 over ints.
11631
ed86e78c
AD
116322002-03-04 Akim Demaille <akim@epita.fr>
11633
11634 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
11635
dfdb1797
AD
116362002-03-04 Akim Demaille <akim@epita.fr>
11637
11638 * src/closure.c (ruleset): Be a bitset.
11639 (rulesetsize): Remove.
11640
7086e707
AD
116412002-03-04 Akim Demaille <akim@epita.fr>
11642
11643 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
11644 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
11645 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
11646 * src/closure.c (fderives): Be an array of bitsets.
11647
98254360
RA
116482002-02-28 Robert Anisko <robert@lrde.epita.fr>
11649
11650 * data/bison.c++: Merge the two generated headers. Insert a copyright
11651 notice in each output file.
11652
a75c057f
AD
116532002-02-28 Akim Demaille <akim@epita.fr>
11654
11655 * data/bison.c++: Copy the prologue of bison.simple to fetch
11656 useful M4 definitions, such as b4_header_guard.
11657
06b00abc
AD
116582002-02-25 Akim Demaille <akim@epita.fr>
11659
11660 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
11661 translator friendly scheme for the bgr
11662 copyright notice.
06b00abc 11663
70e7d534
AD
116642002-02-25 Akim Demaille <akim@epita.fr>
11665
11666 * src/output.c (header_output): Remove, now handled completely via
11667 M4.
11668
abe017f6
AD
116692002-02-25 Akim Demaille <akim@epita.fr>
11670
11671 * m4/m4.m4: New, from CVS Autoconf.
11672 * configure.in: Invoke it.
11673 * src/output.c (output_skeleton): Use its result instead of the
11674 hard coded name.
11675
381fb12e
AD
116762002-02-25 Akim Demaille <akim@epita.fr>
11677
11678 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
11679 Fileutils 4.1.5.
11680 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
11681 * src/output.c (output_skeleton): Use mkstemp to create a real
11682 temporary file.
11683 Move the filling of `skeleton' and its muscle to...
11684 (prepare): here.
11685 (output): Move the definition of the prologue muscle to...
11686 (prepare): here.
11687 * src/system.h (DEFAULT_TMPDIR): New.
11688
6f38107f
PE
116892002-02-14 Paul Eggert <eggert@twinsun.com>
11690
11691 Remove the support for C++ namespace cleanliness; it was
11692 causing more problems than it was curing, since it didn't work
11693 properly on some nonstandard C++ compilers. This can wait
11694 for a proper C++ parser.
11695
11696 * NEWS: Document this.
11697 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
11698 of C++, as it's treated like C now.
11699 * src/bison.simple (YYSTD): Remove.
11700 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
11701 Treat C++ just like Standard C instead of trying to support
11702 namespace cleanliness.
11703
80cce3da
AD
117042002-02-14 Akim Demaille <akim@epita.fr>
11705
11706 * tests/regression.at (else): Adjust to Andreas' change.
11707
842e8679
AD
117082002-02-14 Akim Demaille <akim@epita.fr>
11709
11710 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
11711
4bda3f10
AD
117122002-02-13 Andreas Schwab <schwab@suse.de>
11713
11714 * src/output.c (output_rule_data): Don't output NULL, it might
11715 not be defined yet.
11716
4162fa07 117172002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 11718
4162fa07
RA
11719 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
11720 (Copyright notice): Update.
b418ecd8 11721
bd16a5dc
AD
117222002-02-11 Akim Demaille <akim@epita.fr>
11723
11724 * tests/regression.at (%nonassoc and eof): Don't include
11725 nonportable headers.
11726
8d69a1a3
RA
117272002-02-08 Robert Anisko <robert@lrde.epita.fr>
11728
11729 * data/bison.c++: Correct error recovery. Make the user able to
11730 initialize the starting location.
11731
9b2d0677
AD
117322002-02-07 Akim Demaille <akim@epita.fr>
11733
11734 * tests/input.at: New.
11735
69e2658b
RA
117362002-02-07 Robert Anisko <robert@lrde.epita.fr>
11737
11738 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 11739 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
11740 directives around tables only needed for debugging.
11741
4aacc3a7
RA
117422002-02-07 Robert Anisko <robert@lrde.epita.fr>
11743
11744 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
11745 C++ parsers.
11746 (yy::b4_name::parse): Use print_.
11747
762a801e
RA
117482002-02-07 Robert Anisko <robert@lrde.epita.fr>
11749
11750 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
11751
4bb2bc3f
RA
117522002-02-07 Robert Anisko <robert@lrde.epita.fr>
11753
11754 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
11755 C++ parsers.
11756 (yy::b4_name::parse): Build verbose error messages, and use error_.
11757
6b45a3ca
RA
117582002-02-06 Robert Anisko <robert@lrde.epita.fr>
11759
11760 * data/bison.c++: Fix m4 quoting in comments.
11761
50997c6e
RA
117622002-02-06 Robert Anisko <robert@lrde.epita.fr>
11763
11764 * data/bison.c++: Adjust the parser code. Fix some muscles that were
11765 not expanded by m4.
11766
3f3eed27
AD
117672002-02-05 Akim Demaille <akim@epita.fr>
11768
11769 * data/bison.c++: Adjust to the M4 back end.
11770 More is certainly needed.
11771
be2a1a68
AD
117722002-02-05 Akim Demaille <akim@epita.fr>
11773
11774 Give a try to M4 as a back end.
11775
11776 * lib/readpipe.c: New, from wdiff.
11777 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
11778 BISON_HAIRY.
11779 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
11780 specific values. Now it is m4 that performs the lookup.
11781 * src/parse-skel.y: Remove.
11782 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
11783 * src/output.c (actions_output, guards_output)
11784 (token_definitions_output): No longer keeps track of the output
11785 line number, hence remove the second argument.
11786 (guards_output): Check against the guard member of a rule, not the
11787 action member.
11788 Adjust callers.
11789 (output_skeleton): Don't look for the skeleton location, let m4 do
11790 that.
11791 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
11792 file will be used.
11793 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
11794 (prepare): Given that for the time being changesyntax is not
11795 usable in M4, rename the muscles using `-' to `_'.
11796 Define `defines_flag', `output_parser_name' and `output_header_name'.
11797 * src/output.h (actions_output, guards_output)
11798 (token_definitions_output): Adjust prototypes.
11799 * src/scan-skel.l: Instead of scanning the skeletons, it now
11800 processes the output of m4: `__oline__' and `#output'.
11801 * data/bison.simple: Adjust to be used by M4(sugar).
11802 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
11803 to date.
11804 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
11805 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
11806 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
11807 shamelessly stolen from CVS Autoconf.
11808
beda758b
AD
118092002-02-05 Akim Demaille <akim@epita.fr>
11810
11811 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
11812 * configure.in: Check for the declarations of free and malloc.
11813 * src/muscle_tab.c: Adjust.
11814
5ece6d43
AD
118152002-02-05 Akim Demaille <akim@epita.fr>
11816
11817 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
11818 which have no values.
11819
5bb18f9a
AD
118202002-02-05 Akim Demaille <akim@epita.fr>
11821
11822 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
11823 * data/: here.
11824
894dd62e
PE
118252002-01-29 Paul Eggert <eggert@twinsun.com>
11826
11827 * src/bison.simple (YYSIZE_T): Do not define merely because
11828 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
11829 On some platforms, <alloca.h> does not declare YYSTD (size_t).
11830
82841af7
AD
118312002-01-27 Akim Demaille <akim@epita.fr>
11832
11833 Fix `%nonassoc and eof'.
11834
11835 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
11836 which were not properly copied! Replace
11837 memcpy (res->errs, src->errs, src->nerrs);
11838 with
11839 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
11840 !!!
11841 * tests/regression.at (%nonassoc and eof): Adjust to newest
11842 Autotest: `.' is not in the PATH.
11843
318b76e9
AD
118442002-01-27 Akim Demaille <akim@epita.fr>
11845
11846 * tests/sets.at (AT_EXTRACT_SETS): New.
11847 (Nullable): Use it.
11848 (Firsts): New.
11849
30d2f3d5
AD
118502002-01-26 Akim Demaille <akim@epita.fr>
11851
11852 * tests/actions.at, tests/calc.at, tests/headers.at,
11853 * tests/torture.at: Adjust to the newest Autotest which no longer
11854 forces `.' in the PATH.
11855
30f8c395
AD
118562002-01-25 Akim Demaille <akim@epita.fr>
11857
11858 * tests/regression.at (%nonassoc and eof): New.
11859 Suggested by Robert Anisko.
11860
29ae55f1
AD
118612002-01-24 Akim Demaille <akim@epita.fr>
11862
11863 Bison dumps core when trying to complain about broken input files.
11864 Reported by Cris van Pelt.
11865
11866 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
11867 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
11868 into...
11869 (Invalid inputs): Strengthen: exercise parse_percent_token.
11870
2b548aa6
RA
118712002-01-24 Robert Anisko <robert.anisko@epita.fr>
11872
11873 * src/Makefile.am: Add bison.c++.
11874 * src/bison.c++: New skeleton.
11875
bb0146c2
AD
118762002-01-21 Paolo Bonzini <bonzini@gnu.org>
11877
11878 * po/it.po: New.
11879
bec30531
AD
118802002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
11881
11882 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
11883
fc6edc45
MA
118842002-01-20 Marc Autret <marc@gnu.org>
11885
11886 * src/files.c (compute_output_file_names): Fix
11887
5e5d5415
MA
118882002-01-20 Marc Autret <marc@gnu.org>
11889
11890 * tests/output.at: New test.
11891 * src/files.c (compute_base_names): Don't map extensions when
11892 the YACC flag is set, use defaults.
11893 Reported by Evgeny Stambulchik.
11894
44ea3fbd
MA
118952002-01-20 Marc Autret <marc@gnu.org>
11896
ba0fe3c7
PE
11897 * src/system.h: Need to define __attribute__ away for non-GCC
11898 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
11899 Suggested by Albert Chin-A-Young.
11900
338963d1
TVH
119012002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
11902
11903 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
11904 canonical definition.
11905 * src/system.h: Use the canonical definition for PARAMS (avoids
11906 a conflict with the macro from lib/hash.h).
11907
c57b2479
AD
119082002-01-11 Akim Demaille <akim@epita.fr>
11909
11910 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 11911 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 11912
b85810ae
AD
119132002-01-09 Akim Demaille <akim@epita.fr>
11914
11915 * src/files.c, src/files.h (output_infix): New.
11916 (tab_extension): Remove.
11917 (compute_base_names): Compute the former, drop the latter.
11918 * src/output.c (prepare): Insert the muscles `output-infix', and
11919 `output-suffix'.
11920 * src/parse-skel.y (string, string.1): New.
11921 (section.header): Use it.
11922 (section.yacc): Remove.
11923 (prefix): Remove too.
11924 * src/scan-skel.l: Adjust.
11925 * src/bison.simple, src/bison.hairy: Adjust.
11926
cae60122
AD
119272002-01-09 Akim Demaille <akim@epita.fr>
11928
11929 * configure.in (WERROR_CFLAGS): Compute it.
11930 * src/Makefile.am (CFLAGS): Pass it.
11931 * tests/atlocal.in (CFLAGS): Idem.
11932 * src/files.c: Fix a few warnings.
11933 (get_extension_index): Remove, unused.
11934
ae404801
AD
119352002-01-08 Akim Demaille <akim@epita.fr>
11936
11937 * src/getargs.c (AS_FILE_NAME): New.
11938 (getargs): Use it to convert DOSish file names.
11939 * src/files.c (base_name): Rename as full_base_name to avoid
11940 clashes with `base_name ()'.
11941 (filename_split): New.
11942 (compute_base_names): N-th rewrite, using filename_split.
11943
22312b71
AD
119442002-01-08 Akim Demaille <akim@epita.fr>
11945
11946 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
11947 New, stolen from the Fileutils 4.1.
11948 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
11949 * configure.in: Check for the presence of memrchr, and of its
11950 prototype.
11951
a67cef01
TVH
119522002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
11953
11954 * lib/hash.h (__P): Added definition for this macro.
11955 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
11956 BUILT_SOURCES, to ensure they are generated first.
11957 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
11958 %error-verbose to allow bootstrapping with bison 1.30x.
11959
2b25d624
AD
119602002-01-06 Akim Demaille <akim@epita.fr>
11961
11962 * src/reader.c (parse_braces): Don't fetch the next char, the
11963 convention is to fetch on entry.
11964 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
11965 'switch' without a following semicolon.
11966 * tests/regression.at (braces parsing): New.
11967
3460813b
AD
119682002-01-06 Akim Demaille <akim@epita.fr>
11969
11970 Bison is dead wrong in its RR conflict reports.
11971
11972 * tests/torture.at (GNU Cim Grammar): New.
11973 * src/conflicts.c (count_rr_conflicts): Fix.
11974
73784c64
AD
119752002-01-06 Akim Demaille <akim@epita.fr>
11976
11977 Creating package.m4 from configure.ac causes too many problems.
11978
11979 * tests/Makefile.am (package.m4): Create it by hand,
11980 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
11981
25d81090
AD
119822002-01-06 Akim Demaille <akim@epita.fr>
11983
11984 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
11985 skeleton.h.
11986
a9b8959e
PE
119872002-01-04 Paul Eggert <eggert@twinsun.com>
11988
11989 * doc/bison.texinfo (Debugging):
11990 Remove YYSTDERR; it's no longer defined or used.
11991 Also, s/cstdio.h/cstdio/.
11992
25d81090
AD
119932002-01-03 Akim Demaille <akim@epita.fr>
11994
11995 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
11996
1109455c
AD
119972002-01-03 Akim Demaille <akim@epita.fr>
11998
11999 * src/parse-skel.y (process_skeleton): Don't bind the parser's
12000 tracing code to --trace, wait for a better --trace option, with
12001 args.
12002
7ea5e977
AD
120032002-01-03 Akim Demaille <akim@epita.fr>
12004
12005 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
12006 The ISO C++ standard is extremely clear about it: stderr is
12007 considered a macro, not a regular symbol (see table 94 `Header
12008 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
12009 Therefore std:: does not apply to it. It still does with fprintf.
12010 Also, s/cstdio.h/cstdio/.
12011
fab5b110
AD
120122002-01-03 Akim Demaille <akim@epita.fr>
12013
12014 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
12015 for non system headers.
12016
aed7fd9b
AD
120172002-01-02 Akim Demaille <akim@epita.fr>
12018
12019 Equip the skeleton chain with location tracking, runtime trace,
12020 pure parser and scanner.
12021
12022 * src/parse-skel.y: Request a pure parser, locations, and prefix
12023 renaming.
12024 (%union): Having several members with the same type does not help
12025 type mismatches, simplify.
12026 (YYPRINT, yyprint): New.
12027 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
12028 (skel_error): this.
12029 Handle locations.
12030 * src/scan-skel.l: Adjust to these changes.
12031 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
12032 (LOCATION_PRINT, skel_control_t): New.
12033
24fad99e
AD
120342001-12-30 Akim Demaille <akim@epita.fr>
12035
12036 * src/parse-skel.y: Get rid of the shift/reduce conflict:
12037 replace `gb' with BLANKS.
12038 * src/scan-skel.l: Adjust.
12039
a4b36db4
AD
120402001-12-30 Akim Demaille <akim@epita.fr>
12041
12042 * src/system.h: We don't need nor want bcopy.
12043 Throw away MS-DOS crap: we don't need getpid.
12044 * configure.in: We don't need strndup. It was even causing
12045 problems: because Flex includes the headers *before* us,
12046 _GNU_SOURCE is not defined by config.h, and therefore strndup was
12047 not visible.
12048 * lib/xstrndup.c: New.
12049 * src/scan-skel.l: Use it.
12050 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
12051 * src/parse-skel.y: Use %directives instead of #defines.
12052
1239777d
AD
120532001-12-30 Akim Demaille <akim@epita.fr>
12054
12055 * src/skeleton.h: New.
12056 * src/output.c (output_parser, output_master_parser): Remove, dead
12057 code.
12058 * src/output.h (get_lines_number, actions_output, guards_output)
12059 (token_definitions_output): Prototype them.
12060 * src/parse-skel.y: Add the license notice.
12061 Include output.h and skeleton.h.
12062 (process_skeleton): Returns void, and takes a single parameter.
12063 * src/scan-skel.l: Add the license notice.
12064 Include skeleton.h.
12065 Don't use %option yylineno: it seems that then Flex imagines
12066 REJECT has been used, and therefore it won't reallocate its
12067 buffers (which makes no other sense to me than a bug). It results
12068 in warnings for `unused: yy_flex_realloc'.
12069
9b3add5b
RA
120702001-12-30 Robert Anisko <robert.anisko@epita.fr>
12071
12072 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12073 (MUSCLE_INSERT_PREFIX): ...to there.
12074 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
12075 (MUSCLE_INSERT_PREFIX): Move from here...
12076
12077 * src/bison.hairy: Add a section directive. Put braces around muscle
12078 names. This parser skeleton is still broken, but Bison should not
12079 choke on a bad muscle 'syntax'.
12080 * src/bison.simple: Add a section directive. Put braces around muscle
12081 names.
12082
12083 * src/files.h (strsuffix, stringappend): Add declarations.
12084 (tab_extension): Add declaration.
12085 (short_base_name): Add declaration.
12086
12087 * src/files.c (strsuffix, stringappend): No longer static. These
12088 functions are used in the skeleton parser.
12089 (tab_extension): New.
12090 (compute_base_names): Use the computations done in this function
fab5b110 12091 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
12092 names.
12093 (short_base_name): No longer static.
12094
12095 * src/output.c (output_skeleton): New.
12096 (output): Disable call to output_master_parser, and give a try to
12097 a new skeleton handling system.
12098 (guards_output, actions_output): No longer static.
12099 (token_definitions_output, get_lines_number): No longer static.
12100
12101 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
12102
fab5b110 12103 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
12104 parse-skel.y.
12105
12106 * src/parse-skel.y: New file.
12107 * src/scan-skel.l: New file.
12108
b5b61c61
AD
121092001-12-29 Akim Demaille <akim@epita.fr>
12110
12111 %name-prefix is broken.
12112
12113 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
12114 Adjust all dependencies.
12115 * tests/headers.at (export YYLTYPE): Strengthen this test: use
12116 %name-prefix.
12117
12118 Renaming yylval but not yylloc is not consistent. Now we do.
12119
12120 * src/bison.simple: Prefix yylloc if used.
12121 * doc/bison.texinfo (Decl Summary): Document that.
12122
8c9a50be
AD
121232001-12-29 Akim Demaille <akim@epita.fr>
12124
12125 * doc/bison.texinfo: Promote `%long-directive' over
12126 `%long_directive'.
12127 Remove all references to fixed-output-files, yacc is enough.
12128
d99361e6
AD
121292001-12-29 Akim Demaille <akim@epita.fr>
12130
12131 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
12132 user prologue. These are defaults.
12133 * tests/actions.at (Mid-rule actions): Make sure the user can
12134 define YYDEBUG and YYERROR_VERBOSE.
12135
b9cecb91
AD
121362001-12-29 Akim Demaille <akim@epita.fr>
12137
12138 * src/output.c (header_output): Don't forget to export YYLTYPE and
12139 yylloc.
12140 * tests/headers.at (export YYLTYPE): New, make sure it does.
12141 * tests/regression.at (%union and --defines, Invalid CPP headers):
12142 Move to...
12143 * tests/headers.at: here.
12144
aea13e97
AD
121452001-12-29 Akim Demaille <akim@epita.fr>
12146
12147 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
12148
931394cb
AD
121492001-12-29 Akim Demaille <akim@epita.fr>
12150
12151 * tests/actions.at (Mid-rule actions): Output on a single line
12152 instead of several.
12153
704a47c4
AD
121542001-12-29 Akim Demaille <akim@epita.fr>
12155
12156 * doc/bison.texinfo: Formatting changes.
12157
091e20bb
AD
121582001-12-29 Akim Demaille <akim@epita.fr>
12159
12160 Don't store the token defs in a muscle, just be ready to output it
12161 on command. Now possible via `symbols'. Fixes a memory leak.
12162
12163 * src/output.c (token_definitions_output): New.
12164 (output_parser, header_output): Use it.
12165 * src/reader.c (symbols_save): Remove.
12166
cce71710
AD
121672001-12-29 Akim Demaille <akim@epita.fr>
12168
12169 * src/bison.simple: Do not provide a default for YYSTYPE and
12170 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12171 default.
12172
82c035a8
AD
121732001-12-29 Akim Demaille <akim@epita.fr>
12174
12175 Mid-rule actions are simply... ignored!
12176
12177 * src/reader.c (readgram): Be sure to attach mid-rule actions to
12178 the empty-rule associated to the dummy symbol, not to the host
12179 rule.
12180 * tests/actions.at (Mid-rule actions): New.
12181
8419d367
AD
121822001-12-29 Akim Demaille <akim@epita.fr>
12183
12184 Memory leak.
12185
12186 * src/reader.c (reader): Free grammar.
12187
375d5806
AD
121882001-12-29 Akim Demaille <akim@epita.fr>
12189
12190 Memory leak.
12191
12192 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12193 since it allocates it for each state, although only one is needed.
12194 (allocate_storage): Do it here.
12195
f51cb8ff
AD
121962001-12-29 Akim Demaille <akim@epita.fr>
12197
12198 * src/options.h, src/options.c (create_long_option_table): Rename
12199 as...
12200 (long_option_table_new): this, with a clearer prototype.
12201 (percent_table): Remove, unused,
12202 * src/getargs.c (getargs): Adjust.
12203
29e88316
AD
122042001-12-29 Akim Demaille <akim@epita.fr>
12205
12206 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
12207 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
12208 as states.
12209
b9f71f19
AD
122102001-12-29 Akim Demaille <akim@epita.fr>
12211
12212 * src/lalr.c (build_relations): Rename `states' as `states1'.
12213 Sorry, I don't understand exactly what it is, no better name...
12214
1a2b5d37
AD
122152001-12-29 Akim Demaille <akim@epita.fr>
12216
12217 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
12218 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
12219 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12220 as rules.
12221
1cca533e
AD
122222001-12-29 Akim Demaille <akim@epita.fr>
12223
12224 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12225 ago.
12226
c03ae966
AD
122272001-12-29 Akim Demaille <akim@epita.fr>
12228
12229 * src/reader.c, src/reader.h (user_toknums): Remove.
12230 Adjust all users to use symbols[i]->user_token_number.
12231
5a670b1e
AD
122322001-12-29 Akim Demaille <akim@epita.fr>
12233
12234 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12235 Adjust all users to use symbols[i]->prec or ->assoc.
12236
ad949da9
AD
122372001-12-29 Akim Demaille <akim@epita.fr>
12238
12239 * src/reader.c, src/reader.h (tags): Remove.
12240 Adjust all users to use symbols[i]->tag.
12241
0e78e603
AD
122422001-12-29 Akim Demaille <akim@epita.fr>
12243
12244 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12245 and rule_table.
12246 * src/reader.c (packsymbols): Fill this table.
12247 Drop sprec.
12248 * src/conflicts.c (resolve_sr_conflict): Adjust.
12249 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12250 single table.
12251 Use symbols[i]->tag instead of tags[i].
12252
213e640e
AD
122532001-12-29 Akim Demaille <akim@epita.fr>
12254
12255 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12256 In addition, put a comment in there, to replace...
12257 * tests/regression.at (%union and C comments): Remove.
12258
e7b8bef1
AD
122592001-12-29 Akim Demaille <akim@epita.fr>
12260
12261 * tests/regression.at (Web2c Actions): Blindly move the actual
12262 output as expected output. The contents *seem* right to me, but I
12263 can't pretend reading perfectly parser tables... Nonetheless, all
12264 the other tests pass correctly, the table look OK, even though the
12265 presence of `$axiom' is to be noted: AFAICS it is useless (but
12266 harmless).
12267
b68e7744
AD
122682001-12-29 Akim Demaille <akim@epita.fr>
12269
12270 * src/reader.c (readgram): Don't add the rule 0 if there were no
12271 rules read. In other words, add it _after_ having performed
12272 grammar sanity checks.
12273 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12274
78d5bae9
AD
122752001-12-29 Akim Demaille <akim@epita.fr>
12276
12277 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12278 visible, and some states have now a different number.
12279
ff442794
AD
122802001-12-29 Akim Demaille <akim@epita.fr>
12281
12282 * src/reader.c (readgram): Bind the initial rule's lineno to that
12283 of the first rule.
12284 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12285 (Solved SR Conflicts): Adjust rule 0's line number.
12286
610ab194
AD
122872001-12-29 Akim Demaille <akim@epita.fr>
12288
12289 Fix the `GAWK Grammar' failure.
12290
12291 * src/LR0.c (final_state): Initialize to -1 so that we do compute
12292 the reductions of the first state which was mistakenly confused
12293 with the final state because precisely final_state was initialized
12294 to 0.
12295 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
12296 now noticed by Bison.
12297 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
12298 have a reduction on $default.
12299
29d29c8f
AD
123002001-12-29 Akim Demaille <akim@epita.fr>
12301
12302 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
12303 rule line numbers.
12304 * src/closure.c (print_closure): Likewise.
12305 * src/derives.c (print_derives): Likewise.
12306 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
12307 now.
12308
7c6b64d0
AD
123092001-12-29 Akim Demaille <akim@epita.fr>
12310
12311 * src/lalr.c (lookaheads_print): New.
12312 (lalr): Call it when --trace-flag.
12313 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
12314 are dumped.
12315
3d4daee3
AD
123162001-12-29 Akim Demaille <akim@epita.fr>
12317
12318 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
12319 when walking through ritem, even via rule->rhs.
12320 * src/reduce.c (dump_grammar, useful_production, reduce_output)
12321 (useful_production, useless_nonterminals): Likewise.
12322 (reduce_grammar_tables): Likewise, plus update nritems.
12323 * src/nullable.c (set_nullable): Likewise.
12324 * src/lalr.c (build_relations): Likewise.
12325 * tests/sets.at (Nullable): Adjust.
12326 Fortunately, now, the $axiom is no longer nullable.
12327
9e7f6bbd
AD
123282001-12-29 Akim Demaille <akim@epita.fr>
12329
12330 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
12331 the 0-sentinel.
12332 * src/gram.c (ritem_longest_rhs): Likewise.
12333 * src/reduce.c (nonterminals_reduce): Likewise.
12334 * src/print_graph.c (print_graph): Likewise.
12335 * src/output.c (output_rule_data): Likewise.
12336 * src/nullable.c (set_nullable): Likewise.
12337
255ef638
AD
123382001-12-29 Akim Demaille <akim@epita.fr>
12339
12340 * src/output.c: Comment changes.
12341
0d8a7363
AD
123422001-12-27 Paul Eggert <eggert@twinsun.com>
12343
12344 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
12345 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
12346 Sparc, as they were causing more porting problems than the
12347 (minor) performance improvement was worth.
12348
12349 Also, catch up with 1.31's YYSTD.
12350
3db472b9
AD
123512001-12-27 Akim Demaille <akim@epita.fr>
12352
12353 * src/output.c (output_gram): Rely on nritems, not the
12354 0-sentinel. See below.
12355 Use -1 as separator, not 0.
12356 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
12357 Rely on -1 as separator in yyrhs, instead of 0.
12358 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
12359 twice `Now at end of input', therefore there are two lines less to
12360 expect.
12361
b365aa05
AD
123622001-12-27 Akim Demaille <akim@epita.fr>
12363
12364 * tests/regression.at (Unresolved SR Conflicts):
12365 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
12366 below.
12367
30171f79
AD
123682001-12-27 Akim Demaille <akim@epita.fr>
12369
12370 * src/LR0.c (new_state): Recognize the final state by the fact it
12371 is reached by eoftoken.
12372 (insert_start_shifting_state, insert_eof_shifting_state)
12373 (insert_accepting_state, augment_automaton): Remove, since now
12374 these states are automatically computed from the initial state.
12375 (generate_states): Adjust.
12376 * src/print.c: When reporting a rule number to the user, substract
12377 1, so that the axiom rule is rule 0, and the first user rule is 1.
12378 * src/reduce.c: Likewise.
12379 * src/print_graph.c (print_core): For the time being, just as for
12380 the report, depend upon --trace-flags to dump the full set of
12381 items.
12382 * src/reader.c (readgram): Once the grammar read, insert the rule
12383 0: `$axiom: START-SYMBOL $'.
12384 * tests/set.at: Adjust: rule 0 is now displayed, and since the
12385 number of the states has changed (the final state is no longer
12386 necessarily the last), catch up.
12387
75142d45
AD
123882001-12-27 Akim Demaille <akim@epita.fr>
12389
12390 Try to make the use of the eoftoken valid. Given that its value
12391 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
12392 is used instead of > 0 where appropriate, (ii), depend upon nritems
12393 instead of the 0-sentinel.
12394
12395 * src/gram.h, src/gram.c (nritems): New.
12396 Expected to be duplication of nitems, but for the time being...
12397 * src/reader.c (packgram): Assert nritems and nitems are equal.
12398 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
12399 * src/closure.c (print_closure, print_fderives): Likewise.
12400 * src/gram.c (ritem_print): Likewise.
12401 * src/print.c (print_core, print_grammar): Likewise.
12402 * src/print_graph.c: Likewise.
12403
b7c49edf
AD
124042001-12-27 Akim Demaille <akim@epita.fr>
12405
12406 * src/main.c (main): If there are complains after grammar
12407 reductions, then output the report anyway if requested, then die.
12408 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
12409 * src/reader.c (eoftoken): New.
12410 (parse_token_decl): If the token being defined has value `0', it
12411 is the eoftoken.
12412 (packsymbols): No longer hack `tags' to insert `$' by hand.
12413 Be sure to preserve the value of the eoftoken.
12414 (reader): Make sure eoftoken is defined.
12415 Initialize nsyms to 0: now eoftoken is created just like the others.
12416 * src/print.c (print_grammar): Don't special case the eof token.
12417 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
12418 lie anyway, albeit pleasant.
12419 * tests/calc.at: Exercise error messages with eoftoken.
12420 Change the grammar so that empty input is invalid.
12421 Adjust expectations.
12422 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
12423
ec2da99f
AD
124242001-12-27 Akim Demaille <akim@epita.fr>
12425
12426 * configure.in: Check the protos of strchr ans strspn.
12427 Replace strchr if needed.
12428 * src/system.h: Provide the protos of strchr, strspn and memchr if
12429 missing.
12430 * lib/strchr.c: New.
12431 * src/reader.c (symbols_save): Use strchr.
12432
8adfa272
AD
124332001-12-27 Akim Demaille <akim@epita.fr>
12434
12435 * src/print.c, src/print_graph.c (escape): New.
12436 Use it to quote the TAGS outputs.
12437 * src/print_graph.c (print_state): Now errors are in red, and
12438 reductions in green.
12439 Prefer high to wide: output the state number on a line of its own.
12440
80dac38c
AD
124412001-12-27 Akim Demaille <akim@epita.fr>
12442
12443 * src/state.h, src/state.c (reductions_new): New.
12444 * src/LR0.c (set_state_table): Let all the states have a
12445 `reductions', even if reduced to 0.
12446 (save_reductions): Adjust.
12447 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
12448 * src/print.c (print_reductions, print_actions): Adjust.
12449 * src/output.c (action_row): Adjust.
12450
2cec70b9
AD
124512001-12-27 Akim Demaille <akim@epita.fr>
12452
12453 * src/state.h, src/state.c (errs_new, errs_dup): New.
12454 * src/LR0.c (set_state_table): Let all the states have an errs,
12455 even if reduced to 0.
12456 * src/print.c (print_errs, print_reductions): Adjust.
12457 * src/output.c (output_actions, action_row): Adjust.
12458 * src/conflicts.c (resolve_sr_conflict): Adjust.
12459
13ca549a
AD
124602001-12-27 Akim Demaille <akim@epita.fr>
12461
12462 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
12463
5092aba5
AD
124642001-12-27 Akim Demaille <akim@epita.fr>
12465
12466 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
12467 * src/print.c: here.
12468 (lookaheadset, shiftset): New, used as additional storage by
12469 print_reductions.
12470 (print_results): Adjust.
12471 (print_shifts, print_gotos, print_errs): New, extracted from...
12472 (print_actions): here.
12473 * src/print_graph.c (print_actions): Remove dead code.
12474
11e2beca
AD
124752001-12-27 Akim Demaille <akim@epita.fr>
12476
12477 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
12478 `$n' and `@n'.
12479
dac3c910
AD
124802001-12-27 Akim Demaille <akim@epita.fr>
12481
12482 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
12483 (build_relations): Adjust.
12484
d0b0fefa
AD
124852001-12-27 Akim Demaille <akim@epita.fr>
12486
12487 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
12488 duplication.
12489
adc8c848
AD
124902001-12-27 Akim Demaille <akim@epita.fr>
12491
12492 * src/reader.c (packgram): Catch nitems overflows.
12493
14d293ac
AD
124942001-12-27 Akim Demaille <akim@epita.fr>
12495
12496 * src/files.c, src/files.h (guard_obstack): Remove.
12497 * src/output.c (output): Adjust.
12498 * src/reader.c (parse_braces): New, factoring...
12499 (copy_action, copy_guard): these two which are renamed as...
12500 (parse_action, parse_guard): these.
12501 As a voluntary consequence, using braces around guards is now
12502 mandatory.
12503
f499b062
AD
125042001-12-27 Akim Demaille <akim@epita.fr>
12505
12506 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
12507 * src/reader.c (symbol_list): `guard' and `guard_line' are new
12508 members.
12509 (symbol_list_new): Adjust.
12510 (copy_action): action_line is the first line, not the last.
12511 (copy_guard): Just as for actions, store the `action' only, not
12512 the switch/case/break flesh.
12513 Don't parse the user action that might follow the guard, let...
12514 (readgram): do it, i.e., now, there can be an action after a
12515 guard.
12516 In other words the guard is just explicitly optional.
12517 (packgram): Adjust.
12518 * src/output.c (guards_output): New.
12519 (output_parser): Call it when needed.
12520 (output): Also free the guard and attrs obstacks.
12521 * src/files.c, src/files.h (obstack_save): Remove.
12522 (output_files): Remove.
12523 As a result, if one needs the former `.act' file, using an
12524 appropriate skeleton which requires actions and guards is now
12525 required.
12526 * src/main.c (main): Adjust.
12527 * tests/semantic.at: New.
12528 * tests/regression.at: Use `input.y' as input file name.
12529 Avoid 8+3 problems by requiring input.c when the test needs the
12530 parser.
12531
d945f5cd
AD
125322001-12-27 Akim Demaille <akim@epita.fr>
12533
12534 * src/reader.c (symbol_list_new): Be sure to initialize all the
12535 fields.
12536
d200e455
AD
125372001-12-27 Akim Demaille <akim@epita.fr>
12538
12539 All the hacks using a final pseudo state are now useless.
12540
12541 * src/LR0.c (set_state_table): state_table holds exactly nstates.
12542 * src/lalr.c (nLA): New.
12543 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
12544 instead of lookaheadsp from the pseudo state (nstate + 1).
12545
f9507c28
AD
125462001-12-27 Akim Demaille <akim@epita.fr>
12547
12548 * src/output.c (action_row, token_actions): Use a state_t instead
12549 of a integer, and nlookaheads instead of the following state's
12550 lookaheadsp.
12551
065fbd27
AD
125522001-12-27 Akim Demaille <akim@epita.fr>
12553
12554 * src/conflicts.c (log_resolution, flush_shift)
12555 (resolve_sr_conflict, set_conflicts, solve_conflicts)
12556 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
12557 (conflicts_print, print_reductions): Use a state_t instead of an
12558 integer when referring to a state.
12559 As much as possible, depend upon nlookaheads, instead of the
12560 `lookaheadsp' member of the following state (since lookaheads of
12561 successive states are successive, the difference between state n + 1
12562 and n served as the number of lookaheads for state n).
12563 * src/lalr.c (add_lookback_edge): Likewise.
12564 * src/print.c (print_core, print_actions, print_state)
12565 (print_results): Likewise.
12566 * src/print_graph.c (print_core, print_actions, print_state)
12567 (print_graph): Likewise.
12568 * src/conflicts.h: Adjust.
12569
1b177bd7
AD
125702001-12-27 Akim Demaille <akim@epita.fr>
12571
12572 * src/bison.hairy: Formatting/comment changes.
12573 ANSIfy.
12574 Remove `register' indications.
12575 Add plenty of `static'.
12576
7742ddeb
AD
125772001-12-27 Akim Demaille <akim@epita.fr>
12578
12579 * src/output.c (prepare): Drop the muscle `ntbase' which
12580 duplicates ntokens.
12581 * src/bison.simple: Formatting/comment changes.
12582 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
12583 is an undocumented synonym.
12584
1fa14068
AD
125852001-12-22 Akim Demaille <akim@epita.fr>
12586
12587 * src/output.c (output_table_data): Change the prototype to use
12588 `int' for array ranges: some invocations do pass an int, not a
12589 short.
12590 Reported by Wayne Green.
12591
b9752825
AD
125922001-12-22 Akim Demaille <akim@epita.fr>
12593
12594 Some actions of web2c.y are improperly triggered.
12595 Reported by Mike Castle.
12596
12597 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
12598 * tests/regression.at (Web2c): Rename as...
12599 (Web2c Report): this.
12600 (Web2c Actions): New.
12601
776209d6
AD
126022001-12-22 Akim Demaille <akim@epita.fr>
12603
12604 Reductions in web2c.y are improperly reported.
12605 Reported by Mike Castle.
12606
12607 * src/conflicts.c (print_reductions): Fix.
12608 * tests/regression.at (Web2c): New.
12609
275fc3ad
AD
126102001-12-18 Akim Demaille <akim@epita.fr>
12611
12612 Some host fail on `assert (!"foo")', which expands to
12613 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
12614 Reported by Nelson Beebee.
12615
12616 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
12617 `#define it_succeeded 0' and `assert (it_succeeded)'.
12618
897668ee
MA
126192001-12-17 Marc Autret <autret_m@epita.fr>
12620
12621 * src/bison.simple: Don't hard code the skeleton line and filename.
12622 * src/output.c (output_parser): Rename 'line' as 'output_line'.
12623 New line counter 'skeleton_line' (skeleton-line muscle).
12624
ab3399e0
PE
126252001-12-17 Paul Eggert <eggert@twinsun.com>
12626
12627 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
12628 YYDEBUG must be defined to a nonzero value.
12629
12630 * src/bison.simple (yytname): Do not assume that the user defines
12631 YYDEBUG to a properly parenthesized expression.
12632
3877f72b
AD
126332001-12-17 Akim Demaille <akim@epita.fr>
12634
12635 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
12636 nlookaheads is a new member.
12637 Adjust all users.
12638 * src/lalr.h (nlookaheads): Remove this orphan declaration.
12639 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
12640 state.
776209d6 12641
331dbc1b
AD
126422001-12-17 Akim Demaille <akim@epita.fr>
12643
12644 * src/files.h, src/files.c (open_files, close_files): Remove.
12645 * src/main.c (main): Don't open/close files, nor invoke lex_free,
12646 let...
12647 * src/reader.c (reader): Do it.
776209d6 12648
be750e4c
AD
126492001-12-17 Akim Demaille <akim@epita.fr>
12650
12651 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 12652
709ae8c6
AD
126532001-12-17 Akim Demaille <akim@epita.fr>
12654
12655 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
12656 (flush_reduce): New.
12657 (resolve_sr_conflict): Adjust.
776209d6 12658
f87685c3
AD
126592001-12-17 Akim Demaille <akim@epita.fr>
12660
12661 * src/output.c (output_obstack): Be static and rename as...
12662 (format_obstack): this, to avoid any confusion with files.c's
12663 output_obstack.
12664 * src/reader.h (muscle_obstack): Move to...
12665 * src/output.h: here, since it's defined in output.c.
12666
837491d8
AD
126672001-12-17 Akim Demaille <akim@epita.fr>
12668
12669 * src/output.c (action_row, save_column, default_goto)
12670 (sort_actions, matching_state, pack_vector): Better variable
12671 locality.
12672
796d61fb
AD
126732001-12-17 Akim Demaille <akim@epita.fr>
12674
12675 * src/output.c: Various formatting changes.
776209d6 12676
64d15509
AD
126772001-12-17 Akim Demaille <akim@epita.fr>
12678
12679 * src/files.c (output_files): Free the output_obstack.
12680 * src/main.c (main): Call print and print_graph conditionally.
12681 * src/print.c (print): Work unconditionally.
12682 * src/print_graph.c (print_graph): Work unconditionally.
12683 * src/conflicts.c (log_resolution): Output only if verbose_flag.
12684
fbc8ecb7
MA
126852001-12-16 Marc Autret <autret_m@epita.fr>
12686
12687 * src/output.c (actions_output): Fix. When we use %no-lines,
12688 there is one less line per action.
12689
f0440388
MA
126902001-12-16 Marc Autret <autret_m@epita.fr>
12691
12692 * src/bison.simple: Remove a useless #line directive.
12693 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
12694 * src/output.c (get_lines_number): New.
776209d6 12695 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
12696 output muscles.
12697 Fix line numbering.
12698 (actions_output): Computes the number of lines taken by actions.
12699 (output_master_parser): Insert new skeleton which is the name of
12700 the output parser file name.
12701
a79986b8
MA
127022001-12-15 Marc Autret <autret_m@epita.fr>
12703
12704 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
12705
4ec8e00f
MA
127062001-12-15 Marc Autret <autret_m@epita.fr>
12707
12708 * src/output.c (output_gram): Keep track of the hairy one.
12709
1a4648ff
AD
127102001-12-15 Akim Demaille <akim@epita.fr>
12711
12712 Make `make distcheck' work.
12713
12714 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
12715 system.h which uses libgettext.h.
12716
9c2c67e6
AD
127172001-12-15 Akim Demaille <akim@epita.fr>
12718
12719 * src/nullable.c (set_nullable): Useless rules must be skipped,
12720 otherwise, since we range over their symbols, we might look at a
12721 nonterminal which no longer ``exists'', i.e., it is not counted in
12722 `nvars', hence we overflow our arrays.
12723
93ede233
AD
127242001-12-15 Akim Demaille <akim@epita.fr>
12725
12726 The header can also be produced directly, without any obstack!
12727 Yahoo!
12728
12729 * src/files.c, src/files.h (defines_obstack): Remove.
12730 (compute_header_macro): Global.
12731 (defines_obstack_save): Remove.
12732 * src/reader.c (parse_union_decl): No longer output to
12733 defines_obstack: its content can be found in the `stype' muscle
12734 anyway.
12735 (output_token_translations): Merge into...
12736 (symbols_output): this.
12737 Rename as...
12738 (symbols_save): this.
12739 (reader): Adjust.
12740 * src/output.c (header_output): New.
12741 (output): Call it.
12742
2666f928
AD
127432001-12-15 Akim Demaille <akim@epita.fr>
12744
12745 * src/reader.c (parse_union_decl): Instead of handling two obstack
12746 simultaneously, use one to define the `stype' muscle, and use the
12747 value of the latter to fill defines_obstack.
12748 (copy_comment): Remove.
12749 (copy_comment2): Work for a single obstack.
12750 Rename as...
12751 (copy_comment): this.
12752
428046f8
AD
127532001-12-15 Akim Demaille <akim@epita.fr>
12754
12755 * src/lex.c, src/lex.h (xgetc): No longer static.
12756 * src/reader.c (parse_union_decl): Revamp.
12757
ea52d706
AD
127582001-12-15 Akim Demaille <akim@epita.fr>
12759
12760 Still making progress in separating Bison into (i) input, (ii)
12761 process, (iii) output: now we can directly output the parser file
12762 without using table_obstack at all.
12763
12764 * src/files.c, src/files.h (table_obstack): Bye bye.
12765 (parser_file_name): New.
12766 * src/files.c (compute_output_file_names): Compute it.
12767 * src/output.c (actions_output, output_parser)
12768 (output_master_parser): To a file instead of an obstack.
12769
3f96f4dc
AD
127702001-12-15 Akim Demaille <akim@epita.fr>
12771
12772 Attach actions to rules, instead of pre-outputting them to
12773 actions_obstack.
12774
12775 * src/gram.h (rule_t): action and action_line are new members.
12776 * src/reader.c (symbol_list): Likewise.
12777 (copy_action): Save the actions within the rule.
12778 (packgram): Save them in rule_table.
12779 * src/output.c (actions_output): New.
12780 (output_parser): Use it on `%%actions'.
12781 (output_rule_data): Don't free rule_table.
12782 (output): Do it.
12783 (prepare): Don't save the `action' muscle.
12784 * src/bison.simple: s/%%action/%%actions/.
12785
51576fb3
AD
127862001-12-15 Akim Demaille <akim@epita.fr>
12787
12788 * src/reader.c (copy_action): When --yacc, don't append a `;'
12789 to the user action: let it fail if lacking.
dee049eb 12790 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 12791
2648a72d
AD
127922001-12-14 Akim Demaille <akim@epita.fr>
12793
12794 * src/lex.c (literalchar): Simply return the char you decoded, non
12795 longer mess around with obstacks and int pointers.
12796 Adjust all callers.
12797
92790e5b
AD
127982001-12-14 Akim Demaille <akim@epita.fr>
12799
12800 * src/lex.c (literalchar): Don't escape the special characters,
12801 just decode them, and keep them as char (before, eol was output as
12802 the 2 char string `\n' etc.).
12803 * src/output.c (output_rule_data): Use quotearg to output the
12804 token strings.
12805
927c1557
PE
128062001-12-13 Paul Eggert <eggert@twinsun.com>
12807
12808 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
12809 Do not infringe on the global user namespace when using C++.
12810 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
12811 All uses of `fprintf' and `stderr' changed.
12812
12813 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
12814
ed8e1f68
AD
128152001-12-13 Akim Demaille <akim@epita.fr>
12816
12817 The computation of nullable is broken: it doesn't handle empty
12818 RHS's properly.
12819
12820 * tests/torture.at (GNU AWK Grammar): New.
12821 * tests/sets.at (Nullable): New.
12822 * src/nullable.c (set_nullable): Instead of blindly looping over
12823 `ritems', loop over the rules, and then over their rhs's.
12824
12825 Work around Autotest bugs.
12826
12827 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
12828 frame, because Autotest understand lines starting with a `+' as
12829 traces from the shell. Then, they are not processed properly.
12830 Admittedly an Autotest bug, but we don't have time to wait for
12831 Autotest to catch up.
12832 * tests/regression.at (Broken Closure): Adjust to the new table
12833 frames.
12834 Move to...
12835 * tests/sets.at: here.
12836
cb581495
AD
128372001-12-13 Akim Demaille <akim@epita.fr>
12838
12839 * src/closure.c (closure): Use nrules instead of playing tricks
12840 with BITS_PER_WORD.
12841
2e729273
AD
128422001-12-13 Akim Demaille <akim@epita.fr>
12843
12844 * src/print.c (print_actions): Output the handling of `$' as the
12845 traces do: shifting the token EOF. Before EOF was treated as a
12846 nonterminal.
12847 * tests/regression.at: Adjust some tests.
12848 * src/print_graph.c (print_core): Complete the set of items via
12849 closure. The next-to-final and final states are still unsatisfying,
12850 but that's to be addressed elsewhere.
12851 No longer output the rule numbers, but do output the state number.
12852 A single loop for the shifts + gotos is enough, but picked a
12853 distinct color for each.
12854 (print_graph): Initialize and finalize closure.
12855
107f7dfb
AD
128562001-12-13 Akim Demaille <akim@epita.fr>
12857
12858 * src/reader.c (readgram): Remove dead code, an strip useless
12859 braces.
12860 (get_type): Remove, unused.
12861
9b53a24f
AD
128622001-12-12 Akim Demaille <akim@epita.fr>
12863
12864 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
12865 on that of lib/error.c.
12866
dbfb6dcd
AD
128672001-12-12 Akim Demaille <akim@epita.fr>
12868
12869 Some hosts don't like `/' in includes.
12870
12871 * src/system.h: Include libgettext.h without qualifying the path.
12872 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
12873 $(top_srcdir).
12874
c25fb648
MA
128752001-12-11 Marc Autret <autret_m@epita.fr>
12876
12877 * src/output.c (output_parser): Remove useless muscle.
12878
710ddc4f
MA
128792001-12-11 Marc Autret <autret_m@epita.fr>
12880
12881 * src/bison.simple: Remove #line just before %%epilogue. It
12882 is now handled in ...
12883 * src/reader.c (read_additionnal_code): Add the output of a
12884 #line for the epilogue.
12885
e83d80b8
MA
128862001-12-10 Marc Autret <autret_m@epita.fr>
12887
927c1557 12888 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
12889 replace precedent remove.
12890 * src/bison.simple: Remove #line before %%prologue because
12891 %%input-line is wrong at this time.
12892
971d5158
MA
128932001-12-10 Marc Autret <autret_m@epita.fr>
12894
12895 * src/reader.c (symbols_output): Clean up.
927c1557 12896 * src/output.c (output_gram, output): Clean up.
971d5158 12897
5edafffd
AD
128982001-12-10 Akim Demaille <akim@epita.fr>
12899
12900 * src/lalr.c (initialize_lookaheads): New. Extracted from...
12901 * src/LR0.c (set_state_table): here.
12902 * src/lalr.c (lalr): Call it.
12903
0279f8e9
AD
129042001-12-10 Akim Demaille <akim@epita.fr>
12905
12906 * src/state.h (shifts): Remove the `number' member: shifts are
12907 attached to state, hence no longer need to be labelled with a
12908 state number.
12909
190c4f5f
AD
129102001-12-10 Akim Demaille <akim@epita.fr>
12911
12912 Now that states have a complete set of members, the linked list of
12913 shifts is useless: just fill directly the state's shifts member.
12914
12915 * src/state.h (shifts): Remove the `next' member.
12916 * src/LR0.c (first_state, last_state): Remove.
12917 Adjust the callers.
12918 (augment_automaton): Don't look for the shifts that must be added
12919 a shift on EOF: it is those of the state we looked for! But now,
12920 since shifts are attached, it is no longer needed to looking
12921 merely by its id: its number.
12922
2a73b93d
AD
129232001-12-10 Akim Demaille <akim@epita.fr>
12924
12925 * src/LR0.c (augment_automaton): Better variable locality.
12926 Remove an impossible branch: if there is a state corresponding to
12927 the start symbol being shifted, then there is shift for the start
12928 symbol from the initial state.
12929
74392f6a
AD
129302001-12-10 Akim Demaille <akim@epita.fr>
12931
12932 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
12933 only when appropriate: when insert_start_shifting_state' is not
12934 invoked.
12935 * tests/regression.at (Rule Line Numbers): Adjust.
12936
37c82725
AD
129372001-12-10 Akim Demaille <akim@epita.fr>
12938
12939 * src/LR0.c (augment_automaton): Now that all states have shifts,
12940 merge the two cases addition shifts to the initial state.
12941
6a164e0c
AD
129422001-12-10 Akim Demaille <akim@epita.fr>
12943
12944 * src/lalr.c (set_state_table): Move to...
12945 * src/LR0.c: here.
12946 * src/lalr.c (lalr): Don't call it...
12947 * src/LR0.c (generate_states): do it.
12948 * src/LR0.h (first_state): Remove, only the table is used.
12949
7215de24
AD
129502001-12-10 Akim Demaille <akim@epita.fr>
12951
12952 * src/LR0.h (first_shift, first_reduction): Remove.
12953 * src/lalr.c: Don't use first_shift: find shifts through the
12954 states.
12955
80e25d4d
AD
129562001-12-10 Akim Demaille <akim@epita.fr>
12957
12958 * src/LR0.c: Attach shifts to states as soon as they are
12959 computed.
12960 * src/lalr.c (set_state_table): Instead of assigning shifts to
12961 state, just assert that the mapping was properly done.
12962
0ab3728b
AD
129632001-12-10 Akim Demaille <akim@epita.fr>
12964
12965 * src/LR0.c (insert_start_shift): Rename as...
12966 (insert_start_shifting_state): this.
12967 (insert_eof_shifting_state, insert_accepting_state): New.
12968 (augment_automaton): Adjust.
12969 Better locality of the variables.
12970 When looking if the start_symbol is shifted from the initial
12971 state, using `while (... symbol != start_symbol ...)' sounds
12972 better than `while (... symbol < start_symbol ...)': If fail
12973 to see how the order between symbols could be relevant!
12974
78af9bbc
AD
129752001-12-10 Akim Demaille <akim@epita.fr>
12976
12977 * src/getargs.h: Don't declare `spec_name_prefix' and
12978 `spec_file_prefix', declared by src/files.h.
12979 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
12980 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
12981 * src/output.c (prepare): Adjust.
12982 * src/reader.c (symbols_output): Likewise.
12983 * src/vmsgetargs.c: Vaguely adjust, but who cares?
12984
bdef2a41
AD
129852001-12-10 Akim Demaille <akim@epita.fr>
12986
12987 * src/muscle_tab.c (muscle_init): NULL is a better default than
12988 `"0"'.
12989
3735969c
AD
129902001-12-10 Akim Demaille <akim@epita.fr>
12991
12992 * src/reader.c (reader): Calling symbols_output once is enough.
12993
49701457
AD
129942001-12-10 Akim Demaille <akim@epita.fr>
12995
12996 Now that states have a complete set of members, the linked list of
12997 reductions is useless: just fill directly the state's reductions
12998 member.
12999
13000 * src/state.h (struct reductions): Remove member `number' and
13001 `next'.
13002 * src/LR0.c (first_reduction, last_reduction): Remove.
13003 (save_reductions): Don't link the new reductions, store them in
13004 this_state.
13005 * src/lalr.c (set_state_table): No need to attach reductions to
13006 states, it's already done.
13007 * src/output.c (output_actions): No longer free the shifts, then
13008 the reductions, then the states: free all the states and their
13009 members.
13010
0edad749
AD
130112001-12-10 Akim Demaille <akim@epita.fr>
13012
13013 * src/options.c (OPTN, DRTV, BOTH): New.
13014 (option_table): Use them.
13015
0edad749
AD
13016 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
13017 the job of system.h.
13018 * src/options.c: Don't include stdio.h and xalloc.h for the same
13019 reasons.
13020
5449dd0f
AD
130212001-12-10 Akim Demaille <akim@epita.fr>
13022
13023 * src/output.c (output, prepare): Make sure the values of the
13024 muscles `action' and `prologue' are 0-terminated.
13025
a870c567
AD
130262001-12-10 Akim Demaille <akim@epita.fr>
13027
13028 Clean up GCC warnings.
13029
13030 * src/reader.c (copy_action): `buf' is not used.
13031 (parse_skel_decl): Be static.
13032 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
13033 * src/options.h (create_long_option_table): Have a real prototype.
13034 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
13035 (hash_delete_at): Return const void *.
13036 Adjust casts to preserve the const.
13037
80df8768
AD
130382001-12-10 Akim Demaille <akim@epita.fr>
13039
13040 * configure.in: Require 2.52g.
13041 M4 is not needed, but AUTOM4TE is.
13042 * m4/m4.m4: Remove.
13043 * tests/Makefile.am: Adjust.
13044
f693ad14
AD
130452001-12-10 Akim Demaille <akim@epita.fr>
13046
13047 One structure for states is enough, even though theoretically
13048 there are LR(0) states and LALR(1) states.
13049
13050 * src/lalr.h (state_t): Remove.
13051 (state_table): Be state_t **, not state_t *.
13052 * src/state.h (core, CORE_ALLOC): Rename as...
13053 (state_t, STATE_ALLOC): this.
13054 Add the LALR(1) members: shifts, reductions, errs.
13055 * src/LR0.c (state_table): Rename as...
13056 (state_hash): this, to avoid name clashes with the global
13057 `state_table'.
13058 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
13059 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
13060
74ffbcb6
AD
130612001-12-10 Akim Demaille <akim@epita.fr>
13062
13063 Bison dumps core on bash.y.
13064 Reported by Pascal Bart.
13065
13066 * src/warshall.c (bitmatrix_print): New.
13067 (TC): Use it.
ba0fe3c7 13068 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
13069 j must be the outer loop.
13070 * tests/regression.at (Broken Closure): New.
13071
07708e19
AD
130722001-12-05 Akim Demaille <akim@epita.fr>
13073
13074 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
13075 its argument.
ba1ecc07 13076 Reported by Peter Hamorsky.
07708e19 13077
92b16366
AD
130782001-12-05 Akim Demaille <akim@epita.fr>
13079
13080 * src/conflicts.c (err_table): Remove.
13081 (resolve_sr_conflict): Adjust.
13082 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
13083 Rename as...
13084 (state_t.reductions, state_t.shifts): this.
13085
076ab033
AD
130862001-12-05 Akim Demaille <akim@epita.fr>
13087
13088 * src/reduce.c (reduce_grammar_tables): No longer disable the
13089 removal of useless rules via CPP but via `if (0)', so that the
13090 compiler still check the code is valid.
13091 For instance, it should have noticed `rline' no longer exists: use
13092 the `line' member of rule_t.
13093 * src/gram.c (dummy, rline): Remove, unused.
13094
3843c413
AD
130952001-12-05 Akim Demaille <akim@epita.fr>
13096
13097 * src/output.c (pack_vector): Use assert, not berror.
13098 * src/main.c (berror): Remove, unused.
13099
43168960
AD
131002001-12-05 Akim Demaille <akim@epita.fr>
13101
13102 New experimental feature: if --verbose --trace output all the
13103 items of a state, not only its kernel.
13104
13105 * src/print.c (print_core): If `trace_flag', then invoke closure
13106 before outputting the items of the state (print_core is no longer
13107 a correct name them).
13108 (print_results): Invoke new_closure/free_closure if needed.
13109
b2872512
AD
131102001-12-05 Akim Demaille <akim@epita.fr>
13111
13112 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
13113 * src/closure.c, src/closure.h (itemsetsize): Rename as...
13114 (nitemset): for consistency with the rest of the project.
13115
23cbcc6c
AD
131162001-12-05 Akim Demaille <akim@epita.fr>
13117
13118 * src/closure.c (print_closure): Improve.
13119 (closure): Use it for printing input and output.
13120
03ec521c
AD
131212001-12-05 Akim Demaille <akim@epita.fr>
13122
13123 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
13124 indexed by nonterminals.
13125
3a7456dd
AD
131262001-12-05 Akim Demaille <akim@epita.fr>
13127
13128 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
13129 what it was!).
13130 * src/warshall.h: Remove accidental duplication of the content.
13131
1cbcf2e7
AD
131322001-12-05 Akim Demaille <akim@epita.fr>
13133
13134 * src/closure.c (set_fderives): De-obfuscate.
13135
84182270
AD
131362001-12-05 Akim Demaille <akim@epita.fr>
13137
13138 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
13139
3f6f053c
AD
131402001-12-05 Akim Demaille <akim@epita.fr>
13141
13142 * src/closure.c (set_firsts): De-obfuscate.
13143
7a5350ba
AD
131442001-12-05 Akim Demaille <akim@epita.fr>
13145
13146 * src/output.c (action_row): De-obfuscate
13147 using the good o' techniques: arrays not pointers, variable
13148 locality, BITISSET, RESETBIT etc.
13149
d954473d
AD
131502001-12-05 Akim Demaille <akim@epita.fr>
13151
13152 Pessimize the code to simplify it: from now on, all the states
13153 have a valid SHIFTS, which NSHIFTS is possibly 0.
13154
13155 * src/LR0.c (shifts_new): Be global and move to..
13156 * src/state.c, src/state.h: here.
13157 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
13158 * src/print_graph: Adjust.
13159
9839bbe5
AD
131602001-12-05 Akim Demaille <akim@epita.fr>
13161
13162 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13163 * src/conflicts.c: Use it.
13164 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13165 incorrectly ``simplified''.
13166
9f136c07
AD
131672001-12-05 Akim Demaille <akim@epita.fr>
13168
13169 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
13170 using the good o' techniques: arrays not pointers, variable
13171 locality, BITISSET, RESETBIT etc.
13172
b608206e
AD
131732001-12-05 Akim Demaille <akim@epita.fr>
13174
13175 * src/state.h (SHIFT_SYMBOL): New.
13176 * src/conflicts.c: Use it to deobfuscate.
13177
52afa962
AD
131782001-12-05 Akim Demaille <akim@epita.fr>
13179
13180 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
13181 (print_reductions): De-obfuscate using the good o' techniques:
13182 arrays not pointers, variable locality, BITISSET.
13183
e74dc321
AD
131842001-12-05 Akim Demaille <akim@epita.fr>
13185
13186 * src/conflicts.c (print_reductions): Arrays, not pointers.
13187 Use BITISSET.
13188
768fca83
AD
131892001-12-05 Akim Demaille <akim@epita.fr>
13190
13191 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13192
a17e599f
AD
131932001-12-05 Akim Demaille <akim@epita.fr>
13194
13195 * src/conflicts.c (print_reductions): Improve variable locality.
13196
a04bc341
AD
131972001-12-05 Akim Demaille <akim@epita.fr>
13198
13199 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13200
c8ea038e
AD
132012001-12-05 Akim Demaille <akim@epita.fr>
13202
13203 * src/conflicts.c (print_reductions): Improve variable locality.
13204
aa2aab3c
AD
132052001-12-05 Akim Demaille <akim@epita.fr>
13206
13207 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13208 * src/lalr.c: Use them.
13209
b178c8cc
AD
132102001-12-05 Akim Demaille <akim@epita.fr>
13211
13212 * src/LR0.c (augment_automaton): Formatting changes.
13213 Better variable locality.
13214
f67d13aa
AD
132152001-12-05 Akim Demaille <akim@epita.fr>
13216
13217 * src/lalr.c (matrix_print): New.
13218 (transpose): Use it.
13219 Use arrays instead of pointers.
13220
c2713865
AD
132212001-12-05 Akim Demaille <akim@epita.fr>
13222
13223 * src/lalr.c (maxrhs): Move to...
13224 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
13225 * src/lalr.c (build_relations): Adjust.
13226
9887c18a
AD
132272001-12-05 Akim Demaille <akim@epita.fr>
13228
13229 * src/lalr.c (transpose): Free the memory allocated to the
13230 argument, as it is replaced by the results by the unique caller.
13231 (build_relations): Merely invoke transpose: it handles the memory
13232 deallocation.
13233 Improve variable locality.
13234 Avoid variables used as mere abbreviations.
13235 (compute_lookaheads): Use arrays instead of pointers.
13236
4d4f699c
AD
132372001-12-05 Akim Demaille <akim@epita.fr>
13238
13239 * src/lalr.c (initialize_F): Improve variable locality.
13240 Avoid variables used as mere abbreviations.
13241
80a69750
AD
132422001-12-05 Akim Demaille <akim@epita.fr>
13243
13244 * src/derives.c (print_derives): Display the ruleno.
13245 * src/lalr.c (initialize_F, transpose): Better variable locality
13246 to improve readability.
13247 Avoid variables used as mere abbreviations.
13248
fe961097
AD
132492001-12-05 Akim Demaille <akim@epita.fr>
13250
13251 * src/lalr.c (traverse): Use arrays instead of pointers.
13252
e3e4e814
AD
132532001-12-05 Akim Demaille <akim@epita.fr>
13254
13255 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13256 the handling of squeue.
13257 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13258
630e182b
AD
132592001-12-05 Akim Demaille <akim@epita.fr>
13260
13261 Because useless nonterminals are now kept alive (instead of being
13262 `destroyed'), we now sometimes examine them, and store information
13263 related to them. Hence we need to know their number, and adjust
13264 memory allocations.
13265
13266 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13267 static.
13268 * src/LR0.c (allocate_itemsets): The memory allocated to
13269 `symbol_count' was used for two different purpose: once to count
13270 the number of occurrences of each symbol, and later reassigned to
13271 `shift_symbol', containing the symbol that can be shifted from a
13272 given state.
13273 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13274 only, and...
13275 (new_itemsets): Allocate `shift_symbol' here.
13276 (allocate_itemsets): symbol_count includes useless nonterminals.
13277 Make room for them.
13278 (free_storage): Use `free', not `XFREE', for pointers that cannot
13279 be null.
13280
81b51460
AD
132812001-12-05 Akim Demaille <akim@epita.fr>
13282
13283 * src/nullable.c (set_nullable): Deobfuscate the handling of
13284 ritem.
13285 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13286
3067fbef
AD
132872001-12-05 Akim Demaille <akim@epita.fr>
13288
13289 * src/gram.c, src/gram.h (ritem_print): New.
13290 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
13291 (This useless function was defined only to work around VMS linkers
13292 that can't handle compilation units with variables only).
13293 * src/reduce.c (dump_grammar): Use it to trace the construction of
13294 ritem.
13295
c2bea5f9
PE
132962001-12-04 Paul Eggert <eggert@twinsun.com>
13297
7d27c823
PE
13298 * src/bison.simple (union yyalloc): Change member names
13299 to be the same as the stack names.
13300 (yyparse): yyptr is now union yyalloc *, not char *.
13301 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
13302 and may generate better code on some machines.
c2bea5f9
PE
13303 (yystpcpy): Use prototype if __STDC__ is defined, not just
13304 if __cplusplus is defined.
35687a9d 13305
2c8a9dfa
AD
133062001-11-30 Akim Demaille <akim@epita.fr>
13307
13308 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
13309 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
13310 Gettext doesn't compile cleanly, and dies with -Werror.
13311 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
13312 Include WARNING_CFLAGS here.
13313 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
13314 before being defined.
13315
f4e421e6
AD
133162001-11-27 Paul Eggert <eggert@twinsun.com>
13317
13318 * lib/quotearg.h (quotearg_n, quotearg_n_style):
13319 First arg is int, not unsigned.
13320 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
13321 (SIZE_MAX, UINT_MAX): New macros.
13322 (quotearg_n_options): Abort if N is negative.
13323 Avoid overflow check on hosts where size_t is 64 bits and int
13324 is 32 bits, as overflow is impossible there.
13325 Fix off-by-one typo that caused unnecessary reallocation.
13326
7093d0f5
AD
133272001-11-29 Paul Eggert <eggert@twinsun.com>
13328
13329 Name space cleanup in generated parser.
13330
13331 * doc/bison.texinfo (Bison Parser): Discuss system headers
13332 and their effect on the user name space.
13333
13334 * src/bison.simple:
13335 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
13336 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
13337 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
13338
13339 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
13340 on user names when possible.
13341
13342 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
13343 Simplify test for whather <alloca.h> exists.
13344
13345 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
13346
13347 (<stdio.h>): Include if YYDEBUG.
13348
13349 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
13350 ! defined (yyoverflow) && ! defined (yymemcpy).
13351
13352 (yymemcpy, yyparse): Rename local variables as needed so that
13353 they all begin with 'yy'.
13354
13355 (yystrlen, yystpcpy): New functions.
13356
13357 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
13358 All uses changed.
13359
13360 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
13361 instead of relying on string.h functions. Use YYSTACK_ALLOC
13362 and YYSTACK_FREE instead of malloc and free.
13363
fd51e5ff
AD
133642001-11-30 Akim Demaille <akim@epita.fr>
13365
13366 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
13367 before their first uses.
13368 (YYBISON, YYPURE): Move to the top of the output.
13369
7d13ff5f
AD
133702001-11-30 Akim Demaille <akim@epita.fr>
13371
13372 * tests/reduce.at (Useless Nonterminals): Fix.
13373
892a3995
AD
133742001-11-30 Akim Demaille <akim@epita.fr>
13375
13376 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
13377 if body instead of `;' to pacify GCC's warnings.
13378
68f1e3ed
AD
133792001-11-30 Akim Demaille <akim@epita.fr>
13380
13381 Instead of mapping the LHS of unused rules to -1, keep the LHS
13382 valid, but flag the rules as invalid.
13383
13384 * src/gram.h (rule_t): `useful' is a new member.
13385 * src/print.c (print_grammar): Adjust.
13386 * src/derives.c (set_derives): Likewise.
13387 * src/reader.c (packgram, reduce_output): Likewise.
13388 * src/reduce.c (reduce_grammar_tables): Likewise.
13389 * tests/reduce.at (Underivable Rules, Useless Rules): New.
13390
d2d1b42b
AD
133912001-11-30 Akim Demaille <akim@epita.fr>
13392
13393 * src/reduce.c (reduce_output): Formatting changes.
13394 * src/print.c (print_results, print_grammar): Likewise.
13395 * tests/regression.at (Rule Line Numbers)
13396 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
13397
760b53a8
AD
133982001-11-30 Akim Demaille <akim@epita.fr>
13399
13400 * src/reduce.c (nonterminals_reduce): Instead of throwing away
13401 useless nonterminals, move them at the end of the symbol arrays.
13402 (reduce_output): Adjust.
13403 * tests/reduce.at (Useless Nonterminals): Adjust.
13404
00238958
AD
134052001-11-30 Akim Demaille <akim@epita.fr>
13406
13407 * src/reduce.c: Various comment/formatting changes.
13408 (nonterminals_reduce): New, extracted from...
13409 (reduce_grammar_tables): here.
13410 (reduce_grammar): Call nonterminals_reduce.
13411
396452de
PE
134122001-11-29 Paul Eggert <eggert@twinsun.com>
13413
13414 * src/bison.simple (YYSTACK_REALLOC): Remove.
13415 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
13416 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
13417 New macros.
13418 (union yyalloc): New type.
13419 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
13420 an arbitrary restriction on hosts where size_t is wider than int.
13421
13422 (yyparse): Don't dump core if alloca or malloc fails; instead, report
13423 a parser stack overflow. Allocate just one block of memory for all
13424 three stacks, instead of allocating three blocks; this typically is
13425 faster and reduces fragmentation.
13426
13427 Do not limit the number of items in the stack to a value that fits
13428 in 'int', as this is an arbitrary limit on hosts with 64-bit
13429 size_t and 32-bit int.
13430
147e184c
MA
134312001-11-29 Marc Autret <autret_m@epita.fr>
13432
13433 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
13434 of defining YYERROR_VERBOSE.
13435 [AT_DATA]: $4 is now out of C declarations in the prologue.
13436
426cf563
MA
134372001-11-28 Marc Autret <autret_m@epita.fr>
13438
13439 * src/reader.c (parse_dquoted_param): New.
13440 (parse_skel_decl): Use it.
13441 * src/lex.h: Add its prototype.
13442 * src/lex.c (literalchar): Become not static.
13443
c7925b99
MA
134442001-11-28 Marc Autret <autret_m@epita.fr>
13445
13446 * src/output.h: And put its extern declaration here.
13447 * src/output.c (error_verbose): Define here.
13448 (prepare): Echo name modification.
13449 * src/getargs.h: Clean its extern declaration.
13450 * src/getargs.c (error_verbose_flag): Remove.
13451 (getargs): Remove case 'e'.
13452 * src/options.c (option_table): 'error-verbose' is now seen as simple
13453 percent option.
13454 Include output.h.
13455
13456 * src/reader.c (read_declarations): Remove case tok_include.
13457 (parse_include_decl): Remove.
13458 * src/lex.h (token_t): Remove tok_include.
13459 * src/options.c (option_table): 'include' is now a simple command line
13460 option.
13461
5b5d1929
MA
134622001-11-28 Marc Autret <autret_m@epita.fr>
13463
13464 * src/bison.simple: Adjust muscle names.
13465 * src/muscle_tab.c (muscle_init): Also rename the muscles.
13466 * src/output.c (prepare): s/_/-/ for the muscles names.
13467 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
13468
8850be4b
MA
134692001-11-28 Marc Autret <autret_m@epita.fr>
13470
13471 * src/bison.simple: Fix debug.
13472 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
13473
4a38e613
AD
134742001-11-28 Akim Demaille <akim@epita.fr>
13475
13476 * src/LR0.c (shifts_new): New.
13477 (save_shifts, insert_start_shift, augment_automaton): Use it.
13478
4b35e1c1
AD
134792001-11-28 Akim Demaille <akim@epita.fr>
13480
13481 * src/closure.c (closure): `b' and `ruleno' denote the same value:
13482 keep ruleno only.
13483
d2b04478
AD
134842001-11-28 Akim Demaille <akim@epita.fr>
13485
13486 * src/closure.c (closure): Instead of looping over word in array
13487 then bits in words, loop over bits in array.
13488
2c4c30aa
AD
134892001-11-28 Akim Demaille <akim@epita.fr>
13490
13491 * src/closure.c (closure): No longer optimize the special case
13492 where all the bits of `ruleset[r]' are set to 0, to make the code
13493 clearer.
13494
576890b7
AD
134952001-11-28 Akim Demaille <akim@epita.fr>
13496
13497 * src/closure.c (closure): `r' and `c' are new variables, used to
13498 de-obfuscate accesses to RULESET and CORE.
13499
cb487d7d
AD
135002001-11-28 Akim Demaille <akim@epita.fr>
13501
13502 * src/reduce.c (reduce_print): Use ngettext.
13503 (dump_grammar): Improve the trace accuracy.
13504
6013d43f
AD
135052001-11-28 Akim Demaille <akim@epita.fr>
13506
13507 * src/reduce.c (dump_grammar): Don't translate trace messages.
13508
cb4956ee
AD
135092001-11-28 Akim Demaille <akim@epita.fr>
13510
13511 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
13512 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
13513 as all tags are free'ed afterwards.
13514 From Enrico Scholz.
13515
648185ab
PE
135162001-11-27 Paul Eggert <eggert@twinsun.com>
13517
13518 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
13519 use alloca when we didn't want to, and vice versa.
13520
68254a03
MA
135212001-11-27 Marc Autret <autret_m@epita.fr>
13522
9113b58f
AD
13523 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
13524 initialization.
68254a03
MA
13525 * src/output.c (prepare): Remove its update.
13526
04d843a2
MA
135272001-11-27 Marc Autret <autret_m@epita.fr>
13528
13529 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
13530 Use %error-verbose.
13531
d2079671 135322001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
13533
13534 * src/bison.simple: Remove YYERROR_VERBOSE using.
13535 Use %%error_verbose.
13536 (yyparse): Likewise.
13537 * src/output.c (prepare): Give its final value.
13538 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
13539 * src/getargs.h: Add its extern declaration.
13540 * src/getargs.c (error_verbose_flag): New int.
13541 (getargs): Update to catch new case.
13542 * src/options.c (option_table): 'error-verbose' is a new option.
13543 (shortopts): Update.
13544
e0327bc8
AD
135452001-11-27 Akim Demaille <akim@epita.fr>
13546
13547 * src/system.h: Use intl/libgettext.h.
13548 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
13549
000f1a3c
AD
135502001-11-27 Akim Demaille <akim@epita.fr>
13551
13552 * tests/torture.at (Exploding the Stack Size with Malloc):
13553 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
13554
26cfe0be
AD
135552001-11-27 Akim Demaille <akim@epita.fr>
13556
13557 * src/files.c: Include error.h.
13558 Reported by Hans Aberg.
13559
f6bd5427
MA
135602001-11-26 Marc Autret <autret_m@epita.fr>
13561
d2079671 13562 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
13563 (read_declarations): Add case tok_include.
13564 * src/getargs.h (include): Add its extern definition.
13565 * src/getargs.c (include): New const char *.
13566 (getargs): Add case '-I'.
13567 * src/options.c (option_table): Add include as command line and
13568 percent option.
13569 * src/lex.h (token_t): Add tok_include.
13570
2ca209c1
AD
135712001-11-26 Akim Demaille <akim@epita.fr>
13572
13573 * src/reader.c (readgram): Make sure rules for mid-rule actions
13574 have a lineno equal to that of their host rule.
13575 Reported by Hans Aberg.
13576 * tests/regression.at (Rule Line Numbers): New.
13577
0e41b407
AD
135782001-11-26 Akim Demaille <akim@epita.fr>
13579
13580 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
13581 size_ts.
13582
135832001-11-26 Akim Demaille <akim@epita.fr>
13584
13585 * src/complain.c, src/complain.h (error): Remove, provided by
13586 lib/error.[ch].
13587
e0c40012
AD
135882001-11-26 Akim Demaille <akim@epita.fr>
13589
13590 * src/reader.c (read_declarations): Don't abort on tok_illegal,
13591 issue an error message.
13592 * tests/regression.at (Invalid %directive): New.
13593 Reported by Hans Aberg.
13594
5e147124
AD
135952001-11-26 Akim Demaille <akim@epita.fr>
13596
13597 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
13598 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13599
a034c8b8
AD
136002001-11-26 Akim Demaille <akim@epita.fr>
13601
13602 * src/conflicts.c (conflicts_print): Don't complain at all when
13603 there are no reduce/reduce conflicts, and as many shift/reduce
13604 conflicts as expected.
13605 * tests/regression.at (%expect right): Adjust.
13606
c64a20f3
AD
136072001-11-23 Akim Demaille <akim@epita.fr>
13608
13609 * lib/alloca.c: Update, from fileutils.
13610
5b0d29bb
AD
136112001-11-23 Akim Demaille <akim@epita.fr>
13612
13613 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
13614
722c4bfe
AD
136152001-11-23 Akim Demaille <akim@epita.fr>
13616
13617 * src/system.h: Include alloca.h.
13618 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
13619
6255b435
AD
136202001-11-23 Akim Demaille <akim@epita.fr>
13621
13622 * src/print_graph.c (print_actions): Remove `rule', unused.
13623 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
13624 pacify GCC's signed < unsigned warnings.
13625 * src/closure.c (itemsetsize): Likewise.
13626 * src/reader.c (symbol_list_new): Static.
13627
b29b2ed5
AD
136282001-11-23 Akim Demaille <akim@epita.fr>
13629
13630 Attaching lineno to buckets is stupid, since only one copy of each
13631 symbol is kept, only the line of the first occurrence is kept too.
13632
13633 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
13634 * src/reader.c (rline_allocated): Remove, unused.
13635 (symbol_list): Have a `line' member.
13636 (symbol_list_new): New.
13637 (readgram): Use it.
13638 * src/print.c (print_grammar): Output the rule line numbers.
13639 * tests/regression.at (Solved SR Conflicts)
13640 (Unresolved SR Conflicts): Adjust.
13641 Reported by Hans Aberg.
13642
a81b1d4a
MA
136432001-11-22 Marc Autret <autret_m@epita.fr>
13644
13645 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
13646
c1ecb3c1
MA
136472001-11-22 Marc Autret <autret_m@epita.fr>
13648
13649 * src/muscle_tab.c (muscle_init): Remove initialization of
13650 skeleton muscle.
13651 * src/output.c (output_master_parser): Do it here.
13652
fbe01355
AD
136532001-11-20 Akim Demaille <akim@epita.fr>
13654
13655 * po/sv.po: New.
13656 * configure.in (ALL_LINGUAS): Adjust.
13657 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
13658 longer contains strings to translate.
13659
81e895c0
AD
136602001-11-19 Akim Demaille <akim@epita.fr>
13661
13662 * src/conflicts.c (conflicts_print): Add a missing \n.
13663
6bb1878b
AD
136642001-11-19 Akim Demaille <akim@epita.fr>
13665
13666 * src/nullable.c (nullable_print): New.
13667 (set_nullable): Call it when tracing.
13668 Better locality of variables.
13669
d9ec2d07
AD
136702001-11-19 Akim Demaille <akim@epita.fr>
13671
13672 * src/print.c (print_actions): Better locality of variables.
13673
720e5c1b
AD
136742001-11-19 Akim Demaille <akim@epita.fr>
13675
13676 * src/derives.c (print_derives): Fix and enrich.
13677 * src/closure.c (print_fderives): Likewise.
13678
fb908786
AD
136792001-11-19 Akim Demaille <akim@epita.fr>
13680
13681 * src/closure.c (itemsetend): Remove, replaced with...
13682 (itemsetsize): new.
13683
125ecb56
AD
136842001-11-19 Akim Demaille <akim@epita.fr>
13685
13686 * src/LR0.c (kernel_end): Remove, replaced with...
13687 (kernel_size): new.
13688
d8cf039f
AD
136892001-11-19 Akim Demaille <akim@epita.fr>
13690
13691 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
13692 to clarify.
13693
7bec0760
AD
136942001-11-19 Akim Demaille <akim@epita.fr>
13695
13696 * src/closure.c (closure): Use arrays instead of pointers to clarify.
13697
c87d4863
AD
136982001-11-19 Akim Demaille <akim@epita.fr>
13699
13700 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
13701 trace messages.
13702 * src/LR0.c: Likewise.
13703 (allocate_itemsets): Use arrays instead of pointers to clarify.
13704
9bfe901c
AD
137052001-11-19 Akim Demaille <akim@epita.fr>
13706
13707 * src/getargs.c (statistics_flag): Replace with...
13708 (trace_flag): New.
13709 (longopts): Accept --trace instead of --statistics.
13710 * src/getargs.h, src/options.c: Adjust.
13711 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
13712 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
13713
97db7bd4
AD
137142001-11-19 Akim Demaille <akim@epita.fr>
13715
cc72668c 13716 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
13717 pointers to clarify the code.
13718 (save_reductions, save_shifts): Factor common parts of alternatives.
13719
2c5f66ed
AD
137202001-11-19 Akim Demaille <akim@epita.fr>
13721
13722 * src/LR0.c (new_state, get_state): Complete TRACE code.
13723 * src/closure.c: Include `reader.h' to get `tags', needed by the
13724 trace code.
13725 Rename the conditional DEBUG as TRACE.
13726 Output consistently TRACEs to stderr, not stdout.
13727 * src/derives.c: Likewise.
13728 * src/reduce.c: (inaccessable_symbols): Using if is better style
13729 than goto.
13730 Use `#if TRACE' instead of `#if 0' for tracing code.
13731
300f275f
AD
137322001-11-19 Akim Demaille <akim@epita.fr>
13733
13734 * src/system.h (LIST_FREE, shortcpy): New.
13735 * src/LR0.c: Use them.
13736 * src/output.c (free_itemsets, free_reductions, free_shifts):
13737 Remove, replaced by LIST_FREE.
13738
f59c437a
AD
137392001-11-19 Akim Demaille <akim@epita.fr>
13740
13741 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
13742 (REDUCTIONS_ALLOC): New.
13743 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
13744 allocation.
13745
6986fd9e
AD
137462001-11-19 Akim Demaille <akim@epita.fr>
13747
13748 * src/LR0.c (new_state): Complete trace code.
13749 * src/nullable.c (set_nullable): Don't translate traces.
13750
4bc30f78
AD
137512001-11-19 Akim Demaille <akim@epita.fr>
13752
13753 * src/print_graph.c (print_core): Better locality of variables.
13754 * src/print.c (print_core): Likewise.
13755
08a946e0
AD
137562001-11-19 Akim Demaille <akim@epita.fr>
13757
13758 * src/vcg.c: You do the output, so you are responsible of the
13759 handling of VCG syntax, in particular: use quotearg.
13760 * src/print_graph.c: Don't.
13761 (print_actions): Don't output the actions as part of the nodes,
13762 since that's the job of the edges.
13763 (print_state): Don't output by hand: fill the node description,
9bfe901c 13764 and ask for its output.
08a946e0 13765
f0473484
AD
137662001-11-19 Akim Demaille <akim@epita.fr>
13767
cc72668c
AD
13768 * src/bison.simple (yyparse): When verbosely reporting an error,
13769 no longer put additional quotes around token names.
f0473484
AD
13770 * tests/calc.at: Adjust.
13771
e41dc700
AD
137722001-11-19 Akim Demaille <akim@epita.fr>
13773
13774 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
13775 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
13776 * src/output.c: Adjust.
13777
652a871c
AD
137782001-11-19 Akim Demaille <akim@epita.fr>
13779
13780 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
13781 (rule_t): this.
13782 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
13783
b2ed6e58
AD
137842001-11-19 Akim Demaille <akim@epita.fr>
13785
13786 * src/gram.h (rule_t): New.
13787 (rule_table): New.
13788 (rrhs, rlhs): Remove, part of state_t.
13789 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
13790 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13791 * src/reader.c, src/reduce.c: Adjust.
13792
edad7067
AD
137932001-11-19 Akim Demaille <akim@epita.fr>
13794
13795 * src/reader.c (symbols_output): New, extracted from...
13796 (packsymbols): Here.
13797 (reader): Call it.
13798
3feec034
AD
137992001-11-19 Akim Demaille <akim@epita.fr>
13800
13801 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
13802 (maxrhs): this new function.
13803
ddcd5fdf
AD
138042001-11-19 Akim Demaille <akim@epita.fr>
13805
cc72668c 13806 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
13807 Adjust.
13808
bb527fc2
AD
138092001-11-19 Akim Demaille <akim@epita.fr>
13810
cc72668c 13811 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
13812 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13813 * src/lalr.c: Adjust.
13814
a845a697
AD
138152001-11-19 Akim Demaille <akim@epita.fr>
13816
13817 * src/lalr.c (initialize_LA): Only initialize LA. Let...
13818 (set_state_table): handle the `lookaheads' members.
13819
f004bf6a
AD
138202001-11-19 Akim Demaille <akim@epita.fr>
13821
cc72668c
AD
13822 * src/lalr.h (lookaheads): Removed array, whose contents is now
13823 a member of...
f004bf6a
AD
13824 (state_t): this structure.
13825 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13826 Adjust.
13827
de326cc0
AD
138282001-11-19 Akim Demaille <akim@epita.fr>
13829
cc72668c
AD
13830 * src/lalr.h (consistent): Removed array, whose contents is now
13831 a member of...
de326cc0
AD
13832 (state_t): this structure.
13833 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13834 Adjust.
13835
90b4416b
AD
138362001-11-19 Akim Demaille <akim@epita.fr>
13837
cc72668c
AD
13838 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
13839 contents are now members of...
90b4416b
AD
13840 (state_t): this structure.
13841 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13842 Adjust.
13843
9703cc49
AD
138442001-11-19 Akim Demaille <akim@epita.fr>
13845
13846 * src/lalr.h (state_t): New.
13847 (state_table): Be a state_t * instead of a core **.
13848 (accessing_symbol): Remove, part of state_t.
13849 * src/lalr.c: Adjust.
13850 (set_accessing_symbol): Merge into...
13851 (set_state_table): this.
13852 * src/print_graph.c, src/conflicts.c: Adjust.
13853
d803322e
AD
138542001-11-14 Akim Demaille <akim@epita.fr>
13855
13856 * tests/calc.at, tests/output.at, tests/regression.at,
13857 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
13858 now the tests are run in private dirs, therefore AC_CLEANUP and
13859 family can be simplified to 0-ary.
13860 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
13861 use abs. path to find config.h.
13862 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
13863 stderr, there can be way too much random noise.
13864 Instead pass -Werror to GCC and rely on the exit status.
13865 Reported by Wolfram Wagner.
13866
3d76b07d
AD
138672001-11-14 Akim Demaille <akim@epita.fr>
13868
13869 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
13870 defined only if yyoverflow is defined, to avoid `warning: unused
13871 variable `yyvs1''.
13872 Reported by The Test Suite.
13873
09b503c8
AD
138742001-11-14 Akim Demaille <akim@epita.fr>
13875
13876 * src/print.c: Include reduce.h.
13877 Reported by Hans Aberg.
13878
138792001-11-14 Akim Demaille <akim@epita.fr>
13880
13881 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
13882 Revert a previous patch: these are really const.
13883 * src/conflicts.c (conflict_report): Additional useless pair of
13884 braces to pacify GCC's warnings for `if () if () {} else {}'.
13885 * src/lex.c (parse_percent_token): Replace equal_offset with
13886 arg_offset.
13887 arg is const.
13888 Be sure to strdup `arg' when used, since there is no reason for
13889 token_buffer not to change.
13890
0f37a994
AD
138912001-11-14 Akim Demaille <akim@epita.fr>
13892
13893 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
13894 definition.
13895 * src/main.c (main): Use them.
13896 Suggested by Hans Aberg.
13897
d39d93b8
AD
138982001-11-12 Akim Demaille <akim@epita.fr>
13899
13900 * src/system.h (ngettext): Now that we use ngettext, be sure to
13901 provide a default definition when NLS are not used.
13902
9edcd895
AD
139032001-11-12 Akim Demaille <akim@epita.fr>
13904
13905 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
13906 Use @kbd to denote user input.
13907 (Language and Grammar): ANSIfy the example.
13908 Adjust its layout for info/notinfo.
13909 (Location Tracking Calc): Output error messages to stderr.
13910 Output locations in a more GNUtically correct way.
13911 Fix a couple of Englishos.
13912 Adjust @group/@end group pairs.
13913
7da99ede
AD
139142001-11-12 Akim Demaille <akim@epita.fr>
13915
e3aa65c5 13916 %expect was not functioning at all.
7da99ede
AD
13917
13918 * src/conflicts.c (expected_conflicts): Set to -1.
13919 (conflict_report): Use ngettext.
13920 (conflicts_print): Check %expect and make its violation an error.
13921 * doc/bison.texinfo (Expect Decl): Adjust.
13922 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
13923 * tests/regression.at (%expect not enough, %expect right)
13924 (%expect too much): New.
13925
ba9dda1a
AD
139262001-11-12 Akim Demaille <akim@epita.fr>
13927
13928 * tests/regression.at (Conflicts): Rename as...
13929 (Unresolved SR Conflicts): this.
13930 (Solved SR Conflicts): New.
13931
337c5bd1
AD
139322001-11-12 Akim Demaille <akim@epita.fr>
13933
13934 * src/reduce.c (print_results): Rename as...
13935 (reduce_output): This.
13936 Output to OUT, passed as argument, instead of output_obstack.
13937 (dump_grammar): Likewise.
13938 (reduce_free): New.
13939 Also free V1.
13940 (reduce_grammar): No longer call reduce_output, since...
13941 * src/print.c (print_results): do it.
13942 * src/main.c (main): Call reduce_free;
13943
c73a41af
AD
139442001-11-12 Akim Demaille <akim@epita.fr>
13945
13946 * src/conflicts.c (print_reductions): Accept OUT as argument.
13947 Output to it, not to output_obstack.
13948 * src/print.c (print_actions): Adjust.
13949
0df87bb6
AD
139502001-11-12 Akim Demaille <akim@epita.fr>
13951
13952 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
13953 the result instead of using...
13954 (src_total, rrc_total, src_count, rrc_count): Remove.
13955 (any_conflicts): Remove.
13956 (print_conflicts): Split into...
13957 (conflicts_print, conflicts_output): New.
13958 * src/conflicts.h: Adjust.
13959 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 13960 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
13961 * tests/regression.at (Conflicts): New.
13962 Reported by Tom Lane.
13963
e4d3d4de
AD
139642001-11-12 Akim Demaille <akim@epita.fr>
13965
13966 * tests/regression.at (Invalid input): Remove, duplicate with
13967 ``Invalid input: 1''.
13968
6d7d248e
AD
139692001-11-12 Akim Demaille <akim@epita.fr>
13970
13971 * tests/torture.at (AT_DATA_STACK_TORTURE)
13972 (Exploding the Stack Size with Alloca)
13973 (Exploding the Stack Size with Malloc): New.
13974
e9e4c321
AD
139752001-11-12 Akim Demaille <akim@epita.fr>
13976
13977 * src/bison.simple (YYSTACK_REALLOC): New.
13978 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 13979 Reported by Per Allansson.
e9e4c321 13980
5f7e0832
AD
139812001-11-12 Pascal Bart <pascal.bart@epita.fr>
13982
13983 * src/bison.simple: Define type yystype instead of YYSTYPE, and
13984 define CPP macro, which substitute YYSTYPE by yystype.
13985 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
13986 with yyltype/YYLTYPE. This allows inclusion of the generated
13987 header within the parser if the compiler, such as GGC, accepts
13988 multiple equivalent #defines.
13989 From Akim.
13990
e3f1699f
AD
139912001-11-05 Akim Demaille <akim@epita.fr>
13992
13993 * src/reader.c (symbols_output): New, extracted from...
13994 (packsymbols): here.
13995 (reader): Adjust.
13996
65be0866
AD
139972001-11-05 Akim Demaille <akim@epita.fr>
13998
13999 * src/lex.c (parse_percent_token): s/quotearg/quote/.
14000
e4d910bf
AD
140012001-11-05 Akim Demaille <akim@epita.fr>
14002
14003 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
14004 pattern.
14005
951366c1
AD
140062001-11-05 Akim Demaille <akim@epita.fr>
14007
14008 * src/options.h (struct option_table_struct): set_flags is void*.
14009 * src/options.c (longopts): Support `--output' and `%output'.
14010 (usage): Adjust.
14011 * src/lex.h (tok_setopt): Remove, replaced with...
14012 (tok_intopt, tok_stropt): these new guys.
14013 * src/lex.c (getopt.h): Not needed.
14014 (token_buffer, unlexed_token_buffer): Not const.
14015 (percent_table): Promote `-' over `_' in directive names.
14016 Active `%name-prefix', `file-prefix', and `output'.
14017 (parse_percent_token): Accept possible arguments to directives.
14018 Promote `-' over `_' in directive names.
14019
d8988b2f
AD
140202001-11-04 Akim Demaille <akim@epita.fr>
14021
14022 * doc/bison.texinfo (Decl Summary): Split the list into
14023 `directives for grammars' and `directives for bison'.
14024 Sort'em.
14025 Add description of `%name-prefix', `file-prefix', and `output'.
14026 Promote `-' over `_' in directive names.
14027 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
14028 Simplify the description of `--name-prefix'.
14029 Promote `-' over `_' in directive names.
14030 Promote `--output' over `--output-file'.
14031 Fix the description of `--defines'.
14032 * tests/output.at: Exercise %file-prefix and %output.
14033
6468d18e
AD
140342001-11-02 Akim Demaille <akim@epita.fr>
14035
14036 * doc/refcard.tex: Update.
14037
6b7e85b9
AD
140382001-11-02 Akim Demaille <akim@epita.fr>
14039
14040 * src/symtab.h (SUNDEF): New.
14041 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
14042 stand for `uninitialized', instead of 0.
14043 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
14044 * src/lex.c (lex): Adjust.
14045
14046 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
14047 Number it 0.
14048 Let yylex return it instead of a plain 0.
14049 Reported by Dick Streefland.
14050
cd5aafcf
AD
140512001-11-02 Akim Demaille <akim@epita.fr>
14052
14053 * tests/regression.at (Mixing %token styles): New test.
14054
037ca2f1
AD
140552001-11-02 Akim Demaille <akim@epita.fr>
14056
14057 * src/reader.c (parse_thong_decl): Formatting changes.
14058 (token_translations_init): New, extracted from...
14059 (packsymbols): Here.
14060 Adjust.
14061
270a173c
AD
140622001-11-01 Akim Demaille <akim@epita.fr>
14063
14064 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
14065 Check that `9foo.y' produces correct cpp guards.
14066 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
14067 guards.
14068 Reported by Wwp.
14069
561f9a30
AD
140702001-11-01 Akim Demaille <akim@epita.fr>
14071
14072 * tests/regression.at (Invalid input: 2): New.
14073 * src/lex.c (unlexed_token_buffer): New.
14074 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
14075 too.
14076 Reported by Wwp.
14077
f987e9d2
AD
140782001-11-01 Akim Demaille <akim@epita.fr>
14079
14080 * tests/calc.at: Catch up with 1.30.
14081 * configure.in: Bump to 1.49a.
14082 Adjust to newer Autotest.
14083
0846f581
PB
140842001-10-19 Pascal Bart <pascal.bart@epita.fr>
14085
14086 * src/conflicts.c: Move global variables rrc_total and src_total ...
14087 (print_conflicts): here.
14088 * src/output.c (output): Free global variable user_toknums.
14089 * src/lex.c (token_obstack): Become static.
14090
3c1a79b3
AD
140912001-10-18 Akim Demaille <akim@epita.fr>
14092
14093 * tests/atlocal.in (GCC): Add.
14094 * tests/calc.at: s/m4_match/m4_bmatch/.
14095 s/m4_patsubst/m4_bpatsubst/.
14096 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
14097 * configure.in: AC_SUBST(GCC).
14098
5d52e7d0
MA
140992001-10-14 Marc Autret <autret_m@epita.fr>
14100
14101 * src/options.c (create_long_option_table): Fix.
14102
631aa1d3
AD
141032001-10-10 Akim Demaille <akim@epita.fr>
14104
14105 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
14106
f6ec6d13
AD
141072001-10-04 Akim Demaille <akim@epita.fr>
14108
14109 * src/reader.c (parse_union_decl): Push the caracters in
14110 union_obstack, not attrs_obstack.
14111
342b8b6e
AD
141122001-10-04 Akim Demaille <akim@epita.fr>
14113
14114 Merge in the branch 1.29.
14115
14116 * src/reader.c (packsymbols): Use a temporary obstack for
14117 `%%tokendef', since output_stack is already used elsewhere.
14118
14119 2001-10-02 Akim Demaille <akim@epita.fr>
14120
14121 Bump 1.29d.
14122
14123 2001-10-02 Akim Demaille <akim@epita.fr>
14124
14125 Version 1.29c.
14126
14127 2001-10-02 Akim Demaille <akim@epita.fr>
14128
14129 * tests/regression.at (Invalid CPP headers): New.
14130 From Alexander Belopolsky.
14131 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
14132
14133 2001-10-02 Akim Demaille <akim@epita.fr>
14134
14135 * tests/regression.at (Invalid input): New.
14136 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
14137 Reported by Shura.
14138
14139 2001-10-02 Akim Demaille <akim@epita.fr>
14140
14141 * tests/calc.at: Now that --debug works, the tests must be adjusted.
14142
14143 2001-10-02 Akim Demaille <akim@epita.fr>
14144
14145 * src/output.c (output_parser): Assert `skeleton'.
14146 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
14147 systems.
14148 From Shura.
14149
14150 2001-10-01 Marc Autret <autret_m@epita.fr>
14151
14152 * src/lex.h: Echo modifications.
14153 * src/lex.c (unlex): Parameter is now token_t.
14154 From Hans Aberg.
14155
14156 2001-10-01 Marc Autret <autret_m@epita.fr>
14157
14158 * src/main.c: Include lex.h.
14159 From Hans Aberg.
14160
14161 2001-09-29 Akim Demaille <akim@epita.fr>
14162
14163 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14164
14165 2001-09-28 Akim Demaille <akim@epita.fr>
14166
14167 * tests/testsuite.at: Update to newer Autotest.
14168 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14169
14170 2001-09-27 Akim Demaille <akim@epita.fr>
14171
14172 Position independent wrapper.
14173
14174 * tests/bison: Remove.
14175 * tests/bison.in: New.
14176 * configure.in: Adjust.
14177
14178 2001-09-27 Paul Eggert <eggert@twinsun.com>
14179
14180 Port quotearg fixes from tar 1.13.24.
14181
14182 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14183 tm to be declared.
14184 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14185 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14186
14187 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
14188 * m4/mbrtowc.m4: New file.
14189 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
14190 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
14191
14192 2001-09-27 Akim Demaille <akim@epita.fr>
14193
14194 Bump to 1.29c.
14195
14196 2001-09-27 Akim Demaille <akim@epita.fr>
14197
14198 Version 1.29b.
14199
14200 2001-09-25 Akim Demaille <akim@epita.fr>
14201
14202 * src/system.h: Include `xalloc.h'.
14203 Remove it from the C files.
14204 * src/files.c (output_files): Free the obstacks.
14205 * src/lex.c (init_lex): Rename as...
14206 (lex_init): this.
14207 (lex_free): New.
14208 * src/main.c (main): Use it.
14209
14210 2001-09-24 Marc Autret <autret_m@epita.fr>
14211
14212 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
14213 to output informations in fout (FILE*).
14214 (open_graph, close_graph): Likewise.
14215 (output_graph, output_edge, output_node): Likewise.
14216 * src/vcg.h: Update function prototypes.
14217 * src/print_graph.c (print_graph): Open output graph file.
14218 (print_actions): Adjust.
14219 * src/files.h: Remove extern declaration.
14220 * src/files.c: Remove graph_obstack declaration.
14221 (open_files): Remove graph_obstack initialization.
14222 (output_files): Remove graph_obstack saving.
14223
14224 2001-09-24 Marc Autret <autret_m@epita.fr>
14225
14226 * src/files.c (compute_output_file_names): Fix.
14227
14228 2001-09-24 Marc Autret <autret_m@epita.fr>,
14229 Akim Demaille <akim@epita.fr>
14230
14231 * src/reader.c (reader): Remove call to free_symtab ().
14232 * src/main.c (main): Call it here.
14233 Include symtab.h.
14234 * src/conflicts.c (initialize_conflicts): Rename as...
14235 (solve_conflicts): this.
14236 * src/print.c (print_core, print_actions, print_state)
14237 (print_grammar): Dump to a file instead a `output_obstack'.
14238 (print_results): Dump `output_obstack', and then proceed with the
14239 FILE *.
14240 * src/files.c (compute_output_file_names, close_files): New.
14241 (output_files): Adjust.
14242 * src/main.c (main): Adjust.
14243
14244 2001-09-23 Marc Autret <autret_m@epita.fr>
14245
14246 * src/files.c (compute_header_macro): Computes header macro name
14247 from spec_defines_file when given.
14248
14249 2001-09-23 Marc Autret <autret_m@epita.fr>
14250
14251 * src/files.c (output_files): Add default extensions.
14252
14253 2001-09-22 Akim Demaille <akim@epita.fr>
14254
14255 * src/conflicts.c (finalize_conflicts): Rename as...
14256 (free_conflicts): this.
14257
14258 2001-09-22 Akim Demaille <akim@epita.fr>
14259
14260 * src/gram.c (gram_free): Rename back as...
14261 (dummy): this.
14262 (output_token_translations): Free `token_translations'.
14263 * src/symtab.c (free_symtab): Free the tag field.
14264
14265 2001-09-22 Akim Demaille <akim@epita.fr>
14266
14267 Remove `translations' as it is always set to true.
14268
14269 * src/gram.h: Adjust.
14270 * src/reader.c (packsymbols, parse_token_decl): Adjust
14271 * src/print.c (print_grammar): Adjust.
14272 * src/output.c (output_token_translations): Adjust.
14273 * src/lex.c (lex): Adjust.
14274 * src/gram.c: Be sure the set pointers to NULL.
14275 (dummy): Rename as...
14276 (gram_free): this.
14277
14278 2001-09-22 Akim Demaille <akim@epita.fr>
14279
14280 * configure.in: Invoke AM_LIB_DMALLOC.
14281 * src/system.h: Use dmalloc.
14282 * src/LR0.c: Be sure to have pointers initialized to NULL.
14283 (allocate_itemsets): Allocate kernel_items only if needed.
14284
14285 2001-09-22 Akim Demaille <akim@epita.fr>
14286
14287 * configure.in: Bump to 1.29b.
14288 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
14289 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
14290 need xmalloc.c in calc.y.
14291 From Pascal Bart.
14292
14293 2001-09-21 Akim Demaille <akim@epita.fr>
14294
14295 Version 1.29a.
14296 * Makefile.maint, config/config.guess, config/config.sub,
14297 * config/missing: Update from masters.
14298 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
14299 upon package.m4.
14300 * configure.in (ALL_LINGUAS): Add `tr'.
14301
14302 2001-09-21 Akim Demaille <akim@epita.fr>
14303
14304 * tests/Makefile.am (package.m4): Move to...
14305 ($(srcdir)/$(TESTSUITE)): here.
14306
14307 2001-09-20 Akim Demaille <akim@epita.fr>
14308
14309 * src/complain.c: No longer try to be standalone: use system.h.
14310 Don't assume __STDC__ is defined to 1. Just test if it is defined.
14311 * src/complain.h: Likewise.
14312 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
14313 Remove the unused variable `n'.
14314 From Albert Chin-A-Young.
14315
14316 2001-09-18 Marc Autret <autret_m@epita.fr>
14317
14318 * doc/bison.1: Update.
14319 * doc/bison.texinfo (Bison Options): Update --defines and --graph
14320 descriptions.
14321 (Option Cross Key): Update.
14322 Add --graph.
14323
14324 2001-09-18 Marc Autret <autret_m@epita.fr>
14325
14326 * tests/regression.at: New test (comment in %union).
14327
14328 2001-09-18 Marc Autret <autret_m@epita.fr>
14329
14330 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
14331 do that.
14332 Reported by Keith Browne.
14333
14334 2001-09-18 Marc Autret <autret_m@epita.fr>
14335
14336 * tests/output.at: Add tests for --defines and --graph.
14337
14338 2001-09-18 Marc Autret <autret_m@epita.fr>
14339
14340 * tests/output.at: Removes tests of %{header,src}_extension features.
14341
14342 2001-09-18 Akim Demaille <akim@epita.fr>
14343
14344 * tests/Makefile.am (package.m4): New.
14345 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
14346 (_AT_CHECK_CALC_ERROR): Likewise.
14347 Factor the `, ' part of verbose error messages.
14348
14349 2001-09-18 Marc Autret <autret_m@epita.fr>
14350
14351 * src/getargs.c (longopts): Declare --defines and --graph as options
14352 with optional arguments.
14353 * src/files.h: Add extern declarations.
14354 * src/files.c (spec_graph_file, spec_defines_file): New.
14355 (output_files): Update.
14356 Remove CPP-outed code.
14357
14358 2001-09-18 Marc Autret <autret_m@epita.fr>
14359
14360 Turn off %{source,header}_extension feature.
14361
14362 * src/files.c (compute_exts_from_gf): Update.
14363 (compute_exts_from_src): Update.
14364 (output_files): CPP-out useless code.
14365 * src/files.h: Remove {header,source}_extension extern declarations.
14366 * src/reader.c (parse_dquoted_param): CPP-out.
14367 (parse_header_extension_decl): Remove.
14368 (parse_source_extension_decl): Remove.
14369 (read_declarations): Remove cases tok_{hdrext,srcext}.
14370 * src/lex.c (percent_table): Remove {header,source}_extension entries.
14371 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
14372
14373 2001-09-10 Akim Demaille <akim@epita.fr>
14374
14375 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
14376 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
14377 (AT_CHECK_OUTPUT): this.
14378 Merely check ls' exit status, its output is useless.
14379
14380 2001-09-10 Akim Demaille <akim@epita.fr>
14381
14382 * tests/calc.at: Use m4_match.
14383 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
14384
14385 2001-09-10 Marc Autret <autret_m@epita.fr>,
14386 Akim Demaille <akim@epita.fr>
14387
14388 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
14389 enum color_e.
14390 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
14391 to `normal'.
14392 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
14393 * src/lex.h: Adjust prototype.
14394 (token_t): Add `tok_undef'.
14395 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
14396 (parse_percent_token): Now returns token_t.
14397 Add default statement in switch.
14398 (lex): Separate `c' as an input variable, from the token_t result
14399 part.
14400 (unlexed): Is a token_t.
14401
14402 2001-09-10 Akim Demaille <akim@epita.fr>
14403
14404 * configure.in: Bump to 1.29a.
14405
14406 2001-09-07 Akim Demaille <akim@epita.fr>
14407
14408 Version 1.29.
14409
14410 2001-08-30 Akim Demaille <akim@epita.fr>
14411
14412 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
14413 * m4/atconfig.m4: Remove.
14414 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
14415 * tests/bison: New.
14416 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
14417 m4_if, m4_patsubst, and m4_regexp.
14418 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
14419 `input' file instead of echo.
14420
14421 2001-08-29 Akim Demaille <akim@epita.fr>
14422
14423 Bump to 1.28e.
14424
14425 2001-08-29 Akim Demaille <akim@epita.fr>
14426
14427 Version 1.28d.
14428
14429 2001-08-29 Paul Eggert <eggert@twinsun.com>
14430
14431 * src/bison.simple (yyparse): Don't take the address of an
14432 item before the start of an array, as that doesn't conform to
14433 the C Standard.
14434
14435 2001-08-29 Robert Anisko <anisko_r@epita.fr>
14436
14437 * doc/bison.texinfo (Location Tracking Calc): New node.
14438
14439 2001-08-29 Paul Eggert <eggert@twinsun.com>
14440
14441 * src/output.c (output): Do not define const, as this now
14442 causes more problems than it cures.
14443
14444 2001-08-29 Akim Demaille <akim@epita.fr>
14445
14446 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
14447 the nodes.
14448 Be sure to tag the `detailmenu'.
14449
14450 2001-08-29 Akim Demaille <akim@epita.fr>
14451
14452 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
14453 download in a tmp dir.
14454
14455 2001-08-28 Marc Autret <autret_m@epita.fr>
14456
14457 * config/depcomp: New file.
14458
14459 2001-08-28 Marc Autret <autret_m@epita.fr>
14460
14461 * doc/bison.1 (mandoc): Adjust.
14462 From Juan Manuel Guerrero.
14463
14464 2001-08-28 Marc Autret <autret_m@epita.fr>
14465
14466 * src/print_graph.c (print_state): Fix.
14467
14468 2001-08-27 Marc Autret <autret_m@epita.fr>
14469
14470 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
14471 char * members.
14472 Echo modifications to the functions prototypes.
14473 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
14474
14475 2001-08-27 Marc Autret <autret_m@epita.fr>
14476
14477 * src/vcg.c: Include `xalloc.h'.
14478 (add_colorentry): New.
14479 (add_classname): New.
14480 (add_infoname): New.
14481 * src/vcg.h: Add new prototypes.
14482
14483 2001-08-27 Akim Demaille <akim@epita.fr>
14484
14485 * Makefile.maint: Sync. again with CVS Autoconf.
14486
14487 2001-08-27 Akim Demaille <akim@epita.fr>
14488
14489 * Makefile.maint: Formatting changes.
14490 (po-update, cvs-update, update): New targets.
14491 (AMTAR): Remove.
14492
14493 2001-08-27 Akim Demaille <akim@epita.fr>
14494
14495 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
14496 * Makefile.maint: Sync. with CVS Autoconf.
14497
14498 2001-08-27 Marc Autret <autret_m@epita.fr>
14499
14500 * src/vcg.h (struct infoname_s): New.
14501 (struct colorentry_s): New.
14502 (graph_s): New fields {vertical,horizontal}_order in structure.
14503 Add `infoname' field.
14504 Add `colorentry' field;
14505 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
14506 (G_HORIZONTAL_ORDER): New.
14507 (G_INFONAME): New.
14508 (G_COLORENTRY): New.
14509 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
14510 Add output of `infoname'.
14511 Add output of `colorentry'.
14512
14513 2001-08-27 Marc Autret <autret_m@epita.fr>
14514
14515 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
14516 This one shadowed a global parameter.
14517
14518 2001-08-24 Marc Autret <autret_m@epita.fr>
14519
14520 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
14521 instead of `unsigned'.
14522 (print_state): Do not call obstack_object_size () in obstack_grow ()
14523 to avoid macro variables shadowing.
14524
14525 2001-08-23 Marc Autret <autret_m@epita.fr>
14526
14527 * src/lex.c (percent_table): Typo: s/naem/name/.
14528 Add graph option.
14529 Normalize new options declarations.
14530
14531 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
14532
14533 * tests/suite.at: Exercise %header_extension and %source_extension.
14534
14535 2001-08-16 Marc Autret <autret_m@epita.fr>
14536
14537 * src/reader.c (parse_dquoted_param): New.
14538 (parse_header_extension_decl): Use it.
14539 (parse_source_extension_decl): Likewise.
14540
14541 2001-08-16 Marc Autret <autret_m@epita.fr>
14542
14543 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
14544 (get_xxxx_str): Use assert () instead of complain ().
14545 Remove return invokations in default cases.
14546 (get_decision_str): Modify default behaviour. Remove second argument.
14547 Echo modifications on calls.
14548 (output_graph): Fix.
14549
14550 2001-08-16 Marc Autret <autret_m@epita.fr>
14551
14552 * src/getargs.c (usage): Update with ``-g, --graph''.
14553
14554 2001-08-16 Marc Autret <autret_m@epita.fr>
14555
14556 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
14557 (Option Cross Key): Likewise.
14558 * doc/bison.1: Update.
14559
1c8c2190
PB
145602001-09-25 Pascal Bart <pascal.bart@epita.fr>
14561
14562 * src/output.c (output_master_parser): Don't finish action_obstack.
14563 (output_parser): Don't care about the muscle action, here.
14564 (prepare): Copy the action_obstack in the action muscle.
14565 (output): Free action_obstack.
14566
180d45ba
PB
145672001-09-23 Pascal Bart <pascal.bart@epita.fr>
14568
14569 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
14570 will contain `%union' declaration.
14571 (parse_union_decl): Delete #line directive output.
14572 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
14573 informations about %union.
14574 (parse_union_decl): Copy the union_obstack in the muscle stype.
14575 * src/bison.simple: Add new #line directive.
14576 Add typdef %%stype YYSTYPE.
14577
c51d1a19
PB
145782001-09-23 Pascal Bart <pascal.bart@epita.fr>
14579
14580 * src/bison.simple: Add new `#line' directive.
14581
6f9344da
PB
145822001-09-22 Pascal Bart <pascal.bart@epita.fr>
14583
14584 * src/bison.simple: New `#line' directive.
14585 * src/output.c (output_parser): Support new dynamic muscle input_line.
14586
652def80
MA
145872001-09-22 Marc Autret <autret_m@epita.fr>
14588
14589 * src/output.c (output_master_parser): New.
14590 (output_parser): Be more re-entrant.
14591
25b222fa
MA
145922001-09-21 Marc Autret <autret_m@epita.fr>
14593
14594 * src/reader.c (copy_definition, parse_union_decl): Update and use
14595 `linef' muscle.
14596 (copy_action): Likewise.
14597 Use obstack_1grow ().
14598 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
14599
6bc35ae5
MA
146002001-09-21 Marc Autret <autret_m@epita.fr>
14601
14602 * src/options.c (option_table): Adjust.
14603 * src/lex.c (parse_percent_token): Fix.
14604
c0629aa1
PB
146052001-09-20 Pascal Bart <pascal.bart@epita.fr>
14606
14607 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 14608
82b6d266
PB
146092001-09-20 Pascal Bart <pascal.bart@epita.fr>
14610
14611 * src/lex.c (parse_percent_token): Change type of variable `tx', which
14612 is now an option_table_struct*.
14613 (option_strcmp): New function option_strcmp.
14614 (parse_percent_token): Call option_strcmp.
14615 * src/getargs.c (xalloc.h, options.h): Include it.
14616 (getargs): Call create_long_option_table.
14617 (getargs): Free longopts at the end of the function.
14618 (shortopts): Move in options.c.
14619 * src/options.c (create_long_option_table): New function. Convert
14620 information from option_table to option structure.
14621 * src/reader.c (options.h): Include it.
14622
14623 * src/Makefile.am: Adjust.
14624 * src/options.c (option_table): Create from longopts and percent_table.
14625 * src/getargs.c (longopts): Delete.
14626 * src/lex.c (struct percent_table_struct): Delete.
14627 (percent_table): Delete.
14628 (options.h): Include it.
14629 * src/options.c: Create.
14630 * src/options.h: Create.
14631 Declare enum opt_access_e.
14632 Define struct option_table_struct.
14633
75f5aaea
MA
146342001-09-20 Marc Autret <autret_m@epita.fr>
14635
14636 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
14637 sections of Bison.
14638
f508cb0a
PB
146392001-09-19 Pascal Bart <pascal.bart@epita.fr>
14640
14641 * src/bison.simple: s/%%filename/%%skeleton.
14642 * src/muscle_tab.c (getargs.h): Include it.
14643 (muscle_init): Insert new muscle skeleton.
14644
13105fc1
PB
146452001-09-18 Pascal Bart <pascal.bart@epita.fr>
14646
14647 * src/output.c (output_parser): Delete unused variable actions_dumped.
14648
b0c4483e
PB
146492001-09-07 Pascal Bart <pascal.bart@epita.fr>
14650
14651 * src/output.c (output): Delete call to reader_output_yylsp.
14652 * src/reader.c (reader): Likewise.
ba0fe3c7 14653 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 14654
11d82f03
MA
146552001-09-02 Marc Autret <autret_m@epita.fr>
14656
14657 * src/reader.c: Include muscle_tab.h.
14658 (parse_union_decl): Update.
14659 (parse_macro_decl): Rename parse_muscle_decl.
14660 Update to use renamed functions and variable.
14661 (read_declarations, copy_action, read_additionnal_code, : Updated
14662 with correct variables and functions names.
14663 (packsymbols, reader): Likewise.
342b8b6e 14664
11d82f03 14665 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 14666
11d82f03
MA
14667 * src/output.c: Include muscle_tab.h
14668 In all functions using macro_insert, change by using muscle_insert ().
14669 (macro_obstack): Rename muscle_obstack.
14670 Echo modifications in the whole file.
14671 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
14672 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
14673 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
14674
14675 * src/muscle_tab.h: Update double inclusion macros.
14676 (macro_entry_s): Rename muscle_entry_s.
14677 Update prototypes.
342b8b6e 14678
11d82f03
MA
14679 * src/muscle_tab.c: Include muscle_tab.h.
14680 Rename macro_tabble to muscle_table.
14681 (mhash1, mhash2, mcmp): Use muscle_entry.
14682 (macro_init): Rename muscle_init. Update.
14683 (macro_insert): Rename muscle_insert. Update.
14684 (macro_find): Rename muscle_find. Update.
14685
14686 * src/main.c: Include muscle_tab.h.
14687 (main): Call muscle_init ().
14688 * src/Makefile.am (bison_SOURCES): Echo modifications.
14689
93a37297
MA
146902001-09-02 Marc Autret <autret_m@epita.fr>
14691
f753cd62 14692 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 14693
f753cd62
MA
14694 * src/muscle_tab.c, src/muscle_tab.h: Add files.
14695
146962001-09-02 Marc Autret <autret_m@epita.fr>
14697
14698 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 14699
682d48cd
PB
147002001-09-01 Pascal Bart <pascal.bart@epita.fr>
14701
342b8b6e 14702 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
14703 filename.
14704
087c8fda
MA
147052001-09-01 Marc Autret <autret_m@epita.fr>
14706
14707 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
14708 to an explicit value to activate the feature. We do it here.
14709
dda680cb
PB
147102001-08-31 Pascal Bart <pascal.bart@epita.fr>
14711
14712 * src/output.c (prepare): Delete the `filename' muscule insertion.
14713 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
14714 (parse_union_decl): Likewise.
14715 * src/macrotab.c (macro_init): Initialize filename by infile.
14716
9e644e64
MA
147172001-08-31 Marc Autret <autret_m@epita.fr>
14718
14719 * src/bison.simple (YYLSP_NEEDED): New definition.
14720 * src/output.c (prepare): Add macro insertion of `locations_flag'
14721
17da6427
PB
147222001-08-31 Pascal Bart <pascal.bart@epita.fr>
14723
14724 * src/output.c (prepare): Delete insertion of previous muscles,
14725 and insert the `prefix' muscles.
14726 * src/macrotab.c (macro_init): Likewise.
14727 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 14728 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
14729 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
14730 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 14731 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
14732 name_prefix.
14733
e8cb70b9
PB
147342001-08-31 Pascal Bart <pascal.bart@epita.fr>
14735
14736 * src/main.c (main): Standardize.
14737 * src/output.c (output_table_data, output_parser): Likewise.
14738 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
14739
63c2d5de
MA
147402001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
14741
342b8b6e 14742 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
14743 %%epilogue.
14744 * src/output.c (output): Rename %%declarations to %%prologue.
14745 * src/bison.simple: Echo modifications.
342b8b6e 14746
d8cb5183
MA
147472001-08-31 Marc Autret <autret_m@epita.fr>
14748
14749 * src/reader.c (readgram): CleanUp.
14750 (output_token_defines): Likewise.
14751 (packsymbols): Likewise.
14752 (reader): Likewise.
14753 * src/output.c (output): CPP-out useless code.
14754
6c686258
PB
147552001-08-31 Pascal Bart <pascal.bart@epita.fr>
14756
342b8b6e 14757 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
14758 output_trailers and output_headers.
14759 * src/output.h: Remove obsolete functions prototypes of output_headers
14760 and output_trailers.
14761
8f451ef7
PB
147622001-08-30 Pascal Bart <pascal.bart@epita.fr>
14763
14764 * src/main.c: Include macrotab.h.
342b8b6e 14765 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
14766 Adjust functions prototypes.
14767 * src/macrotab.c (macro_insert): Constify key and value.
14768 (macro_find): Constify key.
14769 (macro_insert): Include 'xalloc.h'
14770 (macro_insert): Use XMALLOC.
14771 (macro_find): Constify return value.
14772 * src/output.c (output_table_data): Rename table to table_data.
14773 (output_parser): Constify macro_key, macro_value.
14774
997b6fd0 147752001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
14776
14777 * src/reader.c (parse_skel_decl): New.
342b8b6e 14778 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
14779 * src/lex.h (token_t): New token `tok_skel'.
14780 * src/lex.c (percent_table): Add skeleton option entry.
14781 Standardize.
14782
ff48177d
MA
147832001-08-29 Marc Autret <autret_m@epita.fr>
14784
14785 * src/bison.simple: Add %%user_code directive at the end.
14786 * src/reader.c (read_additionnal_code): New.
14787 (reader): Use it.
14788 * src/output.c (output_program): Remove.
14789 (output): Update.
14790
b33160bf
MA
147912001-08-28 Marc Autret <autret_m@epita.fr>
14792
14793 * src/output.c (output_actions): Clean up.
4e5caae2 14794 (output_gram): CPP-out useless code.
b33160bf
MA
14795 * src/reader.c (reader): Clean up, CPP-out useless code.
14796
d1a2daf7
PB
147972001-08-28 Pascal Bart <pascal.bart@epita.fr>
14798
342b8b6e 14799 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 14800 directive.
d1a2daf7
PB
14801 * src/bison.simple: Add `%%definitions'.
14802
2b763dfe
MA
148032001-08-28 Marc Autret <autret_m@epita.fr>
14804
14805 * config/depcomp: New file.
14806
f1a87ef6
PE
148072001-08-27 Paul Eggert <eggert@twinsun.com>
14808
14809 * src/bison.simple (yyparse): Don't take the address of an
14810 item before the start of an array, as that doesn't conform to
14811 the C Standard.
14812
82e236e2
RA
148132001-08-27 Robert Anisko <robert.anisko@epita.fr>
14814
f1a87ef6 14815 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
14816 obstack. It was done too late here.
14817
14818 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
14819 completely wrong.
14820 (reader): Initialize the macro obstack here, since we need it to grow
14821 '%define' directives.
14822
14823 * src/reader.h: Declare the macro obstack as extern.
14824
b0cfa28a
RA
148252001-08-27 Robert Anisko <robert.anisko@epita.fr>
14826
14827 * src/output.c (output_parser): Fix. Store single '%' characters in
14828 the output obstack instead of throwing them away.
14829
6fc74234
AD
148302001-08-27 Akim Demaille <akim@epita.fr>
14831
14832 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
14833
9c76d118
RA
148342001-08-25 Robert Anisko <robert.anisko@epita.fr>
14835
14836 * lib/Makefile.am: Adjust.
14837
a8289c62
RA
148382001-08-25 Robert Anisko <robert.anisko@epita.fr>
14839
14840 * src/bison.simple: Update and add '%%' directives.
14841
b6610515
RA
148422001-08-25 Robert Anisko <robert.anisko@epita.fr>
14843
14844 * src/reader.c (reader): Remove calls to 'output_headers' and
14845 'output_trailers'. Remove some C output.
14846 (readgram): Disable a piece of code that was writing a default
14847 definition for 'YYSTYPE'.
14848 (reader_output_yylsp): Remove.
14849 (packsymbols): Output token defintions to a macro.
14850 (copy_definition): Disable C output.
6fc74234 14851
b6610515
RA
14852 * src/reader.c (parse_macro_decl): New function used to parse macro
14853 declarations.
14854 (copy_string2): Put the body of copy_string into this new function.
14855 Add a parameter to let the caller choose whether he wants to copy the
14856 string delimiters or not.
14857 (copy_string): Be a simple call to copy_string2 with the last argument
14858 bound to true.
14859 (read_declarations): Add case for macro definition.
14860 (copy_identifier): New.
6fc74234 14861 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
14862 rather than lex.
14863
26f609ff
RA
148642001-08-25 Robert Anisko <robert.anisko@epita.fr>
14865
14866 * src/output.c (prepare): Add prefixed names.
14867 (output_parser): Output semantic actions.
14868 (output_parser): Fix bug on '%%line' directives.
6fc74234 14869
26f609ff
RA
14870 * src/output.c (output_headers): Remove. The C code printed by this
14871 function should now be in the skeletons.
14872 (output_trailers): Remove.
14873 (output): Disable call to 'reader_output_yylsp'.
14874 (output_rule_data): Do not output tables to the table obstack.
14875
14876 * src/output.c: Remove some C dedicated output.
14877 Improve the use of macro and output obstacks.
14878 (output_defines): Remove.
6fc74234 14879
26f609ff
RA
14880 * src/output.c (output_token_translations): Associate 'translate'
14881 table with a macro. No output to the table obstack.
14882 (output_gram): Same for 'rhs' and 'prhs'.
14883 (output_stos): Same for 'stos'.
14884 (output_rule_data): Same for 'r1' and 'r2'.
14885 (token_actions): Same for 'defact'.
14886 (goto_actions): Same for 'defgoto'.
14887 (output_base): Same for 'pact' and 'pgoto'.
14888 (output_table): Same for 'table'.
14889 (output_check): Same for 'check'.
6fc74234 14890
26f609ff
RA
14891 * src/output.c (output_table_data): New function.
14892 (output_short_table): Remove.
14893 (output_short_or_char_table): Remove.
6fc74234 14894
26f609ff
RA
14895 * src/output.c (output_parser): Replace most of the skeleton copy code
14896 with something new. Skeletons are now processed character by character
14897 rather than line by line, and Bison looks for '%%' macros. This is the
14898 first step in making Bison's output process (a lot) more flexible.
14899 (output_parser): Use the macro table.
14900
6f43b113
RA
149012001-08-25 Robert Anisko <robert.anisko@epita.fr>
14902
14903 * src/main.c (main): Initialize the macro table.
14904
dd3127cf
RA
149052001-08-25 Robert Anisko <robert.anisko@epita.fr>
14906
14907 * src/lex.c (percent_table): Add tok_define.
14908 * src/lex.h: Add tok_define.
14909
aa321494
RA
149102001-08-25 Robert Anisko <robert.anisko@epita.fr>
14911
14912 * src/macrotab.c: New file.
14913 * src/macrotab.h: New file.
14914 * src/Makefile.am: Update.
14915
68bd3b6b
RA
149162001-08-25 Robert Anisko <robert.anisko@epita.fr>
14917
14918 * lib/hash.c: New file.
14919 * lib/hash.h: New file.
14920 * lib/Makefile.am: Update.
14921
45f8dd1e
AD
149222001-08-15 Akim Demaille <akim@epita.fr>
14923
14924 Version 1.28c.
14925
40a64a7a 149262001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
14927
14928 * src/reader.c (readgram): Indent output macro YYSTYPE.
14929 (packsymbols): Likewise.
14930 (output_token_defines): Likewise.
14931 * src/files.c: Standardize.
14932 (compute_header_macro): New.
14933 (defines_obstack_save): New. Use compute_header_macro.
14934 (output_files): Update. Use defines_obstack_save.
14935
f9a8293a
AD
149362001-08-15 Akim Demaille <akim@epita.fr>
14937
14938 * doc/bison.texinfo (Table of Symbols): Document
14939 YYSTACK_USE_ALLOCA.
14940
150ca7a7
AD
149412001-08-15 Akim Demaille <akim@epita.fr>
14942
14943 * missing: Update from CVS Automake.
14944 * config/config.guess, config/config.sub, config/texinfo.tex:
14945 Update from gnu.org.
14946
69b5cec4
AD
149472001-08-15 Akim Demaille <akim@epita.fr>
14948
14949 * Makefile.maint: Sync with CVS Autoconf.
14950
f2b5126e
PB
149512001-08-14 Pascal Bart <pascal.bart@epita.fr>
14952
69b5cec4 14953 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
14954 `fdl.texi'.
14955 * doc/fdl.texi: Add to package.
14956
4ecbf796
MA
149572001-08-14 Marc Autret <autret_m@epita.fr>
14958
14959 Turn on %{source,header}_extension features.
14960
69b5cec4 14961 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
14962 source_extension.
14963 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 14964 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
14965 between options.
14966
95fb5662
MA
149672001-08-14 Marc Autret <autret_m@epita.fr>
14968
14969 * src/files.c (compute_base_names): Add extensions computing when
14970 `--file-prefix' used.
14971 Standardize function calls.
14972
78d09da9
MA
149732001-08-13 Marc Autret <autret_m@epita.fr>
14974
69b5cec4 14975 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
14976 defining it (defined but null disables alloca).
14977
5a009f2c
MA
149782001-08-13 Marc Autret <autret_m@epita.fr>
14979
14980 * src/bison.simple (_yy_memcpy): CPP reformat.
14981
1e41465a
PB
149822001-08-13 Pascal Bart <pascal.bart@epita.fr>
14983
14984 * tests/atconfig.in (CPPFLAGS): Fix.
14985
c67a198d
PB
149862001-08-10 Pascal Bart <pascal.bart@epita.fr>
14987
79282c6c 14988 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
14989 `gpl.texi'.
14990 * doc/gpl.texi: Add to package.
14991
09a6de7e
MA
149922001-08-10 Marc Autret <autret_m@epita.fr>
14993
14994 * src/print_graph.h: Fix.
14995 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
14996
b77b9ee0
AD
149972001-08-10 Akim Demaille <akim@epita.fr>
14998
14999 * src/system.h: Provide default declarations for stpcpy, strndup,
15000 and strnlen.
15001
3e259915
MA
150022001-08-10 Robert Anisko <anisko_r@epita.fr>
15003
15004 * doc/bison.texinfo (Locations): Update @$ stuff.
15005
ca96bc2d
MA
150062001-08-09 Robert Anisko <anisko_r@epita.fr>
15007
15008 * src/bison.simple (YYLLOC_DEFAULT): Update.
15009 (yyparse): Adjust.
15010
fdc6758b
MA
150112001-08-08 Marc Autret <autret_m@epita.fr>
15012
b77b9ee0 15013 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
15014 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
15015 Reported by Fabrice Bauzac.
957d4dbf 15016
600cad3b
MA
150172001-08-08 Marc Autret <autret_m@epita.fr>
15018
15019 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
15020 * src/vcg.c (output_node): Fix.
15021 * src/vcg.h: Cleanup.
15022 * src/print_graph.c: Add comments.
b77b9ee0 15023 (node_output_size): New global variable. Simplify the formatting of
600cad3b 15024 the VCG graph output.
b77b9ee0 15025 (print_actions): Unused code is now used. It notifies the final state
600cad3b 15026 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 15027 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
15028 blue.
15029 Get the current node name and node_obstack by argument.
15030 (node_obstack): New variable.
15031 (print_state): Manage node_obstack.
15032 (print_core): Use node_obstack given by argument.
15033 A node is not only computed here but in print_actions also.
15034 (print_graph): CPP out useless code instead of commenting it.
15035
976e528f
AD
150362001-08-07 Pascal Bart <pascal.bart@epita.fr>
15037
15038 * tests/atconfig.in (CPPFLAGS): Fix.
15039
20e8e5ca
AD
150402001-08-07 Akim Demaille <akim@epita.fr>
15041
15042 * src/print_graph.c (quote): New.
15043 (print_core): Use it.
15044
957d4dbf 150452001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 15046
3e3da797
AD
15047 * src/vcg.c (complain.h): Include it.
15048 Unepitaize `return' invocations.
c4b66126 15049 [NDEBUG] (main): Remove.
79282c6c 15050 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
15051 * src/files.c (open_files): Initialize graph_obstack.
15052 * src/print_graph.c (print_actions): CPP out useless code.
15053 (print_core): Don't output the last `\n' in labels.
15054 Use `quote'.
15055 * src/files.c (output_files): Output the VCG file.
15056 * src/main.c (main): Invoke print_graph ();
3e3da797 15057
957d4dbf 150582001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
15059
15060 Automaton VCG graph output.
15061 Using option ``-g'' or long option ``--graph'', you can generate
15062 a gram_filename.vcg file containing a VCG description of the LALR (1)
15063 automaton of your grammar.
15064
15065 * src/main.c: Call to print_graph() function.
15066 * src/getargs.h: Update.
15067 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
15068 (graph_flag): New flag.
15069 (longopts): Update.
15070 (getargs): Add case `g'.
15071 * src/files.c (graph_obstack): New obstack struct.
15072 (open_files): Initialize new obstack.
15073 (output_files): Saves graph_obstack if required.
15074 * src/files.h (graph_obstack): New extern declaration.
15075 * src/Makefile.am: Add new source files.
15076
927c1557 150772001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
15078
15079 * src/print_graph.c, src/print_graph.h (graph): New.
15080 * src/vcg.h: New file.
15081 * src/vcg.c: New file, VCG graph handling.
15082
7333d403
AD
150832001-08-06 Marc Autret <autret_m@epita.fr>
15084
15085 Add of %source_extension and %header_extension which specify
15086 the source or/and the header output file extension.
15087
15088 * src/files.c (compute_base_names): Remove initialisation of
15089 src_extension and header_extension.
15090 (compute_exts_from_gf): Update.
15091 (compute_exts_from_src): Update.
15092 (output_files): Update.
15093 * src/reader.c (parse_header_extension_decl): New.
15094 (parse_source_extension_decl): New.
15095 (read_declarations): New case statements for the new tokens.
15096 * src/lex.c (percent_table): Add entries for %source_extension
15097 and %header_extension.
15098 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
15099
84163231
AD
151002001-08-06 Marc Autret <autret_m@epita.fr>
15101
15102 * configure.in: Bump to 1.28c.
15103 * doc/bison.texinfo: Texinfo thingies.
15104
8303fc42
AD
151052001-08-04 Pascal Bart <pascal.bart@epita.fr>
15106
15107 * tests/atconfig.in (CPPFLAGS): Add.
15108 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
15109
70a84437
AD
151102001-08-03 Akim Demaille <akim@epita.fr>
15111
15112 Version 1.28b.
15113
2ce10144
AD
151142001-08-03 Akim Demaille <akim@epita.fr>
15115
15116 * tests/Makefile.am (check-local): Ship testsuite.
15117 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
15118 Include `string.h'.
15119
1e3e4bc1
AD
151202001-08-03 Akim Demaille <akim@epita.fr>
15121
15122 * configure.in: Try using -Wformat when compiling.
15123
42b45b7f
AD
151242001-08-03 Akim Demaille <akim@epita.fr>
15125
15126 * configure.in: Bump to 1.28b.
15127
8f13fe33
AD
151282001-08-03 Akim Demaille <akim@epita.fr>
15129
15130 * src/complain.c: Adjust strerror_r portability issues.
15131
b37ba92c
AD
151322001-08-03 Akim Demaille <akim@epita.fr>
15133
15134 Version 1.28a.
15135
b0ce6046
AD
151362001-08-03 Akim Demaille <akim@epita.fr>
15137
15138 * src/getargs.c, src/getarg.h (skeleton)): Constify.
15139 * src/lex.c (literalchar): Avoid name clashes on `buf'.
15140 * src/getargs.c: Include complain.h.
15141 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
15142 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
15143
d01c415b
AD
151442001-08-03 Akim Demaille <akim@epita.fr>
15145
15146 * src/reader.c (readgram): Display hidden chars in error messages.
15147
459dd1a6
AD
151482001-08-03 Akim Demaille <akim@epita.fr>
15149
15150 Update to gettext 0.10.39.
15151
53b74c0c
AD
151522001-08-03 Akim Demaille <akim@epita.fr>
15153
15154 * lib/strspn.c: New.
15155
234a3be3
AD
151562001-08-01 Marc Autret <autret_m@epita.fr>
15157
15158 * doc/bison.texinfo: Update.
15159 * doc/bison.1 (mandoc): Update.
15160 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15161 * src/files.c: Support output files extensions computing.
15162 (src_extension): New static variable.
15163 (header_extension): New static variable.
15164 (tr): New function.
15165 (get_extension_index): New function, gets the index of an extension
15166 filename in a string.
15167 (compute_exts_from_gf): New function, computes extensions from the
15168 grammar file extension.
15169 (compute_exts_from_src): New functions, computes extensions from the
15170 C source file extension, file given by ``-o'' option.
15171 (compute_base_names): Update.
15172 (output_files): Update.
15173
847bf1f5
AD
151742001-08-01 Robert Anisko <anisko_r@epita.fr>
15175
d995fee7 15176 * doc/bison.texi: Document @$.
847bf1f5
AD
15177 (Locations): New section.
15178
d074a105
AD
151792001-07-18 Akim Demaille <akim@epita.fr>
15180
15181 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15182 * config/prev-version.txt, config/move-if-change: New.
15183 * Makefile.am: Adjust.
15184
3419715d
AD
151852001-07-08 Pascal Bart <pascal.bart@epita.fr>
15186
15187 * src/bison.simple (yyparse): Suppress warning `comparaison
15188 between signed and unsigned'.
15189
62ab6972
AD
151902001-07-05 Pascal Bart <pascal.bart@epita.fr>
15191
15192 * src/getargs.h (raw_flag): Remove.
15193 * src/getargs.c: Die on `-r'/`--raw'.
15194 * src/lex.c (parse_percent_token): Die on `%raw'.
15195 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
15196 * tests/calc.at: Suppress test with option `--raw'.
15197
1e24cc5b
AD
151982001-07-14 Akim Demaille <akim@epita.fr>
15199
15200 * config/: New.
15201 * configure.in: Require Autoconf 2.50.
15202 Update to gettext 0.10.38.
15203
32dfccf8
AD
152042001-03-16 Akim Demaille <akim@epita.fr>
15205
15206 * doc/bison.texinfo: ANSIfy the examples.
15207
cd5bd6ac
AD
152082001-03-16 Akim Demaille <akim@epita.fr>
15209
15210 * getargs.c (skeleton): New variable.
15211 (longopts): --skeleton is a new option.
15212 (shortopts, getargs): -S is a new option.
15213 * getargs.h: Declare skeleton.
15214 * output.c (output_parser): Use it.
15215
5141b016
AD
152162001-03-16 Akim Demaille <akim@epita.fr>
15217
15218 * m4/strerror_r.m4: New.
15219 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15220 * lib/error.h, lib/error.c: Update.
15221
447992b9
AD
152222001-03-16 Akim Demaille <akim@epita.fr>
15223
15224 * src/getargs.c (longopts): Clean up.
15225
274d42ce
AD
152262001-02-21 Akim Demaille <akim@epita.fr>
15227
15228 * src/reader.c (gensym): `gensym_count' is your own.
15229 Use a static buf to create the symbol name, as token_buffer is no
15230 longer a buffer.
15231
22c821f3
AD
152322001-02-08 Akim Demaille <akim@epita.fr>
15233
15234 * src/conflicts.c (conflict_report): Be sure not to append to res
15235 between two calls, which could happen if both first sprintf were
15236 skipped, but not the first cp += strlen.
15237
18569462
AD
152382001-02-08 Akim Demaille <akim@epita.fr>
15239
15240 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
15241 New, from fileutils 4.0.37.
15242 * configure.in: Require Autoconf 2.49c. I took some time before
15243 making this decision. This is the only way out for portability
15244 issues in Bison, it would mean way too much duplicate effort to
15245 import in Bison features implemented in 2.49c since 2.13.
15246 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15247
0d8f3c8a
AD
152482001-02-02 Akim Demaille <akim@epita.fr>
15249
15250 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 15251 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 15252
f17bcd1f
AD
152532001-01-19 Akim Demaille <akim@epita.fr>
15254
15255 Get rid of the ad hoc handling of token_buffer in the scanner: use
15256 the obstacks.
15257
15258 * src/lex.c (token_obstack): New.
15259 (init_lex): Initialize it. No longer call...
15260 (grow_token_buffer): this. Remove it.
15261 Adjust all the places which used it to use the obstack.
15262
511e79b3
AD
152632001-01-19 Akim Demaille <akim@epita.fr>
15264
15265 * src/lex.h: Rename all the tokens:
15266 s/\bENDFILE\b/tok_eof/g;
15267 s/\bIDENTIFIER\b/tok_identifier/g;
15268 etc.
15269 Let them be enums, not #define, to ease debugging.
15270 Adjust all the code.
15271
0d6508ef
AD
152722001-01-18 Akim Demaille <akim@epita.fr>
15273
15274 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15275 * src/lex.c (maxtoken, grow_token_buffer): Static.
15276
6deb4447
AD
152772001-01-18 Akim Demaille <akim@epita.fr>
15278
15279 Since we now use obstacks, more % directives can be enabled.
15280
15281 * src/lex.c (percent_table): Also accept `%yacc',
15282 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15283 `%debug'.
15284 Handle the actions for `%semantic_parser' and `%pure_parser' here,
15285 instead of returning a token.
15286 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
15287 * src/reader.c (read_declarations): Adjust.
15288 * src/files.c (open_files): Don't call `compute_base_names', don't
15289 compute `attrsfile' since they depend upon data which might be
15290 *in* the input file now.
15291 (output_files): Do it here.
15292 * src/output.c (output_headers): Document the fact that this patch
15293 introduces a guaranteed SEGV for semantic parsers.
15294 * doc/bison.texinfo: Document them.
15295 * tests/suite.at: Exercise these %options.
15296
ff4423cc
AD
152972000-12-20 Akim Demaille <akim@epita.fr>
15298
15299 Also handle the output file (--verbose) with obstacks.
15300
15301 * files.c (foutput): Remove.
15302 (output_obstack): New.
15303 Adjust all dependencies.
15304 * src/conflicts.c: Return a string.
15305 * src/system.h (obstack_grow_string): Rename as...
15306 (obstack_sgrow): this. Be ready to work with non literals.
15307 (obstack_fgrow4): New.
15308
956dba3a
AD
153092000-12-20 Akim Demaille <akim@epita.fr>
15310
15311 * src/files.c (open_files): Fix the computation of short_base_name
15312 in the case of `-o foo.tab.c'.
15313
337bab46
AD
153142000-12-20 Akim Demaille <akim@epita.fr>
15315
15316 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
15317 (copy_dollar): Now that everything uses obstacks, get rid of the
15318 FILE * parameters.
15319
5d3214b8
AD
153202000-12-20 Akim Demaille <akim@epita.fr>
15321
15322 * src/files.c (open_files): Actually the `.output' file is based
15323 on the short_base_name, not base_name.
15324 * tests/suite.at (Checking output file names): Adjust.
15325
29092a57
AD
153262000-12-20 Akim Demaille <akim@epita.fr>
15327
15328 * src/bison.s1: Remove, we now use directly...
15329 * src/bison.simple: this.
15330 * src/Makefile.am: Use pkgdata instead of data.
15331
ea5607fd
AD
153322000-12-20 Akim Demaille <akim@epita.fr>
15333
15334 * src/files.c (guard_obstack): New.
15335 (open_files): Initialize it.
15336 (output_files): Dump it...
15337 * src/files.h: Export it.
15338 * src/reader.c (copy_guard): Use it.
15339
27110317
AD
153402000-12-19 Akim Demaille <akim@epita.fr>
15341
15342 * src/files.c (outfile, defsfile, actfile): Removed as global
15343 vars.
15344 (open_files): Don't compute them.
15345 (output_files): Adjust.
15346 (base_name, short_base_name): Be global.
15347 Adjust dependencies.
15348
19c50364
AD
153492000-12-19 Akim Demaille <akim@epita.fr>
15350
15351 * src/files.c (strsuffix): New.
15352 (stringappend): Be just like strcat but allocate.
15353 (base_names): Eve out from open_files.
15354 Try to simplify the rather hairy computation of base_name and
15355 short_base_name.
15356 (open_files): Use it.
15357 * tests/suite.at (Checking output file names): New test.
15358
573c1d9f
AD
153592000-12-19 Akim Demaille <akim@epita.fr>
15360
15361 * src/system.h (obstack_grow_literal_string): Rename as...
15362 (obstack_grow_string): this.
15363 * src/output.c (output_parser): Recognize `%% actions' instead of
15364 `$'.
15365 * src/bison.s1: s/$/%% actions/.
15366 * src/bison.hairy: Likewise.
15367
ef7ddedd
AD
153682000-12-19 Akim Demaille <akim@epita.fr>
15369
15370 * src/output.c (output_parser): Compute the `#line' lines when
15371 there are.
15372 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
15373 Suggested by Hans Aberg.
15374
ff61dabd
AD
153752000-12-19 Akim Demaille <akim@epita.fr>
15376
15377 Let the handling of the skeleton files be local to the procedures
15378 that use it.
15379
15380 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
15381 longer static.
15382 (fparser, open_extra_files): Remove.
15383 (open_files, output_files): Don't take care of fparser.
15384 * src/files.h: Adjust.
15385 * src/output.c (output_parser): Open and close the file to the
15386 skeleton.
15387 * src/reader.c (read_declarations): When %semantic_parser, open
15388 fguard.
15389
55b96341
AD
153902000-12-19 Akim Demaille <akim@epita.fr>
15391
15392 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
15393 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
15394
358c15b7
AD
153952000-12-19 Akim Demaille <akim@epita.fr>
15396
15397 * src/files.c (open_files): Yipee! We no longer need all the code
15398 looking for `/tmp' since we have no tmp file.
15399
7de3329e
AD
154002000-12-19 Akim Demaille <akim@epita.fr>
15401
15402 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
15403 New macros.
15404 * src/files.c (open_files): Less dependency on MSDOS etc.
15405
3abcd459
AD
154062000-12-14 Akim Demaille <akim@epita.fr>
15407
15408 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
15409 Provide a default definition.
15410 Use it when executing the default @ action.
15411 * src/reader.c (reader_output_yylsp): No longer include
15412 `timestamp' and `text' in the default YYLTYPE.
15413
2a91a95e
AD
154142000-12-12 Akim Demaille <akim@epita.fr>
15415
15416 * src/reader.c (copy_definition, parse_union_decl, copy_action)
15417 (copy_guard): Quote the file names.
15418 Reported by Laurent Mascherpa.
15419
14d3eb9b
AD
154202000-12-12 Akim Demaille <akim@epita.fr>
15421
15422 * src/output.c (output_headers, output_program, output): Be sure
15423 to escape special characters when outputting filenames.
15424 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
15425 (output_headers): Don't depend on them, Use ACTSTR.
15426
d7045ec6
AD
154272000-11-17 Akim Demaille <akim@epita.fr>
15428
15429 * lib/obstack.h: Formatting changes.
15430 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
15431 prevents type checking.
15432 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
15433 cast the value to (void *): assigning a `foo *' to a `void *'
15434 variable is valid.
15435 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
15436 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
15437 append characters.
15438
6fd54b73
AD
154392000-11-17 Akim Demaille <akim@epita.fr>
15440
15441 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
15442 as...
15443 (suite.m4, regression.m4, calc.m4): these.
15444 * tests/atgeneral.m4: Update from CVS Autoconf.
15445
4c50eae6
AD
154462000-11-17 Akim Demaille <akim@epita.fr>
15447
15448 * tests/regression.m4 (%union and --defines): New test,
15449 demonstrating a current bug in the obstack implementation.
15450
a35f64ea
AD
154512000-11-17 Akim Demaille <akim@epita.fr>
15452
15453 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
15454 macros.
15455 Use them to declare the variables which are global or local to
15456 `yyparse'.
15457
7de23534
AD
154582000-11-17 Akim Demaille <akim@epita.fr>
15459
15460 * acconfig.h: Remove, no longer used.
15461
aa7815f5
AD
154622000-11-07 Akim Demaille <akim@epita.fr>
15463
15464 * src: s/Copyright (C)/Copyright/g.
15465
5af1f549
AD
154662000-11-07 Akim Demaille <akim@epita.fr>
15467
15468 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
15469 defining.
15470 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
15471
553e2b22
AD
154722000-11-07 Akim Demaille <akim@epita.fr>
15473
15474 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
15475 Merge in a single CPP if/else.
15476
8a4f41d6
AD
154772000-11-07 Akim Demaille <akim@epita.fr>
15478
15479 * src/output.c (output): Remove useless variables.
15480 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
15481 argument `data' for consistency with the prototypes.
15482 Qualify it `const'.
15483 (obstack_copy, obstack_copy0): Rename the second argument as
15484 `address' for consistency. Qualify it `const'.
15485 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
15486 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
15487 `const' their input argument (`data' or `address').
15488 Adjust the corresponding macros to include `const' in casts.
15489
095a3fb5
AD
154902000-11-03 Akim Demaille <akim@epita.fr>
15491
15492 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
15493 s/PFILE1/BISON_HAIRY/.
15494 Adjust dependencies.
15495
d1cdce7c
AD
154962000-11-03 Akim Demaille <akim@epita.fr>
15497
090c5ebf 15498 For some reason, this was not applied.
d1cdce7c
AD
15499
15500 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
15501 `unlink': it's no longer used.
15502
9311529b
AD
155032000-11-03 Akim Demaille <akim@epita.fr>
15504
15505 * src/files.c (skeleton_find): New function, eved out of...
15506 (open_files, open_extra_files): here.
15507
d8880f69
AD
155082000-11-03 Akim Demaille <akim@epita.fr>
15509
15510 Don't use `atexit'.
15511
15512 * src/files.c (obstack_save): New function.
15513 (done): Rename as...
15514 (output_files): this.
15515 Use `obstack_save'.
15516 * src/main.c (main): Don't use `atexit' to register `done', since
15517 it no longer has to remove tmp files, just call `output_files'
15518 when there are no errors.
15519
0dbb648e
AD
155202000-11-02 Akim Demaille <akim@epita.fr>
15521
15522 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
15523 `unlink': it's no longer used.
15524 * src/files.h: Formatting changes.
15525
896fe5c1
AD
155262000-11-02 Akim Demaille <akim@epita.fr>
15527
15528 Remove the last uses of mktemp and unlink/delete.
15529
15530 * src/files.c (fdefines, ftable): Removed.
15531 (defines_ostack, table_obstack): New.
15532 Adjust dependencies of the former into uses of the latter.
15533 * src/output.c (output_short_or_char_table, output_short_table):
15534 Convert to using obstacks.
15535 * src/reader.c (copy_comment2): Accept one FILE * and two
15536 obstacks.
15537 (output_token_defines, reader_output_yylsp): Use obstacks.
15538 * src/system.h (obstack_fgrow3): New.
1f65350a 15539 * po/POTFILES.in: Adjust.
896fe5c1 15540
dd60faec
AD
155412000-11-01 Akim Demaille <akim@epita.fr>
15542
15543 Change each use of `fattrs' into a use of `attrs_obstack'.
15544
15545 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
15546 * src/files.c (fattrs): Remove.
15547 (attrs_obstack): New.
15548 Adjust all dependencies.
15549 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
15550
8c7ebe49
AD
155512000-11-01 Akim Demaille <akim@epita.fr>
15552
15553 Introduce obstacks.
15554 Change each use of `faction' into a use of `action_obstack'.
15555
15556 * lib/obstack.h, lib/obstack.c: New files.
15557 * src/files.c (faction): Remove.
15558 (action_obstack): New.
15559 Adjust all dependencies.
15560
77aee789
AD
155612000-10-20 Akim Demaille <akim@epita.fr>
15562
15563 * lib/quote.h (PARAMS): New macro. Use it.
15564
43591cec
AD
155652000-10-16 Akim Demaille <akim@epita.fr>
15566
15567 * src/output.c (output_short_or_char_table): New function.
15568 (output_short_table, output_token_translations): Use it.
15569 (goto_actions): Use output_short_table.
15570
1e9798d5
AD
155712000-10-16 Akim Demaille <akim@epita.fr>
15572
15573 * src/symtab.c (bucket_new): New function.
15574 (getsym): Use it.
15575
15576 * src/output.c (output_short_table): New argument to display the
15577 comment associated with the table.
15578 Adjust dependencies.
15579 (output_gram): Use it.
15580 (output_rule_data): Nicer output layout for YYTNAME.
15581
f282676b
AD
155822000-10-16 Akim Demaille <akim@epita.fr>
15583
15584 * src/lex.c (read_typename): New function.
15585 (lex): Use it.
15586 * src/reader.c (copy_dollar): Likewise.
15587
550a72a3
AD
155882000-10-16 Akim Demaille <akim@epita.fr>
15589
15590 * src/reader.c (copy_comment2): Expect the input stream to be on
15591 the `/' which is suspected to open a comment, instead of being
15592 called after `//' or `/*' was read.
15593 (copy_comment, copy_definition, parse_union_decl, copy_action)
15594 (copy_guard): Adjust.
15595
131e2fef
AD
155962000-10-16 Akim Demaille <akim@epita.fr>
15597
15598 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
15599 `read_signed_integer'.
15600
79282c5a
AD
156012000-10-16 Akim Demaille <akim@epita.fr>
15602
15603 * src/reader.c (copy_dollar): New function.
15604 (copy_guard, copy_action): Use it.
15605
ff4a34be
AD
156062000-10-16 Akim Demaille <akim@epita.fr>
15607
15608 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
15609 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
15610 New files, from Fileutils 4.0.27.
15611 * src/main.c (printable_version): Remove.
15612 * src/lex.c, src/reader.c: Use `quote'.
15613
156142000-10-04 Akim Demaille <akim@epita.fr>
15615
15616 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
15617
14ded682
AD
156182000-10-04 Akim Demaille <akim@epita.fr>
15619
15620 * doc/bison.texinfo: Various typos spotted by Neil Booth.
15621
8e03724b
AD
156222000-10-04 Akim Demaille <akim@epita.fr>
15623
15624 When a literal string is used to define two different tokens,
15625 `bison -v' segfaults.
15626 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
15627
15628 * tests/regression.m4: New file.
15629 Include the core of the sample provided by Piotr Gackiewicz.
15630 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
15631 properly.
15632
a9e64249
AD
156332000-10-04 Akim Demaille <akim@epita.fr>
15634
15635 * src/reader.c (parse_expect_decl): Keep `count' within the size
15636 of `buffer'.
15637 From Neil Booth.
15638
da9abf43
AD
156392000-10-02 Paul Eggert <eggert@twinsun.com>
15640
15641 * bison.s1 (yyparse): Assign the default value
15642 unconditionally, to avoid a GCC warning and make the parser a
15643 tad smaller.
15644
c33638bb
AD
156452000-10-02 Akim Demaille <akim@epita.fr>
15646
15647 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
15648 options.
15649
444c570a
AD
156502000-10-02 Akim Demaille <akim@epita.fr>
15651
15652 * src/derives.c, src/print.c, src/reduce.c: To ease the
15653 translation, move some `\n' out of the translated strings.
15654
89cab50d
AD
156552000-10-02 Akim Demaille <akim@epita.fr>
15656
15657 The location tracking mechanism is precious for parse error
15658 messages. Nevertheless, it is enabled only when `@n' is used in
15659 the grammar, which is a different issue (you can use it in error
15660 message, but not in the grammar per se). Therefore, there should
15661 be another means to enable it.
15662
15663 * src/getargs.c (getargs): Support `--locations'.
15664 (usage): Report it.
15665 * src/getargs.h (locationsflag): Export it.
15666 * src/lex.c (percent_table): Support `%locations'.
15667 * src/reader.c (yylsp_needed): Remove this variable, now replaced
15668 with `locationsflag'.
15669 * doc/bison.texinfo: Document `--locations' and `%locations'.
15670 Sort the options.
15671 * tests/calc.m4: Test it.
15672
15673 For regularity of the names, replace each
15674 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
15675 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
15676 In addition replace each `flag' with `_flag'.
15677
d6c2cba0
AD
156782000-10-02 Akim Demaille <akim@epita.fr>
15679
15680 Also test parse error messages, including with YYERROR_VERBOSE.
15681
15682 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
15683 associative).
15684 Use it to check the computations.
15685 Use it to check `nonassoc' is honored.
15686 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
15687 `--yyerror-verbose'.
15688 (_AT_CHECK_CALC): Adjust to this option.
15689 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
15690
5a35a6cb
AD
156912000-10-02 Akim Demaille <akim@epita.fr>
15692
15693 Test also `--verbose', `--defines' and `--name-prefix'. Testing
15694 the latter demonstrates a flaw in the handling of non debugging
15695 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
15696 was used in order to simplify:
15697
15698 #if YYDEBUG
15699 if (yydebug)
15700 {
15701 ...
15702 }
15703 #endif
15704
15705 into
15706
15707 if (yydebug)
15708 {
15709 ...
15710 }
15711
15712 unfortunately this leads to a CPP conflict when
15713 `--name-prefix=foo' is used since it produces `#define yydebug
15714 foodebug'.
15715
15716 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
15717 (YYDPRINTF): New macro.
15718 Spread its use.
15719 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
15720 the bison options.
15721 Also test `--verbose', `--defines' and `--name-prefix'.
15722
71da9eea
AD
157232000-10-02 Akim Demaille <akim@epita.fr>
15724
15725 Improve the readability of the produced parsers.
15726
15727 * src/bison.s1: Formatting changes.
15728 Improve the comment related to the `$' mark.
15729 (yydefault): Don't fall through to `yyresume': `goto' there.
15730 * src/output.c (output_parser): When the `$' is met, skip the end
15731 of its line.
15732 New variable, `number_of_dollar_signs', to check there's exactly
15733 one `$' in the parser skeleton.
15734
95e36146
AD
157352000-10-02 Akim Demaille <akim@epita.fr>
15736
15737 * lib/xstrdup.c: New file, from the fileutils.
15738 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
15739 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
15740 instead of strlen + xmalloc + strcpy.
15741 * src/symtab.c (copys): Remove, use xstrdup instead.
15742
d7020c20
AD
157432000-10-02 Akim Demaille <akim@epita.fr>
15744
15745 * src/gram.h (associativity): New enum type which replaces the
15746 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
15747 `right_assoc', `left_assoc' and `non_assoc'.
15748 Adjust all dependencies.
15749 * src/reader.c: Formatting changes.
15750 (LTYPESTR): Don't define it, use it as a literal in
15751 `reader_output_yylsp'.
15752 * src/symtab.h (symbol_class): New enum type which replaces the
15753 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
15754 `sunknown', `stoken and `snterm'.
15755
1916f98e
AD
157562000-10-02 Akim Demaille <akim@epita.fr>
15757
15758 * src/getargs.c (fixed_outfiles): Rename as...
15759 (yaccflag): for consistency and accuracy.
15760 Adjust dependencies.
15761
d7913476
AD
157622000-10-02 Akim Demaille <akim@epita.fr>
15763
15764 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
15765 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
15766 difficult and introduced a lot of core dump. It turns out that
15767 Bison used an implementation of `xmalloc' based on `calloc', and
15768 at various places it does depend upon the initialization to 0. I
15769 have not tried to isolate the pertinent places, and all the former
15770 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
15771 someone should address this issue.
15772
15773 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
15774 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
15775 files.
15776 Adjust dependencies.
15777 * src/warshall.h: New file.
15778 Propagate.
15779
340ef489
AD
157802000-10-02 Akim Demaille <akim@epita.fr>
15781
15782 Various anti-`extern in *.c' changes.
15783
15784 * src/system.h: Include `assert.h'.
15785
b2ca4022
AD
157862000-10-02 Akim Demaille <akim@epita.fr>
15787
15788 * src/state.h (nstates, final_state, first_state, first_shift)
15789 (first_reduction): Move their exportation from here...
15790 * src/LR0.h: to here.
15791 Adjust dependencies.
15792 * src/getargs.c (statisticsflag): New variable.
15793 Add support for `--statistics'.
15794 Adjust dependencies.
15795
15796 Remove a lot of now useless `extern' statements in most files.
15797
403b315b
AD
157982000-10-02 Akim Demaille <akim@epita.fr>
15799
15800 * src/LR0.h: New file.
15801 Propagate its use.
15802
07a58c13
AD
158032000-10-02 Akim Demaille <akim@epita.fr>
15804
15805 * src/print.h: New file.
15806 Propagate its use.
15807 * src/print.c: Formatting and ordering changes.
15808 (verbose, terse): Replace with...
15809 (print_results): this new function.
15810 Adjust dependencies.
15811
0619caf0
AD
158122000-10-02 Akim Demaille <akim@epita.fr>
15813
15814 * src/conflicts.c (conflict_report): New function.
15815 (conflict_log, verbose_conflict_log): Replace with...
15816 (print_conflicts): this function.
15817 Adjust dependencies.
15818 * src/conflicts.h: New file.
15819 Propagate its inclusion.
15820
3519ec76
AD
158212000-10-02 Akim Demaille <akim@epita.fr>
15822
15823 * src/nullable.h: New file.
15824 Propagate its inclusion.
15825 * src/nullable.c: Formatting changes.
15826
015acc48
AD
158272000-10-02 Akim Demaille <akim@epita.fr>
15828
15829 * src/reduce.h: New file.
15830 Propagate its inclusion.
15831 * src/reduce.c: Topological sort and other formatting changes.
15832 (bool, TRUE, FALSE): Move their definition to...
15833 * src/system.h: here.
15834
8963a27b
AD
158352000-10-02 Akim Demaille <akim@epita.fr>
15836
15837 * src/files.c: Formatting changes.
15838 (tryopen, tryclose, openfiles): Rename as...
15839 (xfopen, xfclose, open_files): this.
15840 (stringappend): static.
15841 * src/files.h: Complete the list of exported symbols.
15842 Propagate its use.
15843
a70083a3
AD
158442000-10-02 Akim Demaille <akim@epita.fr>
15845
15846 * src/reader.h: New file.
15847 Propagate its use instead of tedious list of `extern' and
15848 prototypes.
15849 * src/reader.c: Formatting changes, topological sort,
15850 s/register//.
15851
abadc117
AD
158522000-10-02 Akim Demaille <akim@epita.fr>
15853
15854 * src/lex.h: Prototype `lex.c' exported functions.
15855 * src/reader.c: Adjust.
15856 * src/lex.c: Formatting changes.
15857 (safegetc): Rename as...
15858 (xgetc): this.
15859
720d742f
AD
158602000-10-02 Akim Demaille <akim@epita.fr>
15861
15862 * src/lalr.h: New file.
15863 Propagate its inclusion instead of prototypes and `extern'.
15864 * src/lalr.c: Formatting changes, topological sorting etc.
15865
f2acea59
AD
158662000-10-02 Akim Demaille <akim@epita.fr>
15867
15868 * src/output.c (token_actions): Introduce a temporary array,
15869 YYDEFACT, that makes it possible for this function to use
15870 output_short_table.
15871
d019d655
AD
158722000-10-02 Akim Demaille <akim@epita.fr>
15873
15874 `user_toknums' is output as a `short[]' in `output.c', while it is
15875 defined as a `int[]' in `reader.c'. For consistency with the
15876 other output tables, `user_toknums' is now defined as a table of
15877 shorts.
15878
15879 * src/reader.c (user_toknums): Be a short table instead of an int
15880 table.
15881 Adjust dependencies.
15882
15883 Factor the short table outputs.
15884
15885 * src/output.c (output_short_table): New function.
15886 * src/output.c (output_gram, output_stos, output_rule_data)
15887 (output_base, output_table, output_check): Use it.
15888
6c89f1c1
AD
158892000-10-02 Akim Demaille <akim@epita.fr>
15890
15891 * src/output.c (output): Topological sort of the functions, in
15892 order to get rid of the `static' prototypes.
15893 No longer use `register'.
15894 * src/output.h: New file.
15895 Propagate its inclusion in files explicitly prototyping functions
15896 from output.c.
15897
d9efd181
AD
158982000-09-21 Akim Demaille <akim@epita.fr>
15899
15900 * src/atgeneral.m4: Update from Autoconf.
15901
c29240e7 159022000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
15903
15904 * src/closure.h: New file.
15905 * src/closure.c: Formatting changes, topological sort over the
15906 functions, use of closure.h.
15907 (initialize_closure, finalize_closure): Rename as...
15908 (new_closure, free_closure): these. Adjust dependencies.
15909 * src/LR0.c: Formatting changes, topological sort, use of
15910 cloture.h.
15911 (initialize_states): Rename as...
15912 (new_states): this.
15913 * src/Makefile.am (noinst_HEADERS): Adjust.
15914
499daa50
AD
159152000-09-20 Akim Demaille <akim@epita.fr>
15916
15917 * src/acconfig.h: Don't protect config.h against multiple
15918 inclusion.
15919 Don't define PARAMS.
15920 * src/system.h: Define PARAMS.
15921 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
15922 purpose of config.h. system.h must not try to fix wrong
15923 definitions in config.h.
15924
cc84fd5d
AD
159252000-09-20 Akim Demaille <akim@epita.fr>
15926
15927 * src/derives.h: New file.
15928 * src/main.c, src/derives.h: Use it.
15929 Formatting changes.
15930 * src/Makefile.am (noinst_HEADERS): Adjust.
15931
db5b3a89
AD
159322000-09-20 Akim Demaille <akim@epita.fr>
15933
15934 * tests/atgeneral.m4: Update from Autoconf.
15935 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
15936 (AT_CHECK_CALC): New macros.
15937 Use these macros to test bison with options `', `--raw',
15938 `--debug', `--yacc', `--yacc --debug'.
15939
ceed8467
AD
159402000-09-19 Akim Demaille <akim@epita.fr>
15941
15942 * src/output.c: Formatting changes.
15943 * src/machine.h: Remove, leaving its contents in...
15944 * src/system.h: here.
15945 Include stdio.h.
15946 Adjust all dependencies on stdio.h and machine.h.
15947 * src/getargs.h: New file.
15948 Let all `extern' declarations about getargs.c be replaced with
15949 inclusion of `getargs.h'.
15950 * src/Makefile.am (noinst_HEADERS): Adjust.
15951
15952 * tests/calc.m4 (yyin): Be initialized in main, not on the global
15953 scope.
15954 (yyerror): Returns void, not int.
15955 * doc/bison.texinfo: Formatting changes.
15956
05a1d24b
AD
159572000-09-19 Akim Demaille <akim@epita.fr>
15958
15959 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
15960 portable.
15961
cbd25751
AD
159622000-09-18 Akim Demaille <akim@epita.fr>
15963
15964 * configure.in: Append WARNING_CFLAGS to CFLAGS.
15965 * src/Makefile.am (INCLUDES): Don't.
15966 Be ready to fetch headers in lib/.
15967
13863333
AD
159682000-09-18 Akim Demaille <akim@epita.fr>
15969
15970 * doc/bison.texinfo: Update the copyright.
15971 ANSIfy and GNUify the examples.
15972 Remove the old menu.
15973
0d533154
AD
159742000-09-18 Akim Demaille <akim@epita.fr>
15975
15976 First set of tests: use the `calc' example from the documentation.
15977
15978 * src/bison.s1 (yyparse): Condition the code using `yytname' which
15979 is defined only when YYDEBUG is.
15980 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
15981 * src/files.c (tryopen, tryclose): Formatting changes.
15982 Move to the top and be static.
15983 * src/reader.c (read_signed_integer): Likewise.
15984 * tests/calc.m4: New file.
15985 * Makefile.am, suite.m4: Adjust.
15986 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
15987
e79137ac
AD
159882000-09-18 Akim Demaille <akim@epita.fr>
15989
15990 Add support for an Autotest test suite for Bison.
15991
15992 * m4/m4.m4, m4/atconfig.m4: New files.
15993 * m4/Makefile.am (EXTRA_DIST): Adjust.
15994 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
15995 files.
15996 * src/getargs.c: Display a more standard --version message.
15997 * src/reader.c (reader): Formatting changes.
15998 No longer depend upon VERSION_STRING.
15999 * configure.in: No longer use `dnl'.
16000 Set up the test suite and the new directory `tests/.
16001 (VERSION_STRING): Remove.
16002
27821bff
AD
160032000-04-14 Akim Demaille <akim@epita.fr>
16004
16005 * src/reader.c (copy_comment2): New function, same as former
16006 `copy_comment', but outputs into two FILE *.
16007 (copy_comment): Use it.
16008 (parse_union_decl): Use it.
16009 (get_type, parse_start_decl): Use the same `invalid' message.
16010 (parse_start_decl, parse_union_decl): Use the same `multiple'
16011 message.
16012 (parse_union_decl, copy_guard, copy_action): Use the same
16013 `unmatched' message.
16014 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
16015
cfe5fbc0
AD
160162000-03-31 Akim Demaille <akim@epita.fr>
16017
16018 * src/files.c (tryopen, tryclose): Move to the top.
16019 Be static.
16020
cb7db13e
AD
160212000-03-31 Akim Demaille <akim@epita.fr>
16022
16023 * src/main.c (main): Don't call `done', exit does it.
16024
a0f6b076
AD
160252000-03-31 Akim Demaille <akim@epita.fr>
16026
36281465
AD
16027 * allocate.c: s/return (foo)/return foo/.
16028 * lalr.c: Likewise.
16029 * LR0.c: Likewise.
16030 * output.c: Likewise.
16031 * reader.c: Likewise.
16032 * symtab.c: Likewise.
16033 * vmsgetargs.c: Likewise.
16034
160352000-03-31 Akim Demaille <akim@epita.fr>
16036
16037 Clean up the error reporting functions.
a0f6b076
AD
16038
16039 * src/report.c: New file.
16040 * src/report.h: Likewise.
16041 * src/Makefile.am: Adjust.
16042 * m4/error.m4: New file.
16043 * m4/Makefile.am: Adjust.
16044 * configure.in (jm_PREREQ_ERROR): Call it.
16045 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
16046 Remove.
16047 (fatal, fatals): Remove. All callers use complain.c::fatal.
16048 (warn, warni, warns, warnss, warnss): Remove. All callers use
16049 complain.c::complain.
16050 (toomany): Remove, use fatal instead.
16051 * src/files.c (done): No argument, use complain_message_count.
16052 * src/main.c (main): Register `done' to `atexit'.
16053
16054 * src/getargs.c (usage): More `fputs', less `fprintf'.
16055
18539825
AD
160562000-03-28 Akim Demaille <akim@epita.fr>
16057
16058 * lib/: New directory.
16059 * Makefile.am (SUBDIRS): Adjust.
16060 * configure.in: Adjust.
16061 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
16062 useless.
16063 * src/alloca.c: Moved to lib/.
16064 * src/getopt.c: Likewise.
16065 * src/getopt1.c: Likewise.
16066 * src/getopt.h: Likewise.
16067 * src/ansi2knr.c: Likewise.
16068 * src/ansi2knr.1: Likewise.
16069 * src/Makefile.am: Adjust.
16070 * lib/Makefile.am: New file.
16071
9f306f2a
AD
160722000-03-28 Akim Demaille <akim@epita.fr>
16073
16074 * src/getargs.c (usage): Refresh the help message.
16075
0ba347b6
AD
160762000-03-17 Akim Demaille <akim@epita.fr>
16077
16078 * src/getopt1.c: Updated from textutils 2.0e
16079 * src/getopt.c: Likewise.
16080 * src/getopt.h: Likewise.
16081
dbe7f271
AD
160822000-03-17 Akim Demaille <akim@epita.fr>
16083
16084 * src/Makefile.am (bison.simple): Fix the awk program: quote only
16085 the file name, not the whole `#line LINE FILE'.
16086
75bbe78d
AD
160872000-03-17 Akim Demaille <akim@epita.fr>
16088
16089 On syntax errors, report the token on which we choked.
16090
aa5fd0ee
AD
16091 * src/bison.s1 (yyparse): In the label yyerrlab, when
16092 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 16093
7b306f52
AD
160942000-03-17 Akim Demaille <akim@epita.fr>
16095
aa5fd0ee 16096 * src/reader.c (copy_at): New function.
7b306f52
AD
16097 (copy_guard): Use it.
16098 (copy_action): Use it.
16099
e87b5700
AD
161002000-03-17 Akim Demaille <akim@epita.fr>
16101
16102 Be kind to translators, save some useless translations.
16103
aa5fd0ee 16104 * src/main.c (banner): New function.
e87b5700
AD
16105 (fatal_banner): Use it.
16106 (warn_banner): Use it.
16107
ae3c3164
AD
161082000-03-17 Akim Demaille <akim@epita.fr>
16109
aa5fd0ee
AD
16110 * src/reader.c (copy_definition): Use copy_string and
16111 copy_comment. Removed now unused `match', `ended',
16112 `cplus_comment'.
ae3c3164
AD
16113 (copy_comment, copy_string): Moved, to be visible from
16114 copy_definition.
16115
4dc58e7c
AD
161162000-03-17 Akim Demaille <akim@epita.fr>
16117
aa5fd0ee
AD
16118 * src/reader.c (copy_string): Declare `static inline'. No
16119 problems with inline, since it is checked by configure.
4dc58e7c
AD
16120 (copy_comment): Likewise.
16121
0a6384c4
AD
161222000-03-17 Akim Demaille <akim@epita.fr>
16123
aa5fd0ee 16124 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 16125
3cef001a
AD
161262000-03-17 Akim Demaille <akim@epita.fr>
16127
aa5fd0ee 16128 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
16129 (copy_action): Use it. Removed now unused `match', `ended',
16130 `cplus_comment'.
16131 (copy_guard): Likewise.
16132
ca36d2ef
AD
161332000-03-17 Akim Demaille <akim@epita.fr>
16134
aa5fd0ee 16135 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
16136 (copy_action): Use it.
16137 (copy_guard): Likewise.
16138
6666f98f
AD
161392000-03-17 Akim Demaille <akim@epita.fr>
16140
16141 Change the handling of @s so that they behave exactly like $s.
16142 There is now a pseudo variable @$ (readble and writable), location
16143 of the lhs of the rule (by default ranging from the location of
16144 the first symbol of the rhs, to the location of the last symbol,
16145 or, if the rhs is empty, YYLLOC).
16146
16147 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
16148 yyval.
16149 (yyparse): When providing a default semantic action, provide a
16150 default location action.
16151 (after the $): No longer change `*YYLSP', just stack YYLOC the
16152 same way you stack YYVAL.
16153 * src/reader.c (read_declarations): Use warns.
16154 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
16155 (copy_action, case '@'): Likewise.
16156 Use a standard error message, to save useless work from
16157 translators.
16158
41aca2e0
AD
161592000-03-17 Akim Demaille <akim@epita.fr>
16160
aa5fd0ee
AD
16161 * src/bison.s1: Formatting and cosmetics changes.
16162 * src/reader.c: Likewise.
41aca2e0
AD
16163 Update the Copyright notice.
16164
dc08c1d5
AD
161652000-03-17 Akim Demaille <akim@epita.fr>
16166
aa5fd0ee
AD
16167 * src/bison.s1 (#line): All set to `#line' only, since the
16168 Makefile now handles them.
dc08c1d5 16169
9ee3c97b
AD
161702000-03-16 Akim Demaille <akim@epita.fr>
16171
16172 * src/output.c (output_rule_data): Output the documentation of
16173 some of the tables.
16174 (Copyright notice): Update.
16175 Formatting changes.
16176
0de741ca
AD
161772000-03-16 Akim Demaille <akim@epita.fr>
16178
16179 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
16180 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
16181 One `#if YYDEBUG' remains, since it uses variables which are
16182 defined only if `YYDEBUG != 0'.
16183
bb10be54
AD
161842000-03-16 Akim Demaille <akim@epita.fr>
16185
16186 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16187 and related variables so that the similarities are highlighted.
16188
b07b484a
AD
161892000-03-16 Akim Demaille <akim@epita.fr>
16190
16191 * src/bison.s1: Properly indent CPP directives.
16192
361f60b3
AD
161932000-03-16 Akim Demaille <akim@epita.fr>
16194
16195 * src/bison.s1: Properly indent the `alloca' CPP section.
16196
8c44d3ec
AD
161972000-03-16 Akim Demaille <akim@epita.fr>
16198
16199 Do not hard code values of directories in `configure.in'.
16200 Update the `configure' tool chain.
16201
16202 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16203 src/makefile.am.
16204 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
16205 (AC_OUTPUT): Add m4/Makefile.
16206 Bump to bison 1.28a, 1.29 has never been released.
16207 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
16208 handled via src/Makefile.am.
16209 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
16210 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
16211 autoheader.
16212 * Makefile.am (SUBDIRS): Add m4.
16213 (ACLOCAL_AM_FLAGS): New variable.
16214 (AUTOMAKE_OPTIONS): Add check-news.
16215 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
16216 the proper line number and file name.
16217 (DEFS): Propagate the location of bison library files and of the
16218 locale files.
16219 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16220 builddir.
16221 * acinclude.m4: Remove, replaced by the directory m4.
16222 * m4/Makefile.am (EXTRA_DIST): New variable.
16223 * m4/gettext.m4: New file, from the fileutils.
16224 * m4/lcmessage.m4: Likewise
16225 * m4/progtest.m4: Likewise.
16226 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
16227
f95997e7
AD
162282000-03-10 Akim Demaille <akim@epita.fr>
16229
16230 * src/closure.c:
16231 Formatting changes of various comments.
16232 Respect the GNU coding standards at various places.
16233 Don't use `_()' when no translation is needed.
16234
162351999-12-13 Jesse Thilo <jthilo@gnu.org>
16236
16237 * src/files.c:
16238 OS/2 honors TMPDIR environment variable.
16239
162401999-12-13 Jesse Thilo <jthilo@gnu.org>
16241
16242 * doc/bison.texinfo: Tweaked spelling and grammar.
16243 Updated ISBN.
16244 Removed reference to price of printed copy.
16245 Mention BISON_SIMPLE and BISON_HAIRY.
16246
162471999-12-13 Jesse Thilo <jthilo@gnu.org>
16248
16249 * configure.in, NEWS:
16250 Bison 1.29 released.
16251
162521999-10-27 Jesse Thilo <jthilo@gnu.org>
16253
16254 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16255 Added reference card.
16256
162571999-07-26 Jesse Thilo <jthilo@gnu.org>
16258
16259 * po/ru.po: Added Russian translation.
16260
162611999-07-26 Jesse Thilo <jthilo@gnu.org>
16262
16263 * configure.in: Added Russian translation.
16264
162651999-07-06 Jesse Thilo <jthilo@gnu.org>
16266
16267 * configure.in, NEWS, README:
16268 Released version 1.28.
16269
162701999-06-14 Jesse Thilo <jthilo@gnu.org>
16271
16272 * src/system.h:
16273 Squashed redefinition warning on some systems.
16274
16275 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16276 Have configure build version string instead of relying on ANSI string
16277 concatentation.
16278
162791999-06-14 Jesse Thilo <jthilo@gnu.org>
16280
16281 * po/POTFILES.in: Got rid of version.c.
16282
162831999-06-14 Jesse Thilo <jthilo@gnu.org>
16284
16285 * acconfig.h, configure.in:
16286 Have configure build version string instead of relying on ANSI string
16287 concatentation.
16288
162891999-06-08 Jesse Thilo <jthilo@gnu.org>
16290
16291 * doc/bison.1:
16292 Dropped mention of `+' for long-named options.
16293
162941999-05-30 Jesse Thilo <jthilo@gnu.org>
16295
16296 * src/files.c: Added <unistd.h> for unlink().
16297
16298 * src/Makefile.am, src/system.h:
16299 I18n fixes.
16300
163011999-05-30 Jesse Thilo <jthilo@gnu.org>
16302
16303 * README: Added a FAQ list.
16304
16305 * configure.in, acconfig.h:
16306 I18n fixes.
16307
163081999-05-30 Jesse Thilo <jthilo@gnu.org>
16309
16310 * doc/FAQ, doc/Makefile.am:
16311 Added a FAQ list.
16312
163131999-05-19 Jesse Thilo <jthilo@gnu.org>
16314
16315 * src/alloc.h, src/symtab.h, src/version.c:
16316 Protected inclusion of "config.h" with HAVE_CONFIG_H.
16317
163181999-04-18 Jesse Thilo <jthilo@gnu.org>
16319
16320 * src/.cvsignore, src/Makefile.am:
16321 Reorganized: sources in `src', documentation in `doc'.
16322
16323 * src/lex.c (literalchar):
16324 fixed the code for escaping double quotes (thanks
16325 Jonathan Czisny.)
16326
163271999-04-18 Jesse Thilo <jthilo@gnu.org>
16328
16329 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
16330 Adjusted paths to reflect directory reorganization.
16331
163321999-04-18 Jesse Thilo <jthilo@gnu.org>
16333
16334 * doc/.cvsignore, doc/Makefile.am:
16335 Reorganized: sources in `src', documentation in `doc'.
16336
163371999-04-18 Jesse Thilo <jthilo@gnu.org>
16338
16339 * configure.in:
16340 Updated AC_INIT file to reflect directory reorganization.
16341
16342 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
16343 Reorganized: sources in `src', documentation in `doc'.
16344
163451999-04-13 Jesse Thilo <jthilo@gnu.org>
16346
16347 * src/allocate.c:
16348 Don't declare calloc() and realloc() if not necessary.
16349
163501999-04-13 Jesse Thilo <jthilo@gnu.org>
16351
16352 * configure.in, acconfig.h, acinclude.m4:
16353 Don't declare calloc() and realloc() if not necessary.
16354
163551999-03-23 Jesse Thilo <jthilo@gnu.org>
16356
16357 * po/.cvsignore: Added i18n support.
16358
163591999-03-23 Jesse Thilo <jthilo@gnu.org>
16360
16361 * acconfig.h, configure.in, Makefile.am:
16362 Added i18n support.
16363
163641999-03-22 Jesse Thilo <jthilo@gnu.org>
16365
16366 * src/bison.s1: Fixed #line numbers.
16367
163681999-03-15 Jesse Thilo <jthilo@gnu.org>
16369
16370 * po/es.po, po/fr.po, po/nl.po, po/de.po:
16371 Added PO files from Translation Project.
16372
163731999-03-03 Jesse Thilo <jthilo@gnu.org>
16374
16375 * Makefile.am:
16376 Added support for non-ANSI compilers (ansi2knr).
16377
163781999-02-16 Jesse Thilo <jthilo@gnu.org>
16379
16380 * configure.in: Bumped version number to 1.27.
16381
16382 * Makefile.am:
16383 Added `bison.simple' to list of files removed by `make distclean'.
16384
163851999-02-12 Jesse Thilo <jthilo@gnu.org>
16386
16387 * src/files.c, src/files.h:
16388 Defined locations of parser files in config.h instead of Makefile.
16389
163901999-02-12 Jesse Thilo <jthilo@gnu.org>
16391
16392 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
16393 Defined locations of parser files in config.h instead of Makefile.
16394
163951999-02-09 Jesse Thilo <jthilo@gnu.org>
16396
16397 * Makefile.am:
16398 Removed inappropriate use of $< macro.
16399
164001999-02-05 Jesse Thilo <jthilo@gnu.org>
16401
16402 * po/Makefile.in.in, po/POTFILES.in:
16403 Add `po' directory skeleton.
16404
164051999-01-27 Jesse Thilo <jthilo@gnu.org>
16406
16407 * README: Document help-bison list.
16408
16409 * configure.in: Add check for mkstemp().
16410
164111999-01-20 Jesse Thilo <jthilo@gnu.org>
16412
16413 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
16414 Hush a few compiler warnings.
16415
16416 * src/files.c:
16417 Add tryclose(), which verifies that fclose was successful.
16418 Hush a couple of compiler warnings.
16419
164201999-01-20 Jesse Thilo <jthilo@gnu.org>
16421
16422 * Makefile.am, OChangeLog:
16423 ChangeLog is now automatically generated. Include the old version as
16424 OChangeLog.
16425
164261999-01-14 Jesse Thilo <jthilo@gnu.org>
16427
16428 * 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:
16429 Update FSF address.
16430
164311999-01-14 Jesse Thilo <jthilo@gnu.org>
16432
16433 * doc/bison.texinfo: Fix formatting glitch.
16434
16435 * doc/bison.texinfo: Update FSF address.
16436
164371999-01-14 Jesse Thilo <jthilo@gnu.org>
16438
16439 * acconfig.h: Update FSF address.
16440
164411999-01-08 Jesse Thilo <jthilo@gnu.org>
16442
16443 * src/system.h:
16444 Don't define PACKAGE here, since config.h defines it.
16445
164461998-12-30 Jesse Thilo <jthilo@gnu.org>
16447
16448 * src/reader.c: Update copyright date.
16449
16450 * src/main.c:
16451 Ditch sprintf to statically-sized buffers in fatal/warn functions in
16452 favor of output directly to stderr (avoids buffer overruns).
16453
16454 * src/reader.c: Some checks for premature EOF.
16455
16456 * 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:
16457 Use prototypes if the compiler understands them.
16458
16459 * src/files.c: Honor TMPDIR on Unix hosts.
16460 Use prototypes if the compiler understands them.
16461
16462 * src/reader.c:
16463 Fix a couple of buffer overrun bugs.
16464 Use prototypes if the compiler understands them.
16465
16466 * src/system.h: Include unistd.h and ctype.h.
16467 Use #ifdef instead of #if for NLS symbols.
16468
164691998-12-30 Jesse Thilo <jthilo@gnu.org>
16470
16471 * doc/bison.texinfo:
16472 Delete comment "consider using @set for edition number, etc..." since
16473 we now are doing so.
16474
164751998-12-30 Jesse Thilo <jthilo@gnu.org>
16476
16477 * configure.in:
16478 Use prototypes if the compiler understands them.
16479
16480 * NEWS: Document 1.26 highlights.
16481
16482 * Makefile.am: Require Automake 1.3 or later.
16483
16484 * acconfig.h:
16485 Use prototypes if the compiler understands them.
16486
164871998-12-29 Jesse Thilo <jthilo@gnu.org>
16488
16489 * src/version.c:
16490 Use VERSION symbol from automake for version number.
16491
164921998-12-29 Jesse Thilo <jthilo@gnu.org>
16493
16494 * acconfig.h, configure.in, version.cin:
16495 Use VERSION symbol from automake for version number.
16496
164971998-11-28 Jesse Thilo <jthilo@gnu.org>
16498
16499 * Makefile.am:
16500 Distribute original version of simple parser (bison.s1), not built
16501 version (bison.simple).
16502
165031998-11-28 Jesse Thilo <jthilo@gnu.org>
16504
16505 * doc/bison.texinfo: Add info dir entry.
16506
16507 * doc/bison.texinfo:
16508 Let automake put version number into documentation.
16509
165101998-11-26 Jesse Thilo <jthilo@gnu.org>
16511
16512 * src/bison.cld, src/build.com, src/vmshlp.mar:
16513 Add non-RCS files from /gd/gnu/bison.
16514
165151998-11-26 Jesse Thilo <jthilo@gnu.org>
16516
16517 * doc/bison.1:
16518 Document the BISON_HAIRY and BISON_SIMPLE variables.
16519
165201998-11-25 Jesse Thilo <jthilo@gnu.org>
16521
16522 * src/version.c: Build version.c automatically.
16523
16524 * src/reader.c:
16525 Fix token numbering (used to start at 258, not 257).
16526
16527 * src/system.h: Include config.h.
16528
16529 * src/getargs.c: Update bug report address.
16530
16531 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
16532 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
16533
165341998-11-25 Jesse Thilo <jthilo@gnu.org>
16535
16536 * Makefile.am:
16537 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
16538
16539 * configure.in, version.cin:
16540 Build version.c automatically.
16541
16542 * AUTHORS: Add AUTHORS file.
16543
16544 * README: Update bug report address.
16545
16546 * bison.simple:
16547 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
16548
16549 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
16550 Add automake stuff.
16551
165521998-11-25 Jesse Thilo <jthilo@gnu.org>
16553
16554 * doc/bison.texinfo: Clean up some formatting.
16555
165561998-05-05 Richard Stallman <rms@gnu.org>
16557
16558 * doc/bison.texinfo:
16559 Explain better why to make a pure parser.
16560
165611998-01-05 Richard Stallman <rms@gnu.org>
16562
16563 * src/files.c (openfiles):
16564 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
16565 find a temporary directory, if possible. Do not unlink files while
16566 they are open.
16567
165681997-08-25 Richard Stallman <rms@gnu.org>
16569
16570 * src/reader.c (stack_offset;):
16571 Change some warni to warns.
16572
16573 * src/lex.c (literalchar): Use warns, not warni.
16574
165751997-06-28 Richard Stallman <rms@gnu.org>
16576
16577 * src/bison.s1: Add a Bison version comment.
16578
16579 * src/main.c (fatal, warn, berror):
16580 Use program_name.
16581
165821997-06-28 Richard Stallman <rms@gnu.org>
16583
16584 * Makefile.in (bison_version): New variable.
16585 (dist): Use that variable.
16586 (bison.s1): Substitute the Bison version into bison.simple.
16587
16588 * bison.simple: Add a Bison version comment.
16589
165901997-06-18 Richard Stallman <rms@gnu.org>
16591
16592 * src/main.c (fatal, warn, berror):
16593 Make error messages standard.
16594 (toomany): Improve error message text.
16595
16596 * 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:
16597 new.h renamed to alloc.h.
16598
165991997-06-18 Richard Stallman <rms@gnu.org>
16600
16601 * Makefile.in: new.h renamed to alloc.h.
16602
166031997-05-24 Richard Stallman <rms@gnu.org>
16604
16605 * src/lex.c (literalchar):
16606 Fix the code for escaping \, " and '.
16607
16608 (lex): Avoid trouble when there are many chars
16609 to discard in a char literal with just several chars in it.
16610
166111997-05-17 Richard Stallman <rms@gnu.org>
16612
16613 * src/bison.s1:
16614 Use malloc, if using alloca is troublesome.
16615 (YYSTACK_USE_ALLOCA): New flag macro.
16616 Define it for some systems and compilers.
16617 (YYSTACK_ALLOC): New macro.
16618 (yyparse): Use YYSTACK_ALLOC to allocate stack.
16619 If it was malloc'd, free it.
16620
166211997-05-17 Richard Stallman <rms@gnu.org>
16622
16623 * bison.simple:
16624 Use malloc, if using alloca is troublesome.
16625 (YYSTACK_USE_ALLOCA): New flag macro.
16626 Define it for some systems and compilers.
16627 (YYSTACK_ALLOC): New macro.
16628 (yyparse): Use YYSTACK_ALLOC to allocate stack.
16629 If it was malloc'd, free it.
16630
166311997-04-23 Richard Stallman <rms@gnu.org>
16632
16633 * src/bison.s1:
16634 (alloca) [__hpux]: Always define as __builtin_alloca.
16635
166361997-04-23 Richard Stallman <rms@gnu.org>
16637
16638 * bison.simple:
16639 (alloca) [__hpux]: Always define as __builtin_alloca.
16640
166411997-04-22 Richard Stallman <rms@gnu.org>
16642
16643 * src/bison.s1:
16644 [__hpux]: Include alloca.h (right for HPUX 10)
16645 instead of declaring alloca (right for HPUX 9).
16646
16647 * src/bison.s1 (__yy_memcpy):
16648 Declare arg `count' as unsigned int.
16649 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
16650
166511997-04-22 Richard Stallman <rms@gnu.org>
16652
16653 * bison.simple:
16654 [__hpux]: Include alloca.h (right for HPUX 10)
16655 instead of declaring alloca (right for HPUX 9).
16656
16657 * bison.simple (__yy_memcpy):
16658 Declare arg `count' as unsigned int.
16659 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
16660
166611997-01-03 Richard Stallman <rms@gnu.org>
16662
16663 * src/allocate.c: [__STDC__ or _MSC_VER]:
16664 Declare calloc and realloc to return void *.
16665
166661997-01-02 Richard Stallman <rms@gnu.org>
16667
16668 * src/system.h:
16669 [_MSC_VER]: Include stdlib.h and process.h.
16670 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
16671
16672 * src/main.c (main): Return FAILURE as a value.
16673 (printable_version): Declare arg as int, not char.
16674
166751997-01-02 Richard Stallman <rms@gnu.org>
16676
16677 * Makefile.in (dist):
16678 Explicitly check for symlinks, and copy them.
16679
166801996-12-19 Richard Stallman <rms@gnu.org>
16681
16682 * src/files.c:
16683 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
16684
166851996-12-18 Paul Eggert <eggert@gnu.org>
16686
16687 * src/bison.s1 (yyparse):
16688 If __GNUC__ and YYPARSE_PARAM are both defined,
16689 declare yyparse to have a void * argument.
16690
166911996-12-18 Paul Eggert <eggert@gnu.org>
16692
16693 * bison.simple (yyparse):
16694 If __GNUC__ and YYPARSE_PARAM are both defined,
16695 declare yyparse to have a void * argument.
16696
166971996-12-17 Richard Stallman <rms@gnu.org>
16698
16699 * src/reduce.c (nbits): Add some casts.
16700
167011996-08-12 Richard Stallman <rms@gnu.org>
16702
16703 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
16704
167051996-08-12 Richard Stallman <rms@gnu.org>
16706
16707 * bison.simple: Test _MSDOS as well as _MSDOS_.
16708
167091996-07-31 Richard Stallman <rms@gnu.org>
16710
16711 * src/bison.s1:
16712 [__sun && __i386]: Include alloca.h.
16713
167141996-07-31 Richard Stallman <rms@gnu.org>
16715
16716 * bison.simple:
16717 [__sun && __i386]: Include alloca.h.
16718
167191996-07-30 Richard Stallman <rms@gnu.org>
16720
16721 * src/bison.s1: Comment change.
16722
16723 * src/bison.s1: Test _MSDOS_, not MSDOS.
16724
167251996-07-30 Richard Stallman <rms@gnu.org>
16726
16727 * bison.simple: Comment change.
16728
16729 * bison.simple: Test _MSDOS_, not MSDOS.
16730
167311996-06-01 Richard Stallman <rms@gnu.org>
16732
16733 * 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:
16734 Insert `_' macro around many string constants.
16735
16736 * src/main.c:
16737 Insert `_' macro around many string constants.
16738
16739 (main): Call setlocale, bindtextdomain and textdomain.
16740
16741 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
16742 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
16743 [ENABLE_NLS]: Include libintl.h.
16744 [ENABLE_NLS] (gettext): Define.
16745 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
16746 (N_, PACKAGE, LOCALEDIR): New macros.
16747
167481996-06-01 Richard Stallman <rms@gnu.org>
16749
16750 * POTFILES.in: New file.
16751
16752 * Makefile.in (allocate.o):
16753 Define target explicitly.
16754
16755 * Makefile.in (CFLAGS): Set to @CFLAGS@.
16756 (LDFLAGS): Set to @LDFLAGS@.
16757 (configure): Run autoconf only if preceding `cd' succeeds.
16758 (bison.s1): Redirect output to temporary file then move the
16759 temporary to the target, rather than redirecting directly to bison.s1.
16760 (clean): Remove config.status and config.log.
16761 (distclean): Don't remove config.status here.
16762
167631996-05-12 Richard Stallman <rms@gnu.org>
16764
16765 * src/bison.s1:
16766 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
16767
167681996-05-12 Richard Stallman <rms@gnu.org>
16769
16770 * bison.simple:
16771 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
16772
167731996-05-11 Richard Stallman <rms@gnu.org>
16774
16775 * src/bison.s1 (__yy_memcpy):
16776 Really reorder the args, as was supposedly done on Feb 14 1995.
16777 (yyparse): Calls changed accordingly.
16778
167791996-05-11 Richard Stallman <rms@gnu.org>
16780
16781 * Makefile.in (dist): Don't use $(srcdir).
16782
16783 * bison.simple (__yy_memcpy):
16784 Really reorder the args, as was supposedly done on Feb 14 1995.
16785 (yyparse): Calls changed accordingly.
16786
167871996-01-27 Richard Stallman <rms@gnu.org>
16788
16789 * src/output.c (output_rule_data):
16790 Test YYERROR_VERBOSE in the conditional
16791 around the definition of ttyname.
16792
167931995-12-29 Richard Stallman <rms@gnu.org>
16794
16795 * src/bison.s1:
16796 Fix line numbers in #line commands.
16797
167981995-12-29 Richard Stallman <rms@gnu.org>
16799
16800 * bison.simple:
16801 Fix line numbers in #line commands.
16802
168031995-12-27 Richard Stallman <rms@gnu.org>
16804
16805 * src/bison.s1 (YYPARSE_PARAM_DECL):
16806 In C++, make it always null.
16807 (YYPARSE_PARAM_ARG): New macro.
16808 (yyparse): Use YYPARSE_PARAM_ARG.
16809
168101995-12-27 Richard Stallman <rms@gnu.org>
16811
16812 * bison.simple (YYPARSE_PARAM_DECL):
16813 In C++, make it always null.
16814 (YYPARSE_PARAM_ARG): New macro.
16815 (yyparse): Use YYPARSE_PARAM_ARG.
16816
168171995-11-29 Richard Stallman <rms@gnu.org>
16818
16819 * doc/bison.texinfo:
16820 Describe literal string tokens, %raw, %no_lines, %token_table.
16821
168221995-11-29 Daniel Hagerty <hag@gnu.org>
16823
16824 * doc/bison.texinfo: Fixed update date
16825
168261995-10-16 Richard Stallman <rms@gnu.org>
16827
16828 * src/version.c: Version 1.25.
16829
168301995-10-16 Richard Stallman <rms@gnu.org>
16831
16832 * NEWS: *** empty log message ***
16833
168341995-10-16 Richard Stallman <rms@gnu.org>
16835
16836 * doc/bison.1, doc/bison.rnh:
16837 Add new options.
16838
168391995-10-15 Richard Stallman <rms@gnu.org>
16840
16841 * src/vmsgetargs.c, src/getargs.c:
16842 Added -n, -k, and -raw switches.
16843 (noparserflag, toknumflag, rawtoknumflag): New variables.
16844
16845 * src/symtab.h (SALIAS):
16846 New #define for adding aliases to %token.
16847 (struct bucket): Added `alias' field.
16848
16849 * src/reduce.c (reduce_grammar):
16850 Revise error message.
16851 (print_notices): Remove final `.' from error message.
16852
16853 * src/reader.c (reader_output_yylsp):
16854 New function.
16855 (readgram): Use `#if 0' around code that accepted %command
16856 inside grammar rules: The documentation doesn't allow it,
16857 and it will fail since the %command processors scan for the next %.
16858 (parse_token_decl): Extended the %token
16859 declaration to allow a multi-character symbol as an alias.
16860 (parse_thong_decl): New function.
16861 (read_declarations): Added %thong declarations.
16862 (read_declarations): Handle NOOP to deal with allowing
16863 % declarations as another means to specify the flags.
16864 (readgram): Allow %prec prior to semantics embedded in a rule.
16865 (skip_to_char, read_declarations, copy_definition)
16866 (parse_token_decl, parse_start_decl, parse_type_decl)
16867 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
16868 (get_type_name, copy_guard, copy_action, readgram)
16869 (get_type, packsymbols): Revised most error messages.
16870 Changed `fatal' to `warnxxx' to avoid aborting for error.
16871 Revised and use multiple warnxxx functions to avoid using VARARGS1.
16872 (read_declarations): Improve the error message for
16873 an invalid character. Do not abort.
16874 (read_declarations, copy_guard, copy_action): Use
16875 printable_version to avoid unprintable characters in printed output.
16876 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
16877 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
16878 Allow the type of a non-terminal can be given
16879 more than once, as long as all specifications give the same type.
16880
16881 * src/output.c:
16882 (output_headers, output_trailers, output, output_gram)
16883 (output_rule_data): Implement noparserflag variable.
16884 Implement toknumflag variable.
16885 (output): Call reader_output_yylsp to output LTYPESTR.
16886
16887 * src/main.c (main):
16888 If reader sees an error, don't process the grammar.
16889 (fatals): Updated to not use VARARGS1.
16890 (printable_version, int_to_string, warn, warni, warns, warnss)
16891 (warnsss): New error reporting functions. Avoid abort for error.
16892
16893 * src/lex.h:
16894 Added THONG and NOOP for alias processing.
16895 Added SETOPT for the new code that allows setting options with %flags.
16896
16897 * src/lex.c:
16898 Include getopt.h. Add some extern decls.
16899 (safegetc): New function to deal with EOF gracefully.
16900 (literalchar); new function to deal with reading \ escapes.
16901 (lex): Use literalchar.
16902 (lex): Implemented "..." tokens.
16903 (literalchar, lex, parse_percent_token): Made tokenbuffer
16904 always contain the token. This includes growing the token
16905 buffer while reading an integer.
16906 (parse_percent_token): Replaced if-else statement with percent_table.
16907 (parse_percent_token): Added % declarations as another
16908 way to specify the flags -n, -l, and -r. Also added hooks for
16909 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
16910 major changes to files.c.
16911 (lex) Retain in the incoming stream a character following
16912 an incorrect '/'.
16913 (skip_white_space, lex): Revised most error messages
16914 and changed fatal to warn to avoid aborting.
16915 (percent_table): Added %thong declarations.
16916
16917 * src/gram.h: Comment changes.
16918
16919 * src/files.c (openfiles, open_extra_files, done):
16920 Add faction flag
16921 and actfile file. Handle noparserflag. Both for -n switch.
16922
16923 * src/conflicts.c (resolve_sr_conflict):
16924 Remove use of alloca.
16925
169261995-06-01 Jim Meyering <meyering@gnu.org>
16927
16928 * doc/bison.texinfo: *** empty log message ***
16929
169301995-05-06 Richard Stallman <rms@gnu.org>
16931
16932 * src/bison.s1: Comment change.
16933
169341995-05-06 Richard Stallman <rms@gnu.org>
16935
16936 * bison.simple: Comment change.
16937
169381995-05-03 Richard Stallman <rms@gnu.org>
16939
16940 * src/version.c: Version now 1.24.
16941
16942 * src/bison.s1: Change distribution terms.
16943
16944 * src/version.c: Version now 1.23.
16945
169461995-05-03 Richard Stallman <rms@gnu.org>
16947
16948 * doc/bison.texinfo:
16949 Rewrite "Conditions for Using Bison".
16950 Update version to 1.24.
16951
169521995-05-03 Richard Stallman <rms@gnu.org>
16953
16954 * bison.simple: Change distribution terms.
16955
169561995-02-23 Richard Stallman <rms@gnu.org>
16957
16958 * src/files.c: Test __VMS_POSIX as well as VMS.
16959
169601995-02-14 Jim Meyering <meyering@gnu.org>
16961
16962 * src/bison.s1 (__yy_memcpy):
16963 Renamed from __yy_bcopy to avoid
16964 confusion. Reverse FROM and TO arguments to be consistent with
16965 those of memcpy.
16966
169671995-02-14 Jim Meyering <meyering@gnu.org>
16968
16969 * bison.simple (__yy_memcpy):
16970 Renamed from __yy_bcopy to avoid
16971 confusion. Reverse FROM and TO arguments to be consistent with
16972 those of memcpy.
16973
169741994-11-10 David J. MacKenzie <djm@gnu.org>
16975
16976 * NEWS: reformat
16977
16978 * NEWS: New file.
16979
16980 * Makefile.in (DISTFILES): Include NEWS.
16981
16982 * Makefile.in (DISTFILES):
16983 Include install-sh, not install.sh.
16984
16985 * configure.in: Update to Autoconf v2 macro names.
16986
169871994-10-05 David J. MacKenzie <djm@gnu.org>
16988
16989 * Makefile.in: fix typo
16990
16991 * Makefile.in (prefix, exec_prefix):
16992 Let configure set them.
16993
169941994-09-28 David J. MacKenzie <djm@gnu.org>
16995
16996 * Makefile.in: Set datadir to $(prefix)/share.
16997
169981994-09-15 Richard Stallman <rms@gnu.org>
16999
17000 * src/bison.s1:
17001 Update copyright notice and GPL version.
17002
170031994-09-15 Richard Stallman <rms@gnu.org>
17004
17005 * bison.simple:
17006 Update copyright notice and GPL version.
17007
170081994-07-12 Richard Stallman <rms@gnu.org>
17009
17010 * src/reduce.c, src/reader.c:
17011 entered into RCS
17012
170131994-05-05 David J. MacKenzie <djm@gnu.org>
17014
17015 * Makefile.in: entered into RCS
17016
170171994-03-26 Richard Stallman <rms@gnu.org>
17018
17019 * src/bison.s1: entered into RCS
17020
170211994-03-26 Richard Stallman <rms@gnu.org>
17022
17023 * bison.simple: entered into RCS
17024
170251994-03-25 Richard Stallman <rms@gnu.org>
17026
17027 * src/main.c: entered into RCS
17028
170291994-03-24 Richard Stallman <rms@gnu.org>
17030
17031 * src/conflicts.c: entered into RCS
17032
170331994-01-02 Richard Stallman <rms@gnu.org>
17034
17035 * Makefile.in: *** empty log message ***
17036
170371993-11-21 Richard Stallman <rms@gnu.org>
17038
17039 * src/bison.s1: *** empty log message ***
17040
170411993-11-21 Richard Stallman <rms@gnu.org>
17042
17043 * doc/bison.texinfo: entered into RCS
17044
17045 * doc/bison.texinfo: *** empty log message ***
17046
170471993-11-21 Richard Stallman <rms@gnu.org>
17048
17049 * bison.simple: *** empty log message ***
17050
170511993-10-25 David J. MacKenzie <djm@gnu.org>
17052
17053 * doc/bison.texinfo: *** empty log message ***
17054
170551993-10-19 Richard Stallman <rms@gnu.org>
17056
17057 * src/bison.s1: *** empty log message ***
17058
170591993-10-19 Richard Stallman <rms@gnu.org>
17060
17061 * bison.simple: *** empty log message ***
17062
170631993-10-14 Richard Stallman <rms@gnu.org>
17064
17065 * src/bison.s1: *** empty log message ***
17066
170671993-10-14 Richard Stallman <rms@gnu.org>
17068
17069 * bison.simple: *** empty log message ***
17070
170711993-09-14 David J. MacKenzie <djm@gnu.org>
17072
17073 * doc/bison.texinfo: *** empty log message ***
17074
170751993-09-13 Noah Friedman <friedman@gnu.org>
17076
17077 * Makefile.in: *** empty log message ***
17078
170791993-09-10 Richard Stallman <rms@gnu.org>
17080
17081 * src/conflicts.c: *** empty log message ***
17082
17083 * src/system.h: entered into RCS
17084
170851993-09-10 Richard Stallman <rms@gnu.org>
17086
17087 * doc/bison.1: entered into RCS
17088
170891993-09-06 Noah Friedman <friedman@gnu.org>
17090
17091 * src/version.c: entered into RCS
17092
170931993-09-06 Noah Friedman <friedman@gnu.org>
17094
17095 * Makefile.in: *** empty log message ***
17096
170971993-07-30 David J. MacKenzie <djm@gnu.org>
17098
17099 * Makefile.in: *** empty log message ***
17100
171011993-07-24 Richard Stallman <rms@gnu.org>
17102
17103 * src/bison.s1: *** empty log message ***
17104
171051993-07-24 Richard Stallman <rms@gnu.org>
17106
17107 * bison.simple: *** empty log message ***
17108
171091993-07-08 David J. MacKenzie <djm@gnu.org>
17110
17111 * Makefile.in: *** empty log message ***
17112
171131993-07-04 Richard Stallman <rms@gnu.org>
17114
17115 * src/bison.s1: *** empty log message ***
17116
171171993-07-04 Richard Stallman <rms@gnu.org>
17118
17119 * bison.simple: *** empty log message ***
17120
171211993-06-26 David J. MacKenzie <djm@gnu.org>
17122
17123 * src/getargs.c: entered into RCS
17124
171251993-06-26 David J. MacKenzie <djm@gnu.org>
17126
17127 * doc/bison.texinfo: *** empty log message ***
17128
17129 * doc/bison.1: New file.
17130
171311993-06-25 Richard Stallman <rms@gnu.org>
17132
17133 * src/getargs.c: New file.
17134
171351993-06-16 Richard Stallman <rms@gnu.org>
17136
17137 * src/bison.s1: *** empty log message ***
17138
171391993-06-16 Richard Stallman <rms@gnu.org>
17140
17141 * bison.simple: *** empty log message ***
17142
171431993-06-03 Richard Stallman <rms@gnu.org>
17144
17145 * src/bison.s1: New file.
17146
171471993-06-03 Richard Stallman <rms@gnu.org>
17148
17149 * doc/bison.texinfo: *** empty log message ***
17150
171511993-06-03 Richard Stallman <rms@gnu.org>
17152
17153 * bison.simple: New file.
17154
171551993-05-19 Richard Stallman <rms@gnu.org>
17156
17157 * doc/bison.texinfo: New file.
17158
171591993-05-07 Noah Friedman <friedman@gnu.org>
17160
17161 * Makefile.in: *** empty log message ***
17162
171631993-04-28 Noah Friedman <friedman@gnu.org>
17164
17165 * src/reader.c: *** empty log message ***
17166
171671993-04-23 Noah Friedman <friedman@gnu.org>
17168
17169 * src/alloc.h: entered into RCS
17170
171711993-04-20 David J. MacKenzie <djm@gnu.org>
17172
17173 * src/version.c: *** empty log message ***
17174
17175 * src/files.c, src/allocate.c:
17176 entered into RCS
17177
17178 * src/reader.c: *** empty log message ***
17179
17180 * src/lex.c: entered into RCS
17181
17182 * src/conflicts.c: New file.
17183
17184 * src/symtab.c: entered into RCS
17185
17186 * src/alloc.h: New file.
17187
17188 * src/LR0.c: entered into RCS
17189
171901993-04-18 Noah Friedman <friedman@gnu.org>
17191
17192 * src/reader.c: New file.
17193
17194 * src/version.c: *** empty log message ***
17195
171961993-04-18 Noah Friedman <friedman@gnu.org>
17197
17198 * Makefile.in: *** empty log message ***
17199
172001993-04-17 Noah Friedman <friedman@gnu.org>
17201
17202 * Makefile.in: *** empty log message ***
17203
172041993-04-15 Richard Stallman <rms@gnu.org>
17205
17206 * src/main.c, src/files.c:
17207 New file.
17208
172091993-04-15 Noah Friedman <friedman@gnu.org>
17210
17211 * configure.in: entered into RCS
17212
17213 * configure.in: *** empty log message ***
17214
17215 * configure.in: New file.
17216
172171993-04-14 Richard Stallman <rms@gnu.org>
17218
17219 * Makefile.in: New file.
17220
172211993-04-13 Richard Stallman <rms@gnu.org>
17222
17223 * src/version.c: New file.
17224
172251993-03-25 Richard Stallman <rms@gnu.org>
17226
17227 * src/output.c: entered into RCS
17228
172291992-09-25 Richard Stallman <rms@gnu.org>
17230
17231 * configure.bat: entered into RCS
17232
172331992-06-22 Richard Stallman <rms@gnu.org>
17234
17235 * src/vmsgetargs.c: entered into RCS
17236
172371992-06-22 Richard Stallman <rms@gnu.org>
17238
17239 * doc/bison.rnh: entered into RCS
17240
172411992-04-20 David J. MacKenzie <djm@gnu.org>
17242
17243 * README: entered into RCS
17244
172451992-01-22 Richard Stallman <rms@gnu.org>
17246
17247 * src/machine.h: entered into RCS
17248
172491991-12-21 Richard Stallman <rms@gnu.org>
17250
17251 * src/lalr.c, src/closure.c:
17252 entered into RCS
17253
172541991-12-20 Richard Stallman <rms@gnu.org>
17255
17256 * src/state.h: entered into RCS
17257
172581991-12-18 Richard Stallman <rms@gnu.org>
17259
17260 * src/print.c, src/nullable.c, src/derives.c:
17261 entered into RCS
17262
172631991-11-03 David J. MacKenzie <djm@gnu.org>
17264
17265 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17266 entered into RCS
17267
172681988-09-09 Richard Stallman <rms@gnu.org>
17269
17270 * src/bison.hairy: entered into RCS
17271
172721987-12-16 Richard Stallman <rms@gnu.org>
17273
17274 * REFERENCES: entered into RCS
dc546b0f 17275
f294a2c2 17276
04098407 17277 -----
f294a2c2 17278
04098407 17279 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e2a21b6f
PE
17280 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17281 Software Foundation, Inc.
f294a2c2 17282
04098407
PE
17283 Copying and distribution of this file, with or without
17284 modification, are permitted provided the copyright notice and this
17285 notice are preserved.
e9071366
AD
17286
17287$Id$