1 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3 * data/glr.c (b4_shared_declarations): Put start-header first,
4 before any #includes that we generate, so that feature-test
5 macros work. Problem reported by Michael Deutschmann in
6 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
7 * data/lalr1.cc: Likewise.
8 * doc/bison.texinfo (Prologue): Document that feature-test macros
9 should be defined before any Bison declarations.
10 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
11 that depend on location.hh after, not before, Bison decls, since
12 we now include location.hh after the first user prologue.
14 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
16 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
17 Also, fix minor white space and comment issues.
18 (Prologue): Mention that it's better to define feature-test macros
19 before Bison declarations. Problem reported by Michael Deutschmann.
21 * README-cvs: Fix typo: "&" should be "&&". Problem reported
23 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
24 This adjusts to recent gnulib changes.
26 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
28 Finish implementation of per-type %destructor/%printer. Discussed
30 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
32 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
33 * NEWS (2.3+): Add a description of this feature to the default
34 %destructor/%printer description.
35 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
36 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
37 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
38 list node contains a semantic type.
39 * src/symtab.c, src/symtab.h: Extend with a table that associates
40 semantic types with their %destructor's and %printer's.
41 (semantic_type_from_uniqstr, semantic_type_get,
42 semantic_type_destructor_set, semantic_type_printer_set): New functions
43 composing the public interface of that table.
44 (symbol_destructor_get, symbol_destructor_location_get,
45 symbol_printer_get, symbol_printer_location_get): If there's no
46 per-symbol %destructor/%printer, look up the per-type before trying
48 * tests/actions.at (Per-type %printer and %destructor): New test case.
49 * tests/input.at (Default %printer and %destructor redeclared):
50 Extend to check that multiple occurrences of %symbol-default in a
51 single %destructor/%printer declaration is an error.
52 (Per-type %printer and %destructor redeclared, Unused values with
53 per-type %destructor): New test cases.
55 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
57 Require default %destructor/%printer to be declared using
58 %symbol-default instead of an empty symbol list, and start working on
59 new per-type %destructor/%printer. Discussed at
60 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
61 * NEWS (2.3+): Add %symbol-default to example.
62 * bison.texinfo (Freeing Discarded Symbols): Likewise.
63 (Bison Symbols): Add entry for %symbol-default.
64 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
65 (generic_symlist, generic_symlist_item): New nonterminals for creating
66 a list in which each item is a symbol, semantic type, or
68 (grammar_declaration): Use generic_symlist in %destructor and %printer
69 declarations instead of symbols.1 or an empty list.
70 (symbol_declaration, precedence_declaration, symbols.1): Update actions
71 for changes to symbol_list.
72 * src/reader.c: Update for changes to symbol_list.
73 * src/scan-code.l: Likewise.
74 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
75 * src/symlist.c, src/symlist.h: Extend such that a list node may
76 represent a semantic type or a %symbol-default in addition to just an
77 ordinary symbol. Add switched functions for setting %destructor's and
79 * tests/actions.at, tests/input.at: Add %symbol-default to all default
80 %destructor/%printer declarations.
82 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
84 Whether the default %destructor/%printer applies to a particular symbol
85 isn't a question of whether the user *declares* that symbol (in %token,
86 for example). It's a question of whether the user by any means
87 *defines* the symbol at all (by simply using a char token, for
88 example). $end is defined by Bison whereas any other token with token
89 number 0 is defined by the user. The error token is always defined by
90 Bison regardless of whether the user declares it with %token, but we
91 may one day let the user define error as a nonterminal instead.
92 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
93 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
94 the meaning of "user-defined".
95 * tests/actions.at (Default %printer and %destructor for user-declared
96 end token): Rename to...
97 (Default %printer and %destructor for user-defined end token): ...
100 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
101 computation of whether to apply the default, don't maintain a list of
102 every Bison-defined symbol. Instead, just check for a first character
103 of '$', which a user symbol cannot have, and check for the error token.
105 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
107 Don't apply the default %destructor or %printer to the error token,
108 $undefined, or $accept. This change fits the general rule that the
109 default %destructor and %printer are only for user-declared symbols,
110 and it solves several difficulties that are described in the new test
112 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
113 * tests/actions.at (Default %printer and %destructor are not for error
114 or $undefined, Default %printer and %destructor are not for $accept):
117 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
119 Allow %start after the first rule.
120 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
121 when parsing the first rule.
122 (check_and_convert_grammar): Search for it here after all grammar
123 declarations have been parsed. Skip midrules, which have dummy LHS
125 * src/symtab.c (symbol_is_dummy): New function.
126 * src/symtab.h (symbol_is_dummy): Declare it.
127 * tests/input.at (%start after first rule): New test.
129 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
131 Redo some of the previous commit: add back the ability to use
132 non-aliased/undeclared string literals since it might be useful to
133 those declaring %token-table.
134 * src/reader.c (check_and_convert_grammar): Undo changes in previous
135 commit: don't worry about complaints from symbols_pack.
136 * src/symtab.c (symbol_new, symbol_class_set,
137 symbol_check_alias_consistency): Undo changes in previous commit: count
138 each string literal as a new symbol and token, assign it a symbol
139 number, and don't complain about non-aliased string literals.
140 (symbols_pack): Since symbol_make_alias still does not decrement symbol
141 and token counts but does still set aliased tokens to the same number,
142 symbol_pack_processor now leaves empty slots in the symbols array.
144 * tests/regression.at (Undeclared string literal): Remove test case
145 added in previous commit since non-aliased string literals are allowed
147 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
148 remove unnecessary string literal declarations.
149 * tests/sets.at (Firsts): Likewise.
151 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
153 Don't allow an undeclared string literal, but allow a string literal to
154 be used before its declaration.
155 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
156 symbols_pack complained.
157 * src/symtab.c (symbol_new): Don't count a string literal as a new
159 (symbol_class_set): Don't count a string literal as a new token, and
160 don't assign it a symbol number since symbol_make_alias does that.
161 (symbol_make_alias): It's not necessary to decrement the symbol and
162 token counts anymore. Don't assume that an alias declaration occurs
163 before any uses of the identifier or string, and thus don't assert that
164 one of them has the highest symbol number so far.
165 (symbol_check_alias_consistency): Complain if there's a string literal
166 that wasn't declared as an alias.
167 (symbols_pack): Bail if symbol_check_alias_consistency failed since
168 symbol_pack asserts that every token has been assigned a symbol number
169 although undeclared string literals have not.
170 * tests/regression.at (String alias declared after use, Undeclared
171 string literal): New test cases.
172 (Characters Escapes, Web2c Actions): Declare string literals as
174 * tests/sets.at (Firsts): Likewise.
176 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
178 In the grammar scanner, STRING_FINISH unclosed constructs and return
179 them to the parser in order to improve error messages.
180 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
181 SC_BRACED_CODE, SC_PROLOGUE): Implement.
182 * tests/input.at (Unclosed constructs): New test case.
183 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
186 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
189 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
191 Handle string aliases for character tokens correctly.
192 * src/symtab.c (symbol_user_token_number_set): If the token has an
193 alias, check and set its alias's user token number instead of its own,
194 which is set to indicate the alias. Previously, every occurrence of
195 the character token in the grammar overwrote that alias indicator with
197 * tests/input.at (String aliases for character tokens): New test.
199 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
201 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
203 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
205 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
206 to prevent failures when building on older platforms.
207 Check for autopoint failure.
208 Set XGETTEXT_OPTIONS to values that check for C format strings,
209 so that translators are warned about them (this also helps
212 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
213 function, since it simplifies our code a bit.
215 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
216 rather than -W, so we don't get bogus warnings about sign comparisons.
217 Add -Wpointer-arith, since that warning is useful (it reports code
218 that does not conform to C89 and that some compilers reject).
219 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
220 since it's no longer needed.
222 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
224 Clean up scanners a bit.
225 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
226 definitions so gcc won't warn when obstack_for_string is unused.
227 * src/scan-code.l: config.h and system.h are already #include'd by
228 scan-code-c.c, so get rid of them here.
229 * src/scan-gram.l: Likewise.
230 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
231 definitions rather than duplicating the rest of it.
232 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
234 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
236 Suppress signed/unsigned comparison warnings for yycheck.
237 * data/c.m4 (b4_safest_int_type): New macro.
238 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
239 a signed int type, cast it to b4_safest_int_type first.
240 * data/yacc.c: Likewise.
241 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
244 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
246 * doc/bison.texinfo: Fix some typos.
248 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
250 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
251 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
253 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
254 the latest gnulib does this a different way.
255 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
256 translation was patched, so stop omitting it.
258 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
260 Enable declaration of default %printer/%destructor. Make the parser
261 use these for all user-declared grammar symbols for which the user does
262 not declare a specific %printer/%destructor. Thus, the parser uses it
263 for token 0 if the user declares it but not if Bison generates it as
264 $end. Discussed starting at
265 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
266 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
268 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
269 * NEWS (2.3+): Mention.
270 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
271 declare a %destructor for a mid-rule's semantic value. It's just
272 impossible to declare one specific to it.
273 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
274 code. Describe default %destructor form.
275 * src/parse-gram.y (grammar_declaration): Parse default
276 %printer/%destructor declarations.
277 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
278 and symbol_destructor_location_get rather than accessing the destructor
279 and destructor_location members of struct symbol.
280 (symbol_printers_output): Likewise but for %printer's.
281 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
283 * src/symtab.c (default_destructor, default_destructor_location,
284 default_printer, default_printer_location): New static global
285 variables to record the default %destructor and %printer.
286 (symbol_destructor_get, symbol_destructor_location_get,
287 symbol_printer_get, symbol_printer_location_get): New functions to
288 compute the appropriate %destructor and %printer for a symbol.
289 (default_destructor_set, default_printer_set): New functions to set the
290 default %destructor and %printer.
291 * src/symtab.h: Prototype all those new functions.
292 * tests/actions.at (Default %printer and %destructor): New test to
293 check that the right %printer and %destructor are called, that they're
294 not called for $end, and that $$ and @$ work correctly.
295 (Default %printer and %destructor for user-declared end token): New
296 test to check that the default %printer and %destructor are called for
297 a user-declared end token.
298 * tests/input.at (Default %printer and %destructor redeclared, Unused
299 values with default %destructor): New tests to check related grammar
302 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
304 Clean up handling of %destructor for the end token (token 0).
305 Discussed starting at
306 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
308 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
310 Make the skeletons consistent in how they pop the end token and invoke
312 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
313 state, which has token number 0, since this would invoke the
314 %destructor for the end token.
315 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
316 until after shifting the end token, or else it won't be popped.
317 * data/yacc.c (yyparse): Likewise.
319 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
320 it's the end token. Upon termination, destroy an unshifted lookahead
321 even when it's the end token.
322 * data/lalr1.cc (yy::parser::parse): Likewise.
323 * data/yacc.c (yyparse): Likewise.
325 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
326 value warnings for the end token when the user gives the end token a
329 * tests/actions.at (Printers and Destructors): Test all the above.
331 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
333 Update to latest gnulib and gettext versions.
334 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
336 (gnulib_files): Add m4/warning.m4. Don't worry about files
337 overwritten by autopoint.
338 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
339 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
341 Don't use autoreconf; instead, invoke autopoint etc. by hand,
342 so that we can remove the intl files at a better time.
343 (intl_files_to_remove): Remove aclocal.m4, since it gets
344 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
345 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
346 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
347 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
348 Remove datarootdir hack; no longer needed.
349 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
350 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
351 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
353 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
354 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
356 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
358 * bootstrap: Adjust to today's change to gnulib-tool by invoking
359 it with --assume-autoconf='latest-stable'.
361 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
363 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
364 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
366 * src/muscle_tab.h (muscle_grow): Replace the header comments with
367 those from muscle_tab.c since the old ones are misleading.
369 2006-07-13 Akim Demaille <akim@epita.fr>
371 Support %define "KEY" {VALUE}.
372 * src/scan-code.h, src/scan-code.l (translate_action)
373 (translate_rule_action, translate_symbol_action, translate_code):
374 Return char *, not const char *.
375 * src/parse-gram.y (declaration): Rename as...
376 (prologue_declaration): this.
377 (string_content): Remove this nonterminal, use STRING.
378 (braceless, content, content.opt): New nonterminal.
380 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
382 * src/scan-gram.l (getargs.h): Don't include it.
384 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
386 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
387 rather than a for-loop that declares a local bool variable. This
388 should work around a compatibility problem with a Cray x1e C++
389 compiler reported by Hung Nguyen in
390 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
391 The for-loop was introduced in the 2004-11-17 change but I don't
392 know why it was needed.
394 2006-07-12 Akim Demaille <akim@epita.fr>
396 * data/c.m4: Comment changes.
398 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
400 * src/complain.c (error_message, ERROR_MESSAGE): New.
402 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
403 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
405 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
407 * NEWS: Instead of %union, you can define and use your own union type
408 YYSTYPE if your grammar contains at least one <type> tag.
409 Your YYSTYPE need not be a macro; it can be a typedef.
410 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
411 (Union Decl, Decl Summary): Document this.
412 * data/glr.c (YYSTYPE): Implement this.
413 * data/glr.cc (YYSTYPE): Likewise.
414 * data/lalr1.cc (YYSTYPE): Likewise.
415 * data/yacc.c (YYSTYPE): Likewise.
416 * src/output.c (prepare): Output tag_seen_flag.
417 * src/parse-gram.y (declaration, grammar_declaration):
418 Use 'union_seen' rather than 'typed' to determine whether
419 %union has been seen, since grammars can now be typed without
421 (symbol_declaration, type.opt, symbol_def):
422 Keep track of whether a tag has been seen.
423 * src/reader.c (union_seen, tag_seen): New vars.
425 * src/reader.h (union_seen, tag_seen, typed): Likewise.
426 * src/scan-code.l (untyped_var_seen): New variable.
427 (handle_action_dollar): Adjust to above changes.
428 (handle_action_dollar, handle_action_at):
429 Improve overflow checking for outlandish numbers.
430 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
431 avoid new diagnostics generated by above changes.
432 * tests/regression.at (YYSTYPE typedef): Add test to check
433 for type tags without %union.
435 * src/symlist.c (symbol_list_length): Return int, not unsigned
436 int, since callers expect int. This may need to get revisited
437 once we have proper integer overflow checking.
439 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
440 object is now static.
442 * src/getargs.c (flags_argmatch): Return void, not int,
443 to pacify ./configure --enable-gcc-warnings.
445 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
446 since last_string is already defined to FLEX_PREFIX (last_string).
448 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
450 Implement --warnings/-W.
451 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
453 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
455 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
456 (warnings_args, warnings_types): New.
457 (getargs, short_options, long_options): Accept -W/--warnings.
458 Sort the options by alphabetical order, upper case letter right
459 before its lower case.
461 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
463 Change %merge result type clash warnings to errors. Discussed at
464 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
465 * src/reader.c (record_merge_function_type): Use complain_at.
466 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
467 declared later): Update test case results.
469 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
471 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
472 to be in alphabetical order.
473 (trace_args): Spelling fixes.
475 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
477 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
478 so they don't collide with user-defined macros.
479 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
480 this was never guaranteed, and now that we're using gnulib stdint,
481 which defines int_fast16_t to long int, the problem is exposed.
483 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
485 * data/c.m4 (b4_basename): Simplify a bit, since we don't
486 need the full POSIX semantics (and weren't implementing them
489 Adjust to Autoconf 2.60 and today's gnulib.
490 * bootstrap (gnulib_modules): Add stdint.
491 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
493 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
494 since stdint needs the former and wcwidth (which is now required
495 by mbswidth) needs the latter.
496 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
497 work around a compatibility glitch between gettext 0.14.6 and
499 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
500 Do not check for uintptr_t, since new stdint module does the right
502 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
503 Add stdint.h, stdint_.h, wcwidth.h.
504 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
505 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
506 stdint.m4, wchar_t.m4, wcwidth.m4.
507 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
508 usual order for ../lib/*.h files.
509 (file_name_split): Use last_component, not base_name, to adjust
511 * src/parse-gram.h: Include <strverscmp.h> in the usual order
512 for ../lib/*.h files.
513 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
514 Define unconditionally, since we now assume the stdint module.
515 * src/scan-skel.l: Include <dirname.h>.
516 (BASE_QPUTS): Use last_component, not base_name.
517 * src/system.h: Include <unlocked-io.h> in the usual order
518 for ../lib/*.h files. Include <stdint.h> unconditionally,
519 since we now use the stdint module.
520 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
521 HAVE_UINTPTR_T, since we now use the stdint module.
522 (base_name): Remove decl, since files now include <dirname.h>
525 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
527 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
529 * data/yacc.c, data/glr.c, data/location.cc: Use them.
530 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
532 * tests/calc.at: Adjust.
534 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
536 * data/c.m4 (b4_basename): New.
537 (b4_syncline): Also output the location of its invocation (from
539 (b4_user_action, b4_define_user_action, b4_user_actions)
540 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
541 (b4_user_stype): New.
542 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
544 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
546 In the grammar file, the first column is 1 not 0 on the first line as
548 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
549 * tests/input.at (Torturing the Scanner): Update output.
551 * src/scan-gram.l (scanner_cursor): Declare it static.
553 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
555 In warnings, say "previous declaration" rather than "first
557 * src/symtab.c (redeclaration): Do that here.
558 * src/reader.c (record_merge_function_type): In the case of a result
559 type clash, report the previous declaration rather than the very first
560 one in the grammar file.
561 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
562 declared later): Add a third declaration to check this behavior.
563 * tests/input.at (Incompatible Aliases): Update output.
565 2006-06-27 Akim Demaille <akim@epita.fr>
567 * doc/Doxyfile.in: New.
568 * doc/Makefile.am: Use it.
569 * src/lalr.h, src/symtab.h: Initial doxygenation.
571 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
573 Don't miss %merge result type warnings just because the LHS types are
574 declared after the %merge. This continues the effort of the previous
576 * src/reader.c (get_merge_function): Don't set the merger type yet.
577 (record_merge_function_type): New function for setting the merger type
578 and checking for clashes.
579 (grammar_current_rule_merge_set): Set the location of the %merge for
581 (packgram): Invoke record_merge_function_type for each rule now that
582 all symbol type declarations have been parsed.
583 * src/reader.h (merger_list.type_declaration_location): New member
584 storing the location of the first %merge from which the type for this
585 merging function was derived.
586 * src/symlist.h (symbol_list.merger_declaration_location): New member
587 storing the location of a rule's %merge, if any.
588 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
589 declared later): New test to catch the error fixed by the above patch.
591 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
593 Get action warnings (grammar_rule_check) right even when symbol
594 declarations appear after the rules. Discussed at
595 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
597 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
598 Don't mistake the type of $$ in a midrule to be that of its parent
600 * src/reader.c (grammar_current_rule_end): Don't invoke
601 grammar_rule_check yet since not all symbol declarations may have been
603 (grammar_midrule_action): Likewise.
604 Don't record whether the midrule's $$ has been used yet since actions
605 haven't been translated yet.
606 Record the midrule's parent rule and its RHS index within the parent
608 (grammar_current_rule_action_append): Don't translate the action yet
609 since not all symbol declarations may have been parsed yet and, thus,
610 warnings about types for $$, $n, @$, and @n can't be reported yet.
611 (packgram): Translate the action and invoke grammar_rule_check now that
612 all symbol declarations have been parsed.
613 * src/scan-code.l (handle_action_dollar): Now that this is invoked
614 after parsing the entire grammar file, the symbol list here in the case
615 of a midrule is actually the midrule's empty RHS, so reference its
616 parent rule's RHS where necessary.
617 On the other hand, now that you can already know it's a midrule, you
618 aren't forced to think $$ has the same type as its parent rule's $$.
619 (handle_action_at): In the case of a midrule, reference the parent rule
621 * src/symlist.c (symbol_list_new): Initialize new midrule-related
623 (symbol_list_length): Now that this is invoked after all rules have
624 been parsed, a NULL symbol (rather than a NULL symbol list node)
625 terminates a rule. symbol_list_print already does this correctly.
626 * src/symlist.h (symbol_list.midrule_parent_rule,
627 symbol_list.midrule_parent_rhs_index): New members so that midrules can
628 remember their relationships with their parents.
629 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
630 fixed by the above patch.
631 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
633 (Unused values): ... this old test case and...
634 (Unused values before symbol declarations): ... this new test case.
635 This one is the same as `Unused values' except that all symbol
636 declarations appear after the rules in order to catch the rest of the
637 errors fixed by the above patch.
639 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
642 * src/reader.c (current_rule): Declare it static since it's no longer
643 used outside this file.
644 (grammar_current_rule_action_append): Remove redundant arguments from
645 translate_rule_action invocation.
646 * src/reader.h (current_rule): Remove this unused extern.
647 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
648 * src/scan-code.l (translate_rule_action): Likewise.
650 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
652 Clean up yesterday's patch.
653 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
655 * src/reader.c (grammar_current_rule_action_append): ... here for
656 consistency with grammar_current_rule_symbol_append.
657 * tests/regression.at (Braced code in declaration in rules section):
658 Make yyerror and yylex static as usual.
660 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
662 Fix bug that mistakes braced code in a declaration in the rules section
663 to be a rule action. Mentioned at
664 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
665 * src/scan-gram.l: Move midrule action detection from the start of the
666 scanning of any braced code to...
667 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
668 action. For readability, use $2 and @2 rather than the equivalent
670 * tests/regression.at (Braced code in declaration in rules section):
671 New test to catch the error fixed by the above patch.
673 Work on code readability some.
674 * src/scan-code.l (current_rule): Get rid of this misleading and
675 redundant declaration: it's actually extern'ed in reader.h.
676 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
677 translate_action): Add a rule argument and use it instead of the global
679 (translate_rule_action): This already receives current_rule through an
680 argument, so pass it on to translate_action instead of assigning
681 current_rule to current_rule.
682 (translate_symbol_action, translate_code): Pass rule = NULL to
685 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
687 Rename %before-definitions to %start-header and %after-definitions to
688 %end-header. Don't use these declarations to separate pre-prologue
689 blocks from post-prologue blocks. Add new order-independent
690 declarations %before-header and %after-header as alternatives to the
691 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
692 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
693 * NEWS (2.3+): Update for these changes.
694 * data/glr.c (b4_before_definitions): Update to...
695 (b4_start_header): ... this.
696 (b4_after_definitions): Update to...
697 (b4_end_header): ... this.
698 * data/glr.cc: Likewise.
699 * data/lalr1.cc: Likewise.
700 * data/yacc.c: Likewise.
701 * doc/bison.texinfo (The prologue): Update names, and replace remaining
702 prologue blocks with %*-header declarations.
703 (Calc++ Parser): Likewise.
704 (Bison Declaration Summary): Update names.
705 (Bison Symbols): Update description.
706 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
707 (PERCENT_END_HEADER): ... this.
708 (PERCENT_BEFORE_DEFINITIONS): Update to...
709 (PERCENT_START_HEADER): ... this.
710 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
711 (declaration): Update token names and m4 macro names.
712 When parsing %end-header and %start-header, invoke translate_code
713 before muscle_code_grow, and no longer set global booleans to remember
714 whether these declarations have been seen.
715 Parse new %after-header and %before-header.
716 * src/reader.c (before_definitions, after_definitions): Remove.
717 (prologue_augment): Accept a new bool argument to specify whether to
718 augment the pre-prologue or post-prologue.
719 * src/reader.h (before_definitions, after_definitions): Remove these
721 (prologue_augment): Add new bool argument.
722 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
723 (PERCENT_END_HEADER): ... this.
724 (PERCENT_BEFORE_DEFINITIONS): Update to...
725 (PERCENT_START_HEADER): ... this.
726 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
727 * tests/actions.at (Printers and Destructors): Update names.
729 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
731 Add comparison operators for C++ location classes. Discussed at
732 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
733 * data/c++.m4 (b4_define_location_comparison): New boolean %define
734 declaration indicating whether filename_type has an operator==. If
735 filename_type is `std::string', it defaults to `1', `0' otherwise.
736 * data/location.cc: Iff b4_define_location_comparison is `1', add
737 operator== and operator!= for class position and for class location.
740 * src/scan-action.l: Remove unused file.
741 * src/symtab.c (symbol_printer_set): Use printer_location not
743 * src/symtab.h (struct symbol): Replace incorrect source comment for
745 * tests/input.at (Incompatible Aliases): Update output with correct
748 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
750 Don't put the pre-prologue in the header file. For the yacc.c code
751 file and the glr.c header and code files, move the pre-prologue before
752 the token definitions. Add new %before-definitions and
753 %after-definitions to declare code that will go in both the header file
754 and code file. Discussed at
755 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
756 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
758 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
759 * NEWS (2.3+): Describe these changes.
760 * data/glr.c (b4_pre_prologue): Move from within to before...
761 (b4_shared_declarations): ... this.
762 Add new b4_before_definitions before b4_token_enums.
763 Add new b4_after_definitions at the end.
764 * data/glr.cc (b4_pre_prologue): Replace with...
765 (b4_before_definitions): ... this in the header file.
766 (b4_after_definitions): New near the end of the header file.
767 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
768 code file right before including the header file.
769 (b4_before_definitions): New in the previous position of
770 b4_pre_prologue in the header file.
771 (b4_after_definitions): New near the end of the header file.
772 * data/yacc.c: Clean up some m4 quoting especially in the header file.
773 (b4_token_enums_defines): In the code file, move to right before
774 YYSTYPE for consistency with the header file.
775 (b4_before_definitions): New right before b4_token_enums_defines in
776 both the header and code file.
777 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
778 header and code file.
779 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
780 of prologues for %union dependencies.
781 (Bison Declaration Summary): In %defines description, mention the
782 effect of %before-definitions and %after-definitions on the header
784 (Calc++ Parser): Forward declare driver in a %before-definitions rather
785 than in the pre-prologue so that make check succeeds.
786 (Bison Symbols): Add entries for %before-definitions and
788 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
790 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
791 (declaration): Parse those declarations and append to
792 b4_before_definitions and b4_after_definitions, respectively.
793 * src/reader.c (before_definitions, after_definitions): New bools to
794 track whether those declarations have been seen.
795 (prologue_augment): Add to the post-prologue if %union,
796 %before-definitions, or %after-definitions has been seen.
797 * src/reader.h (before_definitions, after_definitions): New extern's.
798 * src/scan-gram.l: Scan the new declarations.
799 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
800 prologue block in a %before-definitions or a %after-definitions based
801 on whether the %union is declared.
802 * tests/regression.at (Early token definitions with --yacc, Early token
803 definitions without --yacc): Move tests for token definitions into the
804 post-prologue since token names are no longer defined in the
807 2006-06-20 Akim Demaille <akim@epita.fr>
809 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
810 (symbol_get): Use it.
811 * src/parse-gram.y: Use it.
813 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
815 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
816 build succeeds when configured with --enable-gcc-warnings.
818 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
820 * src/parse-gram.y (char_name): New function.
821 (CHAR, STRING, string_content): For %printer, properly escape.
822 (ID): Prefer fputs to fprintf.
823 (id): Reindent to be consistent with other rules.
826 The Translation Project changed its way of publishing translations
827 to maintainers. I haven't received any responses to my request
828 for supporting the old way, or for documenting the new way. I
829 have modified 'bootstrap' to use screen scraping
830 (in this case, HTML scraping). This is unreliable and inelegant,
831 but I don't see any better way. Yuck.
832 * bootstrap (TP_URL, WGET_COMMAND): New vars.
833 (get_translations): New function, which uses HTML scraping to
834 deduce locations of latest translations.
835 Use this function to grab both bison and bison-runtime .po files.
836 Don't bother priming the pump for the runtime-po domain any more,
837 as it's now translated better than bison is.
839 2006-06-19 Akim Demaille <akim@epita.fr>
841 * src/scan-gram.l: No longer "parse" things after `%union' until
842 `{'. Rather, return a single "%union" token.
843 No longer make symbols: return strings, and leave the conversion
844 to symbols to the parser.
845 (SC_PRE_CODE, token_type): Remove.
846 * src/parse-gram.y (%union): New field `character'.
849 (ID, ID_COLON): Now that the scanner no longer makes them
850 identifiers, adjust all uses to invoke symbol_get.
851 (id_colon): New, wraps the conversion from string to symbol.
852 (%union): Accept a possible union_name.
853 (symbol): Now can be a char.
854 * data/c.m4 (b4_union_name): Leave a default value.
855 * data/glr.c, data/yacc.c: Use it.
857 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
859 For associating token numbers with token names for "yacc.c", don't use
860 #define statements unless `--yacc' is specified; always use enum
861 yytokentype. Most important discussions start at:
862 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
863 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
865 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
866 * NEWS (2.3+): Mention.
867 * data/c.m4 (b4_yacc_if): New.
868 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
870 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
871 on token name definitions.
872 * src/getargs.c (usage): Capitalize `Yacc' in English.
873 * src/output.c (prepare): Define b4_yacc_flag.
874 * tests/regression.at (Early token definitions): Test that tokens names
875 are defined before the pre-prologue not just before the post-prologue.
876 Remove this test case and copy to...
877 (Early token definitions with --yacc): ... this to test #define's.
878 (Early token definitions without --yacc): ... and this to test enums.
880 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
882 * NEWS: Reword the post-2.3 change to not be so optimistic about
883 removing the old "look-ahead" spelling.
884 Update previous look-ahead/lookahead change reports.
885 * REFERENCES: look-ahead -> lookahead (since that's
886 what he actually wrote).
887 * doc/refcard.tex: look ahead -> lookahead,
888 look-ahead -> lookahead
890 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
892 For consistency, use `lookahead' instead of `look-ahead' or
893 `look_ahead'. Discussed starting at
894 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
896 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
897 * NEWS: For the next release, note the change to `--report'.
898 * TODO, doc/bison.1: Update English.
899 * doc/bison.texinfo: Update English.
900 (Understanding Your Parser, Bison Options): Document as
901 `--report=lookahead' rather than `--report=look-ahead'.
902 * src/conflicts.c: Update English in comments.
903 (lookahead_set): Rename from look_ahead_set.
904 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
905 (resolve_sr_conflict): Rename local look_ahead_tokens to
906 lookahead_tokens, and update other uses.
907 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
908 count_rr_conflicts, conflicts_free): Update uses.
909 * src/getargs.c (report_args): Move "lookahead" before alternate
911 (report_types): Update uses.
912 (usage): For `--report' usage description, state `lookahead' spelling
913 rather than `look-ahead'.
914 * src/getargs.h (report.report_lookahead_tokens): Rename from
915 report_look_ahead_tokens.
916 * src/lalr.c: Update English in comments.
917 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
918 (state_lookahead_tokens_count): Rename from
919 state_look_ahead_tokens_count.
920 Rename local n_look_ahead_tokens to n_lookahead_tokens.
921 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
922 Rename local n_look_ahead_tokens to n_lookahead_tokens.
924 Update English in output.
925 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
926 * src/print.c: Update English in comments.
927 (lookahead_set): Rename from look_ahead_set.
928 (print_reduction): Rename argument lookahead_token from
930 (print_core, state_default_rule, print_reductions, print_results):
932 * src/print_graph.c: Update English in comments.
933 (print_core): Update uses.
934 * src/state.c: Update English in comments.
935 (reductions_new): Update uses.
936 (state_rule_lookahead_tokens_print): Rename from
937 state_rule_look_ahead_tokens_print, and update other uses.
938 * src/state.h: Update English in comments.
939 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
940 (state_rule_lookahead_tokens_print): Rename from
941 state_rule_look_ahead_tokens_print.
942 * src/tables.c: Update English in comments.
943 (conflict_row, action_row): Update uses.
944 * tests/glr-regression.at
945 (Incorrect lookahead during deterministic GLR,
946 Incorrect lookahead during nondeterministic GLR): Rename
947 print_look_ahead to print_lookahead.
948 * tests/torture.at: Update English in comments.
949 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
950 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
951 (Many lookahead tokens): Update uses.
952 * data/glr.c: Update English in comments.
953 * lalr1.cc: Likewise.
955 * src/conflicts.h: Likewise.
956 * src/lalr.h: Likewise.
957 * src/main.c: Likewise.
958 * src/output.c: Likewise.
959 * src/parse-gram.c: Likewise.
960 * src/tables.h: Likewise.
961 * tests/calc.at: Likewise.
963 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
965 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
967 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
969 * TODO: Add request from Nelson H. F. Beebe to be able to install
970 Bison without installing the yacc script.
972 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
974 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
975 and yytext if they're already #define'd.
976 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
977 * src/scan-code-c.c: ... here.
978 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
981 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
983 Get Bison to build again when configured with --enable-gcc-warnings.
984 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
986 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
987 loc argument as it shadows a global.
988 * src/scan-gram.l: Remove stray comma that prevents boundary_set
991 * src/.cvsignore: Add scan-code.c.
993 2006-06-07 Akim Demaille <akim@epita.fr>
995 * src/scan-gram.l: Move the "add a trailing ; to actions" code
997 * src/scan-code.l: here.
998 * tests/input.at (Torturing the Scanner): Fix another location
1001 2006-06-07 Akim Demaille <akim@epita.fr>
1003 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
1005 2006-06-06 Akim Demaille <akim@epita.fr>
1007 Extract the parsing of user actions from the grammar scanner.
1008 As a consequence, the relation between the grammar scanner and
1009 parser is much simpler. We can also split "composite tokens" back
1011 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
1012 * src/scan-gram.l (add_column_width, adjust_location): Move to and
1014 * src/location.h, src/location.c (add_column_width)
1015 (location_compute): these.
1016 Fix the column count: the initial column is 0.
1017 (location_print): Be robust to ending column being 0.
1018 * src/location.h (boundary_set): New.
1019 * src/main.c: Adjust to scanner_free being renamed as
1021 * src/output.c: Include scan-code.h.
1022 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
1024 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
1025 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
1026 which is now, again, a separate token.
1027 Adjust all dependencies.
1028 Whereever actions with $ and @ are used, use translate_code.
1029 (action): Remove this nonterminal which is now useless.
1030 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
1031 (grammar_current_rule_action_append): Use translate_code.
1032 (packgram): Bound check ruleno, itemno, and rule_length.
1033 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
1034 (last_string, last_braced_code_loc, max_left_semantic_context)
1035 (scanner_initialize, scanner_free, scanner_last_string_free)
1036 (gram_out, gram_lineno, YY_DECL_): Move to...
1037 * src/scan-gram.h: this new file.
1038 (YY_DECL): Rename as...
1040 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
1041 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1042 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1043 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1044 Move these declarations, and...
1045 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
1047 * src/flex-scanner.h: this new file.
1048 * src/scan-gram.l (rule_length, rule_length_overflow)
1049 (increment_rule_length): Remove.
1050 (last_braced_code_loc): Rename as...
1051 (gram_last_braced_code_loc): this.
1052 Adjust to the changes of the parser.
1053 Move all the handling of $ and @ into...
1054 * src/scan-code.l: here.
1055 * src/scan-gram.l (handle_dollar, handle_at): Remove.
1056 (handle_action_dollar, handle_action_at): Move to...
1057 * src/scan-code.l: here.
1058 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
1059 scan-code.h, scan-code-c.c, scan-gram.h.
1060 (EXTRA_bison_SOURCES): Add scan-code.l.
1061 (BUILT_SOURCES): Add scan-code.c.
1062 (yacc): Be robust to white spaces.
1064 * tests/conflicts.at, tests/input.at, tests/reduce.at,
1065 * tests/regression.at: Adjust the column numbers.
1066 * tests/regression.at: Adjust the error message.
1068 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1070 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1071 Use Akim's wording from
1072 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
1074 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
1076 Between Bison releases, manually append `+' to the previous Bison
1077 release number, and use that as a signal to automatically print the
1078 ChangeLog's CVS Id keyword from --version. Discussed starting at
1079 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
1080 * ChangeLog: Add Id header.
1081 * configure.ac (AC_INIT): Append `+' to `2.3'.
1082 * src/.cvsignore: Add revision.c.
1083 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1084 (BUILT_SOURCES): Add revision.c.
1085 (revision.c): New target rule. This file defines a new global variable
1086 named revision. It initializes it with either the Id from ChangeLog
1087 or, if VERSION doesn't contain `+', with the empty string.
1088 * src/getargs.c (version): Print the value of revision.
1089 * src/revision.h: Extern revision.
1091 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1093 * NEWS: Version 2.3.
1094 * configure.ac (AC_INIT): Likewise.
1096 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1098 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1099 with no arguments, not as an object-like macro. This is for
1100 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1101 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1102 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1105 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1107 * src/getargs.c (usage): Back out yesterday's modification of the
1108 --help output so that we don't have to wait for translation before
1111 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1113 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1114 Problem reported by Akim Demaille.
1116 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1118 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1120 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1122 * data/yacc.c (yy_reduce_print): Omit trailing white space in
1123 generated source code. Problem reported by Frans Englich in
1124 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
1126 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1128 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
1129 shell, not within 'make', so that 'make' by an ordinary builder
1130 (using GNU make) does not worry about configuring gzip. This also
1131 works around a bug reported independently by Keith Thompson and by
1132 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
1133 stderr rather than stdout, messing up the build logs.
1135 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1137 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
1138 to make sure that YYID will never be unused. This fixes a 'make
1139 maintainer-check' failure caused by the recent changes to the 'Trivial
1140 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
1142 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
1144 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1146 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
1147 state before an empty RHS is always resolved here. Only the location
1148 of that state is guaranteed to be resolved, and that's enough. This
1149 fixes the remaining bug reported by Derek M. Jones in
1150 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1151 * tests/glr-regression.at (Uninitialized location when reporting
1152 ambiguity): Test the above case.
1153 Also, the embedded comments in this test case claim it checks the case
1154 of an empty RHS that has inherited the initial location. However, the
1155 corresponding LHS was already resolved, so yyresolveLocations didn't
1156 actually have reason to modify it. Fix this by forcing
1157 nondeterministic operation at the beginning of the parse.
1159 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
1161 * data/c.m4 (b4_yy_symbol_print_generate):
1162 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
1163 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
1164 of the bugs reported today by Derek M Jones in
1165 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1166 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
1167 defined to be a type name without parens or brackets.
1168 (Location Type): Similarly for YYLTYPE.
1169 * tests/regression.at (Trivial grammars): Put in a test for this
1170 bug that will be caught by 'make maintainer-check' (though not,
1171 alas, by 'make check' unless your compiler is picky).
1173 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1175 * NEWS: Version 2.2.
1176 * configure.ac (AC_INIT): Likewise.
1178 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
1180 * data/glr.c (yyreportTree): Make room in yystates for the state
1181 preceding the RHS. This fixes the segmentation fault reported by Derek
1183 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
1184 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
1185 to the user. Reported for yyreportTree by Derek M. Jones later in the
1187 * THANKS: Add Derek M. Jones.
1188 Update my email address.
1189 Fix typo in Steve Murphy's name.
1191 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
1193 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
1194 checking against YYLAST that caused the parser to miss a potential
1195 alternative in its diagnostic.
1196 Problem reported by Maria Jose Moron Fernandez in
1197 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
1198 * data/lalr1.cc (yysyntax_error_): Likewise.
1199 * data/yacc.c (yysyntax_error): Likewise.
1200 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
1201 tokens, in case we run into an older C compiler.
1202 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
1203 Use them to check for the off-by-one error fixed above.
1205 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
1206 YYSIZE_T, not size_t.
1207 * tests/regression.at (Trivial grammars): New test, to catch
1208 the error fixed by the above patch.
1210 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
1212 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
1214 Reported by Steve Murphy.
1216 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
1218 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
1219 * data/glr.cc: b4_location_flag is now b4_locations_flag.
1221 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
1223 Implement --trace=m4.
1224 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
1225 * src/output.c (output_skeleton): When set, pass -dV to m4.
1227 Factor the handling of flags in m4.
1228 * src/output.c (prepare): Rename the muscle names debug, defines,
1229 error_verbose to debug_flag, defines_flag, error_verbose_flag.
1230 * data/c.m4: Adjust.
1231 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
1232 Use b4_define_flag_if to define other b4_FLAG_if macros.
1233 (b4_location_if): As a consequence, rename as...
1234 (b4_locations_if): this, for consistency.
1235 Adjust all the skeletons.
1237 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
1239 * etc/bench.pm: Shorten bench names.
1241 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
1243 * src/output.h, src/output.c (error_verbose): Move to...
1244 * src/getargs.h, src/getargs.c: here.
1246 Adjust dependencies.
1248 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
1250 * data/c.m4 (b4_copyright): Put the special exception for Bison
1251 skeletons here, so we don't have to put it in each skeleton. All
1252 uses changed. Suggested by Akim Demaille. Also, wrap the
1253 copyright notice, in case it is longer than 80 columns. Replace
1254 comma by newline after title.
1256 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
1258 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
1259 incompatibility, not a bug. Mention that it wasn't fixed as of
1262 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
1264 * examples/extexi: Enforce the precedence of concatenation over
1266 Reported by Tommy Nordgren.
1268 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
1270 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
1271 with the member "token".
1272 Reported by Martin Nylin.
1274 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
1276 * data/glr.c: Switch to Bison 2.2 special-exception language in
1277 the copyright notice. Use more-regular format for titles and
1279 * data/glr.cc: Likewise.
1280 * data/location.cc: Likewise.
1281 * data/yacc.cc: Likewise.
1282 * doc/bison.texinfo (Conditions): Document this.
1283 * NEWS: likewise. Upgrade version to 2.2.
1285 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
1287 * data/glr.cc: Remove dead code.
1289 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1291 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
1292 that variable and the line breaks the bootstrap. Problem reported
1293 by Juan M. Guerrero.
1295 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
1297 * doc/bison.texinfo (Multiple start-symbols): New.
1299 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
1301 * etc/README, etc/bench.pl: New.
1303 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
1305 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
1307 Reported by Mickael Labau.
1308 * tests/input.at (Torturing the Scanner): Test it.
1310 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
1312 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
1313 Problem reported by Bob Rossi.
1315 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
1317 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
1318 and didn't really work.
1319 For the index, use @ifnotinfo, not @iftex.
1320 Minor cleanups of spacing and terminology.
1322 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
1324 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
1325 of AT_NAME_PREFIX when %name-prefix is not used.
1327 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
1329 Apply --prefix to C++ skeletons too: they change the namespace.
1330 The test suite already exercize these cases.
1331 * data/c++.m4 (b4_namespace): New.
1332 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
1333 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
1334 * data/yacc.c, data/glr.c: Remove a useless `[]'.
1335 * doc/bison.texinfo: Document it.
1336 (Option Cross Key): Use @multitable in all formats. It looks
1337 nicer, even in TeX outputs.
1338 (Rules): Use the same code whatever the output type is.
1339 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
1340 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
1341 * tests/calc.at: Use it, instead of hard coding `yy'.
1343 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
1345 * TODO: Remove dead items.
1347 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
1349 * doc/FAQ: Remove, merged into...
1350 * doc/bison.texinfo (FAQ): this.
1351 * doc/Makefile.am (EXTRA_DIST): Adjust.
1353 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
1355 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
1357 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
1358 * doc/bison.texinfo (Calc++ Scanner): Use it.
1360 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
1362 Fix two nits reported by twlevo, plus one more that I discovered.
1364 * src/assoc.h (assoc_to_string): Give a name to the arg, as
1365 this is the usual Bison style.
1366 * src/location.h (location_print): Likewise.
1368 * src/reader.h (token_name): Likewise.
1370 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
1372 Fix some nits reported by twlevo.
1373 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
1374 and "POSIX". Use more-modern syntax for URLs. Mention C++
1375 and ask for Java. Don't hardwire OS version numbers. Add
1377 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
1378 * src/conflicts.c (solved_conflicts_obstack): Now static.
1380 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1382 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
1383 page. Say "you can use it" not "you may use it" as on the web page;
1384 we're describing capabilities not granting permission.
1386 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
1388 * data/glr.c (yyresolveLocations): Rename local variables to avoid
1389 shadowing warnings. Use usual patter for iterating through RHS.
1390 * tests/glr-regression.at
1391 (Uninitialized location when reporting ambiguity):
1392 Modify yylex so that it uses its argument, rather than trying
1393 to rely on ARGSUSED (which doesn't work for gcc with warnings).
1394 const char -> char const.
1396 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
1397 Don't use tabs inside commands; it messes up 'ps'.
1398 Problem reported by twlevo.
1400 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
1402 * tests/glr-regression.at (Uninitialized location when reporting
1403 ambiguity): New test case.
1404 * data/glr.c (yyresolveLocations): New function, which uses
1406 (yyresolveValue): Invoke yyresolveLocations before reporting an
1408 * doc/bison.texinfo (Default Action for Locations): Note
1409 YYLLOC_DEFAULT's usage for ambiguity locations.
1410 (GLR Semantic Actions): Cross-reference those notes.
1412 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
1414 * tests/glr-regression.at (Leaked semantic values when reporting
1415 ambiguity): Remove unnecessary union and type declarations.
1416 (Leaked lookahead after nondeterministic parse syntax error): New test
1418 * data/glr.c (yyparse): Check for zero stacks remaining before
1419 attempting to shift the lookahead so that you don't lose it.
1421 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1423 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
1424 * tests/glr-regression.at (Leaked semantic values when reporting
1425 ambiguity): New test case.
1426 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
1427 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
1428 now unnecessary yystackp parameter.
1429 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
1430 destructors can be called.
1432 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
1433 in existing testcases.
1435 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1437 Don't leak semantic values for parent RHS when a user action cuts the
1438 parser, and clean up related code a bit.
1439 * tests/glr-regression.at (Leaked merged semantic value if user action
1440 cuts parse): Rename to...
1441 (Leaked semantic values if user action cuts parse): ... this. Add check
1442 for leaked parent RHS values.
1443 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
1444 between an unresolved state (non-empty chain of semantic options) and
1445 an incomplete one (signaled by an empty chain).
1446 (yyresolveStates): Document the interface. Move all manipulation of a
1447 successfully or unsuccessfully resolved yyGLRState to...
1448 (yyresolveValue): ... here so that yyresolveValue always leaves a
1449 yyGLRState with consistent data and thus is easier to understand.
1450 Remove the yyvalp and yylocp parameters since they are always just
1451 taken from the yys parameter. When reporting a discarded merged value
1452 in debugging output, note that it is incompletely merged. Document the
1454 (yyresolveAction): If resolving any of the RHS states fails, destroy
1455 them all rather than leaking them. Thus, as long as user actions are
1456 written to clean up the RHS correctly, yyresolveAction always cleans up
1457 the RHS of a semantic option. Document the interface.
1459 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
1461 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
1462 led to a segmentation fault in GNU Pascal. Problem reported
1465 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
1467 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
1468 mid-rule action inside a nonterminal symbol in order to declare a
1469 destructor for its semantic value.
1471 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
1473 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
1474 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
1475 __cplusplus && ! defined _STDLIB_H && !
1476 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
1477 defined free))]: Include <stdlib.h> rather than rolling our own
1478 declarations of malloc and free, to avoid problems with
1479 incompatible declarations (using 'throw') C++'s stdlib.h. This
1480 should fix Debian bug 340012
1481 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
1482 reported by Guillaume Melquiond.
1484 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
1486 * NEWS: Clarify symbols versus types in unused-value warnings.
1488 * configure.ac (AC_INIT): Bump version number.
1490 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
1492 * NEWS: Version 2.1a.
1493 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
1494 since C99 requires this.
1496 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
1498 * m4/c-working.m4: New file.
1499 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
1501 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
1503 * Makefile.maint: Merge from coreutils.
1505 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
1507 More portability fixes for problems summarized by Nelson H. F. Beebe.
1509 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
1510 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
1511 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
1512 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
1513 messes up because C++ code is compiled in 32-bit mode but linked
1516 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
1518 More portability fixes for problems summarized by Nelson H. F. Beebe.
1520 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
1521 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
1523 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
1524 nodist_PROGRAMS, since we don't need to actually compile the
1525 example if we're just doing a plain 'make'. This avoids bothering
1526 the installer unnecessarily about problems due to weird C++
1529 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
1531 More portability fixes for problems summarized by Nelson H. F. Beebe.
1533 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
1534 than #include "...", and compile with -I'.'. The old method was
1535 not portable, according to Posix and the C standard, and it does
1536 not work with Sun C 5.7, where previous #line directives affect
1537 the working directory used in later #include "..." directives.
1539 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1541 Various DJGGP specific issues in /djgpp
1543 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
1545 More portability fixes for problems summarized by Nelson H. F. Beebe.
1547 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
1548 '#include <map>' works and that you can apply ++ to iterators.
1550 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
1552 Work around portability problems summarized by Nelson H. F. Beebe in
1553 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
1555 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
1556 that '#include <string>' works.
1558 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
1559 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
1560 "warning: sorry: semantics of inline function static data `const
1561 unsigned char translate_table[262]' are wrong (you'll wind up with
1564 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
1565 or, xor to not_, and_, or_, and xor_, respectively. This works
1566 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
1567 random system header somewhere that includes the equivalent of
1570 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
1571 -E" works; it apparently doesn't work with PathScale EKO Compiler
1574 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
1576 During deterministic GLR operation, user actions should be able to
1577 influence the parse by changing yychar. To make this easier to fix and
1578 to make glr.c easier to evolve in general, don't maintain yytoken in
1579 parallel with yychar; just compute yytoken when needed.
1580 * tests/glr-regression.at (Incorrect lookahead during deterministic
1581 GLR): Check that setting yychar in a user action has the intended
1583 * data/glr.c (yyGLRStack): Remove yytokenp member.
1584 (yyclearin): Don't set *yytokenp.
1585 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
1586 yychar rather than *yytokenp to determine the current lookahead.
1587 Compute yytoken locally when needed.
1588 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
1591 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
1592 after `--report' documentation.
1594 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
1596 * src/parse-gram.y (grammar_declaration): Location of printer
1597 symbol is @1, not list->location. Bug reported by twlevo.
1598 * tests/input.at (Incompatible Aliases): Adjust to above change.
1600 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
1602 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
1603 all the test at once. This makes the output easier to read in the
1606 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
1607 got from <http://bro-ids.org/download.html>. The bug is that
1608 when two actions appeared in succession, the second one was
1609 scanned before the first one was added to the grammar rule
1610 as a midrule action. Bison then output the incorrect warning
1611 "parse.y:905.17-906.36: warning: unused value: $3".
1612 * src/parse-gram.y (BRACED_CODE, action): These are no longer
1613 associated with a value.
1614 (rhs): Don't invoke grammar_current_rule_action_append.
1615 (action): Invoke it here instead.
1616 * src/reader.c (grammar_midrule_action): Now extern.
1617 (grammar_current_rule_action_append): Don't invoke
1618 grammar_midrule_action; that is now the scanner's job.
1619 * src/reader.h (last_string, last_braced_code_loc):
1620 (grammar_midrule_action): New decls.
1621 * src/scan-gram.l (last_string): Now extern, sigh.
1622 (last_braced_code_loc): New extern variable.
1623 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
1624 rule already has an action.
1625 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
1626 * tests/input.at (AT_CHECK_UNUSED_VALUES):
1627 Add some tests to check that the above changes fixed the bug.
1629 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
1631 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
1632 All used changed. Check whether the symbol has a destructor,
1633 not whether it is typed.
1634 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
1635 that the values are still reported as unused. All line numbers
1638 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
1640 Work around a bug in bro 0.8, which underparenthesizes its
1641 definition of YYLLOC_DEFAULT.
1642 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
1644 * data/lalr1.cc: Likewise.
1645 * data/yacc.cc: Likewise.
1647 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
1649 Work around a bug in Pike 7.0, and give the Pike folks a
1650 better way to override the usual int widths.
1651 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
1652 user can override the types.
1653 (short): #undef, to work around a bug in Pike 7.0.
1654 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
1655 (union yyalloc.yyss): Use yytype_int16 rather than short.
1657 (yysigned_char): Remove.
1658 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
1659 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
1660 * tests/regression.at (Web2c Actions): Adjust to above changes.
1662 * src/reader.c (check_and_convert_grammar): New function.
1663 (reader): Close the input file even if something went wrong during
1664 parsing. Minor file descriptor leak reported by twlevo.
1666 * src/assoc.c (assoc_to_string): Use a default: abort (); case
1667 to pacify gcc -Wswitch-default.
1668 * src/scan-gram.l (adjust_location): Use a default: break; case
1669 to pacify gcc -Wswitch-default.
1670 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
1671 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
1672 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
1673 Move these decls to scan-skel.l, since they don't need to be
1675 * src/scan-skel.l: Accept the above decls.
1676 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
1679 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
1681 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
1682 since we don't want to insist on a version number at the start
1683 of the changelog every time.
1684 * Makefile.maint: Sync from coreutils a bit better.
1685 (sc_trailing_blank): Renamed from sc_trailing_space.
1687 (sc_no_if_have_config_h, sc_require_config_h):
1688 (sc_prohibit_assert_without_use): New rules.
1689 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
1690 (sc_dd_max_sym_length): Fix leading spaces in rule.
1691 (sc_system_h_headers): Prefix with @.
1692 (sc_useless_cpp_parens, m4-check): Output line numbers.
1693 (changelog-check): Allow version only in head.
1694 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
1695 satisfy new Makefile.maint rule.
1696 * data/glr.c: Likewise.
1697 * data/glr.cc: Likewise.
1698 * data/lalr1.cc: Likewise.
1699 * data/yacc.c: Likewise.
1700 * lib/ebitsetv.c: Likewise.
1701 * lib/lbitset.c: Likewise.
1702 * lib/subpipe.c: Likewise.
1703 * lib/timevar.c: Likewise.
1704 * src/system.h: Likewise.
1705 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
1706 * djgpp/Makefile.maint: Add copyright notice.
1707 * djgpp/README.in: Likewise.
1708 * djgpp/config.bat: Likewise.
1709 * djgpp/config.site: Likewise.
1710 * djgpp/config_h.sed: Likewise.
1711 * djgpp/djunpack.bat: Likewise.
1712 * djgpp/config.sed: Fix copyright notice to match standard format.
1713 * djgpp/subpipe.h: Likewise.
1714 * lib/bitsetv-print.c: Likewise.
1715 * lib/bitsetv.c: Likewise.
1716 * lib/subpipe.h: Likewise.
1717 * lib/timevar.c: Likewise.
1718 * lib/timevar.h: Likewise.
1719 * djgpp/subpipe.c: Use standard recipe for config.h.
1720 * lib/abitset.c: Likewise.
1721 * lib/bitset.c: Likewise.
1722 * lib/bitset_stats.c: Likewise.
1723 * lib/bitsetv-print.c: Likewise.
1724 * lib/bitsetv.c: Likewise.
1725 * lib/ebitsetv.c: Likewise.
1726 * lib/get-errno.c: Likewise.
1727 * lib/lbitset.c: Likewise.
1728 * lib/subpipe.c: Likewise.
1729 * lib/timevar.c: Likewise.
1730 * lib/vbitset.c: Likewise.
1731 * tests/local.at: Likewise.
1732 * src/scan-gram.l: Don't include verify.h, since system.h does
1734 * .x-sc_require_config_h: New file.
1735 * .x-sc_unmarked_diagnostics: New file.
1737 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
1739 Be a bit more systematic about using 'abort'.
1740 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
1741 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
1742 Put 'default: abort ();' before some other case, to satisfy older
1744 * lib/bitset_stats.c (bitset_stats_init): Likewise.
1745 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
1746 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
1747 * src/conflicts.c (resolve_sr_conflict): Likewise.
1748 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
1749 (get_decision_str, get_orientation_str, get_node_alignment_str):
1750 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
1751 (get_linestyle_str, get_arrowstyle_str): Likewise.
1752 * src/conflicts.c (resolve_sr_conflict):
1753 Use a default case rather than one for the one remaining enum
1754 value, to catch invalid enum values as well.
1755 * src/lalr.c (set_goto_map, map_goto):
1756 Prefer "assert (FOO);" to "if (!FOO) abort ();".
1757 * src/nullable.c (nullable_compute, token_definitions_output):
1759 * src/reader.c (packgram, reader): Likewise.
1760 * src/state.c (transitions_to, state_new, state_reduction_find):
1762 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
1763 (symbol_pack): Likewise.
1764 * src/tables.c (conflict_row, pack_vector): Likewise.
1765 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
1766 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
1767 * src/system.h: Don't include <assert.h>.
1768 (assert): New macro.
1770 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
1771 (Destructor Decl, Parser Function, Pure Calling):
1772 Describe rules for braces inside C code more carefully.
1774 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
1776 Fix some porting glitches found by Nelson H. F. Beebe.
1777 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
1778 compilers that don't understand that abort () does not return.
1779 * src/state.c (transitions_to): Likewise.
1780 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
1781 that '#include <cstdlib>' works.
1782 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
1783 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
1784 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
1785 for the benefit of some pre-C99 compilers.
1787 * bootstrap: Undo changes to gnulib files that autoreconf made.
1789 Minor fixups to get 'make maintainer-check' to work.
1790 * configure.ac: Don't use -Wnested-externs, as it's incompatible
1791 with the new verify.h implementation.
1792 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
1793 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
1794 * data/yacc.c (YYUSE): Likewise.
1795 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
1796 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
1797 * src/parse-gram.y (declaration): Don't pass a string constant
1798 to a function that expects char *, since GCC might complain
1799 about the constant value.
1800 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
1801 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
1802 before #defining them.
1803 * tests/glr-regression.at
1804 (Incorrectly initialized location for empty right-hand side in GLR):
1805 In yyerror, use the msg arg.
1806 (Corrupted semantic options if user action cuts parse):
1807 (Incorrect lookahead during deterministic GLR):
1808 (Incorrect lookahead during nondeterministic GLR):
1809 Don't name a local var 'index'; it shadows string.h's 'index'.
1811 2006-01-19 Akim Demaille <akim@epita.fr>
1813 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
1814 location, not just parts of it.
1816 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
1818 * NEWS: Document the fact that multiple %unions are now allowed.
1819 * doc/bison.texinfo (Union Decl): Likewise.
1820 * TODO: This feature is now implemented, so remove it from
1823 * Makefile.maint: Merge with coreutils Makefile.maint.
1824 (CVS_LIST): Use build-aux version if available.
1825 (VERSION_REGEXP): New macro.
1826 (syntax-check-rules): Add sc_no_if_have_config_h,
1827 sc_prohibit_assert_without_use, sc_require_config_h,
1828 sc_useless_cpp_parens.
1829 (sc_obsolete_symbols): Check for O_NDELAY.
1830 (sc_dd_max_sym_length): Track coreutils.
1831 (sc_unmarked_diagnostics): Look in all files, not just *.c.
1832 (sc_useless_cpp_parens): New rule.
1833 (news-date-check): Look for version or today's date.
1834 (changelog-check): Don't require version number near head.
1835 (copyright-check): Use current year instead of hardwiring 2005.
1836 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
1837 (announcement): Add --gpg-key-ID.
1839 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
1842 Avoid undefined behavior that addressed just before the start of an
1843 array. Problem reported by twlevo.
1844 * src/reader.c (packgram): Prepend a new sentinel before ritem.
1845 * src/lalr.c (build_relations): Rely on new sentinel.
1846 * src/gram.c (gram_free): Adjust to new sentinel.
1848 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
1850 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
1851 yylookaheadNeeds. All uses updated.
1852 (yysplitStack): Rename local yynewLookaheadStatuses to
1853 yynewLookaheadNeeds.
1854 * data/glr-regression.at (Incorrect lookahead during nondeterministic
1855 GLR): In comments, change `lookahead status' to `lookahead need'.
1857 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
1859 * data/glr.c (yysplitStack): A little stylistic rewrite.
1861 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
1863 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
1865 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
1867 * doc/bison.texinfo: Fix some typos.
1868 (GLR Semantic Actions): New subsection discussing special
1869 considerations because GLR semantic actions might be deferred.
1870 (Actions): Mention look-ahead usage of yylval.
1871 (Actions and Locations): Mention look-ahead usage of yylloc.
1872 (Special Features for Use in Actions): Add YYEOF entry and mention it
1873 in the yychar entry.
1874 In the yychar entry, remove mention of the local yychar case (pure
1875 parser) since this is irrelevant information when writing semantic
1876 actions and since it's already discussed in `Bison Symbols' where
1877 yychar is otherwise described as an external variable.
1878 In the yychar entry, don't call it the `current' look-ahead since it
1879 isn't when semantic actions are deferred.
1880 In the yychar and yyclearin entries, add note about deferred semantic
1882 Add yylloc and yylval entries discussing look-ahead usage.
1883 (Look-Ahead Tokens): When discussing yychar, don't call it the
1884 `current' look-ahead, and do mention yylval and yylloc.
1885 (Error Recovery): Cross-reference `Action Features' when mentioning
1887 (Bison Symbols): In the yychar entry, don't call it the `current'
1889 In the yylloc and yylval entries, mention look-ahead usage.
1891 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1893 * tests/glr-regression.at: Update copyright year to 2006.
1895 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1897 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
1898 use during nondeterministic operation to track which stacks have
1899 actually needed the current lookahead.
1900 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
1901 Allocate, deallocate, resize, and otherwise shuffle space for
1902 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
1903 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
1904 appropriately during nondeterministic operation.
1905 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
1906 members to store the current lookahead to be used by the deferred
1908 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
1909 from which the RHS is taken. Set the lookahead members of the new
1910 yySemanticOption according to the lookahead status for stack yyk.
1911 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
1912 yyaddDeferredAction.
1913 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
1914 members of yySemanticOption before invoking yyuserAction, and then set
1915 them back to their current values afterward.
1916 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
1917 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
1918 * tests/glr-regression.at: Remove `.' from the ends of recent test case
1919 titles for consistency.
1920 (Leaked merged semantic value if user action cuts parse): In order to
1921 suppress lint warnings, use arguments in merge function, and assign
1922 char value < 128 in main.
1923 (Incorrect lookahead during deterministic GLR): New test case.
1924 (Incorrect lookahead during nondeterministic GLR): New test case.
1926 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1928 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
1929 !yyvaluep as signal that no semantic value is available to print.
1930 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
1931 to print a semantic value.
1933 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1935 * tests/glr-regression.at: For consistency with my newer test cases,
1938 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1940 * data/glr.c (yyresolveValue): When merging semantic options, if at
1941 least one user action succeeds but a later one cuts the parse, then
1942 destroy the semantic value before returning rather than leaking it.
1943 (yyresolveStates): If a user action cuts the parse and thus
1944 yyresolveValue fails, ignore the (unset) semantic value rather than
1945 corrupting the yyGLRState, and empty the semantic options list since
1946 the user actions should have called all necessary destructors.
1947 Simplify code with YYCHK.
1948 * tests/glr-regression.at (Corrupted semantic options if user action
1949 cuts parse): New test case.
1950 (Undesirable destructors if user action cuts parse): New test case.
1951 Before applying any of this patch, this test case never actually failed
1952 for me... but only because the corrupted semantic options usually
1954 (Leaked merged semantic value if user action cuts parse): New test
1957 2006-01-05 Akim Demaille <akim@epita.fr>
1959 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
1961 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
1963 * data/c.m4 (b4_c_modern): New macro, with a new provision for
1964 _MSC_VER. Problem reported by Cenzato Marco.
1965 (b4_c_function_def): Use it.
1966 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
1968 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
1969 than rolling our own.
1971 2006-01-04 Akim Demaille <akim@epita.fr>
1973 Also warn about non-used mid-rule values.
1974 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
1976 (symbol_list_new): Adjust.
1977 * src/reader.c (symbol_typed_p): New.
1978 (grammar_rule_check): Use it.
1979 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
1981 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
1983 * tests/actions.at (Exotic Dollars): Adjust.
1985 2006-01-04 Akim Demaille <akim@epita.fr>
1987 * src/reader.c (grammar_midrule_action): If $$ is set in a
1988 mid-rule, move the `used' bit to its lhs.
1989 * tests/input.at (Unused values): New.
1990 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
1992 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
1994 * doc/bison.texinfo (Bison Options): Say more accurately what
1996 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
1997 about declarations in the grammar when in Yacc mode, as POSIX does
1998 not require a diagnostic when the grammar uses extensions.
2000 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
2002 Warn about dubious constructions like "%token T T".
2004 * src/symtab.h (struct symbol.declared): New member.
2005 * src/symtab.c (symbol_new): Initialize it to false.
2006 (symbol_class_set): New arg DECLARING, specifying whether
2007 this is a declaration that we want to warn about, if there
2008 is more than one of them. All uses changed.
2010 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
2011 Allow multiple %union directives, whose contents concatenate.
2012 * src/parse-gram.y (grammar_declaration): Likewise.
2013 Use muscle_code_grow, so that we don't need stype_line any more.
2016 * src/muscle_tab.c (muscle_grow): Fix comment.
2018 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
2019 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
2020 Update copyright year to 2006.
2022 2006-01-03 Akim Demaille <akim@epita.fr>
2024 Have glr.cc pass (some of) the calc.at tests.
2025 * data/glr.cc (b4_parse_param_orig): New.
2026 (b4_parse_param): Improve its definition, and bound it more
2027 clearly in the skeleton.
2028 (b4_epilogue): Append, instead of prepending, in order to keep
2030 Simplify the generation of auxiliary functions: locations and
2031 purity are mandated.
2032 (b4_global_tokens_and_yystype): Honor it.
2033 * data/location.cc (c++.m4): Don't include it.
2034 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
2036 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
2038 Be sure to initialize the first position's filename.
2039 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
2041 (AT_CHECK_CALC_GLR_CC): New.
2042 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
2044 2006-01-02 Akim Demaille <akim@epita.fr>
2046 * src/output.c (output_skeleton): Don't hard wire the inclusion of
2048 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
2049 * data/glr.cc: Do not include stack.hh.
2051 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2053 * data/glr.c: Reformat whitespace with tabs.
2054 (b4_lpure_formals): Remove this unused m4 macro.
2055 * tests/cxx-type.at: Reformat whitespace with tabs.
2056 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
2057 since it's a member. Rename type to isNterm for clarity.
2059 2005-12-29 Akim <akim@sulaco.local>
2061 Let glr.cc catch up with symbol_value_print.
2062 * data/glr.cc (b4_yysymprint_generate): Replace by...
2063 (b4_yy_symbol_print_generate): this.
2064 (yy_symbol_print, yy_symbol_value_print): Declare them.
2066 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
2068 * src/location.h (boundary): Note that a line or column equal
2069 to INT_MAX indicates an overflow.
2070 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
2071 (rule_length_overflow, increment_rule_length, add_column_width):
2073 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
2074 (<SC_BRACED_CODE>"}"):
2075 Use increment_rule_length rather than incrementing it by hand.
2076 (adjust_location, handle_syncline): Diagnose overflow.
2077 (handle_action_dollar, handle_action_at):
2078 Fix bug with monstrosities like $-2147483648.
2079 Remove now-unnecessary checks.
2080 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2081 (convert_ucn_to_byte): Verify assumptions.
2082 (handle_syncline): New arg LOC. All callers changed.
2083 Don't store through a value derived from char const * pointer.
2085 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2088 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2090 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2091 Remove unnecessary forward static decls.
2093 2005-12-27 Akim Demaille <akim@epita.fr>
2095 * src/reader.c (grammar_current_rule_check): Also check that $$
2097 Take the rule to check as argument, hence rename as...
2098 (grammar_rule_check): this.
2099 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2101 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2102 (grammar_midrule_action, grammar_symbol_append): Now static.
2103 * tests/torture.at (input): Don't rely on the default action
2104 being always performed.
2105 * tests/calc.at: "Set" $$ even when the action is "cut" with
2107 * tests/actions.at (Exotic Dollars): Instead of using unused
2108 values, check that the warning is issued.
2110 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2112 * NEWS: Improve wording for unused-value warnings.
2114 2005-12-22 Akim Demaille <akim@epita.fr>
2116 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2117 (b4_yysymprint_generate): Rename as...
2118 (b4_yy_symbol_print_generate): this.
2119 Generate yy_symbol_print instead of yysymprint.
2120 Generate also yy_symbol_value_print, and use it.
2122 2005-12-22 Akim Demaille <akim@epita.fr>
2124 * NEWS: Warn about unused values.
2125 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2127 (symbol_list_n_get, symbol_list_n_used_set): New.
2128 (symbol_list_n_type_name_get): Use symbol_list_n_get.
2129 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
2130 * src/reader.c (grammar_current_rule_check): Check that values are
2132 * src/symtab.c (symbol_print): Accept 0.
2133 * tests/existing.at: Remove the type information.
2135 Remove useless actions (beware of mid-rule actions: perl -000
2136 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
2137 * tests/actions.at (Exotic Dollars): Use unused values.
2138 * tests/calc.at: Likewise.
2139 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2142 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
2145 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
2147 Undo 2005-12-01 tentative license wording change. The wording is
2148 still being reviewed by the lawyers, and we don't want to wait for
2149 them before publishing a test release. For now, revert to the
2151 * NEWS: Undo 2005-12-01 change.
2152 * data/glr.c: Revert to previous license wording.
2153 * data/glr.cc: Likewise.
2154 * data/lalr1.cc: Likewise.
2155 * data/location.cc: Likewise.
2156 * data/yacc.c: Likewise.
2158 * NEWS: Reword %destructor vs YYABORT etc.
2159 * data/glr.c: Use American spacing, for consistency.
2160 * data/glr.cc: Likewise.
2161 * data/lalr1.cc: Likewise.
2162 * data/yacc.c: Likewise.
2163 * data/yacc.c: Reformat comments slightly.
2164 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
2165 for consistency. Fix some spelling errors and reword recently-included
2167 * tests/cxx-type.at: Cast results of malloc, for C++.
2169 2005-12-21 Joel E. Denny <address@hidden>
2171 * tests/cxx-type.at: Construct a tree, count the parents of shared
2172 nodes, and free each node once and only once. Previously, the memory
2173 for semantic values was leaked instead.
2175 2005-12-21 Joel E. Denny <address@hidden>
2177 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
2178 (yylval, yylloc): If pure, #define to yystackp->yyval and
2179 yystackp->yyloc similar to yychar and yynerrs.
2180 (yyparse): If pure, remove local yylval and yylloc. Add local
2181 yystackp to accommodate pure definitions of yylval and yylloc.
2182 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
2183 yylvalp and yyllocp to &yylval and &yylloc.
2184 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
2185 namespace. Previously, nerrs and char were missing, but lval and lloc
2187 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
2188 yylvalp and yyllocp parameters since, if pure, these are now always
2189 accessible through yystackp. If not pure, they are still accessible
2191 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
2192 `if (YYID (N))' to pacify lint.
2194 2005-12-21 Akim Demaille <akim@epita.fr>
2196 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
2197 destroy the RHS symbols of a rule.
2198 * data/yacc.c (yylen): Initialize to 0.
2199 Keep its value to the number of items to possibly shift.
2200 In particular, a regular successful parse that ends on YYFINAL by
2201 a (internal) YYACCEPT must not have yylen != 0.
2202 (yyerrorlab, yyreturn): Pop the RHS.
2203 Reorder a bit to emphasize the `shifting' bits of code.
2204 (YYPOPSTACK): Now accept a number of items to pop.
2205 * data/lalr1.cc: Likewise.
2206 * data/glr.c: Formatting changes.
2207 Use goto instead of fall through.
2208 * doc/bison.texinfo (Destructor Decl): Complete.
2210 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2212 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
2213 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
2214 * djgpp/config.bat: Replace every occurence of the file name
2215 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
2216 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
2217 * djgpp/config.sed: Replace every occurence of the file name
2218 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
2219 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
2220 * djgpp/djunpack.bat: DJGPP specific file.
2221 * djgpp/fnchange.lst: DJGPP specific file.
2222 * djgpp/README.in: Add new information about how to unpack the bison
2223 source on MSDOS and other systems which have 8.3 file name restrictions
2224 using djunpack.bat and fnchange.lst.
2226 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
2228 * bootstrap (build_cvs_prefix): Remove; unused.
2229 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
2230 when getting gnulib.
2232 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
2234 * data/glr.c: Reorder typedef declarations for structs to match order
2235 of struct declarations.
2236 Rename yystack everywhere to yystackp except in yyparse where it's not
2238 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
2240 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
2241 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
2242 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
2245 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
2247 * tests/sets.at (Accept): Fix typos in regular expression used to
2248 sed out the final state number.
2250 Work around portability problem on Solaris 10: flex-generated
2251 files include <stdio.h> before <config.h>, which messes up
2252 because the latter defines __EXTENSIONS__. Address the problem
2253 by creating two new little files that include <config.h> first,
2254 then include the flex-generated files. Rewrite everyone else
2255 to include <config.h> first, as well.
2256 * lib/timevar.c: Always include "config.h".
2257 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
2258 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
2259 (EXTRA_bison_SOURCES): New macro.
2260 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
2261 * src/system.h: Don't include config.h.
2262 * src/LR0.c: Include <config.h> first.
2263 * src/assoc.c: Likewise.
2264 * src/closure.c: Likewise.
2265 * src/complain.c: Likewise.
2266 * src/conflicts.c: Likewise.
2267 * src/derives.c: Likewise.
2268 * src/files.c: Likewise.
2269 * src/getargs.c: Likewise.
2270 * src/gram.c: Likewise.
2271 * src/lalr.c: Likewise.
2272 * src/location.c: Likewise.
2273 * src/main.c: Likewise.
2274 * src/muscle_tab.c: Likewise.
2275 * src/nullable.c: Likewise.
2276 * src/output.c: Likewise.
2277 * src/parse-gram.y: Likewise.
2278 * src/print.c: Likewise.
2279 * src/print_graph.c: Likewise.
2280 * src/reader.c: Likewise.
2281 * src/reduce.c: Likewise.
2282 * src/relation.c: Likewise.
2283 * src/state.c: Likewise.
2284 * src/symlist.c: Likewise.
2285 * src/symtab.c: Likewise.
2286 * src/tables.c: Likewise.
2287 * src/uniqstr.c: Likewise.
2288 * src/vcg.c: Likewise.
2290 * src/parse-gram.y: Fix minor problems uncovered by lint.
2291 (current_lhs, current_lhs_location): Now static.
2292 (current_assoc): Remove unused variable.
2294 Cleanups so that Bison-generated parsers have less lint.
2295 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
2296 Prepend /*ARGSUSED*/, for lint's sake.
2297 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
2298 definition if 'lint' is defined.
2299 (YYID): New macro (or function, if lint).
2300 All uses of /*CONSTCOND*/0 replaced by YYID(0).
2301 * data/yacc.c: Likewise.
2302 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
2303 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
2304 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
2306 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
2307 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
2308 Use YYID(0) rather than 0, for lint.
2309 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
2310 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
2312 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2314 * tests/glr-regression.at
2315 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
2316 Close memory leak reported by twlevo.
2318 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
2320 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
2322 (yyparse): Iterate another stack in order to call user destructors.
2323 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2325 (Duplicated user destructor for lookahead): This test now is expected
2328 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
2330 * NEWS: Document the following change.
2331 * data/yacc.c: Say "parser skeleton" rather than "file", since
2332 it's no longer just a file.
2333 * data/glr.c: Grant a special exception for C GLR parsers, that
2334 reads like the already-existing exception for C LALR(1) parsers.
2335 * data/glr.cc: Likewise.
2336 * data/lalr1.cc: Likewise.
2337 * data/location.cc: Likewise.
2338 * data/yacc.c: Reword the "written by" statement to clarify that
2339 it was the parser skeleton, not the entire output file.
2340 * data/glr.c: Written by Paul Hilfinger.
2341 * data/glr.cc: Written by Akim Demaille.
2342 * data/lalr1.cc: Likewise.
2344 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
2346 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
2347 Fix typos in previous change that broke 'make check'.
2348 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
2350 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
2351 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
2352 We can revert this once things settle down.
2354 * src/conflicts.c (conflicts_print): Don't print file name twice
2355 when %expect fails because there were no conflicts.
2356 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
2358 * tests/conflicts.at (%expect not enough, %expect too much):
2359 (%expect with reduce conflicts): Adjust to new behavior.
2361 2005-11-18 Akim Demaille <akim@epita.fr>
2363 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
2365 * NEWS: Document this.
2366 * doc/bison.texinfo (Expect Decl): Likewise.
2368 2005-11-16 Akim Demaille <akim@epita.fr>
2370 Generalize the display of semantic values and locations in traces.
2371 * data/glr.c (yy_reduce_print): Fix indices (again).
2372 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
2374 * data/lalr1.cc (yyreduce_print): Rename as...
2375 (yy_reduce_print): this.
2376 Display values and locations.
2377 * data/yacc.c (yy_reduce_print): Likewise.
2378 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
2379 (yysymprint): Move higher to be visible from yy_reduce_print).
2381 * tests/calc.at: Adjust the expected length of the traces.
2383 2005-11-14 Akim Demaille <akim@epita.fr>
2385 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
2386 from 1 to N, while values and location start at 0.
2387 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
2389 2005-11-14 Akim Demaille <akim@epita.fr>
2391 * data/glr.c (yy_reduce_print): Fix the $ number.
2393 2005-11-14 Akim Demaille <akim@epita.fr>
2395 "Use" parse parameters.
2396 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
2397 * data/glr.c, data/glr.cc: Use them.
2398 * data/glr.c (YYUSE): Have a C++ definition that supports
2401 2005-11-14 Akim Demaille <akim@epita.fr>
2403 * data/glr.c (yyexpandGLRStack): Declare only if defined.
2405 2005-11-14 Akim Demaille <akim@epita.fr>
2408 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
2410 2005-11-12 Akim Demaille <akim@epita.fr>
2412 Let position and location be PODs.
2413 * data/location.cc (position::initialize, location::initialize): New.
2414 (position::position, location::location): Define only if
2415 b4_location_constructors is defined.
2416 * data/lalr1.cc (b4_location_constructors): Define it for backward
2418 * doc/bison.texinfo (Initial Action Decl): Use initialize.
2420 2005-11-12 Akim Demaille <akim@epita.fr>
2422 * data/lalr1.cc: Move the body of the ctor and dtor into the
2423 parser file (instead of the header).
2424 Wrap the implementations in a "namespace yy".
2426 2005-11-12 Akim Demaille <akim@epita.fr>
2428 Have glr.c include its header file when created.
2429 * data/glr.c (b4_shared_declarations): New.
2430 Output them verbatim in the parser if !%defines, otherwise
2431 output then in the header file, and include it instead.
2433 2005-11-11 Akim Demaille <akim@epita.fr>
2435 * data/glr.c: Comment changes.
2437 2005-11-11 Akim Demaille <akim@epita.fr>
2439 When yydebug, report semantic and location values for reductions.
2440 * data/glr.c (yy_reduce_print): Report the semantic values and the
2442 (YY_REDUCE_PRINT): Adjust.
2443 (yyglrReduce): Use them.
2444 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
2445 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
2446 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
2449 2005-11-10 Akim Demaille <akim@epita.fr>
2451 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
2452 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
2453 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
2455 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
2457 * m4/cxx.m4, examples/Makefile.am: Don't build
2458 examples/calc++ if no C++ compiler is available. (trivial change)
2460 2005-11-09 Akim Demaille <akim@epita.fr>
2462 * src/scan-skel.l: Use a couple of asserts.
2464 2005-11-03 Akim Demaille <akim@epita.fr>
2466 In some (weird) cases, the final state number is incorrect.
2467 Reported by Alexandre Duret-Lutz.
2468 * src/LR0.c (state_list_append): Remove the computation of
2470 (save_reductions): Do it here.
2471 (get_state): Alpha conversion.
2472 (generate_states): Use a for loop.
2473 * src/gram.h (item_number_is_rule_number)
2474 (item_number_is_symbol_number): New.
2475 * src/state.c: Use assert.
2476 * src/system.h: Include assert.h.
2477 * tests/sets.at (Accept): New.
2479 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2481 * data/glr.c (yyfill): Adjust comment.
2482 (yyresolveAction): Initialize default location properly
2483 for empty right-hand sides.
2484 (yydoAction): Ditto.
2485 Add comment explaining apparently dead code.
2486 * tests/glr-regression.at
2487 (Incorrectly initialized location for empty right-hand side in GLR):
2490 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2492 * bootstrap (cleanup_gnulib): New function. Use it to clean up
2493 gnulib when interrupted. This fixes some race conditions and
2494 works around some portability problems (one noted by Paul
2497 2005-10-22 Akim <akim@epita.fr>
2499 * Makefile.cfg: Adjust to config -> build-aux.
2502 2005-10-21 Akim Demaille <akim@epita.fr>
2504 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
2506 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
2507 * data/yacc.c (b4_Pure_if): Rename as...
2508 (b4_yacc_pure_if): this.
2509 (YY_SYMBOL_PRINT, yyparse): Adjust.
2510 * doc/bison.texinfo: Formatting changes.
2512 2005-10-21 Akim Demaille <akim@epita.fr>
2514 Finish the transition config -> build-aux.
2515 * configure.ac, Makefile.am: Use build-aux.
2516 * config/prev-version, config/announce-gen, config/Makefile.am:
2518 * build-aux/prev-version, build-aux/announce-gen,
2519 * build-aux/Makefile.am: here.
2521 2005-10-14 Akim Demaille <akim@epita.fr>
2523 * examples/calc++/test: Use set -x only when VERBOSE.
2525 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2527 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
2528 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
2530 2005-10-13 Akim Demaille <akim@epita.fr>
2532 * src/scan-skel.l: Output the base name parts of the parser and
2534 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
2536 Use this to exercise C++ outputs in subdirs.
2537 Reported by Oleg Smolsky.
2539 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
2541 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
2542 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
2543 Problem reported by John P. Hartmann.
2544 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
2547 2005-10-12 Akim Demaille <akim@epita.fr>
2549 * src/parse-gram.y (version_check): Exit 63 to please missing
2550 (stands for "version mismatch).
2551 * tests/input.at, doc/bison.texinfo: Adjust.
2553 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
2555 Work around portability problems with Visual Age C compiler
2556 (xlc and xlC_r) reported by John P. Hartmann.
2557 * data/location.cc (initial_column, initial_line): Remove.
2558 All uses replaced by 0 and 1.
2559 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
2560 that xlc complains about.
2561 * src/scan-skel.l (skel_wrap): Likewise.
2562 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
2564 * data/yacc.c (YYMODERN_C): New macro, which also looks at
2565 __STDC_VERSION__. Use it everywhere instead of looking at
2566 __STDC__ and __cplusplus.
2568 2005-10-10 Akim Demaille <akim@epita.fr>
2570 * examples/calc++/test: Be quiet unless VERBOSE.
2572 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
2574 * data/c.m4 (yydestruct, yysymprint):
2575 Use YYUSE instead of casting to void.
2576 * data/glr.c (YYUSE): New macro.
2577 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
2578 Use it instead of rolling our own.
2579 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
2581 Use /*CONSTCOND*/ to suppress lint warnings.
2582 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
2583 (YY_STACK_PRINT): Use 'false' not '0'.
2585 (yysymprint_, yydestruct_): Use it instead of rolling our own.
2586 * data/yacc.c (YYUSE): New macro.
2587 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
2588 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
2589 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
2592 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
2593 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
2595 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
2597 Undo the parts of the unlocked-I/O change that substituted
2598 putc or puts for printf. This might hurt performance a bit,
2599 but some people prefer the printf style.
2600 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
2601 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
2602 All uses replaced by YYFPRINTF and YYDPRINTF.
2603 * data/yacc.c: Likewise.
2604 * lib/bitset.c (bitset_print): Likewise.
2605 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
2607 * lib/lbitset.c (debug_lbitset): Likewise.
2608 * src/closure.c (print_firsts, print_fderives): Likewise.
2609 * src/gram.c (grammar_dump): Likewise.
2610 * src/lalr.c (look_ahead_tokens_print): Likewise.
2611 * src/output.c (escaped_output): Likewise.
2612 (user_actions_output): Break apart two printfs.
2613 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
2614 * src/reduce.c (reduce_print): Likewise.
2615 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2616 * src/system.h: Include unlocked-io.h rathe than stdio.h.
2618 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
2619 Use assignments rather than casts-to-void to suppress
2620 unused-variable warnings. This pacifies 'lint'.
2621 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
2622 unused-variable warnings.
2624 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2626 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
2628 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2630 Use unlocked I/O for a minor performance improvement on hosts like
2631 GNU/Linux and Solaris that support unlocked I/O. The basic idea
2632 is to use the gnlib unlocked-io module, and to prefer putc and
2633 puts to printf when either will work (since the latter doesn't
2634 come in an unlocked flavor).
2635 * bootstrap (gnulib_modules): Add unlocked-io.
2636 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
2637 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
2638 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
2639 and similarly for puts and putc and printf.
2640 * data/yacc.c: Likewise.
2641 * lib/bitset.c (bitset_print): Likewise.
2642 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
2643 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
2645 * lib/lbitset.c (debug_lbitset): Likewise.
2646 * src/closure.c (print_firsts, print_fderives): Likewise.
2647 * src/gram.c (grammar_dump): Likewise.
2648 * src/lalr.c (look_ahead_tokens_print): Likewise.
2649 * src/output.c (escaped_output): Likewise.
2650 (user_actions_output): Coalesce two printfs.
2651 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
2652 * src/reduce.c (reduce_print): Likewise.
2653 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2654 * src/system.h: Include unlocked-io.h rather than stdio.h.
2656 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
2657 this confuses xgettext.
2659 2005-10-02 Akim Demaille <akim@epita.fr>
2661 * bootstrap (gnulib_modules): Add strverscmp.
2662 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
2663 * m4/.cvsignore: Add strverscmp.m4.
2664 * src/parse-gram.y (%require): New token, new rule.
2665 (version_check): New.
2666 * src/scan-gram.l (%require): Adjust.
2667 * tests/input.at (AT_REQUIRE): New.
2669 * doc/bison.texinfo (Require Decl): New.
2670 (Calc++ Parser): Use %require.
2672 2005-10-02 Akim Demaille <akim@epita.fr>
2674 * data/location.cc: New.
2676 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
2677 Akim Demaille <akim@epita.fr>
2679 Make sure -odir/foo.cc creates dir/location.hh etc.
2680 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
2681 (spec_file_prefix, spec_verbose_file, spec_graph_file)
2682 (spec_defines_file): Now const.
2684 (short_base_name): Remove.
2685 * src/files.c: Adjust.
2686 (dirname.h): Include.
2687 (base_name): Don't prototype it.
2688 (finput): Remove, duplicates gram_in.
2689 (full_base_name, short_base_name): Replace by...
2690 (all_but_ext, all_but_tab_ext): these.
2691 (compute_base_names): Rename as...
2692 (compute_file_name_parts): this.
2693 Update to compute the new variables, including dir_prefix.
2694 Adjust dependencies.
2695 * src/output.c (prepare): Output them.
2696 * src/reader.c: Adjust to use gram_in, not finput.
2697 * src/scan-skel.l (@dir_prefix@): New.
2699 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2701 * lib/subpipe.c: New function end_of_output_subpipe() added
2702 to allow support for non-posix systems. This is a no-op function
2705 * lib/subpipe.h: New function end_of_output_subpipe() added
2706 to allow support for non-posix systems. This is a no-op function
2709 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
2710 handle the lack of pipe/fork functionality on non-posix systems.
2712 * djgpp/Makefile.maint: DJGPP specific file.
2714 * djgpp/README.in: DJGPP specific file.
2716 * djgpp/config.bat: DJGPP specific configuration file.
2718 * djgpp/config.sed: DJGPP specific configuration file.
2720 * djgpp/config.site: DJGPP specific configuration file.
2722 * djgpp/config_h.sed: DJGPP specific configuration file.
2724 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
2726 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
2728 2005-10-02 Akim Demaille <akim@epita.fr>
2730 * data/location.cc: New, extract from...
2731 * data/lalr1.cc: here.
2732 (location.hh): Include it after the user prologue, in case the
2733 filename type is defined by the user.
2734 Forward declation location and position before the pre-prologue.
2735 (yyresult_): Rename as...
2736 (yyresult): this, it's a local variable, not an attribute.
2737 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
2739 2005-10-01 Akim Demaille <akim@epita.fr>
2741 * examples/extexi: Restore the #line generation.
2743 2005-09-30 Akim Demaille <akim@epita.fr>,
2744 Alexandre Duret-Lutz <adl@gnu.org>
2746 Move the token type and YYSTYPE in the parser class.
2747 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
2748 (parser::token): New, from the moved free definition of tokens.
2749 (parser::semantic_value): Now a full definition instead of an
2750 indirection to YYSTYPE.
2751 (b4_post_prologue): No longer included in the header file, but
2752 in the implementation file.
2753 * doc/bison.texi (C+ Language Interface): Update.
2754 * src/parse-gram.y: Support unary %define.
2755 * tests/actions.at: Define global_tokens_and_yystype for backward
2756 compatibility until we update the tests.
2757 * tests/calc.at: Idem.
2758 (first_line, first_column, last_line, last_column): Define for lalr1.cc
2759 to simplify the code.
2761 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2763 Port to SunOS 4.1.4, which lacks strtoul and strerror.
2764 Ah, the good old days! Problem reported by Peter Klein.
2765 * bootstrap (gnulib_modules): Add strerror, strtoul.
2766 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
2767 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
2769 2005-09-29 Akim Demaille <akim@epita.fr>
2771 * data/c.m4 (b4_error_verbose_if): New.
2772 * data/lalr1.cc: Use it.
2773 (YYERROR_VERBOSE_IF): Remove.
2774 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
2775 parser members, replaced by...
2776 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
2778 (yysyntax_error_): Takes the state number as argument.
2779 (yyreduce_print_): Use the argument yyrule, not the former
2782 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2784 * bootstrap (gnulib_modules): Add verify.
2785 * lib/.cvsignore: Add verify.h.
2786 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
2787 * src/system.h (verify): Remove.
2788 Include verify.h instead.
2789 * src/tables.c (tables_generate): Use new API for 'verify'.
2791 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
2793 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
2794 local variables whose names begin with 'yy'.
2795 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
2796 Trivial changes from Joel E. Denny.
2798 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
2800 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
2801 don't use alloca any more.
2803 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
2804 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
2805 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
2806 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
2807 to match yacc.c, to test more hosts.
2809 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
2811 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
2812 doesn't affect behavior.
2813 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
2815 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
2816 This works a bit better with glibc, if user code has already included
2818 * doc/bison.texinfo (Bison Parser): Document that users can't
2819 arbitrarily use malloc and free for other purposes. Document
2820 that <alloca.h> and <malloc.h> might be included.
2821 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
2822 user must declare alloca.
2824 * HACKING (release): Forwarn the Translation Project about
2827 2005-09-20 Akim Demaille <akim@epita.fr>
2829 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
2831 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
2833 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
2834 (YYSTACK_ALLOC_MAXIMUM): Use it.
2835 (yysyntax_error): New function.
2836 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
2837 multiple syntax errors are reported, and alloca is being used.
2838 Instead, reallocate buffers twice as big each time, so that
2839 we waste at most half the allocated memory. Start with a small
2840 (128-byte) buffer that will suffice in most cases anyway.
2841 Use yysyntax_error to do most of the work.
2843 * doc/bison.texinfo (Error Reporting, Table of Symbols):
2844 yynerrs is the number of errors reported, not the number of
2847 * tests/glr-regression.at (Duplicated user destructor for lookahead):
2848 Mark it as expected to fail.
2849 Cast result of malloc; problem reported by twlevo@xs4all.nl.
2850 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
2851 Don't start user-code symbols with "yy", to avoid name space problems.
2853 2005-09-19 Akim Demaille <akim@epita.fr>
2855 Remove the traits, failed experiment.
2856 It never proved useful, and anyway because of the current
2857 definition, it was not possible to have several specialization of
2858 this traits, making it useless.
2859 * data/lalr1.cc (yy:traits): Remove.
2860 Inline its definitions in the parser class.
2862 2005-09-19 Akim Demaille <akim@epita.fr>
2864 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
2865 least Mac OSX with a /usr/local install of gettext.
2867 2005-09-19 Akim Demaille <akim@epita.fr>
2869 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
2870 and yytoken for similarity with the other skeletons.
2872 2005-09-19 Akim Demaille <akim@epita.fr>
2874 * NEWS, configure.ac: update version number to 2.1a.
2876 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
2878 * NEWS: Version 2.1.
2880 * NEWS: Remove notice of yytname change, since it was never in an
2882 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
2884 * src/output.c (prepare): Likewise.
2885 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
2886 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
2887 is not defined. This is an awful hack, but it's enough for now.
2888 All callers changed.
2889 * tests/glr-regression-at (make_value): Args are const pointers now,
2890 to avoid GCC warning.
2891 (Duplicated user destructor for lookahead): New test. Currently
2892 skipped. It fails on my host but I'm not sure it'll always fail.
2894 2005-09-16 Akim Demaille <akim@epita.fr>
2896 * src/symtab.h (struct symbol): Declare the printer and destructor
2897 as const, to avoid accidental calls to free.
2898 (symbol_destructor_set, symbol_printer_set): Adjust.
2899 * src/symtab.c: Adjust.
2901 2005-09-16 Akim Demaille <akim@epita.fr>
2903 * data/c.m4 (b4_token_enums): New.
2904 (b4_token_defines): Rename as...
2905 (b4_token_enums_defines): this.
2906 (b4_token_defines): New, output only the #defines.
2907 * data/yacc.c, data/glr.c: Adjust.
2908 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
2909 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
2912 2005-09-16 Akim Demaille <akim@epita.fr>
2914 * data/lalr1.cc (yylex_): Remove, inline its code.
2915 (yyreport_syntax_error_): Remove, replaced by...
2916 (yysyntax_error_): this which returns a string and leaves to the
2917 caller the call to the users' error function.
2918 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
2919 Move from members of the parser object...
2920 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
2921 to local variables of the parse function.
2923 2005-09-16 Akim Demaille <akim@epita.fr>
2925 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
2926 since it's in Bison's name space.
2928 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
2930 * data/glr.c (yyresolveValue): Add default case to pacify
2931 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
2933 * NEWS: Document when yyparse started to return 2.
2934 * doc/bison.texinfo (Parser Function): Document when yyparse
2937 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
2938 (b4_filename_type): Renamed back from b4_file_name_type. All uses
2940 (class position): file_name -> filename (reverting). All uses changed.
2942 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
2944 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
2945 do anything if $@ exists. This reverts part of the 2005-07-07
2948 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
2950 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
2951 contains obsolete information and isn't worth distributing as a
2952 separate file anyway.
2953 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
2954 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
2955 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
2956 (yyparse): Abort if user code uses longjmp to throw an unexpected
2959 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
2961 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
2962 Suggested by twlevo@xs4all.nl.
2964 * data/glr.c (YYCHK1): Do not assume YYE is in range.
2965 This avoids a diagnostic from gcc -Wswitch-enum.
2966 Problem reported by twlevo@xs4all.nl.
2968 * doc/bison.texinfo: Don't use "filename", as per GNU coding
2969 standards. Use "file name" or "file" or "name", depending on
2971 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
2972 not to hack/foo.tab.c.
2973 (Calc++ Top Level): 2nd arg of main is not const.
2974 * data/glr.c: b4_filename -> b4_file_name.
2975 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
2977 (class position): filename -> file_name. All uses changed.
2978 * data/yacc.c: b4_filename -> b4_file_name.
2979 * lib/bitset.h: filename -> file_name in local vars.
2980 * lib/bitset_stats.c: Likewise.
2981 * src/files.c: Likewise.
2982 * src/scan-skel.l ("@output ".*\n): Likewise.
2983 * src/files.c (file_name_split): Renamed from filename_split.
2984 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
2986 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
2988 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
2989 to accommodate latest gnulib.
2991 * tests/glr-regression.at (Duplicate representation of merged trees):
2992 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
2994 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
2997 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
2999 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
3000 All uses changed. Invoke user destructor after an error during a
3001 split parse (trivial change from Joel E. Denny).
3003 * tests/glr-regression.at
3004 (User destructor after an error during a split parse): New test case.
3005 Problem reported by Joel E. Denny in:
3006 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
3008 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
3010 * README-cvs: Give URLs for recommended tools.
3011 Mention Gzip version problem, and bootstrapping issues.
3012 Remove troubleshooting section, as it's somewhat obsolete.
3014 * bootstrap (no_cache): New var, to accommodate different wget
3015 variants. Use it instead of '-C off'. Problem reported by
3018 * data/glr.c (yydestroyStackItem): New function.
3019 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
3020 debugging information. Problem reported by Joel E. Denny.
3022 2005-08-25 Akim Demaille <akim@epita.fr>
3024 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
3026 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
3028 * data/glr.c (yyrecoverSyntaxError, yyreturn):
3029 Don't invoke destructor on unresolved entries.
3030 * tests/glr-regression.at
3031 (User destructor for unresolved GLR semantic value): New test case.
3032 Problem reported by Joel E. Denny in:
3033 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
3035 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
3037 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
3039 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
3040 lib-prefix.m4, po.m4.
3042 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
3043 in yydestruct diagnostic, since it might not be an error.
3044 Problem reported by Joel Denny near end of
3045 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3046 * data/lalr1.cc (yyerturn): Likewise.
3047 * data/yacc.c (yyreturn): Likewise.
3048 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
3050 * src/files.c: Remove obsolete FIXME comment.
3052 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
3053 with the other templates, and to fix bogus run-on messages such
3054 as the one reported at the end of
3055 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
3056 All callers changed to avoid the newline.
3057 (yyprocessOneStack): Output two lines rather than one, to accommodate
3058 the above change. This changes the debug output format slightly.
3060 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
3061 reported by Joel E. Denny in
3062 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
3064 * tests/glr-regression.at (Duplicate representation of merged trees):
3065 New test, from Joel E. Denny in:
3066 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
3067 * THANKS: Add Joel E. Denny.
3069 * configure.ac (AC_INIT): Bump to 2.0c.
3071 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
3073 * NEWS: Version 2.0b.
3075 * Makefile.am (SUBDIRS): Put examples before tests, so that
3076 "make check" doesn't finish with "All 1 tests passed".
3078 * tests/regression.at (Token definitions): Don't rely on
3079 AT_PARSER_CHECK for data that contains backslashes. It currently
3080 uses 'echo', and 'echo' isn't portable if its argument contains
3081 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3082 that the byte '\0xff' is not printable in the C locale; it is,
3083 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3084 not printable, so use '\0x81' to test.
3086 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3087 version of GCC, since the macro is used with non-GCC compilers.
3089 Fix core dump reported by Pablo De Napoli in
3090 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3091 * tests/regression.at (Invalid inputs with {}): New test.
3092 * src/parse-gram.y (token_name): Translate type before using
3095 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3096 the user's name space. All uses changed to __attribute__
3098 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3099 Add __attribute__ ((__noreturn__)).
3101 * etc/clcommit: Remove. We weren't using it, and it failed
3102 "make maintainer-distcheck".
3103 * Makefile.maint: Merge from coreutils.
3104 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3105 (syntax-check-rules): Change list of rules as described below.
3106 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3107 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3108 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3109 (sc_trailing_space): New rules.
3110 (sc_xalloc_h_in_src): Remove.
3111 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3112 (sc_space_tab, sc_error_exit_success, sc_changelog):
3113 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3114 (makefile-check, po-check, author_mark_check):
3115 (makefile_path_separator_check, copyright-check):
3116 Use grep -n, to make it easier to find violations.
3117 Use CVS_LIST and CVS_LIST_EXCEPT.
3118 (header_regexp, h_re): Remove.
3120 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3121 (my-distcheck): Use more-modern GCC flags.
3122 (signatures, %.asc): Remove.
3123 (rel-files, announcement): Remove signatures.
3124 Restore old updating code, even though we don't use it, so
3125 that we're the same as coreutils.
3126 (alpha, beta, major): Depend on news-date-check.
3127 Make the upload commands.
3129 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
3130 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
3131 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
3132 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
3133 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
3134 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
3135 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
3136 * tests/sets.at: Likewise.
3138 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
3139 we comment out the Autoconf version number.
3140 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
3141 it's error-prone and "make maintainer-distcheck" rejects it.
3143 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
3144 Indent calls to "error" to pacify "make maintainer-distcheck",
3145 when the calls are not intended to be translated.
3146 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
3148 * src/Makefile.am (DEFS): Use +=, to pacify
3149 "make maintainer-distcheck".
3150 (bison_SOURCES): Add scan-skel.h.
3151 (sc_tight_scope): New rule, from coreutils.
3153 * src/files.c (src_extension, header_extension):
3154 Now static, not extern.
3155 * src/getargs.c (short_options): Likewise.
3156 * src/muscle_tab.c (muscle_table): Likewise.
3157 * src/parse-gram.y (current_class, current_type, current_prec):
3159 * src/reader.c (grammar_end, previous_rule_end): Likewise.
3160 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
3161 * src/main.c (main): Cast bindtextdomain and textdomain calls to
3162 void, to avoid warning when NLS is disabled.
3163 * src/output.c: Include scan-skel.h.
3164 (scan_skel): Remove decl, since scan-skel.h does this.
3166 Indent calls to "error" to pacify "make maintainer-distcheck".
3167 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
3168 * src/reader.h (gram_end, gram_lineno): New decls to pacify
3169 "make maintainer-distcheck".
3170 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
3171 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
3172 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
3173 (skel_lex_destroy, scan_skel): Move these decls to...
3174 * src/scan-skel.h: New file.
3175 * src/uniqstr.c (uniqstr_assert):
3176 Indent calls to "error" to pacify "make maintainer-distcheck".
3178 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
3181 * tests/torture.at: Revamp to avoid misuse of atoi that
3182 "make maintainer-distcheck" complained about.
3184 * examples/extexi (message): Don't print a message more than once,
3185 and omit line-number decoration that makes Emacs compile think
3186 that informative messages are worth worrying about.
3188 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
3190 * configure.ac: Update version number.
3192 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
3194 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
3195 autogenerated by the maintainer.
3196 * examples/calc++/.cvsignore: Add *.yy.
3198 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
3199 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3200 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3202 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
3204 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
3205 from maintainer-distcheck about casting the argument of 'free'.
3207 * NEWS: Mention recent yytname changes.
3208 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
3210 * bootstrap: For translations that have not yet been upgraded to
3211 the new runtime-po domain, prime the pump by extracting the
3212 relevant strings from the obsolete translations. This code can be
3213 removed once the bison-runtime domain has been translated by each
3216 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
3217 now that token names are already quoted.
3219 Fix problem reported by Anthony Heading.
3220 * data/glr.c (YYTOKEN_TABLE): New macro.
3221 (yytname): Define if YYTOKEN_TABLE.
3222 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
3223 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
3224 (YYERROR_VERBOSE): Define the same way the other skeletons do.
3225 * src/output.c (prepare_symbols): Output token_table_flag.
3227 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
3229 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
3230 again if the first call fails.
3232 * data/glr.c (yytnamerr): New function.
3233 (yyreportSyntaxError): Use it to dequote most string literals.
3234 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
3235 with other skeletons. All uses changed.
3236 (yytnameerr_): New function.
3237 (yyreport_syntax_error): Use it to dequote most string literals.
3238 * data/yacc.c (yytnamerr): New function.
3239 (yyerrlab): Use it to decode most string literals.
3240 * doc/bison.texinfo (Decl Summary, Calling Convention):
3241 Clarify quoting convention of yytname.
3242 * src/output.c (prepare_symbols): Quote all names. This undoes
3243 the 2005-04-17 change, which is now accomplished (mostly) via
3244 changes in the parsers as described above.
3245 * tests/regression.at (Token definitions, Web2c Actions):
3246 Undo most 2005-04-17 change here, too.
3248 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
3250 Fix more problems reported by twlevo@xs4all.nl.
3251 * tests/cxx-type.at: Don't pipe output of ./types through sed to
3252 remove trailing spaces. This loses the exit status of ./types,
3253 and isn't needed since ./types shouldn't be emitting trailing
3255 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
3256 as the stack isn't valid in that case.
3258 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3259 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3260 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3261 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
3263 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
3264 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3265 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3268 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
3269 overly-picky compilers that reject 'char *foo = "bar";'.
3271 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
3272 to FILE * parameter, not to stderr. This fixes a typo introduced
3273 in the 2005-07-12 change.
3275 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
3276 warnings from GCC 4.
3278 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
3279 (yyglrShiftDefer, yysplitStack):
3280 Remove unused parameters b4_pure_formals. All uses changed.
3281 (yyglrShift): Remove unused parameters b4_user_formals.
3283 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
3285 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
3287 Destructor cleanups and regularization among the three skeletons.
3288 * NEWS: Document the behavior changes.
3289 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
3290 stack before failing, as the cleanup code will do it for us now.
3291 * data/lalr1.cc (yyerrlab): Likewise.
3292 * data/glr.c (yyparse): Pop everything off the stack before
3293 freeing it, so that destructors get called properly.
3294 * data/lalr1.cc (yyreturn): Likewise.
3295 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
3296 This is more consistent.
3297 * doc/bison.texinfo (Destructor Decl): Mention more reasons
3298 why destructors might be called. 1.875 -> 2.1.
3299 (Destructor Decl, Decl Summary, Table of Symbols):
3300 Some English-language cleanups for %destructor.
3301 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
3302 Add output line for destructor of start symbol.
3303 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
3304 because of that same extra output line.
3306 * NEWS: Document minor wording changes in diagnostics of
3307 Bison-generated parsers.
3308 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
3309 Remove unused formals. All uses changed.
3310 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
3311 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
3312 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
3313 Rename yyoverflowab to yyexhaustedlab.
3314 When memory exhaustion occurs during syntax-error reporting,
3315 report it separately rather than in a single diagnostic; this
3317 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
3318 (Memory Exhausted): Renamed from Parser Stack Overflow.
3319 Revamp wording slightly to prefer "memory exhaustion".
3320 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
3322 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
3324 Add i18n support to the GLR skeleton. Partially fix the C++
3325 skeleton; a C++ expert needs to finish this. Remove debugging
3326 msgids; there's little point to having them translated, since they
3327 can be understood only by someone who can read the
3328 (English-language) source code.
3330 Generate runtime-po/bison-runtime.pot automatically, so that we
3331 don't have to worry about garbage getting in that file. We'll
3332 make sure after the next official release that old msgids don't
3334 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
3336 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
3338 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
3339 Fix typos in explanations of the runtime file.
3340 * bootstrap: Change gettext keyword from YYI18N to YY_.
3341 Use standard Makefile.in.in in runtime-po, since we'll arrange
3342 for backward-compatible bison-runtime.po files in a different way.
3343 * data/glr.c (YY_): New macro, from yacc.c.
3344 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
3345 Translate messages intended for users.
3346 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
3347 the wording in the other skeletons. We don't know that the memory
3349 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
3350 Use same method that yacc.c uses.
3351 Don't translate debugging messages.
3352 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
3353 it doesn't work (yet), and requires C++ expertise to fix.
3354 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
3355 Move defn to a more logical place, to be consistent with other
3357 Don't translate debugging messages.
3358 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
3359 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
3360 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
3361 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
3363 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
3364 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
3366 * tests/glr-regression.at (Badly Collapsed GLR States):
3368 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3369 yylex should return 0 at EOF rather than aborting.
3371 Improve tests for stack overflow in GLR parser.
3372 Problem reported by twlevo@xs4all.nl.
3373 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
3375 (yyStackOverflow): Just longjmp, but with value 2 so that caller
3376 can handle the problem.
3377 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
3378 (yyparse): New local variable yyresult to record the result.
3379 Use result of setjmp to set it, rather than storing itinto
3381 (yyDone): Remove label.
3382 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
3383 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
3384 if YYABORT is used).
3385 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
3386 yyparse status; put status > 1 into diagnostic.
3387 Check that status==2 works.
3388 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
3389 Use exit status 3 for failure to open (which shouldn't happen).
3391 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
3393 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
3394 1 on syntax error; just let yyparse do its thing.
3395 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
3396 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
3397 (Exploding the Stack Size with Alloca):
3398 (Exploding the Stack Size with Malloc):
3399 Expect exit status 2, not 1, since the parser is supposed to blow
3400 its stack. Problem reported by twlevo@xs4all.nl.
3402 * data/glr.c (yyparse): Don't assume that the initial calls
3403 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
3404 Print a stack-overflow message and fail instead.
3405 Initialize the line-number information before creating the stack,
3406 so that the stack-overflow message can report line zero safely.
3408 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
3410 Fix problems reported by twlevo@xs4all.nl.
3411 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
3412 (yyuserMerge): Provide a default case if b4_mergers is empty.
3413 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
3414 * tests/glr-regression.at
3415 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3416 Add casts to pacify C++ compilers.
3417 * tests/glr-regression.at (Improper merging of GLR delayed action
3418 sets): Declare yylex before using it.
3419 * tests/Makefile.am (maintainer-check-g++): Fix a stray
3420 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
3421 test for valgrind; valgrind is independent of g++.
3422 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
3423 for compatibility with POSIX 1003.1-2001 (if running coreutils).
3424 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
3425 Use a destructor, so that we can expand the stack. Change
3426 YYSTYPE to char * so that we can free it. Cast result of malloc.
3428 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3430 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
3431 a valgrind failure. Problem reported by twlevo@xs4all.nl.
3433 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
3435 * PACKAGING: New file, suggested by Bruno Haible and taken from
3436 similar wording in gettext's PACKAGING file.
3437 * NEWS: Mention PACKAGING.
3438 * Makefile.am (EXTRA_DIST): Add PACKAGING.
3440 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
3442 * NEWS: Document recent i18n improvements.
3443 * bootstrap: Get runtime translations into runtime-po.
3444 Create runtime-po files automatically, if possible.
3445 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
3446 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
3447 does not infringe on the user's name space.
3448 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
3449 * doc/bison.texinfo (Internationalization): Revamp the English
3450 and Texinfo syntax a bit, to try to make it clearer.
3451 (Bison Options, Option Cross Key): Mention --print-localedir.
3452 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
3453 YYENABLE_NLS. Quote a bit more.
3454 * runtime-po/.cvsignore: New file.
3455 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
3456 * runtime-po/Rules-quot: Remove; now created by bootstrap.
3457 * runtime-po/quot.sed: Likewise.
3458 * runtime-po/boldquot.sed: Likewise.
3459 * runtime-po/en@quot.header: Likewise.
3460 * runtime-po/en@boldquot.header: Likewise.
3461 * runtime-po/insert-header.sin: Likewise.
3462 * runtime-po/remove-potcdate.sin: Likewise.
3463 * runtime-po/Makevars: Likewise.
3464 * runtime-po/LINGUAS: Likewise.
3465 * runtime-po/de.po: Likewise; we will rely on the translation project
3466 to maintain this, so "bootstrap" should get it.
3467 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
3469 * src/main.c (main): Bind the bison-runtime domain, too.
3471 2005-07-12 Bruno Haible <bruno@clisp.org>
3473 * data/yacc.c: Include <libintl.h> when NLS is enabled.
3474 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
3475 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
3476 * runtime-po: New directory.
3477 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
3478 $(DOMAIN).pot-update rule, so that old messages are never dropped.
3479 * runtime-po/Rules-quot: New file, copied from po/.
3480 * runtime-po/quot.sed: Likewise.
3481 * runtime-po/boldquot.sed: Likewise.
3482 * runtime-po/en@quot.header: Likewise.
3483 * runtime-po/en@boldquot.header: Likewise.
3484 * runtime-po/insert-header.sin: Likewise.
3485 * runtime-po/remove-potcdate.sin: Likewise.
3486 * runtime-po/Makevars: New file.
3487 * runtime-po/POTFILES.in: New file.
3488 * runtime-po/LINGUAS: New file.
3489 * runtime-po/bison-runtime.pot: New file.
3490 * runtime-po/de.po: New file.
3491 * m4/bison.m4: New file.
3492 * Makefile.am (SUBDIRS): Add runtime-po.
3493 (aclocaldir, aclocal_DATA): New variables.
3494 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
3496 * src/getargs.c (usage): Document --print-localedir option.
3497 (PRINT_LOCALEDIR_OPTION): New enum item.
3498 (long_options): Add --print-localedir option.
3499 (getargs): Handle --print-localedir option.
3500 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
3501 (Internationalization): New section.
3503 2005-07-12 Akim Demaille <akim@epita.fr>
3505 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
3506 for consistency with the rest of the code.
3507 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
3510 2005-07-12 Akim Demaille <akim@epita.fr>
3512 * src/parse-gram.y: Use %printer instead of YYPRINT.
3514 2005-07-12 Akim Demaille <akim@epita.fr>
3516 * src/symtab.h, src/symtab.c (symbol_print): New.
3517 * src/symlist.h, src/symlist.c (symbol_list_print): New.
3518 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
3520 2005-07-12 Akim Demaille <akim@epita.fr>
3522 * data/glr.c (b4_syncline): Fix (swap) the definitions of
3523 b4_at_dollar and b4_dollar_dollar.
3525 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
3527 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
3528 and Pennello's paper.
3530 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
3532 * data/yacc.c (yyparse): Undo previous patch. Instead,
3533 set yylsp[0] and yyvsp[0] only if the initial action
3534 sets yylloc and yylval, respectively.
3536 * data/yacc.c (yyparse): In the initial action, set
3537 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
3538 This avoids the use of undefined variables if the initial
3539 action does not set yylloc and/or yylval.
3541 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
3543 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
3544 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
3545 Remove from CVS. These files are automatically generated.
3546 * examples/extexi: Clarify that this file is now part of Bison,
3547 not GNU M4, and that it works with any POSIX-compatible Awk.
3548 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
3549 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
3550 so that we also get calc++-parser.yy. Geneate it.
3551 Use $(AWK), not gawk, since any conforming Awk will do.
3552 Put comment before action, since older 'make' can't handle comment
3554 $(BUILT_SOURCES): List all built sources, not just some of them.
3555 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
3556 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
3557 $($(calc_sources_generated)): Remove unnecessary test for existence
3558 of target. (This had a shell syntax error anyway; a stray "x".)
3559 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
3561 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
3563 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
3564 implied by the other modules.
3566 2005-07-06 Akim Demaille <akim@epita.fr>
3568 Bind examples/calc++ to the package.
3569 * examples/calc++/Makefile: Remove, replaced by...
3570 * examples/calc++/Makefile.am: ... this new file.
3571 * examples/calc++/test: Remove input.
3572 * examples/calc++/compile: Remove.
3573 * examples/Makefile.am: New.
3574 * configure.ac, Makefile.am: Adjust.
3575 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
3577 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
3579 * data/glr.c (yyFail): Drastically simplify; since the format argument
3580 never had any % directives, we can simply pass it to yyerror.
3581 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
3582 be modified later, as that is the usual style in glr.c.
3583 Problems reported by Paul Hilfinger.
3585 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
3586 and size overflow errors.
3587 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
3588 in case the user prolog sets feature-test macros like _GNU_SOURCE.
3589 (YYSIZEMAX): New macro.
3590 (yystpcpy): New function, taken from yacc.c.
3591 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
3592 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
3593 so that we don't have to maintain their signatures.
3594 (yyFail): Check for buffer overflow, by using vsnprintf rather
3595 than vsprintf. Allocate a bigger buffer if possible.
3596 Report an error if buffer allocation fails.
3597 (yyStackOverflow): New function.
3598 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
3599 the initialization was successful. It might fail if storage was
3601 (yyexpandGLRStack): Add more checks for storage allocation failure.
3602 Use yyStackOverflow to report failures.
3603 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
3604 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
3605 Don't assume stack number fits in int.
3606 (yysplitStack): Check for storage allocation failure.
3607 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
3608 can print diagnostics on storage allocation failure. All callers
3610 (yyresolveValue): Use yybool for boolean.
3611 (yyreportSyntaxError): Check for size-calculation overflow.
3612 This code is taken from yacc.c.
3613 (yyparse): Check for storage allocation errors when allocating
3616 2005-07-05 Akim Demaille <akim@epita.fr>
3618 Extract calc++ from the documentation.
3619 * doc/bison.texinfo (Calc++): Add the extraction marks.
3620 * examples/extexi: New, from the aborted GNU Programming 2E.
3621 Separate the different paragraph of a file with empty lines.
3622 * examples/Makefile: Use it to extract the whole calc++ example.
3624 2005-06-24 Akim Demaille <akim@epita.fr>
3626 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
3629 2005-06-22 Akim Demaille <akim@epita.fr>
3631 * doc/bison.texinfo (C++ Language Interface): First stab.
3632 (C++ Parsers): Remove.
3634 2005-06-22 Akim Demaille <akim@epita.fr>
3636 * data/lalr1.cc (yylex_): Honor %lex-param.
3638 2005-06-22 Akim Demaille <akim@epita.fr>
3640 Start a set of simple examples.
3641 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
3642 * examples/calc++/calc++-driver.hh,
3643 * examples/calc++/calc++-parser.yy,
3644 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
3645 * examples/calc++/compile, examples/calc++/test: New.
3647 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
3649 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
3650 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
3651 which stems from the 2005-05-27 patch.
3653 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3655 * data/glr.c: Modify treatment of unused parameters to permit use
3656 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
3658 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
3660 Fix infringement on user name space reported by Janos Zoltan Szabo.
3661 * data/yacc.c (yyparse): strlen -> yystrlen.
3663 2005-05-30 Akim Demaille <akim@epita.fr>
3665 * data/lalr1.cc (_): New.
3666 Translate the various messages.
3668 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
3670 Fix infringement on user name space reported by Bruno Haible.
3671 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
3672 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
3673 the user's name space.
3674 (alloca): Include <stdlib.h> to get it, if it's not built in.
3675 (YYMALLOC, YYFREE): Define only if needed.
3676 (malloc, free): Declare, but only if needed, as this infringes on
3677 the user name space.
3679 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
3681 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
3682 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
3684 * lib/ebitset.c (min, max): Undef before defining.
3685 * lib/vbitset.c (min, max): Likewise.
3686 * lib/subpipe.c (create_subpipe): Save local variables in case
3687 vfork clobbers them.
3689 2005-05-24 Bruno Haible <bruno@clisp.org>
3691 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
3692 error message syntax used by gcc-4.0.
3694 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
3696 * README: Mention m4 1.4.3. Remove obsolete advice about
3697 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
3699 * bootstrap: Remove workaround for problem I encountered with
3700 gettext 0.14.1; it seems to be fixed now.
3702 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
3704 * NEWS: Version 2.0a.
3706 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
3707 the previous change.
3709 Various maintainer cleanups.
3710 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
3711 conftest*, for benefit of CVS commands run at the same time as
3712 "configure". Add build-aux, since "bootstrap" now creates it and
3714 * Makefile.cfg (move_if_change): Remove.
3715 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
3716 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
3717 (po_repo, do-po-update, po-update, wget_files, get-targets):
3718 (config.guess-url_prefix, config.sub-url_prefix):
3719 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
3720 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
3721 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
3723 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
3724 this is now the recommended name.
3725 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
3726 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
3727 ylwrap. These files now go into build-aux.
3728 * config/move-if-change: Remove.
3729 * config/prev-version.txt: Bump from 1.75 to 2.0.
3731 * bootstrap: Add stdio-safer, unistd-safer modules.
3732 Remove m4/glibc2.m4 (introduced by latest gnulib, but
3734 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
3735 fopen-safer.c, stdio-safer.h, unistd-safer.h.
3736 * lib/subpipe.c: Include "unistd-safer.h".
3737 (create_subpipe): Make sure all the newly-created
3738 file descriptors are > 2, so that diagnostics don't
3739 get sent down them (which might cause Bison to hang, in theory).
3740 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
3741 * src/files.c (xfopen): Use fopen_safer, not fopen.
3743 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
3744 yesterday's yacc.c fix.
3746 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
3748 * data/glr.c, data/lalr1.cc: Update copyright date.
3750 Fix a destructor bug reported by Wolfgang Spraul in
3751 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
3752 * data/yacc.c (yyabortlab): Don't call destructor, and
3753 don't set yychar to EMPTY.
3754 (yyoverflowlab): Don't call destructor.
3755 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
3756 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
3757 since we no longer output the message "discarding lookahead token
3760 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3762 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
3763 fix a small glitch in debugging output.
3764 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
3765 after YY_SYMBOL_PRINT where needed.
3767 (struct yyGLRState): Add some comments.
3768 (struct yySemanticOption): Add some comments.
3769 (union yyGLRStackItem): Add comment.
3771 (yymergeOptionSets): Correct this to properly perform the union,
3772 avoiding infinite reported by Michael Rosien.
3775 * tests/glr-regression.at: Add test for GLR merging error reported
3778 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
3780 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
3781 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
3782 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
3783 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
3784 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
3785 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
3786 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
3787 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
3788 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
3789 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
3790 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
3791 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
3792 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
3793 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
3794 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
3795 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
3796 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
3797 src/derives.h, src/files.c, src/files.h, src/getargs.c,
3798 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
3799 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
3800 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
3801 src/output.h, src/parse-gram.c, src/parse-gram.h,
3802 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
3803 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
3804 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
3805 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
3806 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
3807 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
3808 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
3809 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
3810 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
3811 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
3812 tests/reduce.at, tests/regression.at, tests/sets.at,
3813 tests/synclines.at, tests/testsuite.at, tests/torture.at:
3814 Update FSF postal mail address.
3816 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
3818 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
3819 Problem reported by Ralf Menzel.
3821 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
3823 * tests/actions.at: Test that stack overflow invokes destructors.
3824 From Marcus Holland-Moritz.
3825 * data/yacc.c (yyerrlab): Move the code that destroys the stack
3827 (yyreturn): to here. That way, destructors are called properly
3828 even if the stack overflows, or the user calls YYACCEPT or
3829 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
3830 (yyoverflowlab): Destroy the lookahead.
3832 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
3834 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
3836 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
3838 * NEWS: Bison-generated C parsers no longer quote literal strings
3839 associated with tokens.
3840 * src/output.c (prepare_symbols): Don't escape strings,
3841 since users don't want to see C escapes.
3842 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
3844 * tests/input.at (Torturing the Scanner): Likewise.
3845 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
3847 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
3849 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
3850 the data size is known to be too small and we can't increase it.
3851 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
3853 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
3855 * src/parse-gram.y: Include quotearg.h.
3856 (string_as_id): Quote $1 before using it as a key, since the
3857 lexer no longer quotes it for us.
3858 (string_content): Don't strip quotes, since lexer no longer
3860 * src/scan-gram.l: Include quotearg.h.
3862 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
3863 a key, since the rest of the lexer doesn't quote it.
3864 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
3865 * tests/regression.at (Token definitions): Check for backslashes
3868 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
3869 (YYSIZE_T): Define to unsigned long int when using an older compiler.
3870 (yyparse): Revamp code to generate long syntax error message, to
3871 make it easier to translate, and to avoid problems with arithmetic
3872 overflow. Change "virtual memory" to "memory" in diagnostic, since
3873 we don't know whether the memory is virtual.
3875 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
3877 * NEWS: Bison-generated C parsers now use the _ macro to
3879 * data/yacc.c (_) [!defined _]: New macro.
3880 All English strings wrapped inside this macro.
3881 * doc/bison.texinfo (Bison Parser): Document _.
3882 * po/POTFILES.in: Include src/parse-gram.c, since it now
3883 includes translateable strings that parse-gram.y doesn't.
3885 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
3887 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
3888 reverting the 2004-10-11 change to this function.
3889 (symbol_check_alias_consistency): Don't call symbol_type_set
3890 if the type name is already correct.
3891 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
3893 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
3895 * tests/regression.at (Token definitions): Don't use a token named
3896 c, as that generates a "#define c ..." that runs afoul of buggy
3897 stdlib.h that uses the identifier c as a member of struct
3898 drand48_data. Problem reported by Horst Wente.
3900 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
3902 * bootstrap: Change translation URL from
3903 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
3904 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
3905 redirection glitches. Problem reported by twlevo@xs4all.nl.
3907 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
3909 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
3910 after operands; POSIX says this isn't portable for the c99 command.
3912 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
3914 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
3915 immediately if a data overrun has occurred; this may help us track
3916 down what may be a spurious failure on MacOS.
3918 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
3920 Respond to problems reported by twlevo@xs4all.nl.
3922 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
3924 * src/vcg.h: Comment fix.
3925 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
3926 (G_CMAX): Change to -1 instead of INT_MAX.
3928 * data/yacc.c (yyparse): Omit spaces before #line.
3930 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
3932 * src/tables.c (state_number_to_vector_number): Put it inside an
3933 "#if 0", since it's not currently used. Problem reported by
3936 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
3938 * src/output.c (escaped_output): Renamed from
3939 escaped_file_name_output, since we now use it for symbol tags as
3940 well. All uses changed.
3941 (symbol_destructors_output, symbol_printers_output):
3942 Escape symbol tags too.
3943 Problem reported by Matyas Forstner in
3944 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
3946 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
3948 * src/output.c (user_actions_output, token_definitions_output,
3949 symbol_destructors_output, symbol_printers_output): Likewise.
3950 * src/reader.c (prologue_augment): Likewise.
3951 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
3953 * src/vcg.c (output_edge): Don't quote linestyle arg.
3954 Problem reported by twlevo@xs4all.nl.
3956 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
3958 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
3959 example, reported by Derek M Jones. Also, make the example even
3960 more outrageous, to better illustrate how bad the problem is.
3962 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
3964 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
3965 putsym. Typo reported by Sebastian Piping.
3967 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
3969 * doc/bison.texinfo (Language and Grammar): some -> same
3970 (Epilogue): int he -> in the
3971 Typos reported by Sebastian Piping via Justin Pence.
3973 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
3975 * tests/glr-regression.at (Improper handling of embedded actions
3976 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
3977 embedded actions and $-N in GLR parsers", work around an Autoconf bug
3978 with dollar signs in test names.
3979 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
3980 for a similar reason.
3982 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
3984 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
3985 wants to redefine G_VIEW.
3987 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
3989 * src/vcg.c (get_view_str): Remove case for normal_view.
3990 Problem reported by twlevo@xs4all.nl.
3992 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
3994 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
3995 Problem reported by twlevo@xs4all.nl.
3997 * doc/bison.texinfo: Change @dircategory from "GNU programming
3998 tools" to "Software development". Requested by Richard Stallman
4001 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
4003 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
4004 Problem reported by twlevo@xs4all.nl.
4006 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
4008 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
4009 keyword; it's not needed with modern compilers, and it doesn't
4010 affect correctness with older compilers. Suggested by
4013 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
4015 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
4016 gcc -Wswitch-default.
4017 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4018 * data/yacc.c (yyparse): Likewise.
4020 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
4022 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
4023 already. Let config.h define any nonstandard values.
4025 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
4027 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
4028 for the benefit of slower hosts. Problem reported by
4031 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
4033 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
4034 being defined and not used.
4035 * data/lalr1.cc (yyparse): Likewise.
4036 Use "if (false)" rather than "if (0)".
4038 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
4040 * TODO: Mention that we should allow NUL bytes in tokens.
4042 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
4044 * src/scan-skel.l (<<EOF>>): Don't close standard output.
4045 Problem reported by Hans Aberg.
4047 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
4049 * src/getargs.c (version): Happy new year; update overall
4050 program copyright date from 2004 to 2005.
4052 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
4053 Problem reported by Hans Aberg.
4054 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
4055 (Output file names.): Add a test for the case when standard output
4058 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
4060 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
4061 to fix an oversight in the Bison 2.0 manual.
4063 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
4065 * NEWS: Version 2.0. Reformat the existing news items since
4066 1.875, so that related items are grouped together.
4067 * configure.ac (AC_INIT): Bump version to 2.0.
4068 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
4070 * tests/torture.at (Exploding the Stack Size with Alloca): Set
4071 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
4072 otherwise, we're not testing alloca. Unfortunately there's no
4073 simple way to consult HAVE_ALLOCA here.
4075 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
4078 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
4079 hand. This avoids a warning about comparing int to size_t when
4080 GCC warnings are enabled.
4082 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4084 * NEWS: Bison-generated parsers no longer default to using the
4085 alloca function (when available) to extend the parser stack, due
4086 to widespread problems in unchecked stack-overflow detection.
4087 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4088 responsibility to set it to a positive value. This lets the user
4089 specify a value that is not a preprocessor constant.
4090 * data/yacc.c (YYMAXDEPTH): Likewise.
4091 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4092 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4093 to be a compile-time constant. However, explain the constraints on it.
4094 Also, explain the constraints on YYINITDEPTH.
4095 (Table of Symbols): Explain that alloca is no longer the default.
4096 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4099 * doc/bison.texinfo (Location Default Action): Mention that n must
4100 be zero when k is zero. Suggested by Frank Heckenbach.
4102 2004-12-22 Akim Demaille <akim@epita.fr>
4104 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4105 (parser::state_type, parser::semantic_type, parser::location_type):
4106 Private, not public.
4107 (parser::parse): Return ints, not bool.
4108 Returning a bool introduces a problem: 0 corresponds to false, and
4109 it seems weird to return false on success. Returning true changes
4110 the conventions for yyparse.
4111 Alternatively we could return void and send an exception.
4112 There is no clear consensus (yet?).
4113 (state_stack, semantic_stack, location_stack): Rename as...
4114 (state_stack_type, semantic_stack_type, location_stack_type): these.
4115 Private, not public.
4116 * tests/c++.at: New.
4117 * tests/testsuite.at, tests/Makefile.am: Adjust.
4119 2004-12-21 Akim Demaille <akim@epita.fr>
4121 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4123 2004-12-21 Akim Demaille <akim@epita.fr>
4125 Don't impose std::string for filenames.
4127 * data/lalr1.cc (b4_filename_type): New.
4128 (position::filename): Use it.
4129 (parser.hh): Move the inclusion of stack.hh and location.hh below
4130 the user code, so that needed headers for the filename type can be
4132 Forward declare them before the user code.
4133 * tests/Makefile.am (check-local, installcheck-local): Pass
4134 TESTSUITEFLAGS to the TESTSUITE.
4136 2004-12-20 Akim Demaille <akim@epita.fr>
4138 Use more STL like names: my_class instead of MyClass.
4140 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
4141 (SemanticStack, SemanticType, StateStack, StateType)
4142 (TokenNumberType, Stack, Slice, Traits, Parser::location)
4143 (Parser::value): Rename as...
4144 (location_stack, location_type, rhs_number_type, semantic_stack)
4145 (semantic_type, state_stack, state_type, token_number_type, stack)
4146 (slice, traits, parser::yylloc, parser::yylval): these.
4148 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
4150 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4152 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
4153 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4155 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
4157 Remove uses of 'short int' and 'unsigned short int'. This raises
4158 some arbitrary limits. It uses more memory but nowadays that's
4159 not much of an issue.
4161 This change does not affect the generated parsers; that's a different
4162 task, as some users will want to conserve memory there.
4164 Ideally we should use size_t to represent all object counts, and
4165 something like ptrdiff_t to represent signed differences of object
4166 counts; but that will require more code-cleanup than I have the
4167 time to do right now.
4169 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
4170 Use size_t, not int or short int, to count objects.
4171 * src/closure.c (nritemset, closure): Likewise.
4172 * src/closure.h (nritemset, closure): Likewise.
4173 * src/nullable.c (nullable_compute): Likewise.
4174 * src/print.c (print_core): Likewise.
4175 * src/print_graph.c (print_core): Likewise.
4176 * src/state.c (state_compare, state_hash): Likewise.
4177 * src/state.h (struct state): Likewise.
4178 * src/tables.c (default_goto, goto_actions): Likewise.
4180 * src/gram.h (rule_number, rule): Use int, not short int.
4181 * src/output.c (prepare_rules): Likewise.
4182 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
4183 errs, reductions): Likewise.
4184 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
4186 * src/tables.c (vector_number, tally, action_number,
4187 ACTION_NUMBER_MINIMUM): Likewise.
4188 * src/output.c (muscle_insert_short_int_table): Remove.
4190 2004-12-17 Akim Demaille <akim@epita.fr>
4192 * data/lalr1.cc: Extensive Doxygenation.
4193 (error_): Rename as...
4194 (error): this, since it is visible to the user.
4196 (Parser::message): Now an automatic variable from...
4197 (Parser::yyreport_syntax_error_): here.
4198 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
4200 * tests/input.at: Escape $.
4202 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
4204 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
4205 Parenthesize rhs to avoid obscure problems with mistakes like
4206 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
4207 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
4208 b4_rhs_location): Likewise.
4209 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
4210 b4_rhs_location): Likewise.
4212 2004-12-16 Akim Demaille <akim@epita.fr>
4214 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
4215 yacc.c: be sure to stay within yycheck_.
4216 * tests/actions.at: Re-enable C++ tests.
4218 2004-12-16 Akim Demaille <akim@epita.fr>
4220 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
4223 2004-12-16 Akim Demaille <akim@epita.fr>
4225 Use #define to handle the %name-prefix.
4227 * data/glr.c, data/yacc.c: Comment changes.
4228 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
4229 so that one can refer to yylex in the parser file, and have it
4230 renamed, as is the case with other skeletons.
4232 2004-12-16 Akim Demaille <akim@epita.fr>
4234 Move lalr1.cc internals into yy*.
4236 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
4237 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
4238 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
4239 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
4240 (empty_, final_, terror_, errcode_, ntokens_)
4241 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
4242 (looka_, ilooka_, error_range_, nerrs_):
4244 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
4245 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
4246 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
4247 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
4248 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
4249 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
4250 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
4251 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
4254 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
4256 Fix some problems reported by twlevo at xs4all.
4257 * src/symtab.c (symbol_new): Report an error if the input grammar
4258 contains too many symbols. This is better than calling abort() later.
4259 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
4260 (struct node, struct graph):
4261 Rename member expand to stretch. All uses changed.
4262 (struct graph): Remove member layoutalgorithm. All uses removed.
4263 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
4264 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
4266 (N_STRETCH): Rename from N_EXPAND. All uses changed.
4268 2004-12-15 Akim Demaille <akim@epita.fr>
4270 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
4271 Add more Doxygen comments.
4272 (symprint_, stack_print_, reduce_print_, destruct_, pop)
4273 (report_syntax_error_, translate_): Rename as...
4274 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
4275 (yypop_, yyreport_syntax_error_, yytranslate_): this.
4277 2004-12-15 Akim Demaille <akim@epita.fr>
4279 * data/lalr1.cc (lex_): Rename as...
4281 Move the trace here.
4282 Take the %name-prefix into account.
4283 Reported by Alexandre Duret-Lutz.
4285 2004-12-15 Akim Demaille <akim@epita.fr>
4287 Simplify the C++ parser constructor.
4289 * data/lalr1.cc (debug_): Rename as...
4290 (yydebug_): so that the parser's internals are always in the yy*
4293 (b4_parse_param_decl): Remove the leading comma as it is now only
4294 called as unique argument list.
4295 (Parser::Parser): Remove the constructor accepting a location and
4296 an initial debugging level.
4297 Remove from the other ctor the argument for the debugging level.
4298 (debug_level_type, debug_level, set_debug_level): New.
4300 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
4303 2004-12-15 Akim Demaille <akim@epita.fr>
4305 Remove b4_root related material: failure experiment
4306 (which goal was to allow to derive from a class).
4308 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
4309 definitions and uses.
4311 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
4313 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
4314 not 2, since it's not portable to subtract 1 from the start of an
4315 array. The new item 0 is never set or used. All uses changed.
4317 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
4318 the default definition of YYLLOC_DEFAULT. Problem reported
4319 by Frank Heckenbach.
4321 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
4323 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
4324 the normal case and one for the error case. Just use the
4325 first one uniformly. Problem reported by Frank Heckenbach.
4326 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
4327 use exactly the same macro in both places.
4328 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
4329 so that the normal-case YYRHSLOC works for the error case too.
4331 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
4332 (YYLLOC_DEFAULT): Use the same macro as glr.c.
4333 * doc/bison.texinfo (Location Default Action): Don't claim that
4334 we have an array of locations. Use the same macro for both glr
4335 and lalr parsers. Mention YYRHSLOC. Mention what happens when
4338 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
4340 * HACKING: Update email addresses to send announcements to.
4342 * configure.ac (AC_INIT): Bump version to 1.875f.
4344 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
4346 * NEWS: Version 1.875e.
4347 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
4349 * src/scan-skel.l: Include "complain.h", for "fatal".
4351 * src/relation.h (relation_print, relation_digraph):
4352 Relation sizes are of type relation_node, not size_t (this is
4353 merely a doc fix, since the two types are equivalent).
4354 (relation_transpose): Relation sizes are of type relation_node,
4356 * src/relation.c: Likewise.
4357 (top, infinity): Now of type relation_node, not int.
4358 (traverse, relation_transpose): Use relation_node, not int.
4360 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
4361 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
4362 (yyparse): Remove unused local introduced in 2004-10-25 patch.
4364 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
4365 specifying whether the test should be skipped. Use it tp
4366 specify that the [%defines %skeleton "lalr1.cc"] tests currently
4367 fail on some hosts, and should be skipped.
4369 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
4371 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
4372 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
4373 unless otherwise specified below.
4375 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
4376 to allocate kernel_base, kernel_items, kernel_size, since
4377 they needn't be initialized to 0.
4378 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
4379 * src/closure.c (new_closure): Likewise, for itemset.
4380 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
4381 * src/lalr.c (set_goto_map): Likewise, for temp_map.
4382 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
4383 (build_relations): Likewise for edge, states1, includes.
4384 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
4385 * src/reader.c (packgram): Likewise, for ritem, rules.
4386 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
4387 * src/relation.c (relation_digraph): Likewise for VERTICES.
4388 (relation_transpose): Likewise for new_R, end_R.
4389 * src/symtab.c (symbols_token_translations_init): Likewise for
4391 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
4392 (token_actions): Likewise for yydefact, actrow, conflrow,
4394 (save_column): Likewise for froms[symno], tos[symno].
4395 (goto_actions): Likewise for state_count.
4396 (pack_table): Likewise for base, pos, check.
4397 (tables_generate): Likewise for width.
4399 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
4400 for initial core. Just have a separate core, so we needn't worry
4401 about whether kernel_size and kernel_base are initialized.
4403 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
4404 kernel_size, kernel_items): Remove unnecessary initialization.
4405 * src/conflicts.c (conflicts): Likewise.
4406 * src/derives.c (derives): Likewise.
4407 * src/muscle_tablc (muscle_insert): Likewise.
4408 * src/relation.c (relation_digraph): Likewise.
4409 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
4410 conflrow, conflict_table, conflict_list, table, check):
4413 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
4414 This is because all callers pass unsigned int.
4415 * src/closure.h (new_closure): Likewise.
4417 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
4418 (build_relations): Initialize includes[i] in all cases.
4419 * src/reader.c (packgram): Always initialize rules[ruleno].prec
4420 and rules[ruleno].precsym. Initialize members in order.
4421 * src/relation.c (relation_transpose): Always initialize new_R[i]
4423 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
4425 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
4426 conflict_list[0] was always 0, but now it isn't initialized.
4428 * src/table.c (table_grow): When conflict_table grew, the grown
4429 area wasn't cleared. Fix this.
4431 * lib/.cvsignore: Add strdup.c, strdup.h.
4432 * m4/.cvsignore: Add strdup.m4.
4434 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
4436 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
4437 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
4438 GOTO_NUMBER_MAXIMUM, since we occasionally compute
4439 ngotos + 1 without checking for overflow.
4440 (build_relations): Use END_NODE, not -1, to denote end of edges.
4441 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
4442 build_relations): Use goto_number, not int, for goto numbers.
4443 * src/tables.c (save_column, default_goto): Likewise.
4445 2004-11-23 Akim Demaille <akim@epita.fr>
4447 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
4448 of #defining from yystype.
4449 Don't typedef yystype, C++ does not need it.
4450 This lets it possible to forward declare it as union.
4452 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
4454 * bootstrap (gnulib_modules): Add extensions.
4455 Problem reported by Jim Meyering.
4457 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
4459 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
4460 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
4461 src/system.h, src/tables.c: XFREE -> free, to accommodate
4462 recent change to gnulib xalloc.h.
4463 Problem reported by Jim Meyering.
4465 2004-11-17 Akim Demaille <akim@epita.fr>
4467 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
4469 2004-11-17 Akim Demaille <akim@epita.fr>,
4470 Alexandre Duret-Lutz <adl@gnu.org>
4472 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
4475 Use it instead of cdebug_.
4476 (Parser::debug_stream, Parser::set_debug_stream): New.
4477 (Parser::symprint_): Define cdebug_ for temporary backward
4479 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
4482 2004-11-17 Akim Demaille <akim@epita.fr>
4484 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
4485 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
4486 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
4487 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
4489 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
4491 * data/glr.c (yyloc_default): Remove; not used.
4492 Problem reported by Frank Heckenbach.
4494 2004-10-25 Akim Demaille <akim@epita.fr>
4496 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
4497 Introduce another definition to address simple location arrays.
4498 (yyGLRStack): New member: yyerror_range.
4499 (yyrecoverSyntaxError, yyparse): Update it.
4500 (yyrecoverSyntaxError): Use it when shifting the error token to
4501 have an accurate range, equivalent to the one computed by both
4502 yacc.c and lalr1.cc.
4503 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
4504 that column numbers start at column 0, as per GNU Coding
4505 Standards, the others tests, and the doc.
4506 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
4507 Adjust to the above change (first column is 0).
4508 And adjust the location of the "<error>", now covering the whole
4511 2004-10-22 Akim Demaille <akim@epita.fr>
4512 and Paul Eggert <eggert@cs.ucla.edu>
4514 Remove some arbitrary limits on goto numbers and relations.
4515 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
4516 initial values, since they're never used.
4517 (set_goto_map): ngotos is now unsigned, so test for overflow
4518 by seeing whether it wraps around to zero.
4519 * src/lalr.h (goto_number): Now size_t, not short int.
4520 (GOTO_NUMBER_MAXIMUM): Remove.
4521 * src/relation.c (relation_print, traverse, relation_transpose):
4522 Check for END_NODE rather than looking at sign.
4523 * src/relation.h (END_NODE): New macro.
4524 (relation_node): Now size_t, not short int.
4526 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
4528 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
4529 keyword, not an identifier. Problem reported by Baron Schwartz in
4530 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
4532 2004-10-11 Akim Demaille <akim@epita.fr>
4534 * src/symtab.c (symbol_check_alias_consistency): Also check
4535 type names, destructors, and printers.
4536 Reported by Alexandre Duret-Lutz.
4537 Recode the handling of associativity and precedence in terms
4538 of symbol_precedence_set.
4539 Accept no redeclaration at all, not even equal to the previous
4541 (redeclaration): New.
4542 Use it to factor redeclaration complaints.
4543 (symbol_make_alias): Don't set the type of the alias, let
4544 symbol_check_alias_consistency do it as for other features.
4545 * src/symtab.h (symbol): Add new member prec_location, and
4547 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
4548 * tests/input.at (Incompatible Aliases): New.
4550 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
4552 .cvsignore fixes to accommodate gnulib changes,
4553 and the practice of naming build directories "_build".
4554 * .cvsignore: Add "_*". Sort.
4555 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
4556 * m4/.cvsignore: Add "*_gl.m4".
4558 2004-10-06 Akim Demaille <akim@epita.fr>
4560 * src/parse-gram.y (add_param): Fix the truncation of trailing
4563 2004-10-05 Akim Demaille <akim@epita.fr>
4565 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
4566 whether the reducion was empty or not. This leaves room to
4567 improve the use of YYLLOC_DEFAULT in such a case.
4568 lalr1.cc is still experimental, so changing this is acceptable.
4569 And finally, there are probably not many users who changed the
4570 handling of locations in GLR, so changing is admissible too.
4572 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
4573 empty reduction, set @$ to an empty location ending the previously
4575 Adjust uses to make sure the code is triggered on empty
4577 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
4578 expected output: empty reductions have empty locations.
4580 2004-09-29 Akim Demaille <akim@epita.fr>
4582 * data/lalr1.cc: Move towards a more standard C++ coding style
4583 for templates: Class < T > -> Class<T>.
4585 2004-09-29 Akim Demaille <akim@epita.fr>
4587 * data/lalr1.cc: Reinstall the former ctor, for sake of
4588 compatibility, but warn it will be removed.
4589 Move towards a more standard C++ coding style (i.e., type *var ->
4592 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
4594 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
4595 since it's less likely to work if NULs are involved in the future.
4597 2004-09-27 Akim Demaille <akim@epita.fr>
4599 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
4601 2004-09-27 Akim Demaille <akim@epita.fr>
4603 * data/lalr1.cc (b4_parse_param_decl_1): New.
4604 (b4_parse_param_decl): Use it to have different names between attribute
4606 (b4_cc_constructor_call): Likewise.
4608 2004-09-24 Akim Demaille <akim@epita.fr>
4610 * src/parse-gram.y (add_param): Strip the leading and trailing
4611 blanks from a formal argument declaration.
4612 (YY_LOCATION_PRINT): New.
4614 2004-09-24 Akim Demaille <akim@epita.fr>
4616 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
4619 2004-09-24 Akim Demaille <akim@epita.fr>
4621 * doc/bison.texinfo (Table of Symbols): Sort.
4623 2004-09-21 Akim Demaille <akim@epita.fr>
4625 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
4626 the useless parentheses.
4627 Suggested by Paul Eggert.
4629 2004-09-20 Akim Demaille <akim@epita.fr>
4631 Let the initial-action act on the look-ahead, and use it for the
4632 "initial push" (corresponding to an hypothetical beginning-of-file).
4633 And let lalr1.cc honor %initial-action.
4635 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
4637 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
4638 (Parser::Parser): Remove the ctor that used to initialize it.
4639 (Parser::parse): Like in the other skeletons, issue the "starting
4640 parse" message before any action.
4641 Honor %initial-action.
4642 Initialize the stacks with the lookahead.
4643 * data/yacc.c: Let $$ and @$ in %initial-action designate the
4645 Push them in the stacks.
4646 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
4648 2004-09-20 Akim Demaille <akim@epita.fr>
4650 * doc/bison.texinfo (Initial Action Decl): New.
4652 2004-09-20 Akim Demaille <akim@epita.fr>
4654 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
4655 clearer criterion to define it.
4656 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
4657 When reducing on an empty RHS, use the latest stacked location as
4659 yylloc is not always available.
4660 * data/glr.c: Likewise.
4661 Also, honor initial-actions.
4663 2004-09-20 Akim Demaille <akim@epita.fr>
4665 * data/yacc.c (YY_LOCATION_PRINT): New.
4666 Define when we know YYLTYPE's structure, i.e., when the default
4667 YYLLOC_DEFAULT is used.
4668 * data/c.m4 (b4_yysymprint_generate): Use it.
4669 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
4670 value of the result.
4671 (error_start_): Replace with...
4672 (error_range_): this location array.
4673 This allows to replace code relying on the implementation of
4674 locations by portable code.
4675 * data/yacc.c (yylerrsp): Replace with...
4676 (yyerror_range): this.
4677 Every time a token is popped, update yyerror_range[0], to have an
4678 accurate location for the error token.
4679 * data/glr.c (YY_LOCATION_PRINT): New.
4680 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
4681 deference a pointer.
4682 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
4683 report the location in %printers.
4685 * src/scan-skel.l: Instead of abort, report error messages to ease
4686 understanding skeleton scanning failures.
4688 2004-09-16 Akim Demaille <akim@epita.fr>
4690 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
4691 (iterator, const_iterator): these, to be more in the C++ spirit.
4692 Also, return reverse iterators so that when displaying the stack
4693 we display its bottom first.
4694 (Parser::stack_print_, Parser::reduce_print_): Match the messages
4696 We should probably use vector here though.
4698 2004-09-16 Akim Demaille <akim@epita.fr>
4700 Have more complete shift traces.
4702 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
4703 to report Shifts instead of ad hoc YYDPRINTF invocations,
4704 including for the error token.
4705 * data/lalr1.cc (symprint_): Output the location.
4706 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
4707 output the location within the %printer.
4708 Activate GLR tests, at least to make sure they compile properly.
4709 They still don't pass though.
4710 * tests/calc.at: Adjust expect verbose output, since now "Entering
4711 state..." is on a different line than the "Shifting" message.
4713 2004-09-08 Akim Demaille <akim@epita.fr>
4715 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
4716 Bison directive from the Bison file to the invocation of this
4717 macro, so that these directives are passed to
4718 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
4719 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
4720 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
4721 the extra Bison directives instead of the whole series.
4722 Change the grammar so that there are recoverable errors, and
4723 unrecoverable errors. Now we can have the parser give up before
4724 consuming the whole input. As a result we now can observe that
4725 the lookahead is freed when needed.
4726 Change the parser source to parse argv[1] instead of a hard coded
4728 Simplify yylex, and give a value and location to EOF.
4729 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
4730 passed directives already coded in the file.
4731 Add some tests to check the location of "error".
4732 For some tests, the C++ parser is correct, and not yacc.c.
4733 For other tests, they provide different, but unsatisfying, values,
4734 so keep the C++ value so that at least one parser is "correct"
4735 according to the test suite.
4736 (Actions after errors): Remove, this is subsumed by the
4737 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
4739 2004-09-06 Akim Demaille <akim@epita.fr>
4741 * data/lalr1.cc: Adjust the indentation of the labels.
4745 2004-09-06 Akim Demaille <akim@epita.fr>
4747 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
4748 argument, an informative message.
4749 Call YY_SYMBOL_PRINT.
4750 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
4751 * data/lalr1.cc (destruct_): Likewise.
4752 In addition, no longer depend on b4_yysymprint_generate and
4753 b4_yydestruct_generate to generate these functions, do it "by
4756 2004-09-03 Akim Demaille <akim@epita.fr>
4758 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
4759 invoked, yydestruct the lookahead.
4760 * tests/calc.at (Calculator $1): Update the expected lengths of
4761 traces: there is an added line for the discarded lookahead.
4762 * doc/bison.texinfo (Destructor Decl): Some rewording.
4763 Define "discarded" symbols.
4765 2004-09-02 Akim Demaille <akim@epita.fr>
4767 * data/lalr1.cc (translate_, destruct_): No reason to be static.
4769 2004-09-02 Akim Demaille <akim@epita.fr>
4771 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
4772 (YYDSYMPRINTF): Rename as...
4773 (YY_SYMBOL_PRINT): this.
4774 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
4776 Use it instead of direct symprint_ calls.
4777 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
4780 2004-09-02 Akim Demaille <akim@epita.fr>
4782 * data/lalr1.cc (b4_yysymprint_generate): New.
4783 (symprint_): New member function, defined when YYDEBUG.
4784 Use it consistently instead of token/nterm debugging output by
4786 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
4787 %printer calls to use cdebug_ when using lalr1.cc.
4789 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
4791 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
4792 with #ifdef YYDEBUG.
4794 2004-08-26 Akim Demaille <akim@epita.fr>
4796 * doc/bison.texinfo (Implementing Loops): Rename as...
4797 (Implementing Gotos/Loops): this.
4799 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
4801 Adjust to latest gnulib.
4802 * bootstrap (gnulib_modules): Add xalloc-die.
4803 Set LC_ALL=C so that file names sort consistently.
4804 Prefer the gnulib copies of gettext.m4, glibc21.m4,
4805 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
4806 uintmax_t.m4, ulonglong.m4.
4807 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
4808 po.m4 since we are now using _gl.m4 instead.
4810 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
4812 * src/scan-action.l: Remove. Scanning of semantic actions is
4813 handled in scan-gram.l.
4815 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
4817 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
4819 * src/location.h (struct): The file member is a uniqstr.
4820 (equal_boundaries): Use UNIQSTR_EQ for comparison.
4822 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
4824 Fix bug with non-%union parsers that have printers or destructors,
4825 which led to a Bison core dump. Reported by Peter Fales in
4826 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
4828 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
4829 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
4830 not to our own type.
4831 * src/output.c (symbol_destructors_output, symbol_printers_output):
4832 Don't assume %union.
4833 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
4834 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
4835 UNION-FLAG. All callers changed.
4836 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
4837 Use type char, not unsigned int, when declaring an array of char;
4838 this lets us remove a cast.
4839 (Printers and Destructors): Add non-%union test cases.
4841 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
4843 * doc/bison.texinfo: Minor editorial changes, mostly to the new
4844 GLR writeups. E.g., avoid frenchspacing and the future tense,
4845 change "lookahead" to "look-ahead", and change "wrt" to "with
4848 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4850 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
4851 New sections, split off from the GLR Parsers section. Put the new
4852 Simple GLR Parser near the start of the GLR section, for clarity.
4853 Rewrite connective text.
4855 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
4857 * doc/bison.texinfo (Simple GLR Parsers): New section.
4859 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
4861 * NEWS, TODO, doc/bison.texinfo:
4862 Use "look-ahead" instead of "lookahead", to be consistent.
4863 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
4864 while we're fixing "look-ahead".
4865 * src/conflicts.c (shift_set): Renamed from shiftset.
4866 (look_ahead_set): Renamed from lookaheadset.
4867 * src/print.c: Likewise.
4868 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
4869 name for "lookahead".
4870 (report_types, usage): Likewise.
4871 * src/getargs.h (report_look_ahead_tokens): Renamed from
4873 * src/lalr.c (compute_look_ahead_tokens): Renamed from
4875 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
4876 (look_ahead_tokens_print): Renamed from lookaheads_print.
4877 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
4878 state_rule_lookaheads_print.
4879 * src/state.h: Likewise.
4880 (reductions.look_ahead_tokens): Renamed from lookaheads.
4881 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
4882 AT_DATA_LOOKAHEADS_GRAMMAR.
4884 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
4886 * README: Update location of patched M4 distribution.
4888 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
4890 Don't assume the C++ compiler takes the same arguments as the C compiler
4892 * configure.ac (O0CXXFLAGS): New var.
4893 * tests/atlocal.in (CXXFLAGS): Use it.
4895 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
4897 Fix some "make check" problems with C++ reported by
4898 Albert Chin-A-Young for Tru64 C++ in this thread:
4899 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
4901 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
4902 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4903 Output to a .cc file for C++, not to a .c file.
4904 * tests/calc.at (AT_CHECK_CALC): Likewise.
4905 * tests/regression.at (AT_CHECK_DANCER): Likewise.
4906 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
4908 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
4910 * tests/calc.at, tests/actions.at: Workaround for SGI
4911 C++ compiler. (trivial change)
4913 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
4915 Spent a few hours checking out which prerequisite versions the
4916 current sources actually require. I went all the way back to
4917 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
4918 a seemingly endless set of combinations of versions more recent
4919 than that. The bottom line is that the current sources require
4920 fairly recent versions of the build tools, and it'll be some work
4922 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
4923 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
4924 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
4925 Add comments explaining why those particular versions are
4928 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
4929 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
4930 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
4932 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
4933 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
4935 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
4937 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
4938 0.11.5. Suggested by Bruno Haible.
4939 * bootstrap: Remove gettext version checking.
4941 * doc/bison.texinfo (Decl Summary): Also mention that %union
4942 can depend on prerequisite types. Problem reported by Tim
4945 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
4947 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
4948 * README-alpha: Don't tell people not to package this.
4950 * bootstrap: Don't assume $(...) works; use `...` instead.
4951 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
4954 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
4955 put into the -d output file, and mention what to do if YYSTYPE is
4958 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
4960 Undo change made earlier today: it caused autopoint to not bring
4961 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
4964 * bootstrap: Check that gettext version matches what's in
4965 configure.ac. Warn users to ignore robots.txt ERROR 404.
4966 * bootstrap: Undo today's earlier change (logged below).
4967 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
4969 The gettext version checking is causing more trouble than it's
4970 curing; remove it. Problem reported by Paul Hilfinger.
4972 * bootstrap: Issue a warning that one can expect a message
4973 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
4974 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
4976 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
4978 Ensure that the C++ compiler used for testing actually works on a
4979 simple test program; if not, skip the C++-related tests. Problem
4980 reported by Vin Shelton in:
4981 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
4983 * m4/cxx.m4: New file.
4984 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
4985 * tests/atlocal.in (BISON_CXX_WORKS): Add.
4986 * tests/local.at (AT_COMPILE_CXX): Use it.
4988 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
4990 * data/glr.c (yylloc): Output this macro even if locations are not
4991 being generated, as the GLR parser needs it even in that case.
4992 Problem reported by Troy A. Johnson
4993 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
4995 * configure.ac (AC_INIT): Update to 1.875e.
4997 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
4999 * NEWS: Version 1.875d.
5000 * configure.ac (AC_INIT): Likewise.
5001 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
5003 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
5004 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
5005 lalr1.cc runs afoul of the first, and the last two are no longer
5006 supported by GCC 3.4.0.
5007 * README: Mention GNU m4 1.4 or later; mention m4 patches.
5008 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
5010 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
5012 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
5013 unsigned int, for compatibility with latest gnulib hash module.
5014 * src/state.c (state_hash, state_hasher): Likewise.
5015 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
5016 * src/uniqstr.c (hash_uniqstr): Likewise.
5018 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
5020 * NEWS: Unescaped newlines are no longer allowed in char & strings.
5022 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
5023 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
5024 character and string literals.
5025 (unexpected_end): New function.
5026 (unexpected_eof): Use it.
5027 (unexpected_newline): New function.
5028 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
5031 * NEWS: Document %expect-rr.
5033 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
5034 Fix typo by replacing $1 with $option.
5035 Remove more 'intl'-related files.
5036 Don't DEFUN AM_INTL_SUBDIR twice.
5038 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
5039 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
5041 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
5042 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
5043 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
5044 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
5045 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
5046 * src/.cvsignore: Add *.output.
5048 * src/parse-gram.y: Put copyright notice inside %{ %} so it
5049 gets copied to the output file.
5051 2004-04-28 Paul Eggert <eggert@twinsun.com>
5053 Get files from the gnulib and po repositories, instead of relying
5054 on them being in our CVS. Upgrade to latest versions of gnulib
5057 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
5058 * bootstrap: Bootstrap from gnulib and po repositories.
5059 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
5060 * README-cvs: Document these changes. Remove version numbers from
5061 mentions of build tools, since they change so often. Mention Flex.
5063 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
5064 (gl_USE_SYSTEM_EXTENSIONS): Add.
5065 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
5066 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
5068 (AC_ISC_POSIX): Remove; we no longer support this
5069 ancient OS, as it gets in the way of latest Autoconf & gnulib.
5070 (AC_HEADER_STDC): Remove: we now assume C89 or better.
5071 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
5072 Do not check for C89 headers, except for locale.h which is used
5073 by the Yacc library and must port to K&R hosts.
5074 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
5075 Do not check for C89 functions, except for setlocale which is
5076 used by the Yacc library.
5077 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
5078 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
5079 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
5080 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5081 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5082 AM_GNU_GETTEXT): Remove; now done by:
5083 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5084 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5087 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5088 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5089 Define to empty, as gnulib.mk will do the rest for us.
5090 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5092 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5093 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5095 * src/files.c: Include gnulib's xstrndup.h.
5097 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5098 (REALLOC): Use xnrealloc, for likewise.
5099 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5100 (strnlen, memrchr): Remove decls; functions no longer used.
5103 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5104 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5105 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5106 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5107 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5108 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5109 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5110 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5111 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5112 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5113 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5114 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5115 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5116 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5117 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5118 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5119 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5120 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5121 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5122 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
5123 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
5124 Remove, as these files are now generated automatically
5125 by bootstrap or automake.
5127 * po/ChangeLog: Remove: all but one entry was a duplicate
5128 of this file, and I moved that 2000-11-02 entry here.
5130 * config/.cvsignore: Add Makefile, depcomp, install-sh.
5131 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
5132 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
5133 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
5134 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
5135 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
5136 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
5137 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
5138 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
5139 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
5140 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
5142 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
5143 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
5144 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
5145 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
5146 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
5147 * src/.cvsignore: Remove *_.c.
5150 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
5151 support it. (The latest stable gzip doesn't.)
5153 2004-04-27 Paul Eggert <eggert@twinsun.com>
5155 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
5156 case, as stos_ is now used by destructors due to the 2004-02-09
5159 Remove more K&R C support.
5160 * lib/libiberty.y (PARAMS): Remove. All uses removed.
5161 * lib/subpipe.c (errno): Remove decl.
5162 Include <stdlib.h> unconditionally.
5163 (EXIT_FAILURE): Remove macro.
5164 * src/complain.c (vfprintf, strerror): Remove.
5165 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
5167 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
5168 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
5169 (strchr, strspn, memchr): Remove decls.
5170 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
5171 unconditionally. Do not declare perror.
5172 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
5175 * src/complain.c (_): Remove useless defn, as system.h defines this.
5177 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
5178 with latest obstack.h.
5179 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
5180 to procedure types, as obstack.h now does that for us.
5181 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
5183 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
5184 so that this include file can stand alone.
5185 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
5186 does this now. Include subpipe.h first after config.h, to
5187 test whether it can stand alone.
5189 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
5190 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
5193 * tests/synclines.at (%union synch line): Put a dummy member in
5194 the union, because empty unions aren't allowed in C. Caught
5197 2004-04-13 Jim Meyering <jim@meyering.net>
5199 * src/conflicts.c (conflicts_print): Correct format string typo:
5200 use `%%' to produce literal `%'. (trivial change)
5202 2004-03-30 Paul Eggert <eggert@twinsun.com>
5204 * src/getargs.c (version): Update copyright year to 2004.
5206 * data/c.m4 (b4_int_type): Use 'short int' rather than
5207 'short', and similarly for 'long', 'unsigned', etc.
5208 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
5209 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
5210 yy_yypstack, yydumpstack): Likewise.
5211 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
5212 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
5214 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
5215 yy_stack_print, yyparse): Likewise.
5216 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
5217 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
5218 * lib/bitset.c (bitset_print): Likewise.
5219 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
5220 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
5221 * lib/bitsetv.c (bitsetv_dump): Likewise.
5222 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
5223 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
5225 * src/LR0.c (allocate_itemsets): Likewise.
5226 * src/gram.h (rule_number, rule): Likewise.
5227 * src/lalr.h (goto_number): Likewise.
5228 * src/nullable.c (nullable_compute): Likewise.
5229 * src/output.c (prepare_rules): Likewise.
5230 * src/relation.c (relation_print, relation_digraph): Likewise.
5231 * src/relation.h (relation_node): Likewise.
5232 * src/state.h (state_number, transitions, errs, reductions,
5233 struct state): Likewise.
5234 * src/symtab.h (symbol_number, struct symbol): Likewise.
5235 * src/tables.c (vector_number, tally, action_number,
5236 default_goto, goto_actions): Likewise.
5237 * tests/existing.at (GNU Cim Grammar): Likewise.
5238 * tests/regression.at (Web2c Actions): Likewise.
5240 * src/output.c (muscle_insert_short_int_table): Renamed from
5241 muscle_insert_short_table. All uses changed.
5243 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5245 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
5246 (declaration): Replace expected_conflicts with expected_sr_conflicts.
5247 Add %expect-rr rule.
5249 * src/scan-gram.l: Recognize %expect-rr.
5251 * src/conflicts.h (expected_sr_conflicts): Rename from
5253 (expected_rr_conflicts): Declare.
5255 * src/conflicts.c (expected_sr_conflicts): Rename from
5257 (expected_rr_conflicts): Define.
5258 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
5260 Use expected_sr_conflicts in place of expected_conflicts.
5261 Warn if expected_rr_conflicts used in non-GLR parser.
5263 * doc/bison.texinfo: Add documentation for %expect-rr.
5265 2004-03-08 Paul Eggert <eggert@gnu.org>
5267 Add support for hex token numbers. Suggested by Odd Arild Olsen in
5268 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
5270 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
5272 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
5273 * src/scan-gram.l (scan_integer): New function.
5275 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
5276 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
5277 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
5278 Say "long int", not "long", for uniformity with GNU style.
5280 2004-02-25 Paul Eggert <eggert@twinsun.com>
5282 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
5283 compilers. This fixes a problem with Intel's C++ compiler being
5284 chatty, reported by Guido Trentalancia in
5285 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
5287 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
5289 Support %destructor and merge error locations in lalr1.cc.
5291 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
5292 (Parser::stos_): Define unconditionally.
5293 (Parser::destruct_): New method. Generate its body with
5294 b4_yydestruct_generate.
5295 (Parser::error_start_): New attribute.
5296 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
5297 token which are discarded.
5298 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
5299 error_start_ when erroneous token are discarded.
5300 (Parser::parse) <yyerrlab1>: Compute the location of the error
5301 token so that it covers all the discarded tokens.
5302 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
5303 it can be called with `%skeleton "lalr1.cc"', and do that.
5305 2004-02-02 Paul Eggert <eggert@twinsun.com>
5307 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
5308 $(top_srcdir)/lib and ../lib. This fixes a bug reported
5309 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
5310 There's no need to mention top_builddir since Automake does that
5312 (INCLUDES): Remove, as Automake says it's obsolescent.
5313 Contents migrated into AM_CPPFLAGS as described above.
5314 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
5316 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5318 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
5319 (yyreportSyntaxError): Handle case where lookahead token is
5322 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5324 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
5325 resulting parsers are compilable with C++.
5327 2003-12-23 Paul Eggert <eggert@twinsun.com>
5329 * config/depcomp, config/install-sh: Sync with Automake 1.8.
5330 * src/output.c (output_skeleton): Rename local var.
5331 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
5332 Bison tokens, as this runs afoul of the 2003-10-07 change that
5333 disallowed NUL bytes in character constants or string literals.
5335 * tests/local.at: Require Autoconf 2.59's Autotest.
5336 * tests/testsuite.at: Don't include local.at, since we now assume
5337 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
5339 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
5340 multiple inclusion warnings.
5342 2003-12-02 Akim Demaille <akim@epita.fr>
5344 * doc/bison.texinfo (How Can I Reset the Parser): More about start
5348 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
5350 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
5352 2003-10-07 Paul Eggert <eggert@twinsun.com>
5354 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
5355 if testsuite doesn't exist.
5357 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
5358 literals, unfortunately.
5359 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
5360 Complain about NUL bytes in character constants or string literals.
5362 2003-10-05 Paul Eggert <eggert@twinsun.com>
5364 * NEWS: Don't document %no-default-prec, as it's still
5366 * doc/bison.texinfo: Document %no-default-prec only if
5367 the defaultprec flag is set. Normally it's not.
5369 2003-10-04 Paul Eggert <eggert@twinsun.com>
5371 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
5372 non-modifiable lvalue, instead of a modifiable one.
5373 * doc/bison.texinfo (Actions): Document that $$ can
5374 be assigned to. Do not claim that $$ and $N are
5375 array element references: user code should not rely on this.
5377 2003-10-01 Paul Eggert <eggert@twinsun.com>
5379 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
5380 (grammar_declaration): Use it.
5381 * src/scan-gram.l: New token %no-default-prec.
5382 * tests/conflicts.at: Revamp tests to use %no-default-prec.
5383 * NEWS, doc/bison.texinfo: Document the above.
5385 2003-10-01 Akim Demaille <akim@epita.fr>
5387 VCG no longer supports long_straight_phase.
5389 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
5390 * src/print_graph.c (print_graph): Adjust.
5392 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
5393 and Paul Eggert <eggert@twinsun.com>
5395 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
5396 Table of Symbols): Document %default-prec.
5397 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
5398 (grammar_declaration): Set default_prec on %default-prec.
5399 * src/scan-gram.l (%default-prec): New token.
5400 * src/reader.h (default_prec): New flag.
5401 * src/reader.c: Likewise.
5402 (packgram): Handle it.
5403 * tests/conflicts.at (%default-prec without %prec,
5404 %default-prec with %prec, %default-prec 1): New tests.
5406 2003-09-30 Paul Eggert <eggert@twinsun.com>
5408 * tests/testsuite.at: Include local.at, not input.at, fixing
5409 a typo in the 2003-08-25 patch.
5411 2003-08-27 Akim Demaille <akim@epita.fr>
5413 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
5416 2003-08-26 Akim Demaille <akim@epita.fr>
5418 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
5419 "<\#" to avoid magic from Gnus when posting parts of this script.
5421 2003-08-26 Akim Demaille <akim@epita.fr>
5423 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
5424 (Parser::parse): here.
5425 Adjust: nerrs and errstatus is now replaced by...
5426 (Parser::nerrs_, Parser::errstatus_): New.
5428 2003-08-25 Akim Demaille <akim@epita.fr>
5430 * config/announce-gen, Makefile.cfg: New.
5431 * Makefile.am: Adjust.
5432 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
5433 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
5435 2003-08-25 Akim Demaille <akim@epita.fr>
5437 When reducing initial empty rules, Bison parser read an initial
5438 location that is not defined. This results in garbage, and that
5439 affects Bison's own parser. Therefore we need (i) to extend Bison
5440 to support a means to initialize this location, and (ii) to use
5441 this CVS Bison to fix CVS Bison's parser.
5443 * src/reader.h, reader.c (epilogue_augment): Remove, replace
5445 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
5446 * src/parse-gram.y: Adjust.
5447 (%initial-action): New.
5448 (%error-verbose): Since we require CVS Bison, there is no reason
5450 * src/scan-gram.l: Adjust.
5451 * src/Makefile.am (YACC): New, to make sure we use our own parser.
5452 * data/yacc.c (yyparse): Use b4_initial_action.
5454 2003-08-25 Akim Demaille <akim@epita.fr>
5456 * doc/bison.texinfo: Don't promote stdout for error messages.
5458 2003-08-25 Akim Demaille <akim@epita.fr>
5460 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
5461 From Alexandre Duret-Lutz.
5463 2003-08-25 Akim Demaille <akim@epita.fr>
5467 2003-08-25 Akim Demaille <akim@epita.fr>
5469 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
5472 2003-08-25 Akim Demaille <akim@epita.fr>
5474 * data/lalr1.cc (Parser::reduce_print_): New.
5477 2003-08-25 Akim Demaille <akim@epita.fr>
5479 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
5480 error recovery loops. This patch is based on
5481 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
5482 Also, augment the similarity between lalr1.cc and yacc.c.
5483 Note: the locations of error recovery rules are not correct yet.
5485 * data/lalr1.cc: Comment changes to augment the similarity between
5486 lalr1.cc and yacc.c.
5487 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
5488 (yyerrlab1): Remove, but where it used to be (now the bottom part of
5489 yyerrlab), when hitting EOF, pop the whole stack here instead of
5490 merely falling thru the default error handling mechanism.
5491 (yyerrorlab): New label, with the old contents of YYERROR,
5492 plus the following change: pop the stack of rhs corresponding
5493 to the production that invoked YYERROR. That is how Yacc
5494 behaves (required by POSIX).
5495 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
5498 2003-08-25 Akim Demaille <akim@epita.fr>
5500 Tune local.at so that people can "autom4te -l autotest calc.at -o
5501 calc" for instance, to extract a sub test suite.
5503 * tests/testsuite.at: Move the initialization, Autotest version
5504 requirement, and AT_TESTED invocation into...
5505 * tests/local.at: here.
5506 * tests/testsuite.at: Include it for compatibility with Autoconf
5508 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
5511 2003-08-04 Paul Eggert <eggert@twinsun.com>
5513 Rework code slightly to avoid gcc -Wtraditional warnings.
5514 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
5515 The returned value is now stored in *YY0. All callers changed.
5516 * src/output.c (merge_output): Adjust to the above change.
5518 2003-07-26 Paul Eggert <eggert@twinsun.com>
5520 * data/glr.c (YYASSERT): New macro.
5521 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
5522 yyresolveStates, yyprocessOneStack):
5523 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
5524 Derived from a suggestion by Frank Heckenbach.
5526 2003-07-25 Paul Eggert <eggert@twinsun.com>
5528 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
5529 for portability to K&R C (after ansi2knr, presumably). See
5530 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5531 by Frank Heckenbach, though I have omitted the structure-initialization
5532 part of his glr-knr.diff patch since I recall that the Portable
5533 C Compiler didn't require that change.
5535 Let the user specify how to allocate and free memory.
5536 Derived from a suggestion by Frank Heckenbach in
5537 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
5538 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
5539 All uses of free, malloc, realloc changed to use these macros,
5540 and unnecessary casts removed.
5541 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
5543 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
5545 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
5546 use s.empty() rather than s == "" to test for empty string; see
5547 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
5550 2003-06-25 Akim Demaille <akim@epita.fr>
5552 * config/depcomp, config/install-sh: Update from masters.
5554 2003-06-20 Paul Eggert <eggert@twinsun.com>
5556 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
5557 and return properly parenthesized result.
5558 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
5559 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5560 Remove unnecessary parentheses from uses.
5561 * doc/bison.texinfo (Location Default Action): Describe the
5562 conventions for parentheses.
5564 2003-06-19 Paul Eggert <eggert@twinsun.com>
5566 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
5567 yyreportTree): Do not assume that size_t is the same width as int,
5568 when printing sizes. Print sizes using an unsigned format.
5569 Problem reported by Frank Heckenbach in
5570 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
5572 Port to Forte Developer 7 C compiler.
5573 * data/glr.c (struct YYLTYPE): If locations are not being used,
5574 declare a single dummy member, as empty structs do not conform
5576 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
5577 the Forte Developer 7 C compiler complains that end-of-loop
5578 code is not reached.
5580 2003-06-17 Paul Eggert <eggert@twinsun.com>
5582 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
5583 avoid warnings from picky compilers about redefinition of PARAMS.
5585 2003-06-17 Paul Eggert <eggert@twinsun.com>
5589 * NEWS: Document 1.875b.
5591 * lib/bbitset.h: Do not include config.h; that's the includer's job.
5592 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
5593 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
5594 Don't use 'index' in comments, as it's a builtin fn on some hosts.
5595 * lib/bitset_stats.c: Include gettext.h unconditionally, as
5596 per recent gettext manual's suggestion.
5597 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
5598 Use prototypes, not old-style definitions.
5599 * lib/lbitset.c (lbitset_unused_clear): Likewise.
5600 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
5601 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
5602 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
5603 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
5604 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
5605 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
5606 vbitset_or_and_cmp, vbitset_copy): Likewise.
5608 * lib/libiberty.h: Do not include config.h; that's the includer's job.
5609 Do not include <stdlib.h>.
5610 (PARAMS): Define unconditionally for C89.
5611 (ATTRIBUTE_NORETURN): Remove.
5612 (ATTRIBUTE_UNUSED): Define unconditionally.
5614 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
5615 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
5616 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
5617 * lib/vbitset.c, lib/vbitset.h: New files.
5618 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
5619 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
5622 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
5623 `How Can I Reset @code{yyparse}', since texinfo does not allow
5624 arbitrary @ in node names.
5626 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
5627 shouldn't be needed according to the gettext 0.12.1 documentation
5628 but which seem to be needed anyway: codeset.m4 glibc21.m4
5629 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
5630 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
5631 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
5633 * lib/.cvsignore: Add stdbool.h.
5634 * m4/.cvsignore: Add nls.m4, po.m4.
5636 Upgrade to CVS gnulib.
5637 * stdbool_.h: File renamed from stdbool.h.in.
5638 * configure.ac (AM_STDBOOL_H): Invoke this instead of
5640 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
5641 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
5642 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
5643 (MOSTLYCLEANFILES): New var.
5644 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
5645 (stdbool.h): New rule.
5646 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
5647 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
5648 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
5649 m4/quote.m4: Upgrade to today's gnulib.
5651 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
5652 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
5653 the tests right now.
5654 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
5655 yyerror are declared before use; C99 requires this.
5657 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5659 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
5661 (yyrecoverSyntaxError): Correct the logic for setting and testing
5663 Correct comment on handling EOF.
5664 Allow states with only a default reduction, rather than failing
5665 (I can't quite reconstruct why these were not allowed before).
5667 Fixes to avoid problem that $-N rules in GLR parsers can cause
5668 buffer overruns, corrupting state.
5670 * src/output.c (prepare_rules): Output max_left_semantic_context
5672 * src/reader.h (max_left_semantic_context): New variable declaration.
5673 * src/scan-gram.l (max_left_semantic_context): Define.
5674 (handle_action_dollar): Update max_left_semantic_context.
5675 * data/glr.c (YYMAXLEFT): New definition.
5676 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
5677 (yyresolveAction): Ditto.
5679 Fixes to problems with location handling in GLR parsers reported by
5680 Frank Heckenbach (2003/06/05).
5682 * data/glr.c (YYLTYPE): Make trivial if locations not used.
5683 (YYRHSLOC): Add parentheses, and define only if locations used.
5684 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
5686 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
5687 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
5689 * tests/cxx-type.at: Exercise location information; update tests
5690 to differentiate output with and without locations.
5691 Remove forward declarations of yylex and yyerror---caused errors
5692 because default YYLTYPE not yet defined.
5693 Change semantic actions to compute strings, rather than printing
5694 them directly (to test proper passing of semantics values). Change
5695 output to prefix notation and update test data and expected results.
5696 (yylex): Track locations.
5697 (stmtMerge): Return value rather than printing, and include arguments
5700 2003-06-03 Paul Eggert <eggert@twinsun.com>
5702 Avoid warnings generated by GCC 2.95.4 when Bison is
5703 configured with --enable-gcc-warnings.
5704 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
5705 yy::]b4_parser_class_name[::translate_,
5706 yy::Stack::operator[] (unsigned),
5707 yy::Stack::operator[] (unsigned) const,
5708 yy::Slice::operator[] (unsigned),
5709 yy::Slice::operator[] (unsigned) const):
5710 Rename local vars to avoid warnings.
5711 * tests/glr-regression.at (Improper handling of embedded actions
5712 and $-N in GLR parsers): Remove unused local variable from yylex.
5713 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
5714 (void) as arg when not pure, since we now assume C89 when building
5715 Bison. Pacify GCC by using parameter.
5717 2003-06-02 Paul Eggert <eggert@twinsun.com>
5719 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
5720 yy::Location::lines, yy::Location::columns): Rename arguments
5721 to avoid shadowing; this removes a warning generated by GCC 3.3.
5723 2003-06-01 Paul Eggert <eggert@twinsun.com>
5725 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
5726 to g++, as GCC 3.3 complains if you do it.
5727 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
5728 everything that WARNING_CFLAGS has, except omit warnings
5729 not suitable for C++.
5730 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
5731 * tests/atlocal.in (CXXFLAGS): New var.
5732 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
5734 Fix a GLR parser bug I reported in February; see
5735 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
5736 The problem was that GLR parsers did not conform to the C standard,
5737 because actions like { $1 = $2 + $3; } expanded to expressions
5738 that invoked YYFILL in separate subexpressions, and YYFILL assigned
5739 to a local variable. The C standard says that expressions
5740 like (var = f ()) + (var = f ()) have undefined behavior.
5741 Another problem was that GCC sometimes issues warnings that
5742 yyfill and its parameters are unused.
5744 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
5746 (yyfill): New function.
5748 (yyuserAction): Change type of yynormal to bool, so that it matches
5749 the new yyfill signature. Mark it as possibly unused.
5752 Follow up on a bug I reported in February, where a Bison-generated
5753 parser can loop. Provide a test case and a fix for yacc.c. I
5754 don't have a fix for lalr1.cc or for glr.c, unfortunately.
5755 The original bug report is in:
5756 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
5758 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
5759 macro's size was becoming unwieldy.
5760 (yyerrlab): Do not discard an empty lookahead symbol, as this
5761 might destroy garbage.
5762 (yyerrorlab): New label, with the old contents of YYERROR,
5763 plus the following change: pop the stack of rhs corresponding
5764 to the production that invoked YYERROR. That is how Yacc
5765 behaves, and POSIX requires this behavior.
5766 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
5767 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
5768 Define 'alarm' to do nothing if unistd.h is not available.
5769 Add a new rule "exp: '-' error;" to test the above change to
5770 data/yacc.c. Use 'alarm' to abort any test taking longer than
5771 10 seconds, as it's probably looping.
5772 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
5773 Also, the new yacc.c generates two fewer diagnostics for an
5776 2003-05-24 Paul Eggert <eggert@twinsun.com>
5778 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
5779 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
5780 This fixes a problem reported by John Bowman when the Compaq/HP
5781 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
5783 * data/yacc.c (union yyalloc): Likewise.
5784 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
5786 Switch from 'int' to 'bool' where that makes sense.
5788 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
5789 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
5790 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
5791 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
5792 Return or accept bool, not int. All callers changed.
5793 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
5794 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
5795 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
5796 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
5797 bitset_or_and_cmp_): Likewise.
5798 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
5799 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
5800 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
5801 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
5802 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
5803 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
5804 bitset_stats_or_and_cmp): Likewise.
5805 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
5806 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
5807 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
5808 ebitset_xor_cmp): Likewise.
5809 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
5810 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
5811 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
5812 lbitset_xor_cmp): Likewise.
5813 * lib/bbitset.h: Include <stdbool.h>.
5814 (struct bitset_vtable): The following members now return bool, not
5815 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
5816 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
5818 * src/conflicts.c (count_rr_conflicts): Likewise.
5819 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
5821 * lib/ebitset.c (ebitset_obstack_init): Likewise.
5822 * lib/lbitset.c (lbitset_obstack_init): Likewise.
5823 * src/getargs.c (debug_flag, defines_flag, locations_flag,
5824 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
5825 graph_flag): Likewise.
5826 * src/getargs.h (debug_flag, defines_flag, locations_flag,
5827 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
5828 graph_flag): Likewise.
5829 * src/output.c (error_verbose): Likewise.
5830 * src/output.h (error_verbose): Likewise.
5831 * src/reader.c (start_flag, typed): Likewise.
5832 * src/reader.h (typed): Likewise.
5833 * src/getargs.c (LOCATIONS_OPTION): New constant.
5834 (long_options, getargs): Use it.
5835 * src/lalr.c (build_relations): Use bool, not int.
5836 * src/nullable.c (nullable_compute): Likewise.
5837 * src/print.c (print_reductions): Likewise.
5838 * src/tables.c (action_row, pack_vector): Likewise.
5839 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
5840 * src/output.c (prepare): Use it.
5841 * src/output.c (token_definitions_output,
5842 symbol_destructors_output, symbol_destructors_output): Use string,
5843 not boolean integer, to keep track of whether to output separator.
5844 * src/print_graph.c (print_core): Likewise.
5845 * src/state.c (state_rule_lookaheads_print): Likewise.
5847 * config/install-sh: Sync from automake 1.7.5.
5849 2003-05-14 Paul Eggert <eggert@twinsun.com>
5851 * src/parse-gram.y (rules_or_grammar_declaration): Require a
5852 semicolon after a grammar declaration, in the interest of possible
5853 future changes to the Bison input language.
5854 Do not allow a stray semicolon at the start of the grammar.
5855 (rhses.1): Allow one or more semicolons after any rule, including
5856 just before "|" as required by POSIX.
5857 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
5860 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
5862 %parse-param support for lalr1.cc.
5864 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
5865 b4_cc_constructor_calls, b4_cc_constructor_call,
5866 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
5868 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
5869 parse-param arguments.
5870 (yy::b4_parser_class_name): Declare instance variables to
5871 hold parse-param arguments.
5872 * tests/calc.at: s/value/semantic_value/ because value clashes
5873 with a member of yy::b4_parser_class_name. Adjust C++ code
5874 to handle %parse-param. Enable %parse-param test in C++.
5876 2003-05-12 Paul Eggert <eggert@twinsun.com>
5878 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
5879 English a bit. Fix fclose typo. Change "const char" to "char
5880 const", and use ANSI C rather than K&R for "main". Suggest
5881 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
5882 and suggest yy_switch_to_buffer.
5884 2003-05-05 Paul Eggert <eggert@twinsun.com>
5886 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
5887 C89. This avoids a diagnostic on compilers that define __STDC__
5888 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
5889 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
5891 2003-05-03 Paul Eggert <eggert@twinsun.com>
5893 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
5894 Do not overrun array bounds.
5895 This should fix a bug reported today by Olatunji Oluwabukunmi in
5896 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
5898 2003-04-29 Akim Demaille <akim@epita.fr>
5900 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
5901 * src/getargs.c, src/getargs.h: here, as bool, not int.
5902 (nondeterministic_parser): New.
5903 * src/parse-gram.y, src/scan-gram.l: Support
5904 %nondeterministic-parser.
5905 * src/output.c (prepare): Use nondeterministic_parser instead
5906 of glr_parser where appropriate.
5907 * src/tables.c (conflict_row, action_row, save_row)
5908 (token_actions, token_actions, pack_vector): Ditto.
5910 2003-04-29 Akim Demaille <akim@epita.fr>
5912 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
5914 2003-04-29 Akim Demaille <akim@epita.fr>
5916 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
5917 with %pure-parser and %locations to exercise the patch from Yakov
5920 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
5922 * data/yacc.c: (b4_lex_param): Corrected for the case where
5923 %lex-param is provided and %pure-parser isn't.
5925 2003-04-27 Paul Eggert <eggert@twinsun.com>
5927 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
5928 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
5929 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
5930 if it is not defined.
5931 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
5933 2003-04-26 Paul Eggert <eggert@twinsun.com>
5935 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
5936 Declare to be of type suitable for the ninf value itself, not of
5937 type suitable for the corresponding table, since the latter might
5938 be unsigned but the ninf value might be negative. This fixes a
5939 bug reported by Alexandre Duret-Lutz in
5940 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
5942 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
5943 invokes it. We shouldn't invoke it twice because it will attempt
5944 to put error.o in the archive twice. This fixes a glitch reported
5945 by Martin Mokrejs in
5946 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
5948 2003-04-21 Paul Eggert <eggert@twinsun.com>
5950 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
5953 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
5955 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
5956 Fix obvious typo that results in uncompilable GLR parsers
5957 when both %pure-parser and %locations are used. (trivial change)
5959 2003-04-17 Paul Eggert <eggert@twinsun.com>
5961 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
5962 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
5963 Do not insert the expected token via unput, as this runs afoul
5964 of a POSIX-compatibility bug in flex 2.5.31.
5965 All uses changed to BEGIN the parent state,
5966 since we no longer insert the expected token via unput.
5967 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
5968 that is no longer emitted after the above change.
5970 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
5971 the first one. This change is from Paul Hilfinger, and it fixes
5972 regression reported by Werner Lemberg in
5973 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5975 (resolve_sr_conflict): Don't invoke state_errs_set
5976 unless one or more tokens have been explicitly made errors.
5977 Otherwise, the above change causes Bison to abort.
5979 * tests/existing.at (GNU pic Grammar): New test case, taken from
5982 2003-03-31 Akim Demaille <akim@epita.fr>
5984 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
5986 2003-03-31 Akim Demaille <akim@epita.fr>
5988 * src/output.c (prepare_symbols): Avoid trailing spaces in the
5991 2003-03-31 Akim Demaille <akim@epita.fr>
5993 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
5994 From Paul Hilfinger.
5996 2003-03-29 Akim Demaille <akim@epita.fr>
5998 * m4/error.m4: Do not put under dynamic conditions some code which
5999 expansion is under static control.
6001 2003-03-29 Akim Demaille <akim@epita.fr>
6003 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
6005 2003-03-29 Akim Demaille <akim@epita.fr>
6007 * doc/bison.texinfo (Strings are Destroyed): New.
6009 2003-03-13 Paul Eggert <eggert@twinsun.com>
6011 * .cvsignore: Add configure.lineno.
6012 * src/.cvsignore: Add yacc.
6013 * tests/.cvsignore: Add testsuite.log.
6014 * doc/fdl.texi: Sync with latest FSF version.
6016 2003-03-12 Paul Eggert <eggert@twinsun.com>
6018 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
6019 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
6020 cursor, instead of leaving it undefined. This fixes a bug
6021 reported by Tim Van Holder in
6022 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
6023 * tests/input.at (Torturing the Scanner): Test the scanner on
6024 an empty input file, which was Tim Van Holder's test case.
6026 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
6027 <sys/resource.h> can be included, include sys/time.h and
6028 sys/times.h first, if available. This works around the SunOS
6029 4.1.4 porting bug reported by Bruce Becker in
6030 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
6032 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
6033 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
6036 Merge changes from gnulib. This was prompted because the CVS
6037 snapshot didn't build on Solaris 7 due to strnlen problems.
6039 These changes need to be merged back into gnulib:
6040 * lib/hash.c: Include <stdbool.h> unconditionally.
6041 * m4/onceonly.m4 (m4_quote): New macro.
6042 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
6043 Quote AC_FOREACH variable-expansions properly.
6044 The 2003-01-03 obstack.h change also needs merging.
6045 {end of changes requiring merging}
6047 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
6048 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
6049 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
6050 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
6051 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
6052 New files, imported from gnulib.
6053 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
6056 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
6057 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
6060 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
6062 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
6063 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
6064 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
6065 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
6066 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
6067 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
6068 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
6069 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
6070 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
6071 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
6072 (jm_PREREQ_ARGMATCH): Remove.
6073 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
6074 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
6076 * src/system.h: Include <stdbool.h> unconditionally.
6078 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
6079 assuming at least C89 in the bitset code for some time now.
6081 2003-03-03 Akim Demaille <akim@epita.fr>
6085 2003-03-02 Akim Demaille <akim@epita.fr>
6087 * doc/bison.texinfo (Table of Symbols): Reactivate the
6088 documentation for %lex-param, and %parse-param.
6090 2003-03-02 Akim Demaille <akim@epita.fr>
6092 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6093 generate verbose error messages.
6094 Use the number of tokens as an upper bound in yytname, as it
6095 cannot be a non terminal.
6097 2003-03-02 Akim Demaille <akim@epita.fr>
6099 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6102 2003-03-02 Akim Demaille <akim@epita.fr>
6104 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6105 Use them to exercise yycheck overrun.
6106 Based on Andrew Suffield's grammar.
6108 2003-03-02 Akim Demaille <akim@epita.fr>
6110 Create tests/local.at for Bison generic testing macros.
6112 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6113 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6115 * tests/calc.at (AT_CHECK_CALC): Adjust.
6116 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6117 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6118 * tests/local.at: here.
6119 (AT_COMPILE_CXX): Tags the tests using it as c++.
6120 Ignore the test if CXX is not functional.
6122 2003-03-01 Paul Eggert <eggert@twinsun.com>
6124 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
6125 not loc->end, since loc->end might contain garbage and this leads
6126 to undefined behavior on some platforms.
6127 (id_loc, token_start): Use (IF_LINTed) initial values that do not
6128 depend on *loc, so that the reader doesn't give the the false
6129 impression that *loc is initialized.
6130 (<INITIAL>"%%"): Do not bother setting code_start, since its value
6131 does not survive the return.
6133 2003-03-01 Akim Demaille <akim@epita.fr>
6135 * src/scan-gram.l (code_start): Always initialize it when entering
6136 into yylex, as SC_EPILOGUE is activated *before* the corresponding
6137 yylex invocation. An alternative would be making it static, but
6138 then it starts with the second %%'s beginning, instead of its end.
6140 2003-02-28 Paul Eggert <eggert@twinsun.com>
6142 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
6143 around a UnixWare 7.1.1 porting bug reported by John Hughes in
6144 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
6146 2003-02-26 Paul Eggert <eggert@twinsun.com>
6148 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
6149 Remove Sequent/Pyramid discussion (nobody uses them any more).
6150 Merge VMS and MS-DOS discussion; these ports may well be dead
6151 but let's keep mentioning them for now. Put <> around email
6152 addresses. Add copyright notice.
6154 2003-02-24 Paul Eggert <eggert@twinsun.com>
6156 * data/glr.c (yy_reduce_print): yylineno -> yylno,
6157 to avoid collision with flex use of yylineno.
6158 Problem reported by Bruce Lilly in
6159 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
6160 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6161 * data/yacc.c (yy_reduce_print): Likewise.
6163 * config/depcomp: Sync with Automake 1.7.3.
6165 2003-02-21 Akim Demaille <akim@epita.fr>
6167 * data/lalr1.cc: Use temporary variables instead of casts to
6168 change integer types.
6169 Suggested by Paul Eggert.
6171 2003-02-21 Akim Demaille <akim@epita.fr>
6173 * doc/bison.texinfo: Use "location" consistently to refer to @n,
6174 to avoid confusions with lalr1.cc's notion of Position.
6175 Suggested by Paul Eggert.
6177 2003-02-20 Akim Demaille <akim@epita.fr>
6179 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
6180 before initial_columns.
6181 (location.hh): Use consistent variable names when defining the
6183 Use "last" so that we subtract from Positions, not from unsigned.
6185 2003-02-20 Akim Demaille <akim@epita.fr>
6187 * data/lalr1.cc (position.hh): New subfile, including the extended
6188 and Doxygen'ed documentation of class Position.
6189 (location.hh): Use it.
6190 Document a` la Doxygen.
6191 With the help of Benoit Perrot.
6193 2003-02-20 Akim Demaille <akim@epita.fr>
6195 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
6197 Redefine AT_YYERROR_SEES_LOC_IF using it.
6198 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
6200 Don't use the location in yy::Parser::error_ and
6201 yy::Parser::print_ when not %locations.
6202 Activate more lalr1.cc tests.
6204 2003-02-19 Akim Demaille <akim@epita.fr>
6206 * data/lalr1.cc: When displaying a line number, be sure to make it
6209 2003-02-19 Akim Demaille <akim@epita.fr>
6211 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
6213 (YYABORT, YYACCEPT, YYERROR): New.
6214 * tests/calc.at: Renable the lalr1.cc test.
6216 2003-02-19 Akim Demaille <akim@epita.fr>
6218 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
6219 error recovery, mixing with/without pops and discarding of the
6222 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
6224 2003-02-17 Paul Eggert <eggert@twinsun.com>
6226 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
6227 * tests/testsuite.at (AT_COMPILE): Use them.
6228 This fixes the testsuite problem reported by Robert Lentz in
6229 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
6231 2003-02-12 Paul Eggert <eggert@twinsun.com>
6233 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
6234 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
6235 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
6236 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
6237 Check for malloc failure, for consistency with yacc.c.
6238 (yytname_size): Remove, for consistency with yacc.c.
6240 The bug still remains in data/lalr1.cc, as I didn't have time
6243 2003-02-06 Akim Demaille <akim@epita.fr>
6245 * configure.ac (GXX): Rename as...
6246 (CXX): this, to keep the original Autoconf semantics.
6248 * data/lalr1.cc: Fix b4_copyright invocations.
6249 If YYDEBUG is not defined, don't depend upon name_ being defined.
6250 (location.hh): Include string and iostream.
6251 (Position::filename): New member.
6252 (Position::Position ()): New.
6253 (operator<< (Position)): New.
6254 (operator- (Position, int)): New.
6255 (Location::first, Location::last): Rename as...
6256 (Location::begin, Location::end): these, to mock the conventional
6258 (operator<< (Location)): New.
6259 * tests/atlocal.in (CXX): New.
6260 * tests/testsuite.at (AT_COMPILE_CXX): New.
6261 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
6262 locations in a more synthetic way.
6263 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
6265 Adjust the C locations to match those from Emacs: first column is
6267 Change all the expected results.
6268 Conform to the GCS: simplify the locations when applicable.
6269 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
6270 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
6271 these CPP macros with the m4 macros new defined by...
6272 (AT_CHECK_PUSHDEFS): this, i.e.:
6273 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
6274 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
6276 (AT_CHECK_POPDEFS): Undefine them.
6277 (AT_CHECK_CALC_LALR1_CC): New.
6278 Use it for the first lalr1.cc test.
6280 2003-02-04 Akim Demaille <akim@epita.fr>
6282 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
6283 Location as is defined.
6285 2003-02-04 Akim Demaille <akim@epita.fr>
6287 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
6288 name_ being defined.
6290 2003-02-03 Paul Eggert <eggert@twinsun.com>
6292 * src/gram.h (start_symbol): Remove unused decl.
6294 Use more-consistent naming conventions for local vars.
6296 * src/derives.c (derives_compute): Change type of local var from
6298 * src/gram.c (grammar_rules_partial_print): Likewise.
6299 * src/print.c (print_core): Likewise.
6300 * src/reduce.c (reduce_grammar_tables): Likewise.
6302 * src/gram.c (grammar_dump): Change name of item_number *
6303 local var from r to rp.
6304 * src/nullable.c (nullable_compute): Likewise.
6306 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
6308 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
6309 for symbol or symbol_number var.
6310 * src/reader.c (grammar_start_symbol_set): Likewise.
6311 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
6313 * src/state.c (transitions_to): Likewise.
6314 * src/state.h: Likewise.
6315 * src/tables.c (symbol_number_to_vector_number): Likewise.
6317 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
6320 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
6323 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
6326 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
6327 Use str, not s, for char * var. Use ch, not c, for character var.
6328 Use size for size var.
6330 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
6332 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
6334 * src/uniqstr.h: Likewise.
6336 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
6337 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
6338 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
6339 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
6340 param to have same name as that of enum, so that we don't use
6341 "s" to stand for a non-state.
6343 2003-02-02 Akim Demaille <akim@epita.fr>
6345 * src/scan-skel.l: Scan more than one inert character per yylex
6348 2003-02-01 Paul Eggert <eggert@twinsun.com>
6352 * po/LINGUAS: Add ms.
6354 2003-01-30 Akim Demaille <akim@epita.fr>
6356 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
6358 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6360 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
6363 Changes in response to error report by S. Eken: GLR mode does not
6364 handle negative $ indices or $ indices in embedded rules correctly.
6365 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
6367 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
6368 (b4_rhs_location): Ditto.
6369 (yyfill): New function to copy from stack tree into array
6371 (yyuserAction): Modify to allow incremental move of semantic values
6372 to rhs array when in GLR mode.
6373 Define YYFILL to use in user-defined actions to fill semantic array
6375 Remove dummy use of yystack, as there is now a guaranteed use.
6376 (yydoAction): Modify to allow incremental move of semantic values
6377 to rhs array when in GLR mode.
6378 (yyresolveAction): Ditto.
6379 (yyglrShiftDefer): Update comment.
6380 (yyresolveStates): Use X == NULL for pointers, not !X.
6381 (yyglrReduce): Ditto.
6384 * tests/glr-regr1.at: Rename to ...
6385 * tests/glr-regression.at: Add new regression test for the problems
6386 described above (adapted from S. Eken).
6387 Update copyright notice.
6388 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
6389 * tests/Makefile.am: Ditto.
6391 2003-01-28 Paul Eggert <eggert@twinsun.com>
6393 * data/lalr1.cc: Do not use @output_header_name@ unless
6394 b4_defines_flag is set. This fixes two bugs reported by
6396 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
6397 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6399 2003-01-21 Paul Eggert <eggert@twinsun.com>
6401 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
6402 we don't need to worry about yyerrlab1 being reported as an
6403 "unused label" by non-GCC C compilers. The downside is that if
6404 locations are used then a couple of statements are duplicated each
6405 time YYERROR is invoked, but the upside is that the warnings
6407 (yyerrlab1): Move code to YERROR.
6408 (yyerrlab2): Remove. Change uses back to yyerrlab1.
6409 This reverts some of the 2002-12-27 change.
6411 2003-01-17 Paul Eggert <eggert@twinsun.com>
6413 * src/output.c (symbol_printers_output): Fix typo that led
6414 to core dump. Problem reported by Antonio Rus in
6415 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
6417 2003-01-13 Akim Demaille <akim@epita.fr>,
6418 Quoc Peyrot <chojin@lrde.epita.fr>,
6419 Robert Anisko <anisko_r@lrde.epita.fr>
6421 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
6422 when the stacks contain one element, as the loop would otherwise
6423 free the last state, and then use the top state (the one we just
6424 popped). This means that the initial elements will not be freed
6425 explicitly, as is the case in yacc.c; it is not a problem, as
6426 these elements have fake values.
6428 2003-01-11 Paul Eggert <eggert@twinsun.com>
6430 * NEWS: %expect-violations are now just warnings, reverting
6431 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
6432 bootstrapping problem reported by Matthias Klose; see
6433 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
6434 * src/conflicts.c (conflicts_print): Likewise.
6435 * tests/conflicts.at (%expect not enough, %expect too much,
6436 %expect with reduce conflicts): Likewise.
6437 * doc/bison.texinfo (Expect Decl): Document this. Also mention
6438 that the warning is enabled if the number of conflicts changes
6439 (not necessarily increases).
6441 * src/getargs.c (version): Update copyright year.
6443 2003-01-09 Akim Demaille <akim@epita.fr>
6445 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
6447 2003-01-08 Paul Eggert <eggert@twinsun.com>
6449 * Makefile.maint (WGETFLAGS):
6450 New macro, containing "-C off" to disable proxy caches.
6451 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
6452 (rel-check): Use $(WGET) instead of wget.
6454 2003-01-06 Paul Eggert <eggert@twinsun.com>
6456 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
6457 the GLR paper of Scott, Johnstone and Hussain.
6459 2003-01-04 Paul Eggert <eggert@twinsun.com>
6461 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
6462 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
6463 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
6464 (EXTRA_LIBRARIES): New var, for liby.a.
6465 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
6466 (EXTRA_SCRIPTS): New var, for yacc.
6468 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
6469 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
6470 Problem reported by Nelson H. F. Beebe.
6472 2003-01-03 Paul Eggert <eggert@twinsun.com>
6474 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
6475 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
6476 when compiling Bison 1.875's `bitset bset = obstack_alloc
6477 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
6479 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
6480 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
6481 grow to a huge size with typical invocation.
6483 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
6484 Use the pattern recommended by Autoconf 2.57, except also protect
6485 against double-definition.
6486 * src/system.h: Likewise.
6487 Portability issues reported by Nelson H. F. Beebe.
6489 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
6490 All uses changed. Provide a definition in both C and C++.
6491 (yytrue, yyfalse): Define even if defined (__cplusplus).
6493 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
6494 Reported by Nelson H. F. Beebe.
6496 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
6498 2003-01-02 Paul Eggert <eggert@twinsun.com>
6500 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
6501 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
6502 Bug reported by Nelson H. F. Beebe.
6504 2003-01-01 Paul Eggert <eggert@twinsun.com>
6508 2002-12-30 Paul Eggert <eggert@twinsun.com>
6510 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
6512 (<INITIAL>","): Here. This causes stray "," to be treated
6515 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
6516 last brace in braced code when not in Yacc mode, for compatibility
6517 with Bison 1.35. This resurrects the 2001-12-15 patch to
6520 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
6521 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
6523 2002-12-28 Paul Eggert <eggert@twinsun.com>
6525 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
6526 that of SYM's type. This fixes Debian bug 168069, reported by
6529 2002-12-28 Paul Eggert <eggert@twinsun.com>
6533 Switch back to the Yacc style of conflict reports, undoing some
6534 of the 2002-07-30 change.
6535 * doc/bison.texinfo (Understanding): Use Yacc style for
6536 conflict reports. Also, use new way of locating rules.
6537 * src/conflicts.c (conflict_report):
6538 Renamed from conflict_report_yacc, removing the old
6539 'conflict_report'. Translate the entire conflict report at once,
6540 so that we don't assume that "," has the same interpretation in
6542 (conflicts_output): Use Yacc-style conflict report for each state,
6543 instead of our more-complicated style.
6544 (conflicts_print): Use Yacc-style conflict report, except print
6545 the input file name when not emulating Yacc.
6546 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
6547 Conflicted Reduction, %expect not enough, %expect too much,
6548 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
6549 * tests/existing.at (GNU Cim Grammar): Likewise.
6550 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
6552 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
6553 fatal): Don't invoke fflush; it's not needed and it might even be
6554 harmful for stdout, as stdout might not be open.
6555 * src/reduce.c (reduce_print): Likewise.
6557 2002-12-27 Paul Eggert <eggert@twinsun.com>
6559 Fix a bug where error locations were not being recorded correctly.
6560 This problem was originally reported by Paul Hilfinger in
6561 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
6563 * data/yacc.c (yyparse): New local var yylerrsp, to record the
6564 top of the location stack's error locations.
6565 (yyerrlab): Set it. When discarding a token, push its location
6566 onto yylerrsp so that we don't lose track of the error's end.
6567 (yyerrlab1): Now is only the target of YYERROR, so that we can
6568 properly record the location of the action that failed. For GCC
6569 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
6570 GCC warning about yyerrlab1 being unused if YYERROR is unused.
6571 (yyerrlab2): New label, which yyerrlab now falls through to.
6572 Compute the error's location by applying YYLLOC_DEFAULT to
6573 the locations of all the symbols that went into the error.
6574 * doc/bison.texinfo (Location Default Action): Mention that
6575 YYLLOC_DEFAULT is also invoked for syntax errors.
6576 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6577 Error locations include the locations of all the tokens that were
6578 discarded, not just the last token.
6580 2002-12-26 Paul Eggert <eggert@twinsun.com>
6582 * src/files.c: Include quote.h.
6583 (compute_output_file_names): Warn if we detect conflicting
6584 outputs to the same file. This should catch the misunderstanding
6585 exemplified by Debian Bug 165349, reported by Bruce Stephens..
6587 * src/conflicts.c (conflicts_print): If the user specifies
6588 "%expect N", report an error if there are any reduce/reduce
6589 conflicts. This is what the manual says should happen.
6590 This fixes Debian bug 130890, reported by Anthony DeRobertis.
6591 * tests/conflicts.at (%expect with reduce conflicts): New test.
6593 Don't use m4_include on relative file names, as it doesn't work as
6594 desired if there happens to be a file with that name under ".".
6596 * m4sugar/version.m4: Remove; it was included but it wasn't used.
6597 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
6598 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
6599 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
6600 * src/output.c (output_skeleton): Use full path names when
6601 specifying a file to include; don't rely on include path, as
6602 it's unreliable when the working file contains a file with
6605 2002-12-25 Paul Eggert <eggert@twinsun.com>
6607 Remove obsolete references to bison.simple and bison.hairy.
6608 Problem mentioned by Aubin Mahe in
6609 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
6610 * data/glr.c: Comment fix.
6611 * doc/bison.1: Remove references. Also, mention "yacc".
6613 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
6616 * src/parse-gram.y (declaration): Use enum "report_states" rather
6617 than its numeric value 1.
6619 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
6620 opening a new one. This fixes Debian bug 165349, reported by
6623 2002-12-24 Paul Eggert <eggert@twinsun.com>
6627 * Makefile.maint (cvs-update): Don't assume that the shell
6628 supports $(...), as Solaris sh doesn't.
6630 * src/parse-gram.y (lloc_default): Remove test for empty
6631 nonterminals at the end, since it didn't change the result.
6633 2002-12-24 Paul Eggert <eggert@twinsun.com>
6635 If the user does not define YYSTYPE as a macro, Bison now declares it
6636 using typedef instead of defining it as a macro. POSIX requires this.
6637 For consistency, YYLTYPE is also declared instead of defined.
6639 %union directives can now have a tag before the `{', e.g., the
6640 directive `%union foo {...}' now generates the C code
6641 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
6642 The default union tag is `YYSTYPE', for compatibility with Solaris 9
6643 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
6644 instead of `yyltype'.
6646 `yystype' and `yyltype' are now obsolescent macros instead of being
6647 typedefs or tags; they are no longer documented and will be
6648 withdrawn in a future release.
6650 * data/glr.c (b4_location_type): Remove.
6651 (YYSTYPE): Renamed from yystype.
6652 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
6653 (struct YYLTYPE): Renamed from struct yyltype.
6654 (YYLTYPE): Renamed from yyltype.
6655 (yyltype, yystype): New (and obsolescent) macros,
6656 for backward compatibility.
6657 * data/yacc.c: Likewise.
6659 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
6660 does not specify a union tag. This is for compatibility with
6663 * src/parse-gram.y (add_param): 2nd arg is now char * not char
6664 const *, since it is now modified by stripping surrounding { }.
6665 (current_braced_code): Remove.
6666 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
6667 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
6668 trailing " {...}". Now of type <chars>.
6669 (grammar_declaration): Adjust to bundled tokens.
6670 (code_content): Remove; stripping is now done by add_param.
6671 (print_token_value): Print contents of bundled tokens.
6672 (token_name): New function.
6674 * src/reader.h (braced_code, current_braced_code): Remove.
6675 (token_name): New decl.
6677 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
6678 token_type, not braced_code code_kind. All uses changed.
6679 (SC_PRE_CODE): New state, for scanning after a keyword that
6680 has (or usually has) an immediately-following braced code.
6681 (token_type): New local var, to keep track of which token type
6682 to return when scanning braced code.
6683 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
6684 <INITIAL>"%parse-param", <INITIAL>"%printer",
6685 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
6686 instead of returning a token type immediately.
6687 (<INITIAL>"{"): Set token type.
6688 (<SC_BRACED_CODE>"}"): Use it.
6689 (handle_action_dollar, handle_action_at): Now returns bool
6690 indicating success. Fail if ! current_rule; this prevents a core dump.
6691 (handle_symbol_code_dollar, handle_symbol_code_at):
6692 Remove; merge body into caller.
6693 (handle_dollar, handle_at): Complain in invalid contexts.
6695 * NEWS, doc/bison.texinfo: Document the above.
6696 * NEWS: Fix years and program names in copyright notice.
6698 2002-12-17 Paul Eggert <eggert@twinsun.com>
6700 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
6701 Reporting, Table of Symbols): Omit mentions of %lex-param and
6702 %parse-param from the documentation for now.
6704 2002-12-15 Paul Eggert <eggert@twinsun.com>
6706 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
6707 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
6708 lookahead symbol, and which sets yychar in parser actions) and it
6709 disagreed with the Bison documentation. Bug
6710 reported by Andrew Walrond.
6712 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
6713 as the caller now does that.
6714 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
6715 (YYEMPTY): Parenthesize right hand side, since others use it.
6716 (yyparse): Don't assume that our generated code is the only code
6719 2002-12-13 Paul Eggert <eggert@twinsun.com>
6723 POSIX requires a "yacc" command.
6724 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
6725 (MOSTLYCLEANFILES): Add yacc.
6727 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
6728 as an alias for bison y.
6730 * po/LINGUAS: Add da.
6732 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
6733 problem with latest <getopt.h>.
6734 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
6736 * doc/fdl.texi: Upgrade to 1.2.
6737 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
6738 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
6739 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
6741 * config/install-sh: Sync with autotools.
6743 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
6744 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
6745 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
6746 locations are requested.
6747 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
6748 locations are requested.
6750 2002-12-12 Paul Eggert <eggert@twinsun.com>
6752 Remove unportable casts and storage allocation tricks.
6753 While we're at it, remove almost all casts, since they
6754 usually aren't needed and are a sign of trouble.
6756 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
6758 * src/derives.c (derives_compute): Do not subtract NTOKENS from
6759 the pointer DSET returned by malloc; this isn't portable.
6760 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
6761 Similarly for DERIVES.
6762 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
6763 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
6764 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
6766 * src/derives.c (derives_compute): Do not bother invoking
6767 int_of_rule_number, since rule numbers are integers.
6769 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
6770 rather than XMALLOC (char, N).
6772 * src/files.c (filename_split): Rewrite to avoid cast.
6774 * src/gram.h (symbol_number_as_item_number,
6775 item_number_as_symbol_number, rule_number_as_item_number,
6776 item_number_as_rule_number):
6777 Now inline functions rather than macros, to avoid casts.
6778 * src/state.h (state_number_as_int): Likewise.
6779 * src/tables.c (state_number_to_vector_number,
6780 symbol_number_to_vector_number): Likewise.
6782 * src/gram.h (int_of_rule_number): Remove; no longer used.
6784 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
6785 since the resulting storage is always stored into.
6787 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
6790 * src/muscle_tab.c (muscle_m4_output):
6791 Now inline. Return bool, not int.
6792 * src/state.c (state_compare): Likewise.
6793 * src/symtab.c (symbol_check_defined,
6794 symbol_check_alias_consistency, symbol_pack, symbol_translation,
6795 hash_compare_symbol, hash_symbol):
6797 * src/uniqstr.c (uniqstr_print): Likewise.
6798 * src/muscle_tab.c (muscle_m4_output_processor):
6799 New function, to avoid casts.
6800 * src/state.c (state_comparator, stage_hasher): Likewise.
6801 * src/symtab.c (symbol_check_defined_processor,
6802 symbol_check_alias_consistency_processor, symbol_pack_processor,
6803 symbol_translation_processor, hash_symbol_comparator,
6804 hash_symbol_hasher): Likewise.
6805 * src/uniqstr.c (uniqstr_print_processor): Likewise.
6806 * src/muscle_tab.c (muscles_m4_output):
6807 Use new functions instead of casting old functions unportably.
6808 * src/state.c (state_hash_new): Likewise.
6809 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
6810 symbols_token_translations_init):
6812 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
6814 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
6815 var instead of casting to long, to avoid casts.
6816 (prepare_states): Use MALLOC rather than alloca, so that we don't
6817 have to worry about alloca.
6818 * src/state.c (state_hash_lookup): Likewise.
6820 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
6821 local var instead of casting to unsigned char, to avoid casts.
6823 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
6824 STATE_ALLOC): Remove.
6825 (transitions_new, errs_new, reductions_new, state_new): Use malloc
6826 rather than calloc, and use offsetof to avoid allocating slightly
6828 (state_new): Initialize all members.
6830 * src/state.c (state_hash): Use unsigned accumulator, not signed.
6832 * src/symtab.c (symbol_free): Remove; unused.
6833 (symbol_get): Remove cast in lhs of assignment.
6834 (symbols_do): Now static. Accept generic arguments, not
6835 hashing-related ones.
6837 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
6838 (symbol_processor): Remove.
6839 (symbols_do): Remove decl; now static.
6841 * src/system.h (alloca): Remove; decl no longer needed.
6842 (<stddef.h>): Include, for offsetof.
6843 (<inttypes.>, <stdint.h>): Include if available.
6844 (uintptr_t): New type, if system lacks it.
6845 (CALLOC, MALLOC, REALLOC): New macros.
6846 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
6849 * src/tables.c (table_size): Now int, to pacify GCC.
6850 (table_grow, table_ninf_remap): Use signed table size.
6851 (save_row): Don't bother initializing locals when not needed.
6852 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
6853 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
6855 * src/vcg.h: Correct misspellings.
6857 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
6860 * src/getargs.c (getargs): Don't assume EOF == -1.
6862 2002-12-09 Paul Eggert <eggert@twinsun.com>
6864 Change identifier spellings to avoid collisions with names
6865 that are reserved by POSIX.
6867 Don't use names ending in _t, since POSIX reserves them.
6868 For consistency, remove _e and _s endings -- they're weren't
6869 needed to remove ambiguity. All uses changed.
6870 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
6871 turn was just renamed from struniq_t.
6872 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
6873 which in turn was just renamed from struniq_processor_t.
6874 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
6875 in turn was renamed from hash_compare_struniq_t.
6876 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
6877 (state_list): Renamed from state_list_t.
6878 * src/assoc.h (assoc): Renamed from assoc_t.
6879 * src/conflicts.c (enum conflict_resolution): Renamed from
6880 enum conflict_resolution_e.
6881 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
6882 (rule_list): Renamed from rule_list_t.
6883 * src/getargs.h (enum trace): Renamed from enum trace_e.
6884 (enum report): Renamed from enum report_e.
6885 * src/gram.h (item_number): Renamed from item_number_t.
6886 (rule_number): Renamed from rule_number_t.
6887 (struct rule_s): Remove the "rule_s" part; not used.
6888 (rule): Renamed from rule_t.
6889 (rule_filter): Renamed from rule_filter_t.
6890 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
6891 (goto_list): Renamed from goto_list_t.
6892 * src/lalr.h (goto_number): Renamed from goto_number_t.
6893 * src/location.h (location): Renamed from location_t.
6894 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
6895 and moved here from:
6896 * src/muscle_tab.h (muscle_entry_t): here.
6897 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
6898 (rule_list): Renamed from rule_list_t.
6899 * src/print_graph.c (static_graph): Renamed from graph.
6900 * src/reader.h (braced_code): Renamed from braced_code_t.
6901 Remove brace_code_e tag.
6902 * src/relation.h (relation_node): Renamed from relation_node_t.
6903 (relation_nodes): Renamed from relation_nodes_t.
6904 (relation): Renamed from relation_t.
6905 * src/state.h (state_number): Renamed from state_number_t.
6906 (struct state): Renamed from struct state_s.
6907 (state): Renamed from state_t.
6908 (transitions): Renamed from transitions_t. Unused (and
6909 misspelled) transtion_s tag removed.
6910 (errs): Renamed from errs_t. Unused errs_s tag removed.
6911 (reductions): Renamed from reductions_t. Unused tag
6912 reductions_s removed.
6913 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
6914 (struct symbol_list): Renamed from struct symbol_list_s.
6915 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
6916 (struct symbol): Renamed from struct symbol_s.
6917 (symbol): Renamed from symbol_t.
6918 * src/tables.c (vector_number): Renamed from vector_number_t.
6919 (action_number): Renamed from action_t.
6920 * src/tables.h (base_number): Renamed from base_t.
6921 * src/vcg.h (enum color): Renamed from enum color_e.
6922 (enum textmode): Renamed from enum textmode_e.
6923 (enum shape): Renamed from enum shape_e.
6924 (struct colorentry): Renamed from struct colorentry_s.
6925 (struct classname): Renamed from struct classname_s.
6926 (struct infoname): Renamed from struct infoname_s.
6927 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
6928 (enum decision): Renamed from enum decision_e.
6929 (enum orientation): Renamed from enum orientation_e.
6930 (enum alignment): Renamed from enum alignment_e.
6931 (enum arrow_mode): Renamed from enum arrow_mode_e.
6932 (enum crossing_type): Renamed from enum crossing_type_e.
6933 (enum view): Renamed from enum view_e.
6934 (struct node): Renamed from struct node_s.
6935 (node): Renamed from node_t.
6936 (enum linestyle): Renamed from enum linestyle_e.
6937 (enum arrowstyle): Renamed from enum arrowstyle_e.
6938 (struct edge): Renamed from struct edge.
6939 (edge): Renamed from edge_t.
6940 (struct graph): Renamed from struct graph_s.
6941 (graph): Renamed from graph_t.
6942 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
6943 Rename value_t -> value.
6944 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
6945 value_t_as_yystype -> value_as_yystype.
6947 Don't include <errno.h> in the mainstream code, since it
6948 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
6949 * lib/get-errno.c, lib/get-errno.h: New files.
6950 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
6952 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
6953 * src/output.c (output_skeleton): Likewise.
6954 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
6956 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
6958 (handle_action_dollar, handle_action_at): Likewise.
6959 * src/system.h: Do not include <errno.h>.
6960 (TAB_EXT): Renamed from EXT_TAB.
6961 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
6963 Avoid str[a-z]*, since <string.h> reserves that name space.
6964 Change all instances of "struniq" in names to "uniqstr", and
6965 likewise for "STRUNIQ" and "UNIQSTR".
6966 * src/uniqstr.c: Renamed from src/struniq.c.
6967 * src/uniqstr.h: Renamed from src/struniq.h.
6968 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
6969 * src/files.c (strsuffix): Remove; unused.
6970 (concat2): Renamed from stringappend. Now static.
6971 * src/files.h (strsuffix, stringappend): Remove; unused.
6972 * src/parse-gram.y (<chars>): Renamed from <string>.
6973 (<uniqstr>): Renamed from <struniq>.
6974 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
6975 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
6976 (struct graph_s.expand): Renamed from struct graph_s.stretch.
6977 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
6978 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
6979 (N_EXPAND): Renamed from N_STRETCH.
6981 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
6982 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
6983 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
6985 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
6986 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
6987 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
6988 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
6989 (BASE_MAXIMUM): Renamed from BASE_MAX.
6990 (BASE_MINIMUM): Renamed from BASE_MIN.
6991 (ACTION_MAX): Remove; unused.
6992 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
6993 Unnecessary casts removed from above defines.
6996 Fix misspelling in names.
6997 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
6998 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
7002 * lib/timevar.c (timevar_report): Renamed from time_report,
7003 for consistency with other names.
7004 * lib/timevar.h (timevar_report): New decl.
7005 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
7008 Sort include-file uses.
7010 Reorder all include files under src to be in the order "system.h".
7011 then the ../lib include files in angle brackets (alphabetized),
7012 then the . include files in double-quotes (alphabetized). Fix
7013 dependency breakages encountered in this process, as follows:
7014 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
7015 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
7016 * src/state.h: Include "symtab.h".
7018 2002-12-08 Paul Eggert <eggert@twinsun.com>
7020 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
7021 since this causes problems when __file__ contains character
7022 sequences like "@" that are treated specially by src/scan-skel.l.
7023 Instead, just use the file's basename. This fixes the bug
7024 reported by Martin Mokrejs in
7025 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
7027 2002-12-06 Paul Eggert <eggert@twinsun.com>
7029 Add support for rules that do not have trailing semicolons, as
7030 POSIX requires. Improve the quality of locations in Bison
7033 * src/location.c: Include <quotearg.h>.
7034 (empty_location): Now const.
7035 (location_print): New function. Follow the recommendation of the
7036 GNU Coding Standards for locations that span file boundaries.
7037 * src/location.h: Do not include <quotearg.h>; no longer needed.
7038 (boundary): New type.
7039 (location_t): Use it. This allows locations to span file boundaries.
7040 All member uses changed: file -> start.file or end.file (as needed),
7041 first_line -> start.line, first_column -> start.column,
7042 last_line -> end.line, last_column -> end.column.
7043 (equal_boundaries): New function.
7044 (LOCATION_RESET, LOCATION_STEP): Remove.
7045 (LOCATION_PRINT): Remove. All callers changed to use location_print.
7046 (empty_location): Now const.
7047 (location_print): New decl.
7048 * src/parse-gram.y (lloc_default): New function, which handles
7049 empty locations more accurately.
7050 (YYLLOC_DEFAULT): Use it.
7051 (%token COLON): Remove.
7052 (%token ID_COLON): New token.
7054 (declarations, rules): Remove trailing semicolon.
7055 (declaration, rules_or_grammar_declaration):
7056 Allow empty (";") declaration.
7057 (symbol_def): Remove empty actions; no longer needed.
7058 (rules_or_grammar_declaration): Remove trailing semicolon.
7059 (semi_colon.opt): Remove.
7060 * src/reader.h: Include location.h.
7061 (scanner_cursor): New decl.
7062 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
7064 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
7066 (STEP): Remove. No longer needed, now that adjust_location does
7067 the work. All uses removed.
7068 (scanner_cursor): New var.
7069 (adjust_location): Renamed from extend_location. It now sets
7070 *loc and adjusts the scanner cursor. All uses changed.
7071 Don't bother testing for CR.
7072 (handle_syncline): Remove location arg; now updates scanner cursor.
7073 All callers changed.
7074 (unexpected_end_of_file): Now accepts start boundary of token or
7075 comment, not location. All callers changed. Update scanner cursor,
7077 (SC_AFTER_IDENTIFIER): New state.
7078 (context_state): Renamed from c_context. All uses changed.
7079 (id_loc, code_start, token_start): New local vars.
7080 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7081 processing of Yacc white space and equivalents here.
7082 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7083 instead of returning ID immediately, since we need to search for
7085 (<INITIAL>"'", "\""): Save token_start.
7086 (<INITIAL>"%{", "{", "%%"): Save code_start.
7087 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7088 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7089 BEGIN context_state at end, not INITIAL.
7090 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7091 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7092 Return correct token start.
7093 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7094 the start of a character, string or multiline comment is found.
7095 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7096 Reduction): Adjust reported locations to match the more-precise
7097 results now expected.
7098 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7099 * tests/reduce.at (Useless Rules, Reduced Automaton,
7100 Underivable Rules): Likewise.
7101 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7102 or "|"' now that so many other tokens are allowed by the new grammar.
7104 * src/complain.h (current_file): Remove duplicate decl;
7105 current_file is now owned by files.h.
7106 * src/complain.c, src/scan-gram.l: Include files.h.
7108 2002-12-06 Paul Eggert <eggert@twinsun.com>
7110 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7111 promotes to int; it might be unsigned int.
7112 * data/yacc.c (yy_reduce_print): Likewise.
7114 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7115 be #defined in the prologue, not in the Bison declarations.
7116 This fixes Debian Bug 102878, reported by Shaul Karl.
7118 2002-12-02 Paul Eggert <eggert@twinsun.com>
7120 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7121 * lib/strtoul.c: New file, from gnulib.
7122 This fixes a porting bug reported by Peter Klein in
7123 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
7125 2002-11-30 Paul Eggert <eggert@twinsun.com>
7127 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
7128 and put only a forward declaration in the prologue. This is for
7129 consistency with the other scanner helper functions.
7131 Type clashes now generate warnings, not errors, since it
7132 appears that POSIX may allow some grammars with type clashes.
7133 * src/reader.c (grammar_current_rule_check): Warn about
7134 type clashes instead of complaining.
7135 * tests/input.at (Type Clashes): Expect warnings, not complaints.
7137 Add Yacc library, since POSIX requires it.
7138 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
7139 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
7140 * lib/main.c, lib/yyerror.c: New files.
7142 gram_error can be static; it need not be extern.
7143 * src/reader.h (gram_error): Remove decl.
7144 * src/parse-gram.y (gram_error): Now static. Add static decl.
7145 (print_token_value): Omit parameter names from forward decl,
7148 2002-11-29 Paul Eggert <eggert@twinsun.com>
7150 * doc/bison.texinfo: Emphasize that yylex and yyerror must
7151 be declared before being used. E.g., one should typically
7152 declare them in the prologue. Use GNU coding style in examples.
7153 Put "const" consistently after the type it modifies. Mention
7154 that C99 supports "inline". Mention that yyerror traditionally
7157 %parse-param and %lex-param now take just one argument, the
7158 declaration; the argument name is deduced from the declaration.
7160 * doc/bison.texinfo (Parser Function, Pure Calling, Error
7161 Reporting, Table of Symbols): Document this.
7162 * src/parse-gram.y (add_param): New function.
7164 (declaration): Implement new rule for %parse-param and %lex-param.
7165 * src/scan-gram.l: "," now elicits a warning, rather than being
7166 a token; this is more compatible with byacc.
7167 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
7169 2002-11-27 Paul Eggert <eggert@twinsun.com>
7171 Rename identifiers to avoid real and potential collisions.
7173 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
7174 to avoid collision with lex macro described by Bruce Lilly in
7175 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
7176 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7177 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
7178 * src/parse-gram.y (print_token_value): Renamed from yyprint.
7180 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
7181 The name "yycontrol" violates the name space rules, and this stuff
7182 wasn't being used anyway.
7183 (input): Remove action; this stuff wasn't being used.
7184 (gram_error): Rename local variable yylloc -> loc.
7185 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
7186 (YY_DECL): Don't use "yy" at start of local variables.
7187 All uses changed, e.g., yylloc -> loc.
7188 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
7189 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
7190 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
7191 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
7193 * src/parse-gram.y (gram_error): loc is now const *.
7194 * src/reader.h (gram_error): Likewise.
7196 2002-11-24 Paul Eggert <eggert@twinsun.com>
7200 * tests/actions.at (Actions after errors): Use an output format
7201 more similar to that of the Printers and Destructors test.
7202 Test the position of the ';' token too.
7203 (Printers and Destructors): Likewise.
7204 (Printers and Destructors: %glr-parser): Remove for now, to avoid
7205 unnecessarily alarming people when the test fails.
7207 * data/yacc.c (yyerrlab1): Move this label down, so that the
7208 parser does not discard the lookahead token if the user code
7209 invokes YYERROR. This change is required for POSIX conformance.
7211 * lib/error.c: Sync with gnulib.
7213 2002-11-22 Paul Eggert <eggert@twinsun.com>
7215 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
7216 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
7217 * lib/xmalloc.c: Likewise.
7219 2002-11-20 Paul Eggert <eggert@twinsun.com>
7221 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
7223 2002-11-20 Paul Eggert <eggert@twinsun.com>
7225 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
7226 should use `if (! x) abort ();' rather than `assert (x);', and
7227 anyway it's one less thing to worry about configuring.
7229 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
7230 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
7231 and replace all instances of assert with abort.
7232 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7233 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
7235 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
7236 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
7237 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
7238 hash_find_entry, hash_rehash, hash_insert): Likewise.
7239 * src/conflicts.c (resolve_sr_conflict): Likewise.
7240 * src/lalr.c (set_goto_map, map_goto): Likewise.
7241 * src/nullable.c (nullable_compute): Likewise.
7242 * src/output.c (prepare_rules, token_definitions_output): Likewise.
7243 * src/reader.c (packgram, reader): Likewise.
7244 * src/state.c (state_new, state_free, state_transitions_set,
7245 state_reduction_find): Likewise.
7246 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
7247 symbol_pack): Likewise.
7248 * src/tables.c (conflict_row, pack_vector): Likewise.
7249 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7250 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7251 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
7252 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
7254 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
7255 (ARGMATCH_CONSTRAINT): New macro.
7256 (ARGMATCH_ASSERT): Use it.
7258 * src/system.h (verify): New macro.
7259 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
7261 * src/tables.c (tables_generate): Likewise.
7263 * src/struniq.c (struniq_assert): Now returns void, and aborts
7264 if the assertion is false.
7265 (struniq_assert_p): Remove.
7266 * src/struniq.h: Likewise.
7268 2002-11-18 Paul Eggert <eggert@twinsun.com>
7270 * data/glr.c (yygetLRActions): Replace `yyindex' with
7271 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
7272 This fixes the regression with Sun ONE Studio 7 cc that I reported in
7273 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
7275 2002-11-18 Akim Demaille <akim@epita.fr>
7277 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
7279 From Tim Van Holder.
7281 2002-11-17 Paul Eggert <eggert@twinsun.com>
7283 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
7284 to "SyntaxError" for consistency with my 2002-11-15 change.
7286 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
7287 not define to {}, since this breaks the common use of `YYDPRINTF
7288 ((...));' if a single statement is desired (e.g. before `else').
7289 Work around GCC warnings by surrounding corresponding calls with
7291 (yyhasResolvedValue): Remove unused function.
7292 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
7294 (yyreportSyntaxError): Renamed from yyreportParseError.
7295 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
7297 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
7298 extern when possible. Remove unused initializations.
7300 2002-11-16 Akim Demaille <akim@epita.fr>
7302 Augment the similarity between GLR and LALR traces.
7304 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
7305 (YY_REDUCE_PRINT): New.
7306 (yyparse): Use them.
7307 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
7309 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
7310 state reached after the reduction/recovery, since...
7311 (yyparse, yyprocessOneStack): Report the state we are entering in.
7313 2002-11-16 Akim Demaille <akim@epita.fr>
7315 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
7316 Add support for --trace=skeleton.
7317 * src/scan-skel.l: %option debug.
7318 Scan strings of non-@ or \n instead of character by character.
7319 (scan_skel): Handle trace_skeleton.
7321 (@output_parser_name@, @output_header_name@): ``Restore'' their
7322 support (used to be M4 macros).
7323 * data/yacc.c: Quote larger chunks, a la glr.c.
7324 * data/lalr1.cc: Likewise.
7325 The header guards are no longer available, so use some other
7326 string than `YYLSP_NEEDED'.
7328 2002-11-16 Akim Demaille <akim@epita.fr>
7330 Make the ``Printers and Destructors'' test more verbose, taking
7331 `yacc.c''s behavior as (possibly wrong) reference.
7333 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
7334 instead of fprint on stdout.
7335 Set and report the last_line of the symbols.
7336 Consistently display values and locations.
7338 2002-11-16 Paul Eggert <eggert@twinsun.com>
7340 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
7342 2002-11-15 Paul Eggert <eggert@twinsun.com>
7344 * tests/actions.at (Actions after errors): New test case.
7346 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
7347 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
7348 tests/action.at, tests/calc.at, tests/conflicts.at,
7349 tests/cxx-type.at, tests/regression.at:
7350 "parse error" -> "syntax error" for POSIX compatibility.
7351 "parsing stack overflow..." -> "parser stack overflow" so
7352 that code matches Bison documentation.
7354 2002-11-15 Akim Demaille <akim@epita.fr>
7356 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
7357 take two BRACED_CODE, not two string_content.
7358 Free the scanner's obstack when we are done.
7359 (code_content): New.
7360 * tests/calc.at: Adjust.
7361 * doc/bison.texinfo: Adjust.
7362 Also, make sure to include the `,' for these declarations.
7364 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
7366 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
7367 definition; avoids potential autoreconf problems.
7369 2002-11-15 Akim Demaille <akim@epita.fr>
7371 Always check the value returned by yyparse.
7373 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
7374 returned by yyparse.
7375 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
7377 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
7378 returned by yyparse.
7380 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7382 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
7385 2002-11-14 Paul Eggert <eggert@twinsun.com>
7387 * src/output.c (output_skeleton): Call xfopen instead of
7388 duplicating xfopen's body.
7390 Fix bugs reported by Nelson H. F. Beebe in
7391 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
7393 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
7394 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
7395 Group compiler. Instead, use "$CC -E bar.c". Include the .h
7396 file twice in the grammar, as an extra check.
7398 * tests/input.at (Torturing the Scanner): Surround the
7399 backslash-newline tests with "#if 0", to make it less likely that
7400 we'll run into compiler bugs. Bring back solitary \ inside
7401 comment, but add a closing comment to work around HP C bug. Don't
7402 test backslash-newline in C character constant.
7404 2002-11-14 Akim Demaille <akim@epita.fr>
7406 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
7407 status of the compiler.
7408 Calling `exit 1' is no longer needed.
7409 Reported by Nelson H. F. Beebe.
7411 2002-11-14 Akim Demaille <akim@epita.fr>
7413 * tests/atlocal.in (CPPFLAGS): We have config.h.
7414 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
7416 * tests/actions.at, tests/calc.at, tests/conflicts.at,
7417 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
7418 * tests/regression.at, tests/torture.at: Use them for all the
7419 grammars that are to be compiled.
7420 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
7421 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
7422 * doc/bison.texinfo (GLR Parsers): Document `inline'.
7424 2002-11-14 Akim Demaille <akim@epita.fr>
7426 * doc/bison.texinfo: Various formatting changes (alignments in
7427 samples, additional @group/@end group, GCS in samples.
7428 Use @deffn instead of simple @table to define the directives,
7429 macros, variables etc.
7431 2002-11-13 Paul Eggert <eggert@twinsun.com>
7433 Fix some bugs reported by Albert Chin-A-Young in
7434 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
7436 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
7437 -o c"; the HP C compiler chatters during compilation.
7438 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
7439 * tests/headers.at (export YYLTYPE): Likewise.
7441 * tests/input.at (Torturing the Scanner): Remove lines containing
7442 solitary backslashes, as they tickle a bug in the HP C compiler.
7444 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
7445 comments, since they're not portable. Use GNU coding style.
7447 2002-11-13 Akim Demaille <akim@epita.fr>
7449 * data/yacc.c: Leave bigger chunks of quoted text.
7450 (YYDSYMPRINTF): New.
7451 Use it to report symbol activities.
7452 * data/glr.c (YYDSYMPRINTF): New.
7455 2002-11-12 Paul Eggert <eggert@twinsun.com>
7459 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
7460 (yyglrReduce): Return yyok, not 0.
7461 This should avoid the enumerated-type warnings reported
7462 by Nelson H. F. Beebe in
7463 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
7465 * lib/bbitset.h (BITSET_INLINE): Remove.
7466 * lib/bitset.h [! BITSET_INLINE]: Remove.
7467 (bitset_set, bitset_reset, bitset_test): Rename local vars
7468 to avoid shadowing warnings by GCC.
7470 * data/glr.c (inline): Remove #define. It's the user's
7471 responsibility to #define it away, just like 'const'.
7472 This fixes one of the bugs reported by Nelson H. F. Beebe in
7473 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
7475 * Makefile.maint (po-check): Scan .l and .y files instead of the
7476 .c and the .h files that they generate. This fixes the bug
7477 reported by Tim Van Holder in:
7478 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
7479 Look for N_ as well as for _. Try to avoid matching #define for
7481 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
7482 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
7483 * src/scan-gram.l: Revamp regular expressions so that " and '
7484 do not confuse xgettext.
7486 * src/struniq.h (struniq_new): Do not declare the return type
7487 to be 'const'; this violates the C standard.
7488 * src/struniq.c (struniq_new): Likewise.
7490 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
7492 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
7493 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
7496 2002-11-12 Akim Demaille <akim@epita.fr>
7498 * Makefile.maint: Sync with Autoconf:
7499 (local_updates): New.
7501 2002-11-12 Akim Demaille <akim@epita.fr>
7503 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
7505 2002-11-12 Akim Demaille <akim@epita.fr>
7507 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
7510 2002-11-12 Akim Demaille <akim@epita.fr>
7512 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
7515 2002-11-12 Akim Demaille <akim@epita.fr>
7517 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
7518 Use it to test the GLR parser.
7520 2002-11-12 Akim Demaille <akim@epita.fr>
7522 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
7524 * data/glr.c (yystos): New.
7525 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
7527 (yyval): Don't define it, it is handled via M4.
7528 (yyrecoverParseError): Free verbosely the discarded symbols.
7529 * data/yacc.c (yysymprint): Remove, rather...
7530 (b4_yysymprint_generate): invoke.
7531 * data/c.m4 (b4_yysymprint_generate): New.
7532 Accept pointers as arguments, as opposed to the version from
7534 (b4_yydestruct_generate): Likewise.
7535 * tests/cations.at (Printers and Destructors): Use Bison directives
7536 instead of CPP macros.
7537 Don't rely on internal details.
7539 2002-11-12 Akim Demaille <akim@epita.fr>
7541 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
7542 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
7543 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
7544 it against YYEMPTY and so forth), work on yytoken (i.e., set
7545 it to YYEMPTY etc.).
7546 (yydestruct): Replace with a b4_yydestruct_generate invocation.
7547 (b4_symbol_actions): Remove.
7548 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
7549 for 0, end-of-input.
7551 2002-11-12 Akim Demaille <akim@epita.fr>
7553 * doc/bison.texinfo (Destructor Decl): New.
7555 2002-11-12 Akim Demaille <akim@epita.fr>
7557 * src/tables.c (tables_generate): Use free for pointers that
7558 cannot be NULL, not XFREE.
7559 (pack_vector): Use assert, not fatal, for bound violations.
7560 * src/state.c (state_new): Likewise.
7561 * src/reader.c (reader): Likewise.
7562 * src/lalr.c (set_goto_map): Likewise.
7563 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
7566 2002-11-12 Akim Demaille <akim@epita.fr>
7568 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
7570 * src/scan-gram.l (last_string): Is global to the file, not to
7572 * src/parse-gram.y (input): Don't append the epilogue here,
7573 (epilogue.opt): do it here, and free the scanner's obstack.
7574 * src/reader.c (epilogue_set): Rename as...
7575 (epilogue_augment): this.
7576 * data/c.m4 (b4_epilogue): Defaults to empty.
7578 2002-11-12 Akim Demaille <akim@epita.fr>
7580 * src/getargs.c (long_options): Remove duplicates.
7581 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
7583 * doc/bison.rnh: Remove.
7584 * doc/bison.texinfo (VMS Invocation): Remove.
7586 2002-11-12 Akim Demaille <akim@epita.fr>
7588 * src/struniq.h, src/struniq.c (struniq_t): Is const.
7589 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
7591 Use struniq for symbols.
7593 * src/symtab.h (symbol_t): The tag member is a struniq.
7594 (symbol_type_set): Adjust.
7595 * src/symtab.c (symbol_new): Takes a struniq.
7596 (symbol_free): Don't free the tag member.
7597 (hash_compare_symbol_t, hash_symbol_t): Rename as...
7598 (hash_compare_symbol, hash_symbol): these.
7599 Use the fact that tags as struniqs.
7600 (symbol_get): Use struniq_new.
7601 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
7603 * src/reader.h (merger_list, grammar_currentmerge_set): The name
7604 and type members are struniqs.
7605 * src/reader.c (get_merge_function)
7606 (grammar_current_rule_merge_set): Adjust.
7607 (TYPE, current_type): Are struniq.
7609 Use struniq for file names.
7611 * src/files.h, src/files.c (infile): Split into...
7612 (grammar_file, current_file): these.
7613 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
7614 * src/reduce.c (reduce_print): Likewise.
7615 * src/getargs.c (getargs): Likewise.
7616 * src/complain.h, src/complain.c: Likewise.
7617 * src/main.c (main): Call struniqs_new early enough to use it for
7619 Don't free the input file name.
7621 2002-11-12 Akim Demaille <akim@epita.fr>
7623 * src/symtab.c (symbol_free): Remove dead deactivated code:
7624 type_name are properly removed.
7625 Don't use XFREE to free items that cannot be NULL.
7626 * src/struniq.h, src/struniq.c: New.
7627 * src/main.c (main): Initialize/free struniqs.
7628 * src/parse-gram.y (%union): Add astruniq member.
7630 * src/scan-gram.l (<{tag}>): Return a struniq.
7631 Free the obstack bit that used to store it.
7632 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
7634 2002-11-11 Paul Eggert <eggert@twinsun.com>
7636 Revamp to fix many (but not all) of the C- and M4-related quoting
7637 problems. Among other things, this fixes the Bison bug reported
7638 by Jan Hubicka when processing the Bash grammar; see:
7639 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7641 Use new @ escapes consistently. Represent brackets with @{ and @}
7642 rather than @<:@ and @:>@, since this works a bit better with dumb
7643 editors like vi. Represent @ with @@, since @ is now consistently
7644 an escape. Use @oline@ and @ofile@ rather than __oline__ and
7645 __ofile__, to avoid unexpected expansions. Similarly, use @output
7646 rather than #output.
7648 * data/c.m4 (b4_copyright): Omit file name from comment, since
7649 the file name could contain "*/".
7650 (b4_synclines_flag): Don't quote the 2nd argument; it should already
7651 be quoted. All uses changed.
7653 * data/glr.c: Use new @ escapes consistently.
7654 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
7655 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
7656 Remove, since they couldn't handle arbitrary characters in file
7658 * data/lalr1.cc: Likewise.
7659 * data/yacc.c: Likewise.
7661 * src/files.c (output_infix): Remove; all uses removed.
7662 * src/files.h: Likewise.
7664 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
7665 mishandled funny characters in file names, and anyway it isn't
7667 * data/yacc.c: Likewise.
7668 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
7670 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
7671 * data/yacc.c: Likewise.
7673 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
7675 (muscle_init): Quote filename as a C string.
7676 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
7677 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
7678 * src/output.c (escaped_file_name_output): New function.
7679 (prepare_symbols): Quote tokens for M4.
7680 (prepare): Don't insert output_infix, output_prefix,
7681 output_parser_name, output_header_name; this is now down by scan-skel.
7682 Insert skeleton as a C string.
7684 * src/output.c (user_actions_output, symbol_destructors_output,
7685 symbol_printers_output): Quote filenames for C and M4.
7686 * src/reader.c (prologue_augment, epilogue_set): Likewise.
7688 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
7689 escapes other than \\ and \'; this simplifies the code.
7690 (<SC_STRING>): Likewise, for \\ and \".
7691 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
7692 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
7693 Use new escapes @{ and @} for [ and ].
7695 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
7696 them with auto vars.
7697 Switch to new escape scheme, where @ is the escape character uniformly.
7698 Abort if a stray escape character is found. Avoid unbounded input
7699 buffer when parsing non-escaped text.
7701 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
7702 __oline__, #output, $@, and @{ do not have unintended meanings.
7704 2002-11-09 Paul Eggert <eggert@twinsun.com>
7706 Fix the test failure due to GCC warnings described in
7707 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
7708 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
7709 evaluate to 0 if it's impossible for NINF to be in the respective
7711 (yygetLRActions, yyrecoverParseError): Use them.
7713 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
7714 counted in the token inserted at end of file. Now takes
7715 location_t *, not location_t, so that the location can be
7716 adjusted. All uses changed.
7718 * tests/regression.at (Invalid inputs): Adjust wording in
7719 diagnostic to match the new behavior.
7721 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
7722 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
7723 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
7724 abort ();'. This reduces the runtime of the "Many lookaheads"
7725 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
7728 2002-11-07 Paul Eggert <eggert@twinsun.com>
7730 * src/parse-gram.y (CHARACTER): Remove unused token.
7733 * src/scan-gram.l: Remove stack option. We no longer use the
7734 stack, since the stack was never deeper than 1; instead, use the
7735 new auto var c_context to record the stacked value.
7737 Remove nounput option. At an unexpected end of file, we now unput
7738 the minimal input necessary to end cleanly; this simplifies the
7741 Avoid unbounded token sizes where this is easy.
7743 (unexpected_end_of_file): New function.
7744 Use it to systematize the error message on unexpected EOF.
7745 (last-string): Now auto, not static.
7746 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
7747 (scanner_last_string_free): Remove; not used.
7748 (percent_percent_count): Move decl to just before use.
7749 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
7750 not the (never otherwised-used) CHARACTER.
7752 2002-11-07 Akim Demaille <akim@epita.fr>
7754 Let yyerror always receive the msg as last argument, so that
7755 yyerror can be variadic.
7757 * data/yacc.c (b4_yyerror_args): New.
7758 Use it when calling yyerror.
7759 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
7760 Use it when calling yyerror.
7761 * doc/bison.texinfo (Error Reporting): Adjust.
7762 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
7763 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
7765 2002-11-06 Akim Demaille <akim@epita.fr>
7767 #line should have quoted strings.
7768 Ideally, this should be done by m4_quotearg.
7770 * src/scan-skel.l: Include quotearg.h.
7772 * src/output.c (symbol_printers_output)
7773 (symbol_destructors_output): Quote the file name.
7775 2002-11-06 Akim Demaille <akim@epita.fr>
7777 * tests/regression.at (Invalid inputs): Adjust to the recent
7780 2002-11-06 Akim Demaille <akim@epita.fr>
7783 Reported by Jim Kent.
7785 * data/c.m4 (b4_syncline): New.
7786 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
7787 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
7788 * src/output.c (user_actions_output): Likewise.
7789 (prepare): Define 'b4_synclines_flag'.
7790 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
7792 2002-11-06 Akim Demaille <akim@epita.fr>
7794 * src/main.c (main): Free `infile'.
7795 * src/scan-gram.l (handle_syncline): New.
7797 * src/output.c (user_actions_output, symbol_destructors_output)
7798 (symbol_printers_output): Use the location's file name, not
7800 * src/reader.c (prologue_augment, epilogue_set): Likewise.
7802 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7804 * src/tables.c (matching_state): Don't allow states to match if
7805 either has GLR conflict entries.
7807 2002-11-05 Paul Eggert <eggert@twinsun.com>
7809 * src/scan-gram.l: Use more accurate diagnostics, e.g.
7810 "integer out of range" rather than "invalid value".
7811 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
7814 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
7815 Also, remove one static variable in the scanner.
7817 * src/scan-gram.l (braces_level): Now auto, not static.
7818 Initialize to zero if the compiler is being picky.
7819 (INITIAL): Clear braces_level instead of incrementing it.
7820 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
7821 as POSIX 1003.1-2001 requires.
7822 * src/system.h (IF_LINT): New macro, taken from coreutils.
7823 * configure.ac: Define "lint" if --enable-gcc-warnings.
7825 2002-11-05 Akim Demaille <akim@epita.fr>
7827 * src/scan-gram.l: When it starts with `%', complain about the
7828 whole directive, not just that `invalid character: %'.
7830 2002-11-04 Akim Demaille <akim@epita.fr>
7832 * Makefile.maint: Update from Autoconf.
7833 (update, cvs-update, po-update, do-po-update): New.
7835 2002-11-04 Akim Demaille <akim@epita.fr>
7837 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
7839 Have yyerror `use' its arguments.
7840 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
7841 returns true when location & yacc & pure & parse-param.
7842 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
7844 2002-11-04 Akim Demaille <akim@epita.fr>
7846 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
7848 * src/scan-gram.l: Use [\'] instead of ['] to pacify
7851 Use quote, not quote_n since LOCATION_PRINT no longer uses the
7854 2002-11-03 Paul Eggert <eggert@twinsun.com>
7856 * src/reader.c (get_merge_function, grammar_current_rule_check):
7857 Use consistent diagnostics for reporting type name clashes.
7858 Quote the types with <>, for consistency with Yacc.
7859 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
7861 2002-11-03 Akim Demaille <akim@epita.fr>
7863 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
7865 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
7866 (b4_parse_param): Remove.
7867 Use b4_identification.
7868 Propagate b4_pure_args where needed to pass them to yyerror.
7869 * data/glr.m4 (b4_parse_param): Remove.
7870 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
7871 (b4_lpure_formals): New.
7872 Use b4_identification.
7873 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
7874 b4_user_formals and b4_user_args.
7875 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
7876 (yyreportAmbiguity): When using a pure parser, also need
7877 the location, and the parse-params.
7879 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
7880 When using a pure parser, also need the parse-params.
7882 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
7883 (%pure-parser + %parse-param) LALR and GLR parsers.
7884 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
7885 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
7886 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
7887 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
7888 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
7889 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
7890 * doc/bison.texinfo: Untabify the whole file.
7891 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
7892 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
7893 (Error Reporting): Adjust to these new directives.
7894 Document %error-verbose, deprecate YYERROR_VERBOSE.
7896 2002-11-03 Akim Demaille <akim@epita.fr>
7898 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
7899 AT_CHECK_CALC_GLR invocations to use % directives, instead of
7900 command line options.
7901 * tests/cxx-type.at: Formatting changes.
7903 2002-11-03 Paul Eggert <eggert@twinsun.com>
7905 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
7906 to count columns correctly, and to check for invalid inputs.
7908 Use mbsnwidth to count columns correctly. Account for tabs, too.
7910 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
7911 (extend_location): New function.
7914 Handle CRLF in C code rather than in Lex code.
7915 (YY_INPUT): New macro.
7916 (no_cr_read): New function.
7918 Scan UCNs, even though we don't fully handle them yet.
7919 (convert_ucn_to_byte): New function.
7921 Handle backslash-newline correctly in C code.
7922 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
7923 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
7925 (tag, splice): New EREs. Do not allow NUL or newline in tags.
7926 Use {splice} wherever C allows backslash-newline.
7927 YY_STEP after space, newline, vertical-tab.
7928 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
7930 (letter, id): Don't assume ASCII; e.g., spell out a-z.
7932 ({int}, handle_action_dollar, handle_action_at): Check for integer
7935 (YY_STEP): Omit trailing semicolon, so that it's more like C.
7937 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
7938 as well as \000. Check for UCHAR_MAX, not 255.
7939 Allow \x with an arbitrary positive number of digits, as in C.
7940 Check for overflow here.
7941 Allow \? and UCNs, for compatibility with C.
7943 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
7944 with quote slot used by complain_at.
7946 * tests/input.at: Add tests for backslash-newline, m4 quotes
7947 in symbols, long literals, and funny escapes in strings.
7949 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
7950 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
7951 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
7952 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
7953 * m4/mbswidth.m4: New file, from GNU coreutils.
7955 * doc/bison.texinfo (Grammar Outline): Document // comments.
7956 (Symbols): Document that trigraphs have no special meaning in Bison,
7957 nor is backslash-newline allowed.
7958 (Actions): Document that trigraphs have no special meaning.
7960 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
7963 2002-11-02 Paul Eggert <eggert@twinsun.com>
7965 * src/reader.c: Don't include quote.h; not needed.
7966 (get_merge_function): Reword warning to be consistent with
7967 type clash diagnostic in grammar_current_rule_check.
7969 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
7970 bug in trigraph handling.
7972 * src/output.c (prepare_symbols): When printing token names,
7973 escape "[" as "@<:@" and likewise for "]".
7975 * src/system.h (errno): Remove declaration, as we are now
7976 assuming C89 or better, and C89 guarantees errno.
7978 2002-10-30 Paul Eggert <eggert@twinsun.com>
7980 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
7981 Check for close failures.
7982 * src/files.h (xfclose): Return void, not int, since it always
7984 * src/files.c (xfclose): Likewise. Report I/O error if ferror
7986 * src/output.c (output_skeleton): Use xfclose rather than fclose
7987 and ferror. xfclose now checks ferror.
7989 * data/glr.c (YYLEFTMOST_STATE): Remove.
7990 (yyreportTree): Use a stack-based leftmost state. This avoids
7991 our continuing battles with bogus warnings about initializers.
7993 2002-10-30 Akim Demaille <akim@epita.fr>
7995 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
7998 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8000 * tests/glr-regr1.at: New test for reported regressions.
8001 * tests/testsuite.at: Add glr-regr1.at test.
8002 * tests/Makefile.am: Add glr-regr1.at test.
8004 2002-10-24 Paul Eggert <eggert@twinsun.com>
8008 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
8009 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
8010 we use malloc. Don't assume 'A' through 'Z' are contiguous.
8011 Don't assume strdup exists; POSIX says its an XSI extension.
8012 Check for buffer overflow on input.
8014 2002-10-24 Akim Demaille <akim@epita.fr>
8016 * src/output.c (output_skeleton): Don't disable M4sugar comments
8017 too soon: it results in comments being expanded.
8018 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
8021 2002-10-24 Akim Demaille <akim@epita.fr>
8023 * data/yacc.c (m4_int_type): New.
8024 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
8025 char' as only yacc.c wants K&R portability.
8026 * data/glr.c (yysigned_char): Remove.
8027 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8028 Reported by Quoc Peyrot.
8030 2002-10-23 Paul Eggert <eggert@twinsun.com>
8032 * src/main.c (main): With --trace=time, report times even if a
8033 non-fatal error occurs. Formerly, the times were reported in some
8034 such cases but not in others.
8035 * src/reader.c (reader): Just return if a complaint has been issued,
8036 instead of exiting, so that 'main' can report times.
8038 2002-10-22 Akim Demaille <akim@epita.fr>
8040 * src/system.h: Include sys/types.
8041 Reported by Bert Deknuydt.
8043 2002-10-23 Paul Eggert <eggert@twinsun.com>
8045 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
8046 Suggested by Art Haas.
8048 2002-10-22 Paul Eggert <eggert@twinsun.com>
8050 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
8051 decl; not needed any more.
8052 * src/main.c (main): Use return to exit, undoing yesterday's change.
8053 The last OS that we could find where this wouldn't work is
8054 SunOS 3.5, and that's too old to worry about now.
8056 * data/glr.c (struct yyltype): Define members even when not
8057 doing locations. This is more consistent with yacc.c, and it
8058 works around the following bug reports:
8059 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
8060 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
8062 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
8063 @acronym consistently. Standardize on "Yacc" instead of "YACC",
8064 "Algol" instead of "ALGOL". Give a bit more history about BNF.
8066 2002-10-22 Akim Demaille <akim@epita.fr>
8070 2002-10-21 Paul Eggert <eggert@twinsun.com>
8072 Be consistent about 'bool'; the old code used an enum in one
8073 module and an int in another, and this violates the C standard.
8074 * m4/stdbool.m4: New file, from coreutils 4.5.3.
8075 * configure.ac (AC_HEADER_STDBOOL): Add.
8076 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
8077 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
8078 * src/symtab.c (hash_compare_symbol_t): Likewise.
8079 * src/system.h (bool, false, true): Use a definition consistent
8080 with ../lib/hash.c. All uses changed.
8082 * src/complain.c (warning_issued): Renamed from warn_message_count,
8083 so that we needn't worry about integer overflow (!).
8084 Now of type bool. All uses changed.
8085 (complaint_issued): Renamed from complain_message_count; likewise.
8087 * src/main.c (main): Use exit to exit with failure.
8089 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8090 rather than 1 and 0.
8091 * src/main.c (main): Likewise.
8092 * src/getargs.c (getargs): Likewise.
8093 * src/reader.c (reader): Likewise.
8095 * src/getarg.c (getargs): Remove duplicate code for
8096 "Try `bison --help'".
8098 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8099 What was that "2" for?
8101 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8102 * src/getargs.c (usage): Likewise.
8104 * src/getargs.c (getargs): When there are too few operands, report
8105 the last one. When there are too many, report the first extra
8106 one. This is how diffutils does it.
8108 2002-10-20 Paul Eggert <eggert@twinsun.com>
8110 Remove K&R vestiges.
8111 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8112 * src/complain.c (VA_START): Remove. Assume prototypes.
8113 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8114 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8115 fatal): Assume prototypes.
8116 * src/complain.h: Assume prototypes.
8117 * src/system.h (PARAMS): Remove.
8118 Include <limits.h> unconditionally, since it's guaranteeed even
8119 for a freestanding C89 compiler.
8120 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8121 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8123 2002-10-20 Akim Demaille <akim@epita.fr>
8125 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
8126 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
8127 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
8128 (yyresolveStates, yyresolveAction, yyresolveStack)
8129 (yyprocessOneStack): Use them.
8130 (yy_reduce_print): New.
8131 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
8133 2002-10-20 Akim Demaille <akim@epita.fr>
8135 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
8136 arguments and output `void'.
8137 (b4_c_function): Rename as...
8138 (b4_c_function_def): this.
8139 (b4_c_function_decl, b4_c_ansi_function_def)
8140 (b4_c_ansi_function_decl): New.
8141 Change the interpretation of the arguments: before `int, foo', now
8143 * data/yacc.c (yyparse): Prototype and define thanks to these.
8144 Adjust b4_c_function_def uses.
8145 * data/glr.c (yyparse): Likewise, but ANSI only.
8147 2002-10-20 Akim Demaille <akim@epita.fr>
8149 * src/output.c (prepare): Move the definition of `tokens_number',
8150 `nterms_number', `undef_token_number', `user_token_number_max'
8152 (prepare_tokens): Here.
8153 (prepare_tokens): Rename as...
8154 (prepare_symbols): this.
8155 (prepare): Move the definition of `rules_number' to...
8156 (prepare_rules): here.
8157 (prepare): Move the definition of `last', `final_state_number',
8158 `states_number' to...
8159 (prepare_states): here.
8160 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
8162 2002-10-20 Akim Demaille <akim@epita.fr>
8164 * src/tables.h, src/tables.c, src/output.c: Comment changes.
8166 2002-10-20 Akim Demaille <akim@epita.fr>
8168 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
8171 2002-10-20 Akim Demaille <akim@epita.fr>
8173 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
8174 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
8176 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
8178 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
8179 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
8182 2002-10-19 Paul Eggert <eggert@twinsun.com>
8184 Do not create a temporary file, as that involves security and
8185 cleanup headaches. Instead, use a pair of pipes.
8186 Derived from a suggestion by Florian Krohm.
8187 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
8188 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
8189 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
8190 (BISON_PREREQ_SUBPIPE): Add.
8191 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
8192 Add subpipe.h, subpipe.c.
8193 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
8194 * po/POTFILES.in: Add lib/subpipe.c.
8195 * src/output.c: Include "subpipe.h".
8196 (m4_invoke): Remove decl.
8197 (scan_skel): New decl.
8198 (output_skeleton): Use pipe rather than temporary file for m4 input.
8199 Check that m4sugar.m4 is readable, to avoid deadlock.
8200 Check for pipe I/O error.
8201 * src/scan-skel.l (readpipe): Remove decl.
8202 (scan_skel): New function, to be used in place of m4_invoke.
8203 Read from stream rather than file.
8205 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
8206 float, as this generates a warning on Solaris 8 + GCC 3.2 with
8207 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
8208 this generates a more-accurate value anyway.
8210 * lib/timevar.c (timervar_accumulate): Rename locals to
8211 avoid confusion with similarly-named more-global.
8212 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
8214 * src/output.c (prepare): Use xstrdup to convert char const *
8215 to char *, to avoid GCC warning.
8217 2002-10-19 Akim Demaille <akim@epita.fr>
8219 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
8220 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
8221 Use them to have `calc.y' ready for %pure-parser.
8222 * data/yacc.c (YYLEX): Pass a yylex return type to
8225 2002-10-19 Akim Demaille <akim@epita.fr>
8227 Prototype support of %lex-param and %parse-param.
8229 * src/parse-gram.y: Add the definition of the %lex-param and
8230 %parse-param tokens, plus their rules.
8231 Drop the `_' version of %glr-parser.
8233 * src/scan-gram.l (INITIAL): Scan them.
8234 * src/muscle_tab.c: Comment changes.
8235 (muscle_insert, muscle_find): Rename `pair' as `probe'.
8236 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
8237 (muscle_entry_s): The `value' member is no longer const.
8238 Adjust all dependencies.
8239 * src/muscle_tab.c (muscle_init): Adjust: use
8240 MUSCLE_INSERT_STRING.
8241 Initialize the obstack earlier.
8242 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
8243 (muscle_pair_list_grow): New.
8244 * data/c.m4 (b4_c_function_call, b4_c_args): New.
8245 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
8246 * tests/calc.at: Use %locations, not --locations.
8247 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
8249 2002-10-19 Akim Demaille <akim@epita.fr>
8251 * src/getargs.c (usage): Take status as argument and exit
8253 Report the traditional `Try ... --help' message when status != 0.
8254 (usage, version): Don't take a FILE * as arg, it is pointless.
8255 (getargs): When there is an incorrect number of arguments, make it
8256 an error, and report it GNUlically thanks to `usage ()'.
8258 2002-10-18 Paul Eggert <eggert@twinsun.com>
8260 * data/glr.c (yyreportParseError): Don't assume that sprintf
8261 yields the length of the printed string, as this is not true
8262 on SunOS 4.1.4. Reported by Peter Klein.
8264 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
8265 * tests/conflicts.at (%nonassoc and eof): Likewise.
8266 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
8268 2002-10-17 Akim Demaille <akim@epita.fr>
8270 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
8271 * src/getargs.c (trace_types, trace_args): Adjust.
8272 * src/reader.c (grammar_current_rule_prec_set)
8273 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
8274 Standardize error messages.
8276 (reader): Use trace_flag to enable scanner/parser debugging,
8277 instead of an adhoc scheme.
8278 * src/scan-gram.l: Remove trailing debugging code.
8280 2002-10-16 Paul Eggert <eggert@twinsun.com>
8282 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
8285 * NEWS: Officially drop support for building Bison with K&R C,
8286 since it didn't work anyway and it's not worth worrying about.
8287 * Makefile.maint (wget_files): Remove ansi2knr.c.
8288 (ansi2knr.c-url_prefix): Remove.
8289 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
8290 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8291 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8293 2002-10-15 Paul Eggert <eggert@twinsun.com>
8295 Stop using the "enum_" trick for K&R-style function definitions;
8296 it confused me, and I was the author! Instead, assume that people
8297 who want to use K&R C compilers (when using these modules in GCC,
8298 perhaps?) will run ansi2knr.
8300 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
8301 All uses of "enum_" changed to "enum ".
8302 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
8303 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
8305 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
8306 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
8307 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
8308 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
8309 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
8310 abitset_not, abitset_ones, abitset_or, abitset_or_and,
8311 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
8312 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
8313 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
8314 Use function prototypes; this removes the need for declaring
8315 static functions simply to provide their prototypes.
8316 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
8317 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
8318 bitset_count_, bitset_create, bitset_dump, bitset_first,
8319 bitset_free, bitset_init, bitset_last, bitset_next,
8320 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
8321 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
8322 bitset_print, bitset_release_memory, bitset_toggle_,
8323 bitset_type_choose, bitset_type_get, bitset_type_name_get,
8324 debug_bitset): Likewise.
8325 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
8326 * lib/bitset_stats.c (bitset_log_histogram_print,
8327 bitset_percent_histogram_print, bitset_stats_and,
8328 bitset_stats_and_cmp, bitset_stats_and_or,
8329 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
8330 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
8331 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
8332 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
8333 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
8334 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
8335 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
8336 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
8337 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
8338 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
8339 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
8340 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
8341 bitset_stats_zero): Likewise.
8342 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
8343 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
8344 bitsetv_dump, debug_bitsetv): Likewise.
8345 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
8346 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
8347 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
8348 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
8349 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
8350 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
8351 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
8352 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
8353 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
8354 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
8355 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
8357 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
8358 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
8359 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
8360 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
8361 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
8362 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
8363 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
8364 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
8365 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
8366 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
8367 lbitset_xor_cmp, lbitset_zero): Likewise.
8369 2002-10-14 Akim Demaille <akim@epita.fr>
8373 2002-10-14 Akim Demaille <akim@epita.fr>
8375 * tests/Makefile.am (maintainer-check-posix): New.
8377 2002-10-14 Akim Demaille <akim@epita.fr>
8379 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
8382 2002-10-14 Akim Demaille <akim@epita.fr>
8384 * src/tables.c (table_ninf_remap): base -> tab.
8385 Reported by Matt Rosing.
8387 2002-10-14 Paul Eggert <eggert@twinsun.com>
8389 * tests/action.at, tests/calc.at, tests/conflicts.at,
8390 tests/cxx-type.at, tests/headers.at, tests/input.at,
8391 tests/regression.at, tests/synclines.at, tests/torture.at:
8392 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
8393 so that the tests still work even if POSIXLY_CORRECT is set.
8394 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
8396 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
8397 for portability to K&R hosts. Fix typo: signed char is guaranteed
8398 only to 127, not to 128.
8399 * data/glr.c (yysigned_char): New type.
8400 * data/yacc.c (yysigned_char): Likewise.
8401 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
8403 2002-10-13 Paul Eggert <eggert@twinsun.com>
8405 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
8406 true due to limited range of data type" warning from GCC.
8408 * data/c.m4 (b4_token_defines): Protect against double-inclusion
8409 by wrapping enum yytokentype's definition inside #ifndef
8410 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
8412 2002-10-13 Akim Demaille <akim@epita.fr>
8414 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
8415 Un yy- yyrhs to avoid the name clash with the global YYRHS.
8417 2002-10-13 Akim Demaille <akim@epita.fr>
8419 * Makefile.maint: Update from Autoconf 2.54.
8420 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
8422 2002-10-13 Akim Demaille <akim@epita.fr>
8424 * src/print.c (print_state): Separate the list of solved conflicts
8425 from the other items.
8426 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
8428 2002-10-13 Akim Demaille <akim@epita.fr>
8430 Let nondeterministic skeletons be usable with deterministic
8433 With the patch, GAWK compiled by GCC without -O2 passes its test
8434 suite using a GLR parser driven by LALR tables. It fails with -O2
8435 because `struct stat' gives two different answers on my machine:
8436 88 (definition of an auto var) and later 96 (memset on this var).
8437 Hence the stack is badly corrumpted. The headers inclusion is to
8438 blame: if I move the awk.h inclusion before GLR's system header
8439 inclusion, the two struct stat have the same size.
8441 * src/tables.c (pack_table): Always create conflict_table.
8442 (token_actions): Always create conflict_list.
8443 * data/glr.c (YYFLAG): Remove, unused.
8445 2002-10-13 Akim Demaille <akim@epita.fr>
8447 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
8449 (VALGRIND, GXX): New.
8450 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
8451 * tests/bison.in: Run $PREBISON a pre-command.
8452 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
8453 (maintainer-check-g++): New.
8454 * Makefile.am (maintainer-check): New.
8456 2002-10-13 Akim Demaille <akim@epita.fr>
8458 * data/glr.c: Formatting changes.
8459 Tweak some trace messages to match yacc.c's.
8461 2002-10-13 Akim Demaille <akim@epita.fr>
8463 GLR parsers sometimes raise parse errors instead of performing the
8465 Reported by Charles-Henry de Boysson.
8467 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
8468 check the length of the traces when %glr.
8469 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
8471 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
8473 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
8474 (yyltype): Remove the yy prefix from the member names.
8475 (yytable): Complete its comment.
8476 (yygetLRActions): Map error action number from YYTABLE from
8478 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
8479 (which was a bug: it should have been YYTABEL_NINF, and yet it was
8480 not satisfying as we could compare an YYACTION computed from
8481 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
8482 only value for error actions.
8483 (yyreportParseError): In verbose parse error messages, don't issue
8484 `error' in the list of expected tokens.
8485 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
8486 next action to perform to match glr.c's decoding.
8487 (yytable): Complete its comment.
8489 2002-10-13 Paul Eggert <eggert@twinsun.com>
8491 Fix problem reported by Henrik Grubbstroem in
8492 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
8493 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
8494 because the Bison parser reads the second action before reducing
8496 * src/scan-gram.l (rule_length): New static var.
8497 Use it to keep track of the rule length in the scanner, since
8498 we can't expect the parser to be in lock-step sync with the scanner.
8499 (handle_action_dollar, handle_action_at): Use this var.
8500 * tests/actions.at (Exotic Dollars): Test for the problem.
8502 2002-10-12 Paul Eggert <eggert@twinsun.com>
8504 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
8505 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
8506 Include <sys/time.h> when checking for clock_t and struct tms.
8507 Use same include order as source.
8508 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
8509 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
8511 * lib/timevar.c: Update copyright date and clarify comments.
8512 (get_time) [IN_GCC]: Keep the GCC version for reference.
8514 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
8515 GCC version as of today, then merge Bison's changes.
8516 Change "GCC" to "Bison" in copyright notice. timevar.def's
8517 author is Akim, so change that too.
8519 * src/reader.c (grammar_current_rule_check):
8520 Don't worry about the default action if $$ is untyped.
8521 Prevents bogus warnings reported by Jim Gifford in
8522 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
8524 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
8525 * data/glr.c, data/lalr1.cc, data/yacc.c:
8526 Output token definitions before the first part of user declarations.
8527 Fixes compatibility problem reported by Jim Gifford for kbd in
8528 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
8530 2002-10-11 Paul Eggert <eggert@twinsun.com>
8532 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
8533 (yyparse): here. This undoes some of the 2002-07-25 change.
8534 Compatibility problem reported by Ralf S. Engelschall with
8535 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
8537 2002-10-11 Akim Demaille <akim@epita.fr>
8539 * tests/regression.at Characters Escapes): New.
8540 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
8542 Reported by Jan Nieuwenhuizen.
8544 2002-10-11 Akim Demaille <akim@epita.fr>
8548 2002-10-10 Paul Eggert <eggert@twinsun.com>
8550 Portability fixes for bitsets; this also avoids several GCC
8553 * lib/abitset.c: Include <stddef.h>, for offsetof.
8554 * lib/lbitset.c: Likewise.
8556 * lib/abitset.c (abitset_bytes): Return a size that is aligned
8557 properly for vectors of objects. Do not assume that adding a
8558 header size to a multiple of a word size yields a value that is
8559 properly aligned for the whole union.
8560 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8562 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
8563 unique names for structures.
8564 * lib/ebitset.c (ebitset_bytes): Likewise.
8565 * lib/lbitset.c (lbitset_bytes): Likewise.
8567 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
8568 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
8569 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
8570 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
8571 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
8572 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
8573 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
8574 to improve the type-checking that GCC can do.
8575 * lib/bitset.c (bitset_op4_cmp): Likewise.
8576 * lib/bitset_stats.c (bitset_stats_count,
8577 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
8578 bitset_stats_copy, bitset_stats_disjoint_p,
8579 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
8580 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
8581 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
8582 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
8583 bitset_stats_and_or_cmp, bitset_stats_andn_or,
8584 bitset_stats_andn_or_cmp, bitset_stats_or_and,
8585 bitset_stats_or_and_cmp): Likewise.
8586 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
8587 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
8588 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
8589 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
8591 * lib/abitset.h: Include bitset.h, not bbitset.h.
8592 * lib/ebitset.h: Likewise.
8593 * lib/lbitset.h: Likewise.
8595 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
8596 All instances of parameters of type enum bitset_opts are now of
8597 type enum_bitset_opts, to conform to the C Standard, and similarly
8598 for enum_bitset_type.
8599 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
8600 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
8602 Do not use "struct bitset_struct" to mean different things in
8603 different modules. Not only is this confusing, it violates
8604 the C Standard, which requires that structure types in different
8605 modules must be compatible if one is to be passed to the other.
8606 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
8607 All instances of "struct bitset_struct *" replaced with "bitset".
8608 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
8609 (union bitset_union, struct abitset_struct, struct ebitset_struct,
8610 struct lbitset_struct, struct bitset_stats_struct): New types.
8611 All uses of struct bitset_struct changed to union bitset_union,
8613 * lib/abitset.c (struct abitset_struct, abitset,
8614 struct bitset_struct): Remove.
8615 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
8616 struct bitset_struct): Remove.
8617 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
8618 bitset_struct): Remove.
8619 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
8622 Do not call a function of type T using a call that assumes the
8623 function is of a different type U. Standard C requires that a
8624 function must be called with a type that is compatible with its
8626 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
8628 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
8630 * lib/ebitset.c (PFV): Remove.
8631 * lib/lbitset.c (PFV): Likewise.
8632 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
8633 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
8635 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
8636 (ebitset_vtable): Use them.
8637 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
8638 lbitset_xor): New functions.
8639 (lbitset_vtable): Use them.
8641 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
8644 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
8646 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
8647 Use offsetof, for simplicity.
8649 2002-10-06 Paul Eggert <eggert@twinsun.com>
8651 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
8652 the same width as int. This reapplies a hunk of the 2002-08-12 patch
8653 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
8654 which was inadvertently undone by the 2002-09-30 patch.
8655 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
8656 the same width as int.
8658 2002-10-04 Paul Eggert <eggert@twinsun.com>
8662 * configure.ac (AC_INIT), NEWS: Increment version number.
8664 * doc/bison.texinfo: Minor spelling, grammar, and white space
8666 (Symbols): Mention that any negative value returned from yylex
8667 signifies end-of-input. Warn about negative chars. Mention
8668 the portable Standard C character set.
8670 The GNU coding standard says CFLAGS and YFLAGS are reserved
8671 for the installer to set.
8672 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
8673 * src/Makefile.am (AM_CFLAGS): Likewise.
8674 (AM_YFLAGS): Renamed from YFLAGS.
8676 Fix some MAX and MIN problems.
8677 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
8678 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
8679 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
8680 * src/reader.c (reader): Use it.
8682 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
8683 POSIX 1003.1-2001 has removed fgrep.
8685 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
8687 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
8688 interpreted as signed.
8689 * lib/ebitset.c (ebitset_list): Fix bug.
8691 2002-10-01 Paul Eggert <eggert@twinsun.com>
8693 More fixes for 64-bit hosts and large bitsets.
8695 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
8696 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
8697 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
8698 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
8699 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
8700 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
8701 bitset_count_): Likewise.
8702 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
8703 bitset_first, bitset_last): Likewise.
8704 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
8705 bitset_stats_list_reverse, bitset_stats_size,
8706 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
8708 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8709 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
8710 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
8711 bitsetv_reflexive_transitive_closure): Likewise.
8712 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
8713 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
8715 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
8718 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
8719 Use size_t, not unsigned int, to count bytes.
8720 * lib/abitset.h (abitset_bytes): Likewise.
8721 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
8723 * lib/bitset.h (bitset_bytes): Likewise.
8724 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
8725 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
8726 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8727 * lib/ebitset.c (ebitset_bytes): Likewise.
8728 * lib/ebitset.h (ebitset_bytes): Likewise.
8729 * lib/lbitset.c (lbitset_bytes): Likewise.
8730 * lib/lbitset.h (lbitset_bytes): Likewise.
8732 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
8733 abitset_subset_p, abitset_disjoint_p, abitset_and,
8734 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
8735 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
8736 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
8737 abitset_or_and, abitset_or_and_cmp):
8738 Use bitset_windex instead of unsigned int.
8739 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
8740 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
8741 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
8742 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
8744 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
8746 * lib/bitset.c (bitset_print):
8747 Use proper printf formats for widths of integer types.
8748 * lib/bitset_stats.c (bitset_percent_histogram_print,
8749 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
8750 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8751 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
8752 * lib/lbitset.c (lbitset_bytes): Likewise.
8754 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
8755 BITSET_SIZE_MAX): New macros.
8756 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
8757 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
8758 to BITSET_WINDEX_MAX.
8760 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
8761 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
8762 since we now return the bitset_bindex type (not int).
8764 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
8765 when computing sizes.
8766 * lib/ebitset.c (ebitset_elts_grow): Likewise.
8768 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
8769 and avoid cast to unsigned.
8771 2002-09-30 Akim Demaille <akim@epita.fr>
8773 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8774 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
8775 Updates from Michael Hayes.
8777 2002-09-30 Art Haas <ahaas@neosoft.com>
8779 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
8781 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
8784 2002-09-27 Akim Demaille <akim@epita.fr>
8788 2002-09-27 Akim Demaille <akim@epita.fr>
8790 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
8791 (Because of AC_LIBSOURCE).
8793 2002-09-27 Akim Demaille <akim@epita.fr>
8795 Playing with Autoscan.
8797 * configure.ac: Remove the old LIBOBJ tweaks.
8798 (AC_REPLACE_FUNCS): Add strrchr and strtol.
8799 * lib/strrchr.c: New.
8800 * lib/strtol.c: New, from the Coreutils 4.5.1.
8802 2002-09-27 Akim Demaille <akim@epita.fr>
8804 Playing with Autoscan.
8806 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
8807 * lib/Makefile.am (libbison_a_SOURCES): No longer include
8808 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
8809 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
8812 2002-09-24 Akim Demaille <akim@epita.fr>
8814 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
8815 (Frequently Asked Questions, Parser Stack Overflow): New.
8817 2002-09-13 Akim Demaille <akim@epita.fr>
8819 Playing with autoscan.
8821 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
8822 * src/files.c (skeleton_find): Remove, unused.
8823 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
8824 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
8826 2002-09-13 Akim Demaille <akim@epita.fr>
8828 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
8829 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
8831 2002-09-13 Akim Demaille <akim@epita.fr>
8833 * configure.ac: Require 2.54.
8834 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
8835 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
8836 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
8837 Remove, provided by Autoconf macros.
8839 2002-09-12 Akim Demaille <akim@epita.fr>
8841 * m4/prereq.m4: Update, from Coreutils 4.5.1.
8843 2002-09-12 Akim Demaille <akim@epita.fr>
8845 * m4/prereq.m4: Update, from Fileutils 4.1.5.
8846 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
8847 Reported by Martin Mokrejs.
8849 2002-09-10 Akim Demaille <akim@epita.fr>
8851 * src/parse-gram.y: Associate a human readable string to each
8853 * tests/regression.at (Invalid inputs): Adjust.
8855 2002-09-10 Gary V. Vaughan <gary@gnu.org>
8857 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
8858 with an Autoconf-2.5x style configure.ac.
8860 2002-09-06 Paul Eggert <eggert@twinsun.com>
8862 * doc/bison.texinfo (Conditions): Make explicit that the GPL
8863 exception applies only to yacc.c. This is a modification of a
8864 patch originally suggested by Akim Demaille.
8866 2002-09-06 Akim Demaille <akim@epita.fr>
8868 * data/c.m4 (b4_copyright): Move the GPL exception comment from
8870 * data/yacc.c: here.
8872 * data/lalr1.cc (struct yyltype): Don't define it, since we use
8874 (b4_ltype): Default to yy::Location from location.hh.
8876 2002-09-04 Jim Meyering <jim@meyering.net>
8878 * data/yacc.c: Guard the declaration of yytoknum also with
8879 `#ifdef YYPRINT', so it is declared only when used.
8881 2002-09-04 Akim Demaille <akim@epita.fr>
8883 * configure.in: Rename as...
8884 * configure.ac: this.
8887 2002-09-04 Akim Demaille <akim@epita.fr>
8889 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
8890 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
8891 translate maintainer only messages.
8893 2002-08-12 Paul Eggert <eggert@twinsun.com>
8897 * Makefile.am (SUBDIRS): Remove intl.
8898 (DISTCLEANFILES): Remove.
8899 * NEWS: Mention that GNU M4 is now required. Clarify what is
8900 meant by "larger grammars". Mention the pt_BR translation.
8901 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
8902 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
8903 Bump version from 0.11.2 to 0.11.5.
8904 (BISON_PREREQ_STAGE): Remove.
8905 (AM_GNU_GETTEXT): Use external gettext.
8906 (AC_OUTPUT): Remove intl/Makefile.
8908 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
8910 * data/glr.c: Include string.h, for strlen.
8911 (yyreportParseError): Use size_t for yysize.
8912 (yy_yypstack): No longer nested inside yypstates, as nested
8913 functions are not portable. Do not assume size_t is the
8915 (yypstates): Do not assume that ptrdiff_t is the same width
8916 as int, and similarly for yyposn and YYINDEX.
8918 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
8920 * lib/Makefile.am (INCLUDES): Do not include from the intl
8921 directory, which has been removed.
8922 * src/Makefile.am (INCLUDES): Likewise.
8924 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
8925 (bitsets_sources, additional_bitsets_sources, timevars_sources):
8928 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
8929 * tests/Makefile.am (EXTRA_DIST): Likewise.
8931 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
8932 Do not assume that bitset_windex is the same width as unsigned.
8934 * lib/abitset.c (abitset_unused_clear): Do not assume that
8935 bitset_word is the same width as int.
8936 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
8937 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
8938 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
8939 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
8940 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
8942 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
8943 portability to one's complement hosts!).
8944 * lib/ebitset.c (ebitset_op1): Likewise.
8945 * lib/lbitset.c (lbitset_op1): Likewise.
8947 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
8948 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8949 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
8950 Sync with fileutils.
8951 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
8952 lib/gettext.h: Sync with diffutils.
8954 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
8955 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
8957 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
8958 PROTOTYPES to check for prototypes, and "defined __STDC__" to
8961 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
8962 size_t; the old version tried to do this but casted improperly.
8963 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
8964 (bitset_test): Now returns int, not unsigned long.
8966 * lib/bitset_stats.c: Include "gettext.h".
8968 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
8969 name locals "index", as it generates unnecessary warnings on some
8970 hosts that have an "index" function.
8972 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
8973 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
8974 they need translation.
8975 * src/LR0.c (state_list_append, new_itemsets, get_state,
8976 append_states, generate_states): Likewise.
8977 * src/assoc.c (assoc_to_string): Likewise.
8978 * src/closure.c (print_closure, set_firsts, closure): Likewise.
8979 * src/gram.c (grammar_dump): Likewise.
8980 * src/injections.c (injections_compute): Likewise.
8981 * src/lalr.c (lookaheads_print): Likewise.
8982 * src/relation.c (relation_transpose): Likewise.
8983 * src/scan-gram.l: Likewise.
8984 * src/tables.c (table_grow, pack_vector): Likewise.
8986 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
8987 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
8988 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
8989 * m4/mbstate_t.m4: Sync with fileutils.
8990 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
8992 * po/LINGUAS: Add pt_BR.
8993 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
8994 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
8996 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
8998 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
9000 * src/complain.c (strerror_r): Remove decl; not needed.
9001 (strerror): Use same pattern as ../lib/error.c.
9003 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
9005 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
9007 * src/main.c (main): Cast result of bindtextdomain and textdomain
9008 to void, to avoid a GCC warning when --disable-nls is in effect.
9010 * src/scan-gram.l: Use strings rather than escapes when possible,
9011 to minimize the number of warnings from xgettext.
9012 (handle_action_dollar, handle_action_at): Don't use isdigit,
9013 as it mishandles negative chars and it may not work as expected
9014 outside the C locale.
9016 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
9017 this is a GCC extension and is not portable to other compilers.
9019 * src/system.h (alloca): Use same pattern as ../lib/error.c.
9020 Do not include <ctype.h>; no longer needed.
9021 Do not include <malloc.h>; no longer needed (and generates
9022 warnings on OpenBSD 3.0).
9024 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
9027 * tests/regression.at: Do not use 'cc -c input.c -o input';
9028 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
9030 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
9031 exit status as failure, not just exit status 1. Sun C exits
9032 with status 2 sometimes.
9034 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
9035 Use it for the two large tests.
9037 2002-08-02 Akim Demaille <akim@epita.fr>
9039 * src/conflicts.c (conflicts_output): Don't output rules never
9040 reduced here, since anyway that computation doesn't work.
9041 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
9042 (rule_useless_p, rule_never_reduced_p): New.
9043 (grammar_rules_partial_print): Use a filter instead of a range.
9044 Display the title only if needed.
9045 (grammar_rules_print): Adjust.
9046 (grammar_rules_never_reduced_report): New.
9047 * src/tables.c (action_row): Move the computation of rules never
9049 (token_actions): here.
9050 * src/main.c (main): Make the parser before making the report, so
9051 that rules never reduced are computed.
9052 Call grammar_rules_never_reduced_report.
9053 * src/print.c (print_results): Report rules never reduced.
9054 * tests/conflicts.at, tests/reduce.at: Adjust.
9056 2002-08-01 Akim Demaille <akim@epita.fr>
9058 Instead of attaching lookaheads and duplicating the rules being
9059 reduced by a state, attach the lookaheads to the reductions.
9061 * src/state.h (state_t): Remove the `lookaheads',
9062 `lookaheads_rule' member.
9063 (reductions_t): Add a `lookaheads' member.
9064 Use a regular array for the `rules'.
9065 * src/state.c (reductions_new): Initialize the lookaheads member
9067 (state_rule_lookaheads_print): Adjust.
9068 * src/state.h, src/state.c (state_reductions_find): New.
9069 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
9070 (count_rr_conflicts): Adjust.
9071 * src/lalr.c (LArule): Remove.
9072 (add_lookback_edge): Adjust.
9073 (state_lookaheads_count): New.
9074 (states_lookaheads_initialize): Merge into...
9075 (initialize_LA): this.
9076 (lalr_free): Adjust.
9077 * src/main.c (main): Don't free nullable and derives too early: it
9078 is used by --verbose.
9079 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
9081 2002-08-01 Akim Demaille <akim@epita.fr>
9083 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9085 (set_derives, free_derives): Rename as...
9086 (derives_compute, derives_free): this.
9087 Adjust all dependencies.
9088 * src/nullable.c (set_nullable, free_nullable): Rename as...
9089 (nullable_compute, nullable_free): these.
9090 (rule_list_t): Store rule_t *, not rule_number_t.
9091 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9092 pointers, instead of their numbers.
9093 * src/main.c (main): Call nullable_free, and derives_free earlier,
9094 as they were lo longer used.
9096 2002-08-01 Akim Demaille <akim@epita.fr>
9098 * lib/timevar.c (get_time): Include children time.
9099 * src/lalr.h (LA, LArule): Don't export them: used with the
9101 * src/lalr.c (LA, LArule): Static.
9102 * src/lalr.h, src/lalr.c (lalr_free): New.
9103 * src/main.c (main): Call it.
9104 * src/tables.c (pack_vector): Check whether loc is >= to the
9106 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9107 (tables_generate): do it, since that's also it which allocates
9109 Don't free LA and LArule, main does.
9111 2002-07-31 Akim Demaille <akim@epita.fr>
9113 Separate parser tables computation and output.
9115 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9116 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9117 (yydefgoto, yydefact, high): Move to...
9118 * src/tables.h, src/tables.c: here.
9119 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9120 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9121 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9122 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
9123 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
9124 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
9125 (action_row, save_row, token_actions, save_column, default_goto)
9126 (goto_actions, sort_actions, matching_state, pack_vector)
9127 (table_ninf_remap, pack_table, prepare_actions): Move to...
9128 * src/tables.c: here.
9129 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
9130 * src/output.c (token_actions, output_base, output_conflicts)
9131 (output_check): Merge into...
9132 (prepare_actions): this.
9133 (actions_output): Rename as...
9134 (user_actions_output): this.
9135 * src/main.c (main): Call tables_generate and tables_free.
9137 2002-07-31 Akim Demaille <akim@epita.fr>
9139 Steal GCC's --time-report support.
9141 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
9142 stolen/adjusted from GCC.
9143 * m4/stage.m4: Remove time related checks.
9144 * m4/timevar.m4: New.
9145 * configure.in: Adjust.
9146 * src/system.h: Adjust to using timevar.h.
9147 * src/getargs.h, src/getargs.c: Support trace_time for
9149 * src/main.c (stage): Remove.
9150 (main): Replace `stage' invocations with timevar calls.
9151 * src/output.c: Insert pertinent timevar calls.
9153 2002-07-31 Akim Demaille <akim@epita.fr>
9155 Let --trace have arguments.
9157 * src/getargs.h (enum trace_e): New.
9158 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
9159 (long_options, short_options): --trace/-T takes an optional
9161 Change all the uses of trace_flag to reflect the new flags.
9162 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
9164 Strengthen `stage' portability.
9166 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
9167 * configure.in: Use it.
9168 Don't check for malloc.h and sys/times.h.
9169 * src/system.h: Include them when appropriate.
9170 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
9171 times and struct tms are available.
9173 2002-07-30 Akim Demaille <akim@epita.fr>
9175 In verbose parse error message, don't report `error' as an
9177 * tests/actions.at (Printers and Destructors): Adjust.
9178 * tests/calc.at (Calculator $1): Adjust.
9179 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
9180 error message, do not report the parser accepts the error token in
9183 2002-07-30 Akim Demaille <akim@epita.fr>
9185 Normalize conflict related messages.
9187 * src/complain.h, src/complain.c (warn, complain): New.
9188 * src/conflicts.c (conflicts_print): Use them.
9189 (conflict_report_yacc): New, extracted from...
9190 (conflicts_print): here.
9191 * tests/conflicts.at, tests/existing.at: Adjust.
9193 2002-07-30 Akim Demaille <akim@epita.fr>
9195 Report rules which are never reduced by the parser: those hidden
9198 * src/LR0.c (save_reductions): Don't make the final state too
9199 different: save its reduction (accept) instead of having a state
9200 without any action (no shift or goto, no reduce).
9201 Note: the final state is now a ``regular'' state, i.e., the
9202 parsers now contain `reduce 0' as default reduction.
9203 Nevertheless, since they decide to `accept' when yystate =
9204 final_state, they still will not reduce rule 0.
9205 * src/print.c (print_actions, print_reduction): Adjust.
9206 * src/output.c (action_row): Track reduced rules.
9207 (token_actions): Report rules never reduced.
9208 * tests/conflicts.at, tests/regression.at: Adjust.
9210 2002-07-30 Akim Demaille <akim@epita.fr>
9212 `stage' was accidently included in a previous patch.
9213 Initiate its autoconfiscation.
9215 * configure.in: Look for malloc.h and sys/times.h.
9216 * src/main.c (stage): Adjust.
9217 Report only when trace_flag.
9219 2002-07-29 Akim Demaille <akim@epita.fr>
9221 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
9223 (errs_t): symbol_t*, not symbol_number_t.
9224 (reductions_t): rule_t*, not rule_number_t.
9225 (FOR_EACH_SHIFT): New.
9226 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
9227 * src/print.c, src/print_graph.c: Adjust.
9229 2002-07-29 Akim Demaille <akim@epita.fr>
9231 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
9233 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
9234 (endtoken, accept): these.
9235 * src/reader.c (reader): Set endtoken's default tag to "$end".
9236 Set undeftoken's tag to "$undefined" instead of "$undefined.".
9237 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
9240 2002-07-29 Akim Demaille <akim@epita.fr>
9242 * src/reduce.c (reduce_grammar): When the language is empty,
9243 complain about the start symbol, not the axiom.
9245 * tests/reduce.at (Empty Language): New.
9247 2002-07-26 Akim Demaille <akim@epita.fr>
9249 * src/reader.h, src/reader.c (gram_error): ... can't get
9250 yycontrol without making too strong assumptions on the parser
9252 * src/output.c (prepare_tokens): Use the real 0th value of
9253 token_translations instead of `0'.
9254 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
9256 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
9257 for the time being: %locations ought to provide it to yyerror.
9259 2002-07-25 Akim Demaille <akim@epita.fr>
9261 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
9262 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
9263 * tests/regression.at (Web2c Actions): Adjust.
9265 2002-07-25 Akim Demaille <akim@epita.fr>
9267 Stop storing rules from 1 to nrules + 1.
9269 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
9270 * src/nullable.c, src/output.c, src/print.c, src/reader.c
9271 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
9272 Iterate from 0 to nrules.
9273 Use rule_number_as_item_number and item_number_as_rule_number.
9274 Adjust to `derive' now containing possibly 0.
9275 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
9276 Handle the `- 1' part in rule numbers from/to item numbers.
9277 * src/conflicts.c (log_resolution): Fix the message which reversed
9279 * src/output.c (action_row): Initialize default_rule to -1.
9280 (token_actions): Adjust.
9281 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
9283 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
9285 2002-07-25 Akim Demaille <akim@epita.fr>
9287 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
9288 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
9289 (b4_c_knr_arg_decl): New.
9290 * data/yacc.c: Use it to define yysymprint, yydestruct, and
9291 yyreport_parse_error.
9293 2002-07-25 Akim Demaille <akim@epita.fr>
9295 * data/yacc.c (yyreport_parse_error): New, extracted from...
9297 (yydestruct, yysymprint): Move above yyparse.
9300 2002-07-25 Akim Demaille <akim@epita.fr>
9302 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
9304 (b4_sint_type, b4_uint_type): these.
9305 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
9306 * tests/regression.at (Web2c Actions): Adjust.
9308 2002-07-25 Akim Demaille <akim@epita.fr>
9310 * src/gram.h (TIEM_NUMBER_MAX): New.
9311 (item_number_of_rule_number, rule_number_of_item_number): Rename
9313 (rule_number_as_item_number, item_number_as_rule_number): these.
9314 Adjust dependencies.
9315 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9316 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9317 (symbol_number_to_vector_number): New.
9318 (order): Of vector_number_t* type.
9319 (base_t, BASE_MAX, BASE_MIN): New.
9320 (froms, tos, width, pos, check): Of base_t type.
9321 (action_number_t, ACTION_MIN, ACTION_MAX): New.
9322 (actrow): Of action_number_t type.
9323 (conflrow): Of unsigned int type.
9324 (table_ninf, base_ninf): New.
9325 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
9326 (muscle_insert_int_table, muscle_insert_base_table)
9327 (muscle_insert_rule_number_table): New.
9328 (prepare_tokens): Output `toknum' as int_table.
9329 (action_row): Returns a rule_number_t.
9330 Use ACTION_MIN, not SHRT_MIN.
9331 (token_actions): yydefact is rule_number_t*.
9332 (table_ninf_remap): New.
9333 (pack_table): Use it for `base' and `table'.
9334 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
9336 (YYPACT_NINF, YYTABLE_NINF): these.
9337 (yypact, yytable): Compute their types instead of hard-coded
9339 * tests/regression.at (Web2c Actions): Adjust.
9341 2002-07-19 Akim Demaille <akim@epita.fr>
9343 * src/scan-gram.l (id): Can start with an underscore.
9345 2002-07-16 Akim Demaille <akim@epita.fr>
9347 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
9348 Adjust all former `associativity' dependencies.
9349 * src/symtab.c (symbol_new): Default associativity is `undef', not
9351 (symbol_check_alias_consistence): Adjust.
9353 2002-07-09 Akim Demaille <akim@epita.fr>
9355 * doc/bison.texinfo: Properly set the ``header'' part.
9356 Use @dircategory ``GNU programming tools'' as per Texinfo's
9360 2002-07-09 Akim Demaille <akim@epita.fr>
9362 * lib/quotearg.h: Protect against multiple inclusions.
9363 * src/location.h (location_t): Add a `file' member.
9364 (LOCATION_RESET, LOCATION_PRINT): Adjust.
9365 * src/complain.c (warn_at, complain_at, fatal_at): Drop
9366 `error_one_per_line' support.
9368 2002-07-09 Akim Demaille <akim@epita.fr>
9370 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
9371 * src/reader.c (lineno): Remove.
9372 Adjust all dependencies.
9373 (get_merge_function): Take a location and use complain_at.
9374 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
9375 * tests/regression.at (Invalid inputs, Mixing %token styles):
9378 2002-07-09 Akim Demaille <akim@epita.fr>
9380 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
9381 recovery rule, and forbid extensions when --yacc.
9382 (gram_error): Use complain_at.
9383 * src/reader.c (reader): Exit if there were parse errors.
9385 2002-07-09 Akim Demaille <akim@epita.fr>
9387 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
9388 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
9389 Reported by R Blake <blakers@mac.com>.
9391 2002-07-09 Akim Demaille <akim@epita.fr>
9393 * data/yacc.c: Output the copyright notive in the header.
9395 2002-07-03 Akim Demaille <akim@epita.fr>
9397 * src/output.c (froms, tos): Are state_number_t.
9398 (save_column): sp, sp1, and sp2 are state_number_t.
9399 (prepare): Rename `final' as `final_state_number', `nnts' as
9400 `nterms_number', `nrules' as `rules_number', `nstates' as
9401 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
9403 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
9404 * data/lalr1.cc (nsym_): Remove, unused.
9406 2002-07-03 Akim Demaille <akim@epita.fr>
9408 * src/lalr.h, src/lalr.c (goto_number_t): New.
9409 * src/lalr.c (goto_list_t): New.
9411 * src/nullable.c (rule_list_t): New.
9413 * src/types.h: Remove.
9415 2002-07-03 Akim Demaille <akim@epita.fr>
9417 * src/closure.c (print_fderives): Use rule_rhs_print.
9418 * src/derives.c (print_derives): Use rule_rhs_print.
9419 (rule_list_t): New, replaces `shorts'.
9420 (set_derives): Add comments.
9421 * tests/sets.at (Nullable, Firsts): Adjust.
9423 2002-07-03 Akim Demaille <akim@epita.fr>
9425 * src/output.c (prepare_actions): Free `tally' and `width'.
9426 (prepare_actions): Allocate and free `order'.
9427 * src/symtab.c (symbols_free): Free `symbols'.
9428 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
9429 * src/output.c (m4_invoke): Move to...
9430 * src/scan-skel.l: here.
9431 (<<EOF>>): Close yyout, and free its name.
9433 2002-07-03 Akim Demaille <akim@epita.fr>
9435 Fix some memory leaks, and fix a bug: state 0 was examined twice.
9437 * src/LR0.c (new_state): Merge into...
9438 (state_list_append): this.
9439 (new_states): Merge into...
9440 (generate_states): here.
9441 (set_states): Don't ensure a proper `errs' state member here, do it...
9442 * src/conflicts.c (conflicts_solve): here.
9443 * src/state.h, src/state.c: Comment changes.
9444 (state_t): Rename member `shifts' as `transitions'.
9445 Adjust all dependencies.
9446 (errs_new): For consistency, also take the values as argument.
9448 (state_errs_set): New.
9449 (state_reductions_set, state_transitions_set): Assert that no
9450 previous value was assigned.
9452 (states_free): Use it.
9453 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
9454 temporary storage: use `errs' and `nerrs' as elsewhere.
9455 (set_conflicts): Allocate and free this `errs'.
9457 2002-07-02 Akim Demaille <akim@epita.fr>
9459 * lib/libiberty.h: New.
9460 * lib: Update the bitset implementation from upstream.
9461 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
9462 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
9463 * src/main.c: Adjust bitset stats calls.
9465 2002-07-01 Paul Eggert <eggert@twinsun.com>
9467 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
9468 char, so that negative chars don't collide with $.
9470 2002-06-30 Akim Demaille <akim@epita.fr>
9472 Have the GLR tests be `warning' checked, and fix the warnings.
9474 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
9475 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
9476 (yyremoveDeletes): `yyi' and `yyj' are size_t.
9477 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
9478 (yyaddDeferredAction): static.
9479 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
9480 (yyreportParseError): yyprefix is const.
9481 yytokenp is used only when verbose.
9482 (yy__GNUC__): Replace with __GNUC__.
9483 (yypdumpstack): yyi is size_t.
9484 (yypreference): Un-yy local variables and arguments, to avoid
9485 clashes with `yyr1'. Anyway, we are not in the user name space.
9486 (yytname_size): be an int, as is compared with ints.
9487 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
9489 * tests/cxx-gram.at: Use quotation to protect $1.
9490 Use AT_COMPILE to enable warnings hunts.
9491 Prototype yylex and yyerror.
9493 Include `string.h', not `strings.h'.
9494 Produce and prototype stmtMerge only when used.
9495 yylex takes a location.
9497 2002-06-30 Akim Demaille <akim@epita.fr>
9499 We spend a lot of time in quotearg, in particular when --verbose.
9501 * src/symtab.c (symbol_get): Store a quoted version of the key.
9502 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
9505 2002-06-30 Akim Demaille <akim@epita.fr>
9507 * src/state.h (reductions_t): Rename member `nreds' as num.
9508 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
9509 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
9511 2002-06-30 Akim Demaille <akim@epita.fr>
9513 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
9514 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
9515 (shifts_to): Rename as...
9516 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
9517 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
9518 (TRANSITION_IS_DISABLED, transitions_to): these.
9520 2002-06-30 Akim Demaille <akim@epita.fr>
9522 * src/print.c (print_shifts, print_gotos): Merge into...
9523 (print_transitions): this.
9524 (print_transitions, print_errs, print_reductions): Align the
9526 (print_core, print_transitions, print_errs, print_state,
9527 print_grammar): Output empty lines separator before, not after.
9528 (state_default_rule_compute): Rename as...
9529 (state_default_rule): this.
9530 * tests/conflicts.at (Defaulted Conflicted Reduction),
9531 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
9532 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
9534 2002-06-30 Akim Demaille <akim@epita.fr>
9536 Display items as we display rules.
9538 * src/gram.h, src/gram.c (rule_lhs_print): New.
9539 * src/gram.c (grammar_rules_partial_print): Use it.
9540 * src/print.c (print_core): Likewise.
9541 * tests/conflicts.at (Defaulted Conflicted Reduction),
9542 (Unresolved SR Conflicts): Adjust.
9543 (Unresolved SR Conflicts): Adjust and rename as...
9544 (Resolved SR Conflicts): this, as was meant.
9545 * tests/regression.at (Web2c Report): Adjust.
9547 2002-06-30 Akim Demaille <akim@epita.fr>
9549 * src/print.c (state_default_rule_compute): New, extracted from...
9550 (print_reductions): here.
9551 Pessimize, but clarify the code.
9552 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
9554 2002-06-30 Akim Demaille <akim@epita.fr>
9556 * src/output.c (action_row): Let default_rule be always a rule
9559 2002-06-30 Akim Demaille <akim@epita.fr>
9561 * src/closure.c (print_firsts, print_fderives, closure):
9563 * src/lalr.c (lookaheads_print): Likewise.
9564 * src/state.c (state_rule_lookaheads_print): Likewise.
9565 * src/print_graph.c (print_core): Likewise.
9566 * src/print.c (print_reductions): Likewise.
9567 * src/output.c (action_row): Likewise.
9568 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
9570 2002-06-30 Akim Demaille <akim@epita.fr>
9572 * src/print_graph.c: Use report_flag.
9574 2002-06-30 Akim Demaille <akim@epita.fr>
9576 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
9578 * src/relation.h, src/relation.c (traverse, relation_digraph)
9579 (relation_print, relation_transpose): New.
9581 2002-06-30 Akim Demaille <akim@epita.fr>
9583 * src/state.h, src/state.c (shifts_to): New.
9584 * src/lalr.c (build_relations): Use it.
9586 2002-06-30 Akim Demaille <akim@epita.fr>
9588 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
9589 (item_number_of_rule_number, rule_number_of_item_number): New.
9590 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
9591 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
9592 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
9593 Propagate their use.
9594 Much remains to be done, in particular wrt `shorts' from types.h.
9596 2002-06-30 Akim Demaille <akim@epita.fr>
9598 * src/symtab.c (symbol_new): Initialize the `printer' member.
9600 2002-06-30 Akim Demaille <akim@epita.fr>
9602 * src/LR0.c (save_reductions): Remove, replaced by...
9603 * src/state.h, src/state.c (state_reductions_set): New.
9604 (reductions, errs): Rename as...
9605 (reductions_t, errs_t): these.
9606 Adjust all dependencies.
9608 2002-06-30 Akim Demaille <akim@epita.fr>
9610 * src/LR0.c (state_list_t, state_list_append): New.
9611 (first_state, last_state): Now symbol_list_t.
9612 (this_state): Remove.
9613 (new_itemsets, append_states, save_reductions): Take a state_t as
9615 (set_states, generate_states): Adjust.
9616 (save_shifts): Remove, replaced by...
9617 * src/state.h, src/state.c (state_shifts_set): New.
9618 (shifts): Rename as...
9620 Adjust all dependencies.
9621 * src/state.h (state_t): Remove the `next' member.
9623 2002-06-30 Akim Demaille <akim@epita.fr>
9625 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
9628 2002-06-30 Akim Demaille <akim@epita.fr>
9630 Use hash.h for the state hash table.
9632 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
9633 (allocate_storage): Use state_hash_new.
9634 (free_storage): Use state_hash_free.
9635 (new_state, get_state): Adjust.
9636 * src/lalr.h, src/lalr.c (states): Move to...
9637 * src/states.h (state_t): Remove the `link' member, no longer
9639 * src/states.h, src/states.c: here.
9640 (state_hash_new, state_hash_free, state_hash_lookup)
9641 (state_hash_insert, states_free): New.
9642 * src/states.c (state_table, state_compare, state_hash): New.
9643 * src/output.c (output_actions): Do not free states now, since we
9644 still need to know the final_state number in `prepare', called
9645 afterwards. Do it...
9646 * src/main.c (main): here: call states_free after `output'.
9648 2002-06-30 Akim Demaille <akim@epita.fr>
9650 * src/state.h, src/state.c (state_new): New, extracted from...
9651 * src/LR0.c (new_state): here.
9652 * src/state.h (STATE_ALLOC): Move to...
9653 * src/state.c: here.
9654 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
9655 * src/state.h, src/state.c: here.
9657 2002-06-30 Akim Demaille <akim@epita.fr>
9659 * src/reader.c (gensym): Rename as...
9660 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
9661 (getsym): Rename as...
9664 2002-06-30 Akim Demaille <akim@epita.fr>
9666 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
9667 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
9668 * src/output.c, src/print.c, src/print_graph.c: Propagate.
9669 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
9671 2002-06-30 Akim Demaille <akim@epita.fr>
9673 Make the test suite pass with warnings checked.
9675 * tests/actions.at (Printers and Destructors): Improve.
9676 Avoid unsigned vs. signed issues.
9677 * tests/calc.at: Don't exercise the scanner here, do it...
9678 * tests/input.at (Torturing the Scanner): here.
9680 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9682 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
9683 reorganize first lines parallel to yacc.c.
9685 2002-06-28 Akim Demaille <akim@epita.fr>
9687 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
9688 (b4_token_enum, b4_token_defines): New, factored from...
9689 * data/lalr1.cc, data/yacc.c, glr.c: here.
9691 2002-06-28 Akim Demaille <akim@epita.fr>
9693 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
9695 * src/output.c (merger_output): static.
9697 2002-06-28 Akim Demaille <akim@epita.fr>
9699 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
9700 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
9702 * src/output.c (save_row): Initialize all the variables to pacify GCC.
9704 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9706 Accumulated changelog for new GLR parsing features.
9708 * src/conflicts.c (count_total_conflicts): Change name to
9709 conflicts_total_count.
9710 * src/conflicts.h: Ditto.
9711 * src/output.c (token_actions): Use the new name.
9712 (output_conflicts): Change conflp => conflict_list_heads, and
9713 confl => conflict_list for better readability.
9714 * data/glr.c: Use the new names.
9715 * NEWS: Add self to GLR announcement.
9717 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
9719 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
9722 * data/bison.glr: Change name to glr.c
9723 * data/glr.c: Renamed from bison.glr.
9724 * data/Makefile.am: Add glr.c
9728 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
9729 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
9731 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9733 * data/bison.glr: Be sure to restore the
9734 current #line when returning to the skeleton contents after having
9735 exposed the input file's #line.
9737 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9739 * data/bison.glr: Bring up to date with changes to bison.simple.
9741 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9743 * data/bison.glr: Correct definitions that use b4_prefix.
9744 Various reformatting.
9745 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
9746 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
9747 yytokenp argument; now part of stack.
9748 (yychar): Define to behave as documented.
9751 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9753 * src/reader.h: Add declaration for free_merger_functions.
9755 * src/reader.c (merge_functions): New variable.
9756 (get_merge_function): New function.
9757 (free_merger_functions): New function.
9758 (readgram): Check for %prec that is not followed by a symbol.
9759 Handle %dprec and %merge declarations.
9760 (packgram): Initialize dprec and merger fields in rules array.
9762 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
9763 conflict_list_cnt, conflict_list_free): New variables.
9764 (table_grow): Also grow conflict_table.
9765 (prepare_rules): Output dprec and merger tables.
9766 (conflict_row): New function.
9767 (action_row): Output conflict lists for GLR parser. Don't use
9768 default reduction in conflicted states for GLR parser so that there
9769 are spaces for the conflict lists.
9770 (save_row): Also save conflict information.
9771 (token_actions): Allocate conflict list.
9772 (merger_output): New function.
9773 (pack_vector): Pack conflict table, too.
9774 (output_conflicts): New function to output yyconflp and yyconfl.
9775 (output_check): Allocate conflict_tos.
9776 (output_actions): Output conflict tables, also.
9777 (output_skeleton): Output b4_mergers definition.
9778 (prepare): Output b4_max_rhs_length definition.
9779 Use 'bison.glr' as default skeleton for GLR parsers.
9781 * src/gram.c (glr_parser): New flag.
9782 (grammar_free): Call free_merger_functions.
9784 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
9785 all pairs of conflicting reductions, rather than just all tokens
9786 causing conflicts. Needed to size conflict tables.
9787 (conflicts_output): Modify call to count_rr_conflicts for new
9789 (conflicts_print): Ditto.
9790 (count_total_conflicts): New function.
9792 * src/reader.h (merger_list): New type.
9793 (merge_functions): New variable.
9795 * src/lex.h (tok_dprec, tok_merge): New token types.
9797 * src/gram.h (rule_s): Add dprec and merger fields.
9798 (glr_parser): New flag.
9800 * src/conflicts.h (count_total_conflicts): New function.
9802 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
9804 * doc/bison.texinfo (Generalized LR Parsing): New section.
9805 (GLR Parsers): New section.
9806 (Language and Grammar): Mention GLR parsing.
9807 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
9808 Correct typo ("tge" -> "the").
9810 * data/bison.glr: New skeleton for GLR parsing.
9812 * tests/cxx-gram.at: New tests for GLR parsing.
9814 * tests/testsuite.at: Include cxx-gram.at.
9816 * tests/Makefile.am: Add cxx-gram.at.
9820 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
9822 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
9824 2002-06-27 Akim Demaille <akim@epita.fr>
9826 * src/options.h, src/options.c: Remove.
9827 * src/getargs.c (short_options, long_options): New.
9829 2002-06-27 Akim Demaille <akim@epita.fr>
9831 * data/bison.simple, data/bison.c++: Rename as...
9832 * data/yacc.c, data/lalr1.cc: these.
9833 * doc/bison.texinfo (Environment Variables): Remove.
9835 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
9837 * src/getargs.c (report_argmatch): Initialize strtok().
9839 2002-06-20 Akim Demaille <akim@epita.fr>
9841 * data/bison.simple (b4_symbol_actions): New, replaces...
9842 (b4_symbol_destructor, b4_symbol_printer): these.
9843 (yysymprint): Be sure to call YYPRINT only for tokens, and using
9846 2002-06-20 Akim Demaille <akim@epita.fr>
9848 * data/bison.simple (yydestructor): Rename as...
9851 2002-06-20 Akim Demaille <akim@epita.fr>
9853 * src/symtab.h, src/symtab.c (symbol_type_set)
9854 (symbol_destructor_set, symbol_precedence_set): The location is
9858 2002-06-20 Akim Demaille <akim@epita.fr>
9860 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
9862 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
9864 * src/symtab.h, src/symtab.c (symbol_class_set)
9865 (symbol_user_token_number_set): Likewise.
9867 Promote complain_at.
9868 * tests/input.at (Type Clashes): Adjust.
9870 2002-06-20 Akim Demaille <akim@epita.fr>
9872 * data/bison.simple (YYLEX): Fix the declaration when
9875 2002-06-20 Akim Demaille <akim@epita.fr>
9877 * data/bison.simple (yysymprint): Don't print the token number,
9879 * tests/actions.at (Destructors): Rename as...
9880 (Printers and Destructors): this.
9881 Also exercise %printer.
9883 2002-06-20 Akim Demaille <akim@epita.fr>
9885 * data/bison.simple (YYDSYMPRINT): New.
9886 Use it to remove many of the #if YYDEBUG/if (yydebug).
9888 2002-06-20 Akim Demaille <akim@epita.fr>
9890 * src/symtab.h, src/symtab.c (symbol_t): printer and
9891 printer_location are new members.
9892 (symbol_printer_set): New.
9893 * src/parse-gram.y (PERCENT_PRINTER): New token.
9894 Handle its associated rule.
9895 * src/scan-gram.l: Adjust.
9896 (handle_destructor_at, handle_destructor_dollar): Rename as...
9897 (handle_symbol_code_at, handle_symbol_code_dollar): these.
9898 * src/output.c (symbol_printers_output): New.
9899 (output_skeleton): Call it.
9900 * data/bison.simple (yysymprint): New. Cannot be named yyprint
9901 since there are already many grammar files with a user `yyprint'.
9902 Replace the calls to YYPRINT to calls to yysymprint.
9903 * tests/calc.at: Adjust.
9904 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
9905 taking advantage of parser very internal details (stack size!).
9907 2002-06-20 Akim Demaille <akim@epita.fr>
9909 * src/scan-gram.l: Complete the scanner with the missing patterns
9911 Use `quote' and `symbol_tag_get' where appropriate.
9913 2002-06-19 Akim Demaille <akim@epita.fr>
9915 * tests/actions.at (Destructors): Augment to test locations.
9916 * data/bison.simple (yydestructor): Pass it the current location
9917 if locations are enabled.
9918 Prototype only when __STDC__ or C++.
9919 Change the argument names to move into the yy name space: there is
9922 2002-06-19 Akim Demaille <akim@epita.fr>
9924 * data/bison.simple (b4_pure_if): New.
9925 Use it instead of #ifdef YYPURE.
9927 2002-06-19 Akim Demaille <akim@epita.fr>
9929 * data/bison.simple (b4_location_if): New.
9930 Use it instead of #ifdef YYLSP_NEEDED.
9932 2002-06-19 Akim Demaille <akim@epita.fr>
9934 Prepare @$ in %destructor, but currently don't bind it in the
9935 skeleton, as %location use is not cleaned up yet.
9937 * src/scan-gram.l (handle_dollar, handle_destructor_at)
9938 (handle_action_at): New.
9939 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
9940 a braced_code_t and a location as additional arguments.
9941 (handle_destructor_dollar): Instead of requiring `b4_eval', just
9942 unquote one when outputting `b4_dollar_dollar'.
9944 * data/bison.simple (b4_eval): Remove.
9945 (b4_symbol_destructor): Adjust.
9946 * tests/input.at (Invalid @n): Adjust.
9948 2002-06-19 Zack Weinberg <zack@codesourcery.com>
9950 * doc/bison.texinfo: Document ability to have multiple
9953 2002-06-18 Akim Demaille <akim@epita.fr>
9955 * src/files.c (compute_base_names): When computing the output file
9956 names from the input file name, strip the directory part.
9958 2002-06-18 Akim Demaille <akim@epita.fr>
9960 * data/bison.simple.new: Comment changes.
9961 Reported by Andreas Schwab.
9963 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
9965 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
9966 there are no `label `yyoverflowlab' defined but not used' warnings
9967 when yyoverflow is defined.
9969 2002-06-18 Akim Demaille <akim@epita.fr>
9971 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
9973 (symbol_destructor_set): Adjust.
9974 * src/output.c (symbol_destructors_output): Output the destructor
9976 Output the symbol name.
9977 * data/bison.simple (b4_symbol_destructor): Adjust.
9979 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
9980 and Akim Demaille <akim@epita.fr>
9982 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
9983 what's left on the stack when the error recovery hits EOF.
9984 * tests/actions.at (Destructors): Complete to exercise this case.
9986 2002-06-17 Akim Demaille <akim@epita.fr>
9988 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
9989 arguments is really empty, not only equal to `[]'.
9990 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
9992 (symbol_destructor_set): New.
9993 * src/output.c (symbol_destructors_output): New.
9994 * src/reader.h (brace_code_t, current_braced_code): New.
9995 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
9996 (handle_dollar): Rename as...
9997 (handle_action_dollar): this.
9998 (handle_destructor_dollar): New.
9999 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
10000 (grammar_declaration): Use it.
10001 * data/bison.simple (yystos): Is always defined.
10002 (yydestructor): New.
10003 * tests/actions.at (Destructors): New.
10004 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
10006 2002-06-17 Akim Demaille <akim@epita.fr>
10008 * src/symlist.h, src/symlist.c (symbol_list_length): New.
10009 * src/scan-gram.l (handle_dollar, handle_at): Compute the
10010 rule_length only when needed.
10011 * src/output.c (actions_output, token_definitions_output): Output
10013 * src/symtab.c: Don't access directly to the symbol tag, use
10015 * src/parse-gram.y: Use symbol_list_free.
10017 2002-06-17 Akim Demaille <akim@epita.fr>
10019 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
10020 (symbol_list_prepend, get_type_name): Move to...
10021 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
10022 (symbol_list_prepend, symbol_list_n_type_name_get): here.
10023 Adjust all callers.
10024 (symbol_list_free): New.
10025 * src/scan-gram.l (handle_dollar): Takes a location.
10026 * tests/input.at (Invalid $n): Adjust.
10028 2002-06-17 Akim Demaille <akim@epita.fr>
10030 * src/reader.h, src/reader.c (symbol_list_new): Export it.
10031 (symbol_list_prepend): New.
10032 * src/parse-gram.y (%union): `list' is a new member.
10033 (symbols.1): New, replaces...
10034 (terms_to_prec.1, nterms_to_type.1): these.
10035 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
10036 Take a location as additional argument.
10037 Adjust all callers.
10039 2002-06-15 Akim Demaille <akim@epita.fr>
10041 * src/parse-gram.y: Move %token in the declaration section so that
10042 we don't depend upon CVS Bison.
10044 2002-06-15 Akim Demaille <akim@epita.fr>
10046 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
10047 * src/print.c (print_core): Use it.
10049 2002-06-15 Akim Demaille <akim@epita.fr>
10051 * src/conflicts.c (log_resolution): Accept the rule involved in
10052 the sr conflicts instead of the lookahead number that points to
10054 (flush_reduce): Accept the current lookahead vector as argument,
10055 instead of the index in LA.
10056 (resolve_sr_conflict): Accept the current number of lookahead
10057 bitset to consider for the STATE, instead of the index in LA.
10058 (set_conflicts): Adjust.
10059 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
10061 2002-06-15 Akim Demaille <akim@epita.fr>
10063 * src/state.h (state_t): Replace the `lookaheadsp' member, a
10064 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
10065 Adjust all dependencies.
10066 * src/lalr.c (initialize_lookaheads): Split into...
10067 (states_lookaheads_count, states_lookaheads_initialize): these.
10070 2002-06-15 Akim Demaille <akim@epita.fr>
10072 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
10074 (grammar_rules_print): here.
10075 * src/reduce.c (reduce_output): Use it.
10076 * tests/reduce.at (Useless Rules, Reduced Automaton)
10077 (Underivable Rules): Adjust.
10079 2002-06-15 Akim Demaille <akim@epita.fr>
10081 Copy BYacc's nice way to report the grammar.
10083 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10085 Don't print the rules' location, it is confusing and useless.
10086 (rule_print): Use grammar_rhs_print.
10087 * src/print.c (print_grammar): Use grammar_rules_print.
10089 2002-06-15 Akim Demaille <akim@epita.fr>
10091 Complete and rationalize `useless thing' warnings.
10093 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10094 (symbol_tag_print): New.
10095 Use them everywhere in place of accessing directly the tag member.
10096 * src/gram.h, src/gram.c (rule_print): New.
10097 Use it where a rule used to be printed `by hand'.
10098 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10099 (reduce_grammar_tables): Report the useless rules.
10100 (reduce_print): Useless things are a warning, not an error.
10102 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10103 (Reduced Automaton, Underivable Rules): Adjust.
10104 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10105 * tests/conflicts.at (Unresolved SR Conflicts)
10106 (Solved SR Conflicts): Adjust.
10108 2002-06-15 Akim Demaille <akim@epita.fr>
10110 Let symbols have a location.
10112 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10114 Adjust all callers.
10115 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10116 Use location_t, not int.
10117 * src/symtab.c (symbol_check_defined): Take advantage of the
10119 * tests/regression.at (Invalid inputs): Adjust.
10121 2002-06-15 Akim Demaille <akim@epita.fr>
10123 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10124 (input): Don't try to initialize yylloc here, do it in the
10126 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
10127 * src/gram.h (rule_t): Change line and action_line into location
10128 and action_location, of location_t type.
10129 Adjust all dependencies.
10130 * src/location.h, src/location.c (empty_location): New.
10131 * src/reader.h, src/reader.c (grammar_start_symbol_set)
10132 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
10133 (grammar_current_rule_symbol_append)
10134 (grammar_current_rule_action_append): Expect a location as argument.
10135 * src/reader.c (grammar_midrule_action): Adjust to attach an
10136 action's location as dummy symbol location.
10137 * src/symtab.h, src/symtab.c (startsymbol_location): New.
10138 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
10141 2002-06-14 Akim Demaille <akim@epita.fr>
10143 Grammar declarations may be found in the grammar section.
10145 * src/parse-gram.y (rules_or_grammar_declaration): New.
10146 (declarations): Each declaration may end with a semicolon, not
10148 (grammar_declaration): `"%union"'.
10149 (grammar): Branch to rules_or_grammar_declaration.
10151 2002-06-14 Akim Demaille <akim@epita.fr>
10153 * src/main.c (main): Invoke scanner_free.
10155 2002-06-14 Akim Demaille <akim@epita.fr>
10157 * src/output.c (m4_invoke): Extracted from...
10158 (output_skeleton): here.
10161 2002-06-14 Akim Demaille <akim@epita.fr>
10163 * src/parse-gram.y (directives, directive, gram)
10164 (grammar_directives, precedence_directives, precedence_directive):
10166 (declarations, declaration, grammar, grammar_declaration)
10167 (precedence_declaration, precedence_declarator): these.
10168 (symbol_declaration): New.
10170 2002-06-14 Akim Demaille <akim@epita.fr>
10172 * src/files.c (action_obstack): Remove, unused.
10173 (output_obstack): Remove it, and all its dependencies, as it is no
10175 * src/reader.c (epilogue_set): Build the epilogue in the
10177 * src/output.h, src/output.c (muscle_obstack): Move to...
10178 * src/muscle_tab.h, src/muscle_tab.h: here.
10179 (muscle_init): Initialize muscle_obstack.
10180 (muscle_free): New.
10181 * src/main.c (main): Call it.
10183 2002-06-14 Akim Demaille <akim@epita.fr>
10185 * src/location.h: New, extracted from...
10186 * src/reader.h: here.
10187 * src/Makefile.am (noinst_HEADERS): Merge into
10188 (bison_SOURCES): this.
10190 * src/parse-gram.y: Use location_t instead of Bison's.
10191 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
10192 Use location_t instead of ints.
10194 2002-06-14 Akim Demaille <akim@epita.fr>
10196 * data/bison.simple, data/bison.c++: Be sure to restore the
10197 current #line when returning to the skeleton contents after having
10198 exposed the input file's #line.
10200 2002-06-12 Akim Demaille <akim@epita.fr>
10202 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
10204 * tests/actions.at (Exotic Dollars): New.
10206 2002-06-12 Akim Demaille <akim@epita.fr>
10208 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
10210 * tests/input.at (Torturing the Scanner): New.
10212 2002-06-11 Akim Demaille <akim@epita.fr>
10214 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
10215 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
10216 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
10217 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
10218 * src/reader.c (reader): Use it.
10220 2002-06-11 Akim Demaille <akim@epita.fr>
10222 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
10223 Adjust all callers.
10224 (scanner_last_string_free): New.
10226 2002-06-11 Akim Demaille <akim@epita.fr>
10228 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
10229 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
10230 (last_string, YY_OBS_FREE): New.
10231 Use them when returning an ID.
10233 2002-06-11 Akim Demaille <akim@epita.fr>
10235 Have Bison grammars parsed by a Bison grammar.
10237 * src/reader.c, src/reader.h (prologue_augment): New.
10238 * src/reader.c (copy_definition): Remove.
10240 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
10241 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
10242 (grammar_current_rule_prec_set, grammar_current_rule_check)
10243 (grammar_current_rule_symbol_append)
10244 (grammar_current_rule_action_append): Export.
10245 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
10246 (symbol_list_action_append): Remove.
10247 Hook the routines from reader.
10248 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
10249 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
10251 * src/reader.c (read_declarations): Remove, unused.
10253 * src/parse-gram.y: Handle the epilogue.
10254 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
10255 (grammar_start_symbol_set): this.
10256 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
10257 * src/reader.c (readgram): Remove, unused.
10258 (reader): Adjust to insert eoftoken and axiom where appropriate.
10260 * src/reader.c (copy_dollar): Replace with...
10261 * src/scan-gram.h (handle_dollar): this.
10262 * src/parse-gram.y: Remove `%thong'.
10264 * src/reader.c (copy_at): Replace with...
10265 * src/scan-gram.h (handle_at): this.
10267 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
10270 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
10273 * src/reader.h, src/reader.c (grammar_rule_end): New.
10275 * src/parse.y (current_type, current_class): New.
10276 Implement `%nterm', `%token' support.
10277 Merge `%term' into `%token'.
10278 (string_as_id): New.
10279 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
10282 * src/parse-gram.y: Be sure to handle properly the beginning of
10285 * src/parse-gram.y: Handle %type.
10286 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
10288 * src/parse-gram.y: More directives support.
10289 * src/options.c: No longer handle source directives.
10291 * src/parse-gram.y: Fix %output.
10293 * src/parse-gram.y: Handle %union.
10294 Use the prologue locations.
10295 * src/reader.c (parse_union_decl): Remove.
10297 * src/reader.h, src/reader.c (epilogue_set): New.
10298 * src/parse-gram.y: Use it.
10300 * data/bison.simple, data/bison.c++: b4_stype is now either not
10301 defined, then default to int, or to the contents of %union,
10302 without `union' itself.
10304 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
10306 * src/output.c (actions_output): Don't output braces, as they are
10307 already handled by the scanner.
10309 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
10310 characters to themselves.
10312 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
10313 that the epilogue has a proper #line.
10315 * src/parse-gram.y: Handle precedence/associativity.
10317 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
10319 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
10320 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
10321 at all to define terminals that cannot be emitted.
10323 * src/scan-gram.l: Escape M4 characters.
10325 * src/scan-gram.l: Working properly with escapes in user
10326 strings/characters.
10328 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
10329 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
10331 Use more modest sizes, as for the time being the parser does not
10332 release memory, and therefore the process swallows a huge amount
10335 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
10336 stricter %token grammar.
10338 * src/symtab.h (associativity): Add `undef_assoc'.
10339 (symbol_precedence_set): Do nothing when passed an undef_assoc.
10340 * src/symtab.c (symbol_check_alias_consistence): Adjust.
10342 * tests/regression.at (Invalid %directive): Remove, as it is now
10344 (Invalid inputs): Adjust to the new error messages.
10345 (Token definitions): The new grammar doesn't allow too many
10348 * src/lex.h, src/lex.c: Remove.
10349 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
10350 (copy_character, copy_string2, copy_string, copy_identifier)
10351 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
10352 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
10353 (parse_action): Remove.
10354 * po/POTFILES.in: Adjust.
10356 2002-06-11 Akim Demaille <akim@epita.fr>
10358 * src/reader.c (parse_action): Don't store directly into the
10359 rule's action member: return the action as a string.
10360 Don't require `rule_length' as an argument: compute it.
10361 (grammar_current_rule_symbol_append)
10362 (grammar_current_rule_action_append): New, eved out from
10364 Remove `action_flag', `rulelength', unused now.
10366 2002-06-11 Akim Demaille <akim@epita.fr>
10368 * src/reader.c (grammar_current_rule_prec_set).
10369 (grammar_current_rule_check): New, eved out from...
10371 Remove `xaction', `first_rhs': useless.
10372 * tests/input.at (Type clashes): New.
10373 * tests/existing.at (GNU Cim Grammar): Adjust.
10375 2002-06-11 Akim Demaille <akim@epita.fr>
10377 * src/reader.c (grammar_midrule_action): New, Eved out from
10380 2002-06-11 Akim Demaille <akim@epita.fr>
10382 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
10384 (readgram): Use them as replacement of inlined code, crule and
10387 2002-06-11 Akim Demaille <akim@epita.fr>
10389 * src/reader.c (grammar_end, grammar_symbol_append): New.
10390 (readgram): Use them.
10391 Make the use of `p' as local as possible.
10393 2002-06-10 Akim Demaille <akim@epita.fr>
10395 GCJ's parser requires the tokens to be defined before the prologue.
10397 * data/bison.simple: Output the token definition before the user's
10399 * tests/regression.at (Braces parsing, Duplicate string)
10400 (Mixing %token styles): Check the output from bison.
10401 (Early token definitions): New.
10403 2002-06-10 Akim Demaille <akim@epita.fr>
10405 * src/symtab.c (symbol_user_token_number_set): Don't complain when
10406 assigning twice the same user number to a token, so that we can
10408 * src/lex.c (lex): here.
10409 Also use `symbol_class_set' instead of hand written code.
10410 * src/reader.c (parse_assoc_decl): Likewise.
10412 2002-06-10 Akim Demaille <akim@epita.fr>
10414 * src/symtab.c, src/symtab.c (symbol_class_set)
10415 (symbol_user_token_number_set): New.
10416 * src/reader.c (parse_token_decl): Use them.
10417 Use a switch instead of ifs.
10418 Use a single argument.
10420 2002-06-10 Akim Demaille <akim@epita.fr>
10422 Remove `%thong' support as it is undocumented, unused, duplicates
10423 `%token's job, and creates useless e-mail traffic with people who
10424 want to know what it is, why it is undocumented, unused, and
10425 duplicates `%token's job.
10427 * src/reader.c (parse_thong_decl): Remove.
10428 * src/options.c (option_table): Remove "thong".
10429 * src/lex.h (tok_thong): Remove.
10431 2002-06-10 Akim Demaille <akim@epita.fr>
10433 * src/symtab.c, src/symtab.c (symbol_type_set)
10434 (symbol_precedence_set): New.
10435 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
10436 (value_components_used): Remove, unused.
10438 2002-06-09 Akim Demaille <akim@epita.fr>
10440 Move symbols handling code out of the reader.
10442 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
10443 (axiom): Move to...
10444 * src/symtab.h, src/symtab.c: here.
10446 * src/gram.c (start_symbol): Remove: use startsymbol->number.
10447 * src/reader.c (startval): Rename as...
10448 * src/symtab.h, src/symtab.c (startsymbol): this.
10449 * src/reader.c: Adjust.
10451 * src/reader.c (symbol_check_defined, symbol_make_alias)
10452 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
10453 (token_translations_init)
10455 * src/symtab.c: here.
10456 * src/reader.c (packsymbols): Move to...
10457 * src/symtab.h, src/symtab.c (symbols_pack): here.
10458 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
10461 2002-06-03 Akim Demaille <akim@epita.fr>
10463 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
10466 2002-06-03 Akim Demaille <akim@epita.fr>
10468 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
10469 structs with non literals.
10470 * src/scan-skel.l: never-interactive.
10471 * src/conflicts.c (enum conflict_resolution_e): No trailing
10473 * src/getargs.c (usage): Split long literal strings.
10474 Reported by Hans Aberg.
10476 2002-05-28 Akim Demaille <akim@epita.fr>
10478 * data/bison.c++: Use C++ ostreams.
10479 (cdebug_): New member.
10481 2002-05-28 Akim Demaille <akim@epita.fr>
10483 * src/output.c (output_skeleton): Be sure to allocate enough room
10484 for `/' _and_ for `\0' in full_skeleton.
10486 2002-05-28 Akim Demaille <akim@epita.fr>
10488 * data/bison.c++: Catch up with bison.simple:
10489 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10490 and Paul Eggert <eggert@twinsun.com>: `error' handing.
10491 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
10492 and popping traces.
10494 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10496 * src/output.c (output_skeleton): Put an explicit path in front of
10497 the skeleton file name, rather than relying on the -I directory,
10498 to partially alleviate effects of having a skeleton file lying around
10499 in the current directory.
10501 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10503 * src/conflicts.c (log_resolution): Correct typo:
10504 obstack_printf should be obstack_fgrow1.
10506 2002-05-26 Akim Demaille <akim@epita.fr>
10508 * src/state.h (state_t): `solved_conflicts' is a new member.
10509 * src/LR0.c (new_state): Set it to 0.
10510 * src/conflicts.h, src/conflicts.c (print_conflicts)
10511 (free_conflicts, solve_conflicts): Rename as...
10512 (conflicts_print, conflicts_free, conflicts_solve): these.
10514 * src/conflicts.c (enum conflict_resolution_e)
10515 (solved_conflicts_obstack): New, used by...
10516 (log_resolution): this.
10517 Adjust to attach the conflict resolution to each state.
10518 Complete the description with the precedence/associativity
10520 (resolve_sr_conflict): Adjust.
10521 * src/print.c (print_state): Output its solved_conflicts.
10522 * tests/conflicts.at (Unresolved SR Conflicts)
10523 (Solved SR Conflicts): Exercise --report=all.
10525 2002-05-26 Akim Demaille <akim@epita.fr>
10527 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
10528 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
10529 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
10530 (token_number_t, item_number_as_token_number)
10531 (token_number_as_item_number, muscle_insert_token_number_table):
10533 (symbol_number_t, item_number_as_symbol_number)
10534 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
10535 these, since it is more appropriate.
10537 2002-05-26 Akim Demaille <akim@epita.fr>
10539 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
10541 * data/bison.simple (yystos) [YYDEBUG]: New.
10542 (yyparse) [YYDEBUG]: Display the symbols which are popped during
10544 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
10546 2002-05-25 Akim Demaille <akim@epita.fr>
10548 * doc/bison.texinfo (Debugging): Split into...
10549 (Tracing): this new section, its former contents, and...
10550 (Understanding): this new section.
10551 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
10553 (report_flag): this.
10554 Adjust all dependencies.
10555 (report_args, report_types, report_argmatch): New.
10556 (usage, getargs): Report/support -r, --report.
10558 (struct option_table_struct): Rename as..,
10559 (struct option_table_s): this.
10560 Rename the `set_flag' member to `flag' to match with getopt_long's
10562 * src/options.c (option_table): Split verbose into an entry for
10563 %verbose, and another for --verbose.
10564 Support --report/-r, so remove -r from the obsolete --raw.
10565 * src/print.c: Attach full item sets and lookaheads reports to
10566 report_flag instead of trace_flag.
10567 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
10569 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10570 and Paul Eggert <eggert@twinsun.com>
10572 * data/bison.simple (yyparse): Correct error handling to conform to
10573 POSIX and yacc. Specifically, after syntax error is discovered,
10574 do not reduce further before shifting the error token.
10575 Clean up the code a bit by removing the labels yyerrdefault,
10576 yyerrhandle, yyerrpop.
10577 * NEWS: Document the above.
10579 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10581 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
10582 type; it isn't always big enough, since it doesn't necessarily
10583 include non-terminals.
10584 (yytranslate): Expand definition of yy_token_number_type, so that
10585 the latter can be removed.
10586 (yy_token_number_type): Remove, only one use.
10587 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
10588 don't use TokenNumberType as element type.
10590 * tests/regression.at: Modify expected output to agree with change
10591 to yyr1 and yytranslate.
10593 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
10595 * src/reader.c (parse_action): Use copy_character instead of
10598 2002-05-13 Akim Demaille <akim@epita.fr>
10600 * tests/regression.at (Token definitions): Prototype yylex and
10603 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10605 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
10606 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
10608 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
10610 2002-05-07 Akim Demaille <akim@epita.fr>
10612 * tests/synclines.at: Be sure to prototype yylex and yyerror to
10613 avoid GCC warnings.
10615 2002-05-07 Akim Demaille <akim@epita.fr>
10619 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
10620 over the RHS of each rule.
10621 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
10622 * src/state.h (state_t): Member `nitems' is unsigned short.
10623 * src/LR0.c (get_state): Adjust.
10624 * src/reader.c (packgram): Likewise.
10625 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
10627 (muscle_insert_int_table): Remove, unused.
10628 (prepare_rules): Remove `max'.
10630 2002-05-06 Akim Demaille <akim@epita.fr>
10632 * src/closure.c (print_firsts): Display of the symbol tags.
10633 (bitmatrix_print): Move to...
10634 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
10636 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
10638 2002-05-06 Akim Demaille <akim@epita.fr>
10640 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
10643 2002-05-06 Akim Demaille <akim@epita.fr>
10645 * src/LR0.c (new_state, get_state): Instead of using the global
10646 `kernel_size' and `kernel_base', have two new arguments:
10647 `core_size' and `core'.
10650 2002-05-06 Akim Demaille <akim@epita.fr>
10652 * src/reader.c (packgram): No longer end `ritem' with a 0
10653 sentinel: it is not used.
10655 2002-05-05 Akim Demaille <akim@epita.fr>
10657 New experimental feature: display the lookaheads in the report and
10660 * src/print (print_core): When --trace-flag, display the rules
10662 * src/print_graph.c (print_core): Likewise.
10663 Swap the arguments.
10666 2002-05-05 Akim Demaille <akim@epita.fr>
10668 * tests/torture.at (Many lookaheads): New test.
10670 2002-05-05 Akim Demaille <akim@epita.fr>
10672 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
10673 (GENERATE_MUSCLE_INSERT_TABLE): this.
10674 (output_int_table, output_unsigned_int_table, output_short_table)
10675 (output_token_number_table, output_item_number_table): Replace with...
10676 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
10677 (muscle_insert_short_table, muscle_insert_token_number_table)
10678 (muscle_insert_item_number_table): these.
10679 Adjust all callers.
10680 (prepare_tokens): Don't free `translations', since...
10681 * src/reader.h, src/reader.c (grammar_free): do it.
10683 * src/gram.h, src/gram.c (grammar_free): here.
10684 * data/bison.simple, data/bison.c++: b4_token_number_max is now
10687 2002-05-05 Akim Demaille <akim@epita.fr>
10689 * src/output.c (output_unsigned_int_table): New.
10690 (prepare_rules): `i' is unsigned.
10691 `prhs', `rline', `r2' are unsigned int.
10692 Rename muscle `rhs_number_max' as `rhs_max'.
10693 Output muscles `prhs_max', `rline_max', and `r2_max'.
10695 * data/bison.simple, data/bison.c++: Adjust to use these muscles
10696 to compute types instead of constant types.
10697 * tests/regression.at (Web2c Actions): Adjust.
10699 2002-05-04 Akim Demaille <akim@epita.fr>
10701 * src/symtab.h (SALIAS, SUNDEF): Rename as...
10702 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
10703 Adjust dependencies.
10704 * src/output.c (token_definitions_output): Be sure not to output a
10705 `#define 'a'' when fed with `%token 'a' "a"'.
10706 * tests/regression.at (Token definitions): New.
10708 2002-05-03 Paul Eggert <eggert@twinsun.com>
10710 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
10713 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
10715 * Makefile.am (SUBDIRS): Remove intl.
10716 (EXTRA_DIST): Add config/config.rpath.
10718 2002-05-03 Akim Demaille <akim@epita.fr>
10720 * data/bison.simple (m4_if): Don't output empty enums.
10721 And actually, output valid enum definitions :(.
10723 2002-05-03 Akim Demaille <akim@epita.fr>
10725 * configure.bat: Remove, completely obsolete.
10726 * Makefile.am (EXTRA_DIST): Adjust.
10727 Don't distribute config.rpath...
10728 * config/Makefile.am (EXTRA_DIST): Do it.
10730 2002-05-03 Akim Demaille <akim@epita.fr>
10732 * configure.in (GETTEXT_VERSION): New.
10733 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
10735 2002-05-03 Akim Demaille <akim@epita.fr>
10737 * data/bison.simple (b4_token_enum): New.
10738 (b4_token_defines): Use it to output tokens both as #define and
10740 Suggested by Paul Eggert.
10741 * src/output.c (token_definitions_output): Don't output spurious
10744 2002-05-03 Akim Demaille <akim@epita.fr>
10746 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
10748 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
10750 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
10751 Update the stack class, give a try to deque as the default container.
10753 2002-05-02 Akim Demaille <akim@epita.fr>
10755 * data/bison.simple (yyparse): Do not implement @$ = @1.
10756 (YYLLOC_DEFAULT): Adjust to do it.
10757 * doc/bison.texinfo (Location Default Action): Fix.
10759 2002-05-02 Akim Demaille <akim@epita.fr>
10761 * src/reader.c (parse_braces): Merge into...
10762 (parse_action): this.
10764 2002-05-02 Akim Demaille <akim@epita.fr>
10766 * configure.in (ALL_LINGUAS): Remove.
10767 * po/LINGUAS, hr.po: New.
10769 2002-05-02 Akim Demaille <akim@epita.fr>
10771 Remove the so called hairy (semantic) parsers.
10773 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
10774 * src/gram.h, src/gram.c (semantic_parser): Remove.
10775 (rule_t): Remove the guard and guard_line members.
10776 * src/lex.h (token_t): remove tok_guard.
10777 * src/options.c (option_table): Remove %guard and %semantic_parser
10779 * src/output.c, src/output.h (guards_output): Remove.
10781 (token_definitions_output): Don't output the `T'
10783 (output_skeleton): Don't output the guards.
10784 * src/files.c, src/files.c (attrsfile): Remove.
10785 * src/reader.c (symbol_list): Remove the guard and guard_line
10787 Adjust dependencies.
10788 (parse_guard): Remove.
10789 * data/bison.hairy: Remove.
10790 * doc/bison.texinfo (Environment Variables): Remove occurrences of
10793 2002-05-02 Akim Demaille <akim@epita.fr>
10795 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
10796 (parse_guard): Rename the formal argument `stack_offset' as
10797 `rule_length', which is more readable.
10799 (copy_at, copy_dollar): Instead of outputting the hard coded
10800 values of $$, $n and so forth, output invocation to b4_lhs_value,
10801 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
10802 Note: this patch partially drops `semantic-parser' support: it
10803 always does `rule_length - n', where semantic parsers ought to
10805 * data/bison.simple, data/bison.c++ (b4_lhs_value)
10806 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
10808 2002-05-02 Akim Demaille <akim@epita.fr>
10810 * configure.in (AC_INIT): Bump to 1.49b.
10811 (AM_INIT_AUTOMAKE): Short invocation.
10813 2002-05-02 Akim Demaille <akim@epita.fr>
10817 2002-05-01 Akim Demaille <akim@epita.fr>
10819 * src/skeleton.h: Remove.
10821 2002-05-01 Akim Demaille <akim@epita.fr>
10823 * src/skeleton.h: Fix the #endif.
10824 Reported by Magnus Fromreide.
10826 2002-04-26 Paul Eggert <eggert@twinsun.com>
10828 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
10829 Define if we define YYSTYPE and YYLTYPE, respectively.
10830 (YYCOPY): Fix [] quoting problem in the non-GCC case.
10832 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
10834 * src/scan-skel.l: Postprocess quadrigraphs.
10836 * src/reader.c (copy_character): New function, used to output
10837 single characters while replacing `[' and `]' with quadrigraphs, to
10838 avoid troubles with M4 quotes.
10839 (copy_comment): Output characters with copy_character.
10840 (read_additionnal_code): Likewise.
10841 (copy_string2): Likewise.
10842 (copy_definition): Likewise.
10844 * tests/calc.at: Exercise M4 quoting.
10846 2002-04-25 Akim Demaille <akim@epita.fr>
10848 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
10849 between `!' and the command.
10850 Reported by Paul Eggert.
10852 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
10854 * tests/calc.at: Exercise prologue splitting.
10856 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
10857 `b4_post_prologue' instead of `b4_prologue'.
10859 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
10861 (output): Free pre_prologue_obstack and post_prologue_obstack.
10862 * src/files.h, src/files.c (attrs_obstack): Remove.
10863 (pre_prologue_obstack, post_prologue_obstack): New.
10864 * src/reader.c (copy_definition): Add a parameter to specify the
10865 obstack to fill, instead of using attrs_obstack unconditionally.
10866 (read_declarations): Pass pre_prologue_obstack to copy_definition if
10867 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
10869 2002-04-23 Paul Eggert <eggert@twinsun.com>
10871 * data/bison.simple: Remove unnecessary commentary and white
10872 space differences from 1_29-branch.
10873 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
10875 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
10876 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
10877 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
10878 constructors or destructors.
10880 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
10882 2002-04-23 Akim Demaille <akim@epita.fr>
10884 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
10885 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
10886 location with columns.
10887 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
10888 All reported by Paul Eggert.
10890 2002-04-22 Akim Demaille <akim@epita.fr>
10892 * src/reduce.c (dump_grammar): Move to...
10893 * src/gram.h, src/gram.c (grammar_dump): here.
10894 Be sure to separate long item numbers.
10895 Don't read the members of a rule's prec if its nil.
10897 2002-04-22 Akim Demaille <akim@epita.fr>
10899 * src/output.c (table_size, table_grow): New.
10900 (MAXTABLE): Remove, replace uses with table_size.
10901 (pack_vector): Instead of dying when the table is too big, grow it.
10903 2002-04-22 Akim Demaille <akim@epita.fr>
10905 * data/bison.simple (yyr1): Its type is that of a token number.
10906 * data/bison.c++ (r1_): Likewise.
10907 * tests/regression.at (Web2c Actions): Adjust.
10909 2002-04-22 Akim Demaille <akim@epita.fr>
10911 * src/reader.c (token_translations_init): 256 is now the default
10912 value for the error token, i.e., it will be assigned another
10913 number if the user assigned 256 to one of her tokens.
10914 (reader): Don't force 256 to error.
10915 * doc/bison.texinfo (Symbols): Adjust.
10916 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
10917 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
10918 etc. instead of 10, 20, 30 (which was used to `jump' over error
10919 (256) and undefined (2)).
10921 2002-04-22 Akim Demaille <akim@epita.fr>
10923 Propagate more token_number_t.
10925 * src/gram.h (token_number_as_item_number)
10926 (item_number_as_token_number): New.
10927 * src/output.c (GENERATE_OUTPUT_TABLE): New.
10928 Use it to create output_item_number_table and
10929 output_token_number_table.
10930 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
10931 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
10932 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
10933 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
10935 2002-04-22 Akim Demaille <akim@epita.fr>
10937 * src/output.h, src/output.c (get_lines_number): Remove.
10939 2002-04-19 Akim Demaille <akim@epita.fr>
10941 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
10943 (Debugging): More details about enabling the debugging features.
10944 (Table of Symbols): Describe $$, $n, @$, and @n.
10945 Suggested by Tim Josling.
10947 2002-04-19 Akim Demaille <akim@epita.fr>
10949 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
10951 2002-04-10 Akim Demaille <akim@epita.fr>
10953 * src/system.h: Rely on HAVE_LIMITS_H.
10954 Suggested by Paul Eggert.
10956 2002-04-09 Akim Demaille <akim@epita.fr>
10958 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
10959 full stderr, and strip it according to the bison options, instead
10960 of composing the error message from different bits.
10961 This makes it easier to check for several error messages.
10962 Adjust all the invocations.
10963 Add an invocation exercising the error token.
10964 Add an invocation demonstrating a stupid error message.
10965 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
10967 Error message are for stderr, not stdout.
10969 2002-04-09 Akim Demaille <akim@epita.fr>
10971 * src/gram.h, src/gram.c (error_token_number): Remove, use
10973 * src/reader.c (reader): Don't specify the user token number (2)
10974 for $undefined, as it uselessly prevents using it.
10975 * src/gram.h (token_number_t): Move to...
10976 * src/symtab.h: here.
10977 (state_t.number): Is a token_number_t.
10978 * src/print.c, src/reader.c: Use undeftoken->number instead of
10980 (Even though this 2 is not the same as above: the number of the
10981 undeftoken remains being 2, it is its user token number which
10983 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
10984 `user_token_number_max'.
10985 Output `undef_token_number'.
10986 * data/bison.simple, data/bison.c++: Use them.
10987 Be sure to map invalid yylex return values to
10988 `undef_token_number'. This saves us from gratuitous SEGV.
10990 * tests/conflicts.at (Solved SR Conflicts)
10991 (Unresolved SR Conflicts): Adjust.
10992 * tests/regression.at (Web2c Actions): Adjust.
10994 2002-04-08 Akim Demaille <akim@epita.fr>
10996 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
10998 Remove the duplicate `typedefs'.
10999 (RhsNumberType): Fix the declaration and various other typos.
11001 * data/bison.simple: Use __ofile__.
11002 * src/scan-skel.l: Handle __ofile__.
11004 2002-04-08 Akim Demaille <akim@epita.fr>
11006 * src/gram.h (item_number_t): New, the type of item numbers in
11007 RITEM. Note that it must be able to code symbol numbers as
11008 positive number, and the negation of rule numbers as negative
11010 Adjust all dependencies (pretty many).
11011 * src/reduce.c (rule): Remove this `short *' pointer: use
11013 * src/system.h (MINSHORT, MAXSHORT): Remove.
11014 Include `limits.h'.
11015 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
11016 (shortcpy): Remove.
11017 (MAXTABLE): Move to...
11018 * src/output.c (MAXTABLE): here.
11019 (prepare_rules): Use output_int_table to output rhs.
11020 * data/bison.simple, data/bison.c++: Adjust.
11021 * tests/torture.at (Big triangle): Move the limit from 254 to
11023 * tests/regression.at (Web2c Actions): Ajust.
11025 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
11026 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
11027 passes, but produces negative #line number, once fixed, GCC is
11028 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
11030 * src/state.h (state_h): Code input lines on ints, not shorts.
11032 2002-04-08 Akim Demaille <akim@epita.fr>
11034 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
11035 and then the grammar.
11037 2002-04-08 Akim Demaille <akim@epita.fr>
11039 * src/system.h: No longer using strndup.
11041 2002-04-07 Akim Demaille <akim@epita.fr>
11043 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
11044 * src/output.c (output_table_data): Return the longest number.
11045 (prepare_tokens): Output `token_number_max').
11046 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
11048 Use them to define yy_token_number_type/TokenNumberType.
11049 Use this type for yytranslate.
11050 * tests/torture.at (Big triangle): Push the limit from 124 to
11052 * tests/regression.at (Web2c Actions): Adjust.
11054 2002-04-07 Akim Demaille <akim@epita.fr>
11056 * tests/torture.at (Big triangle): New.
11057 (GNU AWK Grammar, GNU Cim Grammar): Move to...
11058 * tests/existing.at: here.
11060 2002-04-07 Akim Demaille <akim@epita.fr>
11062 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
11064 Adjust dependencies.
11066 2002-04-07 Akim Demaille <akim@epita.fr>
11068 * src/reader.c: Normalize increments to prefix form.
11070 2002-04-07 Akim Demaille <akim@epita.fr>
11072 * src/reader.c, symtab.c: Remove debugging code.
11074 2002-04-07 Akim Demaille <akim@epita.fr>
11076 Rename all the `bucket's as `symbol_t'.
11078 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
11079 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
11080 * src/symtab.c, src/symtab.h (bucket): Rename as...
11082 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11083 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11084 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11085 (buckets_new, buckets_free, buckets_do): Rename as...
11086 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11087 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11088 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11089 (symbols_new, symbols_free, symbols_do): these.
11091 2002-04-07 Akim Demaille <akim@epita.fr>
11093 Use lib/hash for the symbol table.
11095 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11097 * src/lex.c (lex): Set the `number' member of new terminals.
11098 * src/reader.c (bucket_check_defined, bucket_make_alias)
11099 (bucket_check_alias_consistence, bucket_translation): New.
11100 (reader, grammar_free, readgram, token_translations_init)
11101 (packsymbols): Adjust.
11102 (reader): Number the predefined tokens.
11103 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11104 for predefined tokens.
11105 * src/symtab.h (bucket): Remove all the hash table related
11107 * src/symtab.c (symtab): Replace by...
11108 (bucket_table): this.
11109 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11110 (buckets_new, buckets_do): New.
11112 2002-04-07 Akim Demaille <akim@epita.fr>
11114 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11115 (start_symbol, max_user_token_number, semantic_parser)
11116 (error_token_number): Initialize.
11117 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11120 (errtoken, eoftoken, undeftoken, axiom): Extern.
11122 2002-04-07 Akim Demaille <akim@epita.fr>
11124 * src/gram.h (rule_s): prec and precsym are now pointers
11125 to the bucket giving the priority/associativity.
11126 Member `associativity' removed: useless.
11127 * src/reduce.c, src/conflicts.c: Adjust.
11129 2002-04-07 Akim Demaille <akim@epita.fr>
11131 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
11132 Properly escape the symbols' TAG when outputting them.
11134 2002-04-07 Akim Demaille <akim@epita.fr>
11136 * src/lalr.h (LA): Is a bitsetv, not bitset*.
11138 2002-04-07 Akim Demaille <akim@epita.fr>
11140 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
11141 (LArule): this, which is an array to rule_t*.
11142 * src/print.c, src/conflicts.c: Adjust.
11144 2002-04-07 Akim Demaille <akim@epita.fr>
11146 * src/gram.h (rule_t): Rename `number' as `user_number'.
11147 `number' is a new member.
11148 Adjust dependencies.
11149 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
11151 2002-04-07 Akim Demaille <akim@epita.fr>
11153 As a result of the previous patch, it is no longer needed
11154 to reorder ritem itself.
11156 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
11158 2002-04-07 Akim Demaille <akim@epita.fr>
11160 Be sure never to walk through RITEMS, but use only data related to
11161 the rules themselves. RITEMS should be banished.
11163 * src/output.c (output_token_translations): Rename as...
11164 (prepare_tokens): this.
11165 In addition to `translate', prepare the muscles `tname' and
11166 `toknum', which were handled by...
11167 (output_rule_data): this.
11168 Remove, and move the remainder of its outputs into...
11169 (prepare_rules): this new routines, which also merges content from
11170 (output_gram): this.
11171 (prepare_rules): Be sure never to walk through RITEMS.
11172 (output_stos): Rename as...
11173 (prepare_stos): this.
11174 (output): Always invoke prepare_states, after all, just don't use it
11175 in the output if you don't need it.
11177 2002-04-07 Akim Demaille <akim@epita.fr>
11179 * src/LR0.c (new_state): Display `nstates' as the name of the
11180 newly created state.
11181 Adjust to initialize first_state and last_state if needed.
11182 Be sure to distinguish the initial from the final state.
11183 (new_states): Create the itemset of the initial state, and use
11185 * src/closure.c (closure): Now that the initial state has its
11186 items properly set, there is no need for a special case when
11187 creating `ruleset'.
11189 As a result, now the rule 0, reducing to $axiom, is visible in the
11190 outputs. Adjust the test suite.
11192 * tests/conflicts.at (Solved SR Conflicts)
11193 (Unresolved SR Conflicts): Adjust.
11194 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
11195 * tests/conflicts.at (S/R in initial): New.
11197 2002-04-07 Akim Demaille <akim@epita.fr>
11199 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
11200 the RHS of the rules.
11201 * src/output.c (output_gram): Likewise.
11203 2002-04-07 Akim Demaille <akim@epita.fr>
11205 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
11207 Adjust all dependencies.
11208 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
11209 `number' of the buckets too.
11210 * src/gram.h: Include `symtab.h'.
11211 (associativity): Move to...
11212 * src/symtab.h: here.
11213 No longer include `gram.h'.
11215 2002-04-07 Akim Demaille <akim@epita.fr>
11217 * src/gram.h, src/gram.c (rules_rhs_length): New.
11218 (ritem_longest_rhs): Use it.
11219 * src/gram.h (rule_t): `number' is a new member.
11220 * src/reader.c (packgram): Set it.
11221 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
11222 the end of `rules', and count them out of `nrules'.
11223 (reduce_output, dump_grammar): Adjust.
11224 * src/print.c (print_grammar): It is no longer needed to check for
11225 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
11226 * tests/reduce.at (Reduced Automaton): New test.
11228 2002-04-07 Akim Demaille <akim@epita.fr>
11230 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
11231 lacking `+ 1' to nrules, Bison reported as useless a token if it
11232 was used solely to set the precedence of the last rule...
11234 2002-04-07 Akim Demaille <akim@epita.fr>
11236 * data/bison.c++, data/bison.simple: Don't output the current file
11237 name in #line, to avoid useless diffs between two identical
11238 outputs under different names.
11240 2002-04-07 Akim Demaille <akim@epita.fr>
11242 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
11243 Normalize loops to using `< nrules + 1', not `<= nrules'.
11245 2002-04-07 Akim Demaille <akim@epita.fr>
11249 2002-04-07 Akim Demaille <akim@epita.fr>
11251 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
11252 bucket.value as bucket.number.
11254 2002-04-07 Akim Demaille <akim@epita.fr>
11256 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
11257 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11258 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
11259 RHS, instead of being an index in RITEMS.
11261 2002-04-04 Paul Eggert <eggert@twinsun.com>
11263 * doc/bison.texinfo: Update copyright date.
11264 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
11265 (Symbols): Warn about running Bison in one character set,
11266 but compiling and/or running in an incompatible one.
11267 Warn about character code 256, too.
11269 2002-04-03 Paul Eggert <eggert@twinsun.com>
11271 * src/bison.data (YYSTACK_ALLOC): Depend on whether
11272 YYERROR_VERBOSE is nonzero, not whether it is defined.
11274 Merge changes from bison-1_29-branch.
11276 2002-03-20 Paul Eggert <eggert@twinsun.com>
11278 Merge fixes from Debian bison_1.34-1.diff.
11280 * configure.in (AC_PREREQ): 2.53.
11282 2002-03-20 Akim Demaille <akim@epita.fr>
11284 * src/conflicts.c (log_resolution): Argument `resolution' is const.
11286 2002-03-19 Paul Eggert <eggert@twinsun.com>
11288 * src/bison.simple (YYCOPY): New macro.
11289 (YYSTACK_RELOCATE): Use it.
11290 Remove Type arg; no longer needed. All callers changed.
11291 (yymemcpy): Remove; no longer needed.
11293 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
11294 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11296 2002-03-19 Akim Demaille <akim@epita.fr>
11298 Test and fix the #line outputs.
11300 * tests/atlocal.at (GCC): New.
11301 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
11302 (Prologue synch line, %union synch line, Postprologue synch line)
11303 (Action synch line, Epilogue synch line): New tests.
11304 * src/reader.c (parse_union_decl): Define the muscle stype_line.
11305 * data/bison.simple, data/bison.c++: Use it.
11307 2002-03-19 Akim Demaille <akim@epita.fr>
11309 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
11310 (Solved SR Conflicts, %expect not enough, %expect right)
11311 (%expect too much): Move to...
11312 * tests/conflicts.at: this new file.
11314 2002-03-19 Akim Demaille <akim@epita.fr>
11316 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11317 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
11318 that we can move to enums for instance.
11319 * src/output.c (token_definitions_output): Output a list of
11320 `token-name, token-number' instead of the #define.
11321 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
11323 2002-03-14 Akim Demaille <akim@epita.fr>
11325 Use Gettext 0.11.1.
11327 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
11329 * data/bison.c++: Make the user able to add members to the generated
11330 parser by subclassing.
11332 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
11334 * src/reader.c (read_additionnal_code): `c' should be an integer, not
11336 Reported by Nicolas Tisserand and Nicolas Burrus.
11338 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
11340 * src/reader.c: Warn about lacking semi-colons, do not complain.
11342 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
11344 * data/bison.c++: Remove a debug line.
11346 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
11348 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
11349 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
11350 provide a default implementation.
11352 2002-03-04 Akim Demaille <akim@epita.fr>
11354 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
11355 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
11356 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
11357 * tests/semantic.at (Parsing Guards): Similarly.
11358 * src/reader.at (readgram): Complain if the last rule is not ended
11361 2002-03-04 Akim Demaille <akim@epita.fr>
11363 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
11364 * src/closure.c: here.
11365 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
11367 * src/warshall.h, src/warshall.c: Remove.
11368 * tests/sets.at (Broken Closure): Adjust.
11370 2002-03-04 Akim Demaille <akim@epita.fr>
11372 * src/output.c (output_skeleton): tempdir is const.
11373 bytes_read is unused.
11375 2002-03-04 Akim Demaille <akim@epita.fr>
11377 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
11378 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
11380 From Michael Hayes.
11382 2002-03-04 Akim Demaille <akim@epita.fr>
11384 * src/closure.c (closure): `r' is unused.
11386 2002-03-04 Akim Demaille <akim@epita.fr>
11388 * tests/sets.at (Broken Closure): Add the ending `;'.
11389 * src/reader.at (readgram): Complain if a rule is not ended with a
11392 2002-03-04 Akim Demaille <akim@epita.fr>
11394 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
11395 (count_sr_conflicts): Use bitset_count.
11396 * src/reduce.c (inaccessable_symbols): Ditto.
11397 (bits_size): Remove.
11398 * src/warshall.h, src/warshall.c: Convert to bitsetv.
11400 2002-03-04 Akim Demaille <akim@epita.fr>
11402 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
11403 * src/reduce.c: Remove the `bitset_zero's following the
11404 `bitset_create's, as now it is performed by the latter.
11406 2002-03-04 Akim Demaille <akim@epita.fr>
11408 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
11409 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
11410 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
11411 latest sources from Michael.
11413 2002-03-04 Akim Demaille <akim@epita.fr>
11415 * src/output.c (output): Don't free the grammar.
11416 * src/reader.c (grammar_free): New.
11417 * src/main.c (main): Call it and don't free symtab here.
11419 2002-03-04 Akim Demaille <akim@epita.fr>
11421 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
11423 Reported by Benoit Perrot.
11425 2002-03-04 Akim Demaille <akim@epita.fr>
11427 Use bitset operations when possible, not loops over bits.
11429 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
11431 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
11432 * src/reduce.c (useless_nonterminals): Formatting changes.
11433 * src/warshall.c (TC): Use bitset_or.
11435 2002-03-04 Akim Demaille <akim@epita.fr>
11437 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
11438 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
11441 2002-03-04 Akim Demaille <akim@epita.fr>
11443 * src/lalr.c (F): Now a bitset*.
11444 Adjust all dependencies.
11446 2002-03-04 Akim Demaille <akim@epita.fr>
11448 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
11449 Adjust all dependencies.
11451 2002-03-04 Akim Demaille <akim@epita.fr>
11453 * src/L0.c, src/LR0.h (nstates): Be size_t.
11454 Adjust comparisons (signed vs unsigned).
11455 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
11457 Adjust all dependencies.
11459 2002-03-04 Akim Demaille <akim@epita.fr>
11461 * src/closure.c (firsts): Now, also a bitset.
11462 Adjust all dependencies.
11463 (varsetsize): Remove, now unused.
11464 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
11466 2002-03-04 Akim Demaille <akim@epita.fr>
11468 * src/print.c: Convert to use bitset.h, not hand coded iterations
11471 2002-03-04 Akim Demaille <akim@epita.fr>
11473 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
11475 2002-03-04 Akim Demaille <akim@epita.fr>
11477 * src/closure.c (ruleset): Be a bitset.
11478 (rulesetsize): Remove.
11480 2002-03-04 Akim Demaille <akim@epita.fr>
11482 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
11483 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
11484 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
11485 * src/closure.c (fderives): Be an array of bitsets.
11487 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
11489 * data/bison.c++: Merge the two generated headers. Insert a copyright
11490 notice in each output file.
11492 2002-02-28 Akim Demaille <akim@epita.fr>
11494 * data/bison.c++: Copy the prologue of bison.simple to fetch
11495 useful M4 definitions, such as b4_header_guard.
11497 2002-02-25 Akim Demaille <akim@epita.fr>
11499 * src/getargs.c (version): Give the name of the authors, and use a
11500 translator friendly scheme for the bgr
11503 2002-02-25 Akim Demaille <akim@epita.fr>
11505 * src/output.c (header_output): Remove, now handled completely via
11508 2002-02-25 Akim Demaille <akim@epita.fr>
11510 * m4/m4.m4: New, from CVS Autoconf.
11511 * configure.in: Invoke it.
11512 * src/output.c (output_skeleton): Use its result instead of the
11515 2002-02-25 Akim Demaille <akim@epita.fr>
11517 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
11519 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
11520 * src/output.c (output_skeleton): Use mkstemp to create a real
11522 Move the filling of `skeleton' and its muscle to...
11524 (output): Move the definition of the prologue muscle to...
11526 * src/system.h (DEFAULT_TMPDIR): New.
11528 2002-02-14 Paul Eggert <eggert@twinsun.com>
11530 Remove the support for C++ namespace cleanliness; it was
11531 causing more problems than it was curing, since it didn't work
11532 properly on some nonstandard C++ compilers. This can wait
11533 for a proper C++ parser.
11535 * NEWS: Document this.
11536 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
11537 of C++, as it's treated like C now.
11538 * src/bison.simple (YYSTD): Remove.
11539 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
11540 Treat C++ just like Standard C instead of trying to support
11541 namespace cleanliness.
11543 2002-02-14 Akim Demaille <akim@epita.fr>
11545 * tests/regression.at (else): Adjust to Andreas' change.
11547 2002-02-14 Akim Demaille <akim@epita.fr>
11549 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
11551 2002-02-13 Andreas Schwab <schwab@suse.de>
11553 * src/output.c (output_rule_data): Don't output NULL, it might
11554 not be defined yet.
11556 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
11558 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
11559 (Copyright notice): Update.
11561 2002-02-11 Akim Demaille <akim@epita.fr>
11563 * tests/regression.at (%nonassoc and eof): Don't include
11564 nonportable headers.
11566 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
11568 * data/bison.c++: Correct error recovery. Make the user able to
11569 initialize the starting location.
11571 2002-02-07 Akim Demaille <akim@epita.fr>
11573 * tests/input.at: New.
11575 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
11577 * data/bison.c++: Replace some direct m4 expansions by constants. Be
11578 more consistent when naming methods and variables. Put preprocessor
11579 directives around tables only needed for debugging.
11581 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
11583 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
11585 (yy::b4_name::parse): Use print_.
11587 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
11589 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
11591 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
11593 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
11595 (yy::b4_name::parse): Build verbose error messages, and use error_.
11597 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
11599 * data/bison.c++: Fix m4 quoting in comments.
11601 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
11603 * data/bison.c++: Adjust the parser code. Fix some muscles that were
11604 not expanded by m4.
11606 2002-02-05 Akim Demaille <akim@epita.fr>
11608 * data/bison.c++: Adjust to the M4 back end.
11609 More is certainly needed.
11611 2002-02-05 Akim Demaille <akim@epita.fr>
11613 Give a try to M4 as a back end.
11615 * lib/readpipe.c: New, from wdiff.
11616 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
11618 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
11619 specific values. Now it is m4 that performs the lookup.
11620 * src/parse-skel.y: Remove.
11621 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
11622 * src/output.c (actions_output, guards_output)
11623 (token_definitions_output): No longer keeps track of the output
11624 line number, hence remove the second argument.
11625 (guards_output): Check against the guard member of a rule, not the
11628 (output_skeleton): Don't look for the skeleton location, let m4 do
11630 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
11632 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
11633 (prepare): Given that for the time being changesyntax is not
11634 usable in M4, rename the muscles using `-' to `_'.
11635 Define `defines_flag', `output_parser_name' and `output_header_name'.
11636 * src/output.h (actions_output, guards_output)
11637 (token_definitions_output): Adjust prototypes.
11638 * src/scan-skel.l: Instead of scanning the skeletons, it now
11639 processes the output of m4: `__oline__' and `#output'.
11640 * data/bison.simple: Adjust to be used by M4(sugar).
11641 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
11643 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
11644 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
11645 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
11646 shamelessly stolen from CVS Autoconf.
11648 2002-02-05 Akim Demaille <akim@epita.fr>
11650 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
11651 * configure.in: Check for the declarations of free and malloc.
11652 * src/muscle_tab.c: Adjust.
11654 2002-02-05 Akim Demaille <akim@epita.fr>
11656 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
11657 which have no values.
11659 2002-02-05 Akim Demaille <akim@epita.fr>
11661 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
11664 2002-01-29 Paul Eggert <eggert@twinsun.com>
11666 * src/bison.simple (YYSIZE_T): Do not define merely because
11667 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
11668 On some platforms, <alloca.h> does not declare YYSTD (size_t).
11670 2002-01-27 Akim Demaille <akim@epita.fr>
11672 Fix `%nonassoc and eof'.
11674 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
11675 which were not properly copied! Replace
11676 memcpy (res->errs, src->errs, src->nerrs);
11678 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
11680 * tests/regression.at (%nonassoc and eof): Adjust to newest
11681 Autotest: `.' is not in the PATH.
11683 2002-01-27 Akim Demaille <akim@epita.fr>
11685 * tests/sets.at (AT_EXTRACT_SETS): New.
11686 (Nullable): Use it.
11689 2002-01-26 Akim Demaille <akim@epita.fr>
11691 * tests/actions.at, tests/calc.at, tests/headers.at,
11692 * tests/torture.at: Adjust to the newest Autotest which no longer
11693 forces `.' in the PATH.
11695 2002-01-25 Akim Demaille <akim@epita.fr>
11697 * tests/regression.at (%nonassoc and eof): New.
11698 Suggested by Robert Anisko.
11700 2002-01-24 Akim Demaille <akim@epita.fr>
11702 Bison dumps core when trying to complain about broken input files.
11703 Reported by Cris van Pelt.
11705 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
11706 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
11708 (Invalid inputs): Strengthen: exercise parse_percent_token.
11710 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
11712 * src/Makefile.am: Add bison.c++.
11713 * src/bison.c++: New skeleton.
11715 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
11719 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
11721 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
11723 2002-01-20 Marc Autret <marc@gnu.org>
11725 * src/files.c (compute_output_file_names): Fix
11727 2002-01-20 Marc Autret <marc@gnu.org>
11729 * tests/output.at: New test.
11730 * src/files.c (compute_base_names): Don't map extensions when
11731 the YACC flag is set, use defaults.
11732 Reported by Evgeny Stambulchik.
11734 2002-01-20 Marc Autret <marc@gnu.org>
11736 * src/system.h: Need to define __attribute__ away for non-GCC
11737 compilers as well (i.e., the vendor C compiler).
11738 Suggested by Albert Chin-A-Young.
11740 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
11742 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
11743 canonical definition.
11744 * src/system.h: Use the canonical definition for PARAMS (avoids
11745 a conflict with the macro from lib/hash.h).
11747 2002-01-11 Akim Demaille <akim@epita.fr>
11749 * configure.in: Use AC_FUNC_STRNLEN.
11750 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
11752 2002-01-09 Akim Demaille <akim@epita.fr>
11754 * src/files.c, src/files.h (output_infix): New.
11755 (tab_extension): Remove.
11756 (compute_base_names): Compute the former, drop the latter.
11757 * src/output.c (prepare): Insert the muscles `output-infix', and
11759 * src/parse-skel.y (string, string.1): New.
11760 (section.header): Use it.
11761 (section.yacc): Remove.
11762 (prefix): Remove too.
11763 * src/scan-skel.l: Adjust.
11764 * src/bison.simple, src/bison.hairy: Adjust.
11766 2002-01-09 Akim Demaille <akim@epita.fr>
11768 * configure.in (WERROR_CFLAGS): Compute it.
11769 * src/Makefile.am (CFLAGS): Pass it.
11770 * tests/atlocal.in (CFLAGS): Idem.
11771 * src/files.c: Fix a few warnings.
11772 (get_extension_index): Remove, unused.
11774 2002-01-08 Akim Demaille <akim@epita.fr>
11776 * src/getargs.c (AS_FILE_NAME): New.
11777 (getargs): Use it to convert DOSish file names.
11778 * src/files.c (base_name): Rename as full_base_name to avoid
11779 clashes with `base_name ()'.
11780 (filename_split): New.
11781 (compute_base_names): N-th rewrite, using filename_split.
11783 2002-01-08 Akim Demaille <akim@epita.fr>
11785 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
11786 New, stolen from the Fileutils 4.1.
11787 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
11788 * configure.in: Check for the presence of memrchr, and of its
11791 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
11793 * lib/hash.h (__P): Added definition for this macro.
11794 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
11795 BUILT_SOURCES, to ensure they are generated first.
11796 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
11797 %error-verbose to allow bootstrapping with bison 1.30x.
11799 2002-01-06 Akim Demaille <akim@epita.fr>
11801 * src/reader.c (parse_braces): Don't fetch the next char, the
11802 convention is to fetch on entry.
11803 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
11804 'switch' without a following semicolon.
11805 * tests/regression.at (braces parsing): New.
11807 2002-01-06 Akim Demaille <akim@epita.fr>
11809 Bison is dead wrong in its RR conflict reports.
11811 * tests/torture.at (GNU Cim Grammar): New.
11812 * src/conflicts.c (count_rr_conflicts): Fix.
11814 2002-01-06 Akim Demaille <akim@epita.fr>
11816 Creating package.m4 from configure.ac causes too many problems.
11818 * tests/Makefile.am (package.m4): Create it by hand,
11819 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
11821 2002-01-06 Akim Demaille <akim@epita.fr>
11823 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
11826 2002-01-04 Paul Eggert <eggert@twinsun.com>
11828 * doc/bison.texinfo (Debugging):
11829 Remove YYSTDERR; it's no longer defined or used.
11830 Also, s/cstdio.h/cstdio/.
11832 2002-01-03 Akim Demaille <akim@epita.fr>
11834 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
11836 2002-01-03 Akim Demaille <akim@epita.fr>
11838 * src/parse-skel.y (process_skeleton): Don't bind the parser's
11839 tracing code to --trace, wait for a better --trace option, with
11842 2002-01-03 Akim Demaille <akim@epita.fr>
11844 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
11845 The ISO C++ standard is extremely clear about it: stderr is
11846 considered a macro, not a regular symbol (see table 94 `Header
11847 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
11848 Therefore std:: does not apply to it. It still does with fprintf.
11849 Also, s/cstdio.h/cstdio/.
11851 2002-01-03 Akim Demaille <akim@epita.fr>
11853 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
11854 for non system headers.
11856 2002-01-02 Akim Demaille <akim@epita.fr>
11858 Equip the skeleton chain with location tracking, runtime trace,
11859 pure parser and scanner.
11861 * src/parse-skel.y: Request a pure parser, locations, and prefix
11863 (%union): Having several members with the same type does not help
11864 type mismatches, simplify.
11865 (YYPRINT, yyprint): New.
11866 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
11867 (skel_error): this.
11869 * src/scan-skel.l: Adjust to these changes.
11870 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
11871 (LOCATION_PRINT, skel_control_t): New.
11873 2001-12-30 Akim Demaille <akim@epita.fr>
11875 * src/parse-skel.y: Get rid of the shift/reduce conflict:
11876 replace `gb' with BLANKS.
11877 * src/scan-skel.l: Adjust.
11879 2001-12-30 Akim Demaille <akim@epita.fr>
11881 * src/system.h: We don't need nor want bcopy.
11882 Throw away MS-DOS crap: we don't need getpid.
11883 * configure.in: We don't need strndup. It was even causing
11884 problems: because Flex includes the headers *before* us,
11885 _GNU_SOURCE is not defined by config.h, and therefore strndup was
11887 * lib/xstrndup.c: New.
11888 * src/scan-skel.l: Use it.
11889 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
11890 * src/parse-skel.y: Use %directives instead of #defines.
11892 2001-12-30 Akim Demaille <akim@epita.fr>
11894 * src/skeleton.h: New.
11895 * src/output.c (output_parser, output_master_parser): Remove, dead
11897 * src/output.h (get_lines_number, actions_output, guards_output)
11898 (token_definitions_output): Prototype them.
11899 * src/parse-skel.y: Add the license notice.
11900 Include output.h and skeleton.h.
11901 (process_skeleton): Returns void, and takes a single parameter.
11902 * src/scan-skel.l: Add the license notice.
11903 Include skeleton.h.
11904 Don't use %option yylineno: it seems that then Flex imagines
11905 REJECT has been used, and therefore it won't reallocate its
11906 buffers (which makes no other sense to me than a bug). It results
11907 in warnings for `unused: yy_flex_realloc'.
11909 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
11911 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
11912 (MUSCLE_INSERT_PREFIX): ...to there.
11913 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
11914 (MUSCLE_INSERT_PREFIX): Move from here...
11916 * src/bison.hairy: Add a section directive. Put braces around muscle
11917 names. This parser skeleton is still broken, but Bison should not
11918 choke on a bad muscle 'syntax'.
11919 * src/bison.simple: Add a section directive. Put braces around muscle
11922 * src/files.h (strsuffix, stringappend): Add declarations.
11923 (tab_extension): Add declaration.
11924 (short_base_name): Add declaration.
11926 * src/files.c (strsuffix, stringappend): No longer static. These
11927 functions are used in the skeleton parser.
11928 (tab_extension): New.
11929 (compute_base_names): Use the computations done in this function
11930 to guess if the generated parsers should have '.tab' in their
11932 (short_base_name): No longer static.
11934 * src/output.c (output_skeleton): New.
11935 (output): Disable call to output_master_parser, and give a try to
11936 a new skeleton handling system.
11937 (guards_output, actions_output): No longer static.
11938 (token_definitions_output, get_lines_number): No longer static.
11940 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
11942 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
11945 * src/parse-skel.y: New file.
11946 * src/scan-skel.l: New file.
11948 2001-12-29 Akim Demaille <akim@epita.fr>
11950 %name-prefix is broken.
11952 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
11953 Adjust all dependencies.
11954 * tests/headers.at (export YYLTYPE): Strengthen this test: use
11957 Renaming yylval but not yylloc is not consistent. Now we do.
11959 * src/bison.simple: Prefix yylloc if used.
11960 * doc/bison.texinfo (Decl Summary): Document that.
11962 2001-12-29 Akim Demaille <akim@epita.fr>
11964 * doc/bison.texinfo: Promote `%long-directive' over
11966 Remove all references to fixed-output-files, yacc is enough.
11968 2001-12-29 Akim Demaille <akim@epita.fr>
11970 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
11971 user prologue. These are defaults.
11972 * tests/actions.at (Mid-rule actions): Make sure the user can
11973 define YYDEBUG and YYERROR_VERBOSE.
11975 2001-12-29 Akim Demaille <akim@epita.fr>
11977 * src/output.c (header_output): Don't forget to export YYLTYPE and
11979 * tests/headers.at (export YYLTYPE): New, make sure it does.
11980 * tests/regression.at (%union and --defines, Invalid CPP headers):
11982 * tests/headers.at: here.
11984 2001-12-29 Akim Demaille <akim@epita.fr>
11986 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
11988 2001-12-29 Akim Demaille <akim@epita.fr>
11990 * tests/actions.at (Mid-rule actions): Output on a single line
11991 instead of several.
11993 2001-12-29 Akim Demaille <akim@epita.fr>
11995 * doc/bison.texinfo: Formatting changes.
11997 2001-12-29 Akim Demaille <akim@epita.fr>
11999 Don't store the token defs in a muscle, just be ready to output it
12000 on command. Now possible via `symbols'. Fixes a memory leak.
12002 * src/output.c (token_definitions_output): New.
12003 (output_parser, header_output): Use it.
12004 * src/reader.c (symbols_save): Remove.
12006 2001-12-29 Akim Demaille <akim@epita.fr>
12008 * src/bison.simple: Do not provide a default for YYSTYPE and
12009 YYLTYPE before the user's prologue. Otherwise it's hardly... a
12012 2001-12-29 Akim Demaille <akim@epita.fr>
12014 Mid-rule actions are simply... ignored!
12016 * src/reader.c (readgram): Be sure to attach mid-rule actions to
12017 the empty-rule associated to the dummy symbol, not to the host
12019 * tests/actions.at (Mid-rule actions): New.
12021 2001-12-29 Akim Demaille <akim@epita.fr>
12025 * src/reader.c (reader): Free grammar.
12027 2001-12-29 Akim Demaille <akim@epita.fr>
12031 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
12032 since it allocates it for each state, although only one is needed.
12033 (allocate_storage): Do it here.
12035 2001-12-29 Akim Demaille <akim@epita.fr>
12037 * src/options.h, src/options.c (create_long_option_table): Rename
12039 (long_option_table_new): this, with a clearer prototype.
12040 (percent_table): Remove, unused,
12041 * src/getargs.c (getargs): Adjust.
12043 2001-12-29 Akim Demaille <akim@epita.fr>
12045 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
12046 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
12049 2001-12-29 Akim Demaille <akim@epita.fr>
12051 * src/lalr.c (build_relations): Rename `states' as `states1'.
12052 Sorry, I don't understand exactly what it is, no better name...
12054 2001-12-29 Akim Demaille <akim@epita.fr>
12056 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
12057 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
12058 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
12061 2001-12-29 Akim Demaille <akim@epita.fr>
12063 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
12066 2001-12-29 Akim Demaille <akim@epita.fr>
12068 * src/reader.c, src/reader.h (user_toknums): Remove.
12069 Adjust all users to use symbols[i]->user_token_number.
12071 2001-12-29 Akim Demaille <akim@epita.fr>
12073 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
12074 Adjust all users to use symbols[i]->prec or ->assoc.
12076 2001-12-29 Akim Demaille <akim@epita.fr>
12078 * src/reader.c, src/reader.h (tags): Remove.
12079 Adjust all users to use symbols[i]->tag.
12081 2001-12-29 Akim Demaille <akim@epita.fr>
12083 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12085 * src/reader.c (packsymbols): Fill this table.
12087 * src/conflicts.c (resolve_sr_conflict): Adjust.
12088 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12090 Use symbols[i]->tag instead of tags[i].
12092 2001-12-29 Akim Demaille <akim@epita.fr>
12094 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12095 In addition, put a comment in there, to replace...
12096 * tests/regression.at (%union and C comments): Remove.
12098 2001-12-29 Akim Demaille <akim@epita.fr>
12100 * tests/regression.at (Web2c Actions): Blindly move the actual
12101 output as expected output. The contents *seem* right to me, but I
12102 can't pretend reading perfectly parser tables... Nonetheless, all
12103 the other tests pass correctly, the table look OK, even though the
12104 presence of `$axiom' is to be noted: AFAICS it is useless (but
12107 2001-12-29 Akim Demaille <akim@epita.fr>
12109 * src/reader.c (readgram): Don't add the rule 0 if there were no
12110 rules read. In other words, add it _after_ having performed
12111 grammar sanity checks.
12112 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12114 2001-12-29 Akim Demaille <akim@epita.fr>
12116 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12117 visible, and some states have now a different number.
12119 2001-12-29 Akim Demaille <akim@epita.fr>
12121 * src/reader.c (readgram): Bind the initial rule's lineno to that
12123 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12124 (Solved SR Conflicts): Adjust rule 0's line number.
12126 2001-12-29 Akim Demaille <akim@epita.fr>
12128 Fix the `GAWK Grammar' failure.
12130 * src/LR0.c (final_state): Initialize to -1 so that we do compute
12131 the reductions of the first state which was mistakenly confused
12132 with the final state because precisely final_state was initialized
12134 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
12135 now noticed by Bison.
12136 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
12137 have a reduction on $default.
12139 2001-12-29 Akim Demaille <akim@epita.fr>
12141 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
12143 * src/closure.c (print_closure): Likewise.
12144 * src/derives.c (print_derives): Likewise.
12145 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
12148 2001-12-29 Akim Demaille <akim@epita.fr>
12150 * src/lalr.c (lookaheads_print): New.
12151 (lalr): Call it when --trace-flag.
12152 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
12155 2001-12-29 Akim Demaille <akim@epita.fr>
12157 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
12158 when walking through ritem, even via rule->rhs.
12159 * src/reduce.c (dump_grammar, useful_production, reduce_output)
12160 (useful_production, useless_nonterminals): Likewise.
12161 (reduce_grammar_tables): Likewise, plus update nritems.
12162 * src/nullable.c (set_nullable): Likewise.
12163 * src/lalr.c (build_relations): Likewise.
12164 * tests/sets.at (Nullable): Adjust.
12165 Fortunately, now, the $axiom is no longer nullable.
12167 2001-12-29 Akim Demaille <akim@epita.fr>
12169 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
12171 * src/gram.c (ritem_longest_rhs): Likewise.
12172 * src/reduce.c (nonterminals_reduce): Likewise.
12173 * src/print_graph.c (print_graph): Likewise.
12174 * src/output.c (output_rule_data): Likewise.
12175 * src/nullable.c (set_nullable): Likewise.
12177 2001-12-29 Akim Demaille <akim@epita.fr>
12179 * src/output.c: Comment changes.
12181 2001-12-27 Paul Eggert <eggert@twinsun.com>
12183 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
12184 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
12185 Sparc, as they were causing more porting problems than the
12186 (minor) performance improvement was worth.
12188 Also, catch up with 1.31's YYSTD.
12190 2001-12-27 Akim Demaille <akim@epita.fr>
12192 * src/output.c (output_gram): Rely on nritems, not the
12193 0-sentinel. See below.
12194 Use -1 as separator, not 0.
12195 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
12196 Rely on -1 as separator in yyrhs, instead of 0.
12197 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
12198 twice `Now at end of input', therefore there are two lines less to
12201 2001-12-27 Akim Demaille <akim@epita.fr>
12203 * tests/regression.at (Unresolved SR Conflicts):
12204 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
12207 2001-12-27 Akim Demaille <akim@epita.fr>
12209 * src/LR0.c (new_state): Recognize the final state by the fact it
12210 is reached by eoftoken.
12211 (insert_start_shifting_state, insert_eof_shifting_state)
12212 (insert_accepting_state, augment_automaton): Remove, since now
12213 these states are automatically computed from the initial state.
12214 (generate_states): Adjust.
12215 * src/print.c: When reporting a rule number to the user, substract
12216 1, so that the axiom rule is rule 0, and the first user rule is 1.
12217 * src/reduce.c: Likewise.
12218 * src/print_graph.c (print_core): For the time being, just as for
12219 the report, depend upon --trace-flags to dump the full set of
12221 * src/reader.c (readgram): Once the grammar read, insert the rule
12222 0: `$axiom: START-SYMBOL $'.
12223 * tests/set.at: Adjust: rule 0 is now displayed, and since the
12224 number of the states has changed (the final state is no longer
12225 necessarily the last), catch up.
12227 2001-12-27 Akim Demaille <akim@epita.fr>
12229 Try to make the use of the eoftoken valid. Given that its value
12230 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
12231 is used instead of > 0 where appropriate, (ii), depend upon nritems
12232 instead of the 0-sentinel.
12234 * src/gram.h, src/gram.c (nritems): New.
12235 Expected to be duplication of nitems, but for the time being...
12236 * src/reader.c (packgram): Assert nritems and nitems are equal.
12237 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
12238 * src/closure.c (print_closure, print_fderives): Likewise.
12239 * src/gram.c (ritem_print): Likewise.
12240 * src/print.c (print_core, print_grammar): Likewise.
12241 * src/print_graph.c: Likewise.
12243 2001-12-27 Akim Demaille <akim@epita.fr>
12245 * src/main.c (main): If there are complains after grammar
12246 reductions, then output the report anyway if requested, then die.
12247 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
12248 * src/reader.c (eoftoken): New.
12249 (parse_token_decl): If the token being defined has value `0', it
12251 (packsymbols): No longer hack `tags' to insert `$' by hand.
12252 Be sure to preserve the value of the eoftoken.
12253 (reader): Make sure eoftoken is defined.
12254 Initialize nsyms to 0: now eoftoken is created just like the others.
12255 * src/print.c (print_grammar): Don't special case the eof token.
12256 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
12257 lie anyway, albeit pleasant.
12258 * tests/calc.at: Exercise error messages with eoftoken.
12259 Change the grammar so that empty input is invalid.
12260 Adjust expectations.
12261 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
12263 2001-12-27 Akim Demaille <akim@epita.fr>
12265 * configure.in: Check the protos of strchr ans strspn.
12266 Replace strchr if needed.
12267 * src/system.h: Provide the protos of strchr, strspn and memchr if
12269 * lib/strchr.c: New.
12270 * src/reader.c (symbols_save): Use strchr.
12272 2001-12-27 Akim Demaille <akim@epita.fr>
12274 * src/print.c, src/print_graph.c (escape): New.
12275 Use it to quote the TAGS outputs.
12276 * src/print_graph.c (print_state): Now errors are in red, and
12277 reductions in green.
12278 Prefer high to wide: output the state number on a line of its own.
12280 2001-12-27 Akim Demaille <akim@epita.fr>
12282 * src/state.h, src/state.c (reductions_new): New.
12283 * src/LR0.c (set_state_table): Let all the states have a
12284 `reductions', even if reduced to 0.
12285 (save_reductions): Adjust.
12286 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
12287 * src/print.c (print_reductions, print_actions): Adjust.
12288 * src/output.c (action_row): Adjust.
12290 2001-12-27 Akim Demaille <akim@epita.fr>
12292 * src/state.h, src/state.c (errs_new, errs_dup): New.
12293 * src/LR0.c (set_state_table): Let all the states have an errs,
12294 even if reduced to 0.
12295 * src/print.c (print_errs, print_reductions): Adjust.
12296 * src/output.c (output_actions, action_row): Adjust.
12297 * src/conflicts.c (resolve_sr_conflict): Adjust.
12299 2001-12-27 Akim Demaille <akim@epita.fr>
12301 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
12303 2001-12-27 Akim Demaille <akim@epita.fr>
12305 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
12306 * src/print.c: here.
12307 (lookaheadset, shiftset): New, used as additional storage by
12309 (print_results): Adjust.
12310 (print_shifts, print_gotos, print_errs): New, extracted from...
12311 (print_actions): here.
12312 * src/print_graph.c (print_actions): Remove dead code.
12314 2001-12-27 Akim Demaille <akim@epita.fr>
12316 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
12319 2001-12-27 Akim Demaille <akim@epita.fr>
12321 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
12322 (build_relations): Adjust.
12324 2001-12-27 Akim Demaille <akim@epita.fr>
12326 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
12329 2001-12-27 Akim Demaille <akim@epita.fr>
12331 * src/reader.c (packgram): Catch nitems overflows.
12333 2001-12-27 Akim Demaille <akim@epita.fr>
12335 * src/files.c, src/files.h (guard_obstack): Remove.
12336 * src/output.c (output): Adjust.
12337 * src/reader.c (parse_braces): New, factoring...
12338 (copy_action, copy_guard): these two which are renamed as...
12339 (parse_action, parse_guard): these.
12340 As a voluntary consequence, using braces around guards is now
12343 2001-12-27 Akim Demaille <akim@epita.fr>
12345 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
12346 * src/reader.c (symbol_list): `guard' and `guard_line' are new
12348 (symbol_list_new): Adjust.
12349 (copy_action): action_line is the first line, not the last.
12350 (copy_guard): Just as for actions, store the `action' only, not
12351 the switch/case/break flesh.
12352 Don't parse the user action that might follow the guard, let...
12353 (readgram): do it, i.e., now, there can be an action after a
12355 In other words the guard is just explicitly optional.
12356 (packgram): Adjust.
12357 * src/output.c (guards_output): New.
12358 (output_parser): Call it when needed.
12359 (output): Also free the guard and attrs obstacks.
12360 * src/files.c, src/files.h (obstack_save): Remove.
12361 (output_files): Remove.
12362 As a result, if one needs the former `.act' file, using an
12363 appropriate skeleton which requires actions and guards is now
12365 * src/main.c (main): Adjust.
12366 * tests/semantic.at: New.
12367 * tests/regression.at: Use `input.y' as input file name.
12368 Avoid 8+3 problems by requiring input.c when the test needs the
12371 2001-12-27 Akim Demaille <akim@epita.fr>
12373 * src/reader.c (symbol_list_new): Be sure to initialize all the
12376 2001-12-27 Akim Demaille <akim@epita.fr>
12378 All the hacks using a final pseudo state are now useless.
12380 * src/LR0.c (set_state_table): state_table holds exactly nstates.
12381 * src/lalr.c (nLA): New.
12382 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
12383 instead of lookaheadsp from the pseudo state (nstate + 1).
12385 2001-12-27 Akim Demaille <akim@epita.fr>
12387 * src/output.c (action_row, token_actions): Use a state_t instead
12388 of a integer, and nlookaheads instead of the following state's
12391 2001-12-27 Akim Demaille <akim@epita.fr>
12393 * src/conflicts.c (log_resolution, flush_shift)
12394 (resolve_sr_conflict, set_conflicts, solve_conflicts)
12395 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
12396 (conflicts_print, print_reductions): Use a state_t instead of an
12397 integer when referring to a state.
12398 As much as possible, depend upon nlookaheads, instead of the
12399 `lookaheadsp' member of the following state (since lookaheads of
12400 successive states are successive, the difference between state n + 1
12401 and n served as the number of lookaheads for state n).
12402 * src/lalr.c (add_lookback_edge): Likewise.
12403 * src/print.c (print_core, print_actions, print_state)
12404 (print_results): Likewise.
12405 * src/print_graph.c (print_core, print_actions, print_state)
12406 (print_graph): Likewise.
12407 * src/conflicts.h: Adjust.
12409 2001-12-27 Akim Demaille <akim@epita.fr>
12411 * src/bison.hairy: Formatting/comment changes.
12413 Remove `register' indications.
12414 Add plenty of `static'.
12416 2001-12-27 Akim Demaille <akim@epita.fr>
12418 * src/output.c (prepare): Drop the muscle `ntbase' which
12419 duplicates ntokens.
12420 * src/bison.simple: Formatting/comment changes.
12421 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
12422 is an undocumented synonym.
12424 2001-12-22 Akim Demaille <akim@epita.fr>
12426 * src/output.c (output_table_data): Change the prototype to use
12427 `int' for array ranges: some invocations do pass an int, not a
12429 Reported by Wayne Green.
12431 2001-12-22 Akim Demaille <akim@epita.fr>
12433 Some actions of web2c.y are improperly triggered.
12434 Reported by Mike Castle.
12436 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
12437 * tests/regression.at (Web2c): Rename as...
12438 (Web2c Report): this.
12439 (Web2c Actions): New.
12441 2001-12-22 Akim Demaille <akim@epita.fr>
12443 Reductions in web2c.y are improperly reported.
12444 Reported by Mike Castle.
12446 * src/conflicts.c (print_reductions): Fix.
12447 * tests/regression.at (Web2c): New.
12449 2001-12-18 Akim Demaille <akim@epita.fr>
12451 Some host fail on `assert (!"foo")', which expands to
12452 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
12453 Reported by Nelson Beebee.
12455 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
12456 `#define it_succeeded 0' and `assert (it_succeeded)'.
12458 2001-12-17 Marc Autret <autret_m@epita.fr>
12460 * src/bison.simple: Don't hard code the skeleton line and filename.
12461 * src/output.c (output_parser): Rename 'line' as 'output_line'.
12462 New line counter 'skeleton_line' (skeleton-line muscle).
12464 2001-12-17 Paul Eggert <eggert@twinsun.com>
12466 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
12467 YYDEBUG must be defined to a nonzero value.
12469 * src/bison.simple (yytname): Do not assume that the user defines
12470 YYDEBUG to a properly parenthesized expression.
12472 2001-12-17 Akim Demaille <akim@epita.fr>
12474 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
12475 nlookaheads is a new member.
12477 * src/lalr.h (nlookaheads): Remove this orphan declaration.
12478 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
12481 2001-12-17 Akim Demaille <akim@epita.fr>
12483 * src/files.h, src/files.c (open_files, close_files): Remove.
12484 * src/main.c (main): Don't open/close files, nor invoke lex_free,
12486 * src/reader.c (reader): Do it.
12488 2001-12-17 Akim Demaille <akim@epita.fr>
12490 * src/conflicts.c (print_reductions): Formatting changes.
12492 2001-12-17 Akim Demaille <akim@epita.fr>
12494 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
12495 (flush_reduce): New.
12496 (resolve_sr_conflict): Adjust.
12498 2001-12-17 Akim Demaille <akim@epita.fr>
12500 * src/output.c (output_obstack): Be static and rename as...
12501 (format_obstack): this, to avoid any confusion with files.c's
12503 * src/reader.h (muscle_obstack): Move to...
12504 * src/output.h: here, since it's defined in output.c.
12506 2001-12-17 Akim Demaille <akim@epita.fr>
12508 * src/output.c (action_row, save_column, default_goto)
12509 (sort_actions, matching_state, pack_vector): Better variable
12512 2001-12-17 Akim Demaille <akim@epita.fr>
12514 * src/output.c: Various formatting changes.
12516 2001-12-17 Akim Demaille <akim@epita.fr>
12518 * src/files.c (output_files): Free the output_obstack.
12519 * src/main.c (main): Call print and print_graph conditionally.
12520 * src/print.c (print): Work unconditionally.
12521 * src/print_graph.c (print_graph): Work unconditionally.
12522 * src/conflicts.c (log_resolution): Output only if verbose_flag.
12524 2001-12-16 Marc Autret <autret_m@epita.fr>
12526 * src/output.c (actions_output): Fix. When we use %no-lines,
12527 there is one less line per action.
12529 2001-12-16 Marc Autret <autret_m@epita.fr>
12531 * src/bison.simple: Remove a useless #line directive.
12532 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
12533 * src/output.c (get_lines_number): New.
12534 (output_parser): Adjust, now takes care about the lines of a
12536 Fix line numbering.
12537 (actions_output): Computes the number of lines taken by actions.
12538 (output_master_parser): Insert new skeleton which is the name of
12539 the output parser file name.
12541 2001-12-15 Marc Autret <autret_m@epita.fr>
12543 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
12545 2001-12-15 Marc Autret <autret_m@epita.fr>
12547 * src/output.c (output_gram): Keep track of the hairy one.
12549 2001-12-15 Akim Demaille <akim@epita.fr>
12551 Make `make distcheck' work.
12553 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
12554 system.h which uses libgettext.h.
12556 2001-12-15 Akim Demaille <akim@epita.fr>
12558 * src/nullable.c (set_nullable): Useless rules must be skipped,
12559 otherwise, since we range over their symbols, we might look at a
12560 nonterminal which no longer ``exists'', i.e., it is not counted in
12561 `nvars', hence we overflow our arrays.
12563 2001-12-15 Akim Demaille <akim@epita.fr>
12565 The header can also be produced directly, without any obstack!
12568 * src/files.c, src/files.h (defines_obstack): Remove.
12569 (compute_header_macro): Global.
12570 (defines_obstack_save): Remove.
12571 * src/reader.c (parse_union_decl): No longer output to
12572 defines_obstack: its content can be found in the `stype' muscle
12574 (output_token_translations): Merge into...
12575 (symbols_output): this.
12577 (symbols_save): this.
12579 * src/output.c (header_output): New.
12582 2001-12-15 Akim Demaille <akim@epita.fr>
12584 * src/reader.c (parse_union_decl): Instead of handling two obstack
12585 simultaneously, use one to define the `stype' muscle, and use the
12586 value of the latter to fill defines_obstack.
12587 (copy_comment): Remove.
12588 (copy_comment2): Work for a single obstack.
12590 (copy_comment): this.
12592 2001-12-15 Akim Demaille <akim@epita.fr>
12594 * src/lex.c, src/lex.h (xgetc): No longer static.
12595 * src/reader.c (parse_union_decl): Revamp.
12597 2001-12-15 Akim Demaille <akim@epita.fr>
12599 Still making progress in separating Bison into (i) input, (ii)
12600 process, (iii) output: now we can directly output the parser file
12601 without using table_obstack at all.
12603 * src/files.c, src/files.h (table_obstack): Bye bye.
12604 (parser_file_name): New.
12605 * src/files.c (compute_output_file_names): Compute it.
12606 * src/output.c (actions_output, output_parser)
12607 (output_master_parser): To a file instead of an obstack.
12609 2001-12-15 Akim Demaille <akim@epita.fr>
12611 Attach actions to rules, instead of pre-outputting them to
12614 * src/gram.h (rule_t): action and action_line are new members.
12615 * src/reader.c (symbol_list): Likewise.
12616 (copy_action): Save the actions within the rule.
12617 (packgram): Save them in rule_table.
12618 * src/output.c (actions_output): New.
12619 (output_parser): Use it on `%%actions'.
12620 (output_rule_data): Don't free rule_table.
12622 (prepare): Don't save the `action' muscle.
12623 * src/bison.simple: s/%%action/%%actions/.
12625 2001-12-15 Akim Demaille <akim@epita.fr>
12627 * src/reader.c (copy_action): When --yacc, don't append a `;'
12628 to the user action: let it fail if lacking.
12629 Suggested by Arnold Robbins and Tom Tromey.
12631 2001-12-14 Akim Demaille <akim@epita.fr>
12633 * src/lex.c (literalchar): Simply return the char you decoded, non
12634 longer mess around with obstacks and int pointers.
12635 Adjust all callers.
12637 2001-12-14 Akim Demaille <akim@epita.fr>
12639 * src/lex.c (literalchar): Don't escape the special characters,
12640 just decode them, and keep them as char (before, eol was output as
12641 the 2 char string `\n' etc.).
12642 * src/output.c (output_rule_data): Use quotearg to output the
12645 2001-12-13 Paul Eggert <eggert@twinsun.com>
12647 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
12648 Do not infringe on the global user namespace when using C++.
12649 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
12650 All uses of `fprintf' and `stderr' changed.
12652 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
12654 2001-12-13 Akim Demaille <akim@epita.fr>
12656 The computation of nullable is broken: it doesn't handle empty
12659 * tests/torture.at (GNU AWK Grammar): New.
12660 * tests/sets.at (Nullable): New.
12661 * src/nullable.c (set_nullable): Instead of blindly looping over
12662 `ritems', loop over the rules, and then over their rhs's.
12664 Work around Autotest bugs.
12666 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
12667 frame, because Autotest understand lines starting with a `+' as
12668 traces from the shell. Then, they are not processed properly.
12669 Admittedly an Autotest bug, but we don't have time to wait for
12670 Autotest to catch up.
12671 * tests/regression.at (Broken Closure): Adjust to the new table
12674 * tests/sets.at: here.
12676 2001-12-13 Akim Demaille <akim@epita.fr>
12678 * src/closure.c (closure): Use nrules instead of playing tricks
12679 with BITS_PER_WORD.
12681 2001-12-13 Akim Demaille <akim@epita.fr>
12683 * src/print.c (print_actions): Output the handling of `$' as the
12684 traces do: shifting the token EOF. Before EOF was treated as a
12686 * tests/regression.at: Adjust some tests.
12687 * src/print_graph.c (print_core): Complete the set of items via
12688 closure. The next-to-final and final states are still unsatisfying,
12689 but that's to be addressed elsewhere.
12690 No longer output the rule numbers, but do output the state number.
12691 A single loop for the shifts + gotos is enough, but picked a
12692 distinct color for each.
12693 (print_graph): Initialize and finalize closure.
12695 2001-12-13 Akim Demaille <akim@epita.fr>
12697 * src/reader.c (readgram): Remove dead code, an strip useless
12699 (get_type): Remove, unused.
12701 2001-12-12 Akim Demaille <akim@epita.fr>
12703 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
12704 on that of lib/error.c.
12706 2001-12-12 Akim Demaille <akim@epita.fr>
12708 Some hosts don't like `/' in includes.
12710 * src/system.h: Include libgettext.h without qualifying the path.
12711 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
12714 2001-12-11 Marc Autret <autret_m@epita.fr>
12716 * src/output.c (output_parser): Remove useless muscle.
12718 2001-12-11 Marc Autret <autret_m@epita.fr>
12720 * src/bison.simple: Remove #line just before %%epilogue. It
12721 is now handled in ...
12722 * src/reader.c (read_additionnal_code): Add the output of a
12723 #line for the epilogue.
12725 2001-12-10 Marc Autret <autret_m@epita.fr>
12727 * src/reader.c (copy_definition): Re-use CPP-outed code which
12728 replace precedent remove.
12729 * src/bison.simple: Remove #line before %%prologue because
12730 %%input-line is wrong at this time.
12732 2001-12-10 Marc Autret <autret_m@epita.fr>
12734 * src/reader.c (symbols_output): Clean up.
12735 * src/output.c (output_gram, output): Clean up.
12737 2001-12-10 Akim Demaille <akim@epita.fr>
12739 * src/lalr.c (initialize_lookaheads): New. Extracted from...
12740 * src/LR0.c (set_state_table): here.
12741 * src/lalr.c (lalr): Call it.
12743 2001-12-10 Akim Demaille <akim@epita.fr>
12745 * src/state.h (shifts): Remove the `number' member: shifts are
12746 attached to state, hence no longer need to be labelled with a
12749 2001-12-10 Akim Demaille <akim@epita.fr>
12751 Now that states have a complete set of members, the linked list of
12752 shifts is useless: just fill directly the state's shifts member.
12754 * src/state.h (shifts): Remove the `next' member.
12755 * src/LR0.c (first_state, last_state): Remove.
12756 Adjust the callers.
12757 (augment_automaton): Don't look for the shifts that must be added
12758 a shift on EOF: it is those of the state we looked for! But now,
12759 since shifts are attached, it is no longer needed to looking
12760 merely by its id: its number.
12762 2001-12-10 Akim Demaille <akim@epita.fr>
12764 * src/LR0.c (augment_automaton): Better variable locality.
12765 Remove an impossible branch: if there is a state corresponding to
12766 the start symbol being shifted, then there is shift for the start
12767 symbol from the initial state.
12769 2001-12-10 Akim Demaille <akim@epita.fr>
12771 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
12772 only when appropriate: when insert_start_shifting_state' is not
12774 * tests/regression.at (Rule Line Numbers): Adjust.
12776 2001-12-10 Akim Demaille <akim@epita.fr>
12778 * src/LR0.c (augment_automaton): Now that all states have shifts,
12779 merge the two cases addition shifts to the initial state.
12781 2001-12-10 Akim Demaille <akim@epita.fr>
12783 * src/lalr.c (set_state_table): Move to...
12785 * src/lalr.c (lalr): Don't call it...
12786 * src/LR0.c (generate_states): do it.
12787 * src/LR0.h (first_state): Remove, only the table is used.
12789 2001-12-10 Akim Demaille <akim@epita.fr>
12791 * src/LR0.h (first_shift, first_reduction): Remove.
12792 * src/lalr.c: Don't use first_shift: find shifts through the
12795 2001-12-10 Akim Demaille <akim@epita.fr>
12797 * src/LR0.c: Attach shifts to states as soon as they are
12799 * src/lalr.c (set_state_table): Instead of assigning shifts to
12800 state, just assert that the mapping was properly done.
12802 2001-12-10 Akim Demaille <akim@epita.fr>
12804 * src/LR0.c (insert_start_shift): Rename as...
12805 (insert_start_shifting_state): this.
12806 (insert_eof_shifting_state, insert_accepting_state): New.
12807 (augment_automaton): Adjust.
12808 Better locality of the variables.
12809 When looking if the start_symbol is shifted from the initial
12810 state, using `while (... symbol != start_symbol ...)' sounds
12811 better than `while (... symbol < start_symbol ...)': If fail
12812 to see how the order between symbols could be relevant!
12814 2001-12-10 Akim Demaille <akim@epita.fr>
12816 * src/getargs.h: Don't declare `spec_name_prefix' and
12817 `spec_file_prefix', declared by src/files.h.
12818 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
12819 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
12820 * src/output.c (prepare): Adjust.
12821 * src/reader.c (symbols_output): Likewise.
12822 * src/vmsgetargs.c: Vaguely adjust, but who cares?
12824 2001-12-10 Akim Demaille <akim@epita.fr>
12826 * src/muscle_tab.c (muscle_init): NULL is a better default than
12829 2001-12-10 Akim Demaille <akim@epita.fr>
12831 * src/reader.c (reader): Calling symbols_output once is enough.
12833 2001-12-10 Akim Demaille <akim@epita.fr>
12835 Now that states have a complete set of members, the linked list of
12836 reductions is useless: just fill directly the state's reductions
12839 * src/state.h (struct reductions): Remove member `number' and
12841 * src/LR0.c (first_reduction, last_reduction): Remove.
12842 (save_reductions): Don't link the new reductions, store them in
12844 * src/lalr.c (set_state_table): No need to attach reductions to
12845 states, it's already done.
12846 * src/output.c (output_actions): No longer free the shifts, then
12847 the reductions, then the states: free all the states and their
12850 2001-12-10 Akim Demaille <akim@epita.fr>
12852 * src/options.c (OPTN, DRTV, BOTH): New.
12853 (option_table): Use them.
12855 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
12856 the job of system.h.
12857 * src/options.c: Don't include stdio.h and xalloc.h for the same
12860 2001-12-10 Akim Demaille <akim@epita.fr>
12862 * src/output.c (output, prepare): Make sure the values of the
12863 muscles `action' and `prologue' are 0-terminated.
12865 2001-12-10 Akim Demaille <akim@epita.fr>
12867 Clean up GCC warnings.
12869 * src/reader.c (copy_action): `buf' is not used.
12870 (parse_skel_decl): Be static.
12871 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
12872 * src/options.h (create_long_option_table): Have a real prototype.
12873 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
12874 (hash_delete_at): Return const void *.
12875 Adjust casts to preserve the const.
12877 2001-12-10 Akim Demaille <akim@epita.fr>
12879 * configure.in: Require 2.52g.
12880 M4 is not needed, but AUTOM4TE is.
12881 * m4/m4.m4: Remove.
12882 * tests/Makefile.am: Adjust.
12884 2001-12-10 Akim Demaille <akim@epita.fr>
12886 One structure for states is enough, even though theoretically
12887 there are LR(0) states and LALR(1) states.
12889 * src/lalr.h (state_t): Remove.
12890 (state_table): Be state_t **, not state_t *.
12891 * src/state.h (core, CORE_ALLOC): Rename as...
12892 (state_t, STATE_ALLOC): this.
12893 Add the LALR(1) members: shifts, reductions, errs.
12894 * src/LR0.c (state_table): Rename as...
12895 (state_hash): this, to avoid name clashes with the global
12897 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
12898 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
12900 2001-12-10 Akim Demaille <akim@epita.fr>
12902 Bison dumps core on bash.y.
12903 Reported by Pascal Bart.
12905 * src/warshall.c (bitmatrix_print): New.
12907 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
12908 j must be the outer loop.
12909 * tests/regression.at (Broken Closure): New.
12911 2001-12-05 Akim Demaille <akim@epita.fr>
12913 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
12915 Reported by Peter Hamorsky.
12917 2001-12-05 Akim Demaille <akim@epita.fr>
12919 * src/conflicts.c (err_table): Remove.
12920 (resolve_sr_conflict): Adjust.
12921 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
12923 (state_t.reductions, state_t.shifts): this.
12925 2001-12-05 Akim Demaille <akim@epita.fr>
12927 * src/reduce.c (reduce_grammar_tables): No longer disable the
12928 removal of useless rules via CPP but via `if (0)', so that the
12929 compiler still check the code is valid.
12930 For instance, it should have noticed `rline' no longer exists: use
12931 the `line' member of rule_t.
12932 * src/gram.c (dummy, rline): Remove, unused.
12934 2001-12-05 Akim Demaille <akim@epita.fr>
12936 * src/output.c (pack_vector): Use assert, not berror.
12937 * src/main.c (berror): Remove, unused.
12939 2001-12-05 Akim Demaille <akim@epita.fr>
12941 New experimental feature: if --verbose --trace output all the
12942 items of a state, not only its kernel.
12944 * src/print.c (print_core): If `trace_flag', then invoke closure
12945 before outputting the items of the state (print_core is no longer
12946 a correct name them).
12947 (print_results): Invoke new_closure/free_closure if needed.
12949 2001-12-05 Akim Demaille <akim@epita.fr>
12951 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
12952 * src/closure.c, src/closure.h (itemsetsize): Rename as...
12953 (nitemset): for consistency with the rest of the project.
12955 2001-12-05 Akim Demaille <akim@epita.fr>
12957 * src/closure.c (print_closure): Improve.
12958 (closure): Use it for printing input and output.
12960 2001-12-05 Akim Demaille <akim@epita.fr>
12962 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
12963 indexed by nonterminals.
12965 2001-12-05 Akim Demaille <akim@epita.fr>
12967 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
12969 * src/warshall.h: Remove accidental duplication of the content.
12971 2001-12-05 Akim Demaille <akim@epita.fr>
12973 * src/closure.c (set_fderives): De-obfuscate.
12975 2001-12-05 Akim Demaille <akim@epita.fr>
12977 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
12979 2001-12-05 Akim Demaille <akim@epita.fr>
12981 * src/closure.c (set_firsts): De-obfuscate.
12983 2001-12-05 Akim Demaille <akim@epita.fr>
12985 * src/output.c (action_row): De-obfuscate
12986 using the good o' techniques: arrays not pointers, variable
12987 locality, BITISSET, RESETBIT etc.
12989 2001-12-05 Akim Demaille <akim@epita.fr>
12991 Pessimize the code to simplify it: from now on, all the states
12992 have a valid SHIFTS, which NSHIFTS is possibly 0.
12994 * src/LR0.c (shifts_new): Be global and move to..
12995 * src/state.c, src/state.h: here.
12996 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
12997 * src/print_graph: Adjust.
12999 2001-12-05 Akim Demaille <akim@epita.fr>
13001 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
13002 * src/conflicts.c: Use it.
13003 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
13004 incorrectly ``simplified''.
13006 2001-12-05 Akim Demaille <akim@epita.fr>
13008 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
13009 using the good o' techniques: arrays not pointers, variable
13010 locality, BITISSET, RESETBIT etc.
13012 2001-12-05 Akim Demaille <akim@epita.fr>
13014 * src/state.h (SHIFT_SYMBOL): New.
13015 * src/conflicts.c: Use it to deobfuscate.
13017 2001-12-05 Akim Demaille <akim@epita.fr>
13019 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
13020 (print_reductions): De-obfuscate using the good o' techniques:
13021 arrays not pointers, variable locality, BITISSET.
13023 2001-12-05 Akim Demaille <akim@epita.fr>
13025 * src/conflicts.c (print_reductions): Arrays, not pointers.
13028 2001-12-05 Akim Demaille <akim@epita.fr>
13030 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13032 2001-12-05 Akim Demaille <akim@epita.fr>
13034 * src/conflicts.c (print_reductions): Improve variable locality.
13036 2001-12-05 Akim Demaille <akim@epita.fr>
13038 * src/conflicts.c (print_reductions): Pessimize, but clarify.
13040 2001-12-05 Akim Demaille <akim@epita.fr>
13042 * src/conflicts.c (print_reductions): Improve variable locality.
13044 2001-12-05 Akim Demaille <akim@epita.fr>
13046 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
13047 * src/lalr.c: Use them.
13049 2001-12-05 Akim Demaille <akim@epita.fr>
13051 * src/LR0.c (augment_automaton): Formatting changes.
13052 Better variable locality.
13054 2001-12-05 Akim Demaille <akim@epita.fr>
13056 * src/lalr.c (matrix_print): New.
13057 (transpose): Use it.
13058 Use arrays instead of pointers.
13060 2001-12-05 Akim Demaille <akim@epita.fr>
13062 * src/lalr.c (maxrhs): Move to...
13063 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
13064 * src/lalr.c (build_relations): Adjust.
13066 2001-12-05 Akim Demaille <akim@epita.fr>
13068 * src/lalr.c (transpose): Free the memory allocated to the
13069 argument, as it is replaced by the results by the unique caller.
13070 (build_relations): Merely invoke transpose: it handles the memory
13072 Improve variable locality.
13073 Avoid variables used as mere abbreviations.
13074 (compute_lookaheads): Use arrays instead of pointers.
13076 2001-12-05 Akim Demaille <akim@epita.fr>
13078 * src/lalr.c (initialize_F): Improve variable locality.
13079 Avoid variables used as mere abbreviations.
13081 2001-12-05 Akim Demaille <akim@epita.fr>
13083 * src/derives.c (print_derives): Display the ruleno.
13084 * src/lalr.c (initialize_F, transpose): Better variable locality
13085 to improve readability.
13086 Avoid variables used as mere abbreviations.
13088 2001-12-05 Akim Demaille <akim@epita.fr>
13090 * src/lalr.c (traverse): Use arrays instead of pointers.
13092 2001-12-05 Akim Demaille <akim@epita.fr>
13094 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13095 the handling of squeue.
13096 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13098 2001-12-05 Akim Demaille <akim@epita.fr>
13100 Because useless nonterminals are now kept alive (instead of being
13101 `destroyed'), we now sometimes examine them, and store information
13102 related to them. Hence we need to know their number, and adjust
13103 memory allocations.
13105 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13107 * src/LR0.c (allocate_itemsets): The memory allocated to
13108 `symbol_count' was used for two different purpose: once to count
13109 the number of occurrences of each symbol, and later reassigned to
13110 `shift_symbol', containing the symbol that can be shifted from a
13112 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13114 (new_itemsets): Allocate `shift_symbol' here.
13115 (allocate_itemsets): symbol_count includes useless nonterminals.
13116 Make room for them.
13117 (free_storage): Use `free', not `XFREE', for pointers that cannot
13120 2001-12-05 Akim Demaille <akim@epita.fr>
13122 * src/nullable.c (set_nullable): Deobfuscate the handling of
13124 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13126 2001-12-05 Akim Demaille <akim@epita.fr>
13128 * src/gram.c, src/gram.h (ritem_print): New.
13129 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
13130 (This useless function was defined only to work around VMS linkers
13131 that can't handle compilation units with variables only).
13132 * src/reduce.c (dump_grammar): Use it to trace the construction of
13135 2001-12-04 Paul Eggert <eggert@twinsun.com>
13137 * src/bison.simple (union yyalloc): Change member names
13138 to be the same as the stack names.
13139 (yyparse): yyptr is now union yyalloc *, not char *.
13140 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
13141 and may generate better code on some machines.
13142 (yystpcpy): Use prototype if __STDC__ is defined, not just
13143 if __cplusplus is defined.
13145 2001-11-30 Akim Demaille <akim@epita.fr>
13147 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
13148 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
13149 Gettext doesn't compile cleanly, and dies with -Werror.
13150 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
13151 Include WARNING_CFLAGS here.
13152 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
13153 before being defined.
13155 2001-11-27 Paul Eggert <eggert@twinsun.com>
13157 * lib/quotearg.h (quotearg_n, quotearg_n_style):
13158 First arg is int, not unsigned.
13159 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
13160 (SIZE_MAX, UINT_MAX): New macros.
13161 (quotearg_n_options): Abort if N is negative.
13162 Avoid overflow check on hosts where size_t is 64 bits and int
13163 is 32 bits, as overflow is impossible there.
13164 Fix off-by-one typo that caused unnecessary reallocation.
13166 2001-11-29 Paul Eggert <eggert@twinsun.com>
13168 Name space cleanup in generated parser.
13170 * doc/bison.texinfo (Bison Parser): Discuss system headers
13171 and their effect on the user name space.
13173 * src/bison.simple:
13174 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
13175 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
13176 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
13178 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
13179 on user names when possible.
13181 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
13182 Simplify test for whather <alloca.h> exists.
13184 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
13186 (<stdio.h>): Include if YYDEBUG.
13188 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
13189 ! defined (yyoverflow) && ! defined (yymemcpy).
13191 (yymemcpy, yyparse): Rename local variables as needed so that
13192 they all begin with 'yy'.
13194 (yystrlen, yystpcpy): New functions.
13196 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
13199 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
13200 instead of relying on string.h functions. Use YYSTACK_ALLOC
13201 and YYSTACK_FREE instead of malloc and free.
13203 2001-11-30 Akim Demaille <akim@epita.fr>
13205 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
13206 before their first uses.
13207 (YYBISON, YYPURE): Move to the top of the output.
13209 2001-11-30 Akim Demaille <akim@epita.fr>
13211 * tests/reduce.at (Useless Nonterminals): Fix.
13213 2001-11-30 Akim Demaille <akim@epita.fr>
13215 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
13216 if body instead of `;' to pacify GCC's warnings.
13218 2001-11-30 Akim Demaille <akim@epita.fr>
13220 Instead of mapping the LHS of unused rules to -1, keep the LHS
13221 valid, but flag the rules as invalid.
13223 * src/gram.h (rule_t): `useful' is a new member.
13224 * src/print.c (print_grammar): Adjust.
13225 * src/derives.c (set_derives): Likewise.
13226 * src/reader.c (packgram, reduce_output): Likewise.
13227 * src/reduce.c (reduce_grammar_tables): Likewise.
13228 * tests/reduce.at (Underivable Rules, Useless Rules): New.
13230 2001-11-30 Akim Demaille <akim@epita.fr>
13232 * src/reduce.c (reduce_output): Formatting changes.
13233 * src/print.c (print_results, print_grammar): Likewise.
13234 * tests/regression.at (Rule Line Numbers)
13235 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
13237 2001-11-30 Akim Demaille <akim@epita.fr>
13239 * src/reduce.c (nonterminals_reduce): Instead of throwing away
13240 useless nonterminals, move them at the end of the symbol arrays.
13241 (reduce_output): Adjust.
13242 * tests/reduce.at (Useless Nonterminals): Adjust.
13244 2001-11-30 Akim Demaille <akim@epita.fr>
13246 * src/reduce.c: Various comment/formatting changes.
13247 (nonterminals_reduce): New, extracted from...
13248 (reduce_grammar_tables): here.
13249 (reduce_grammar): Call nonterminals_reduce.
13251 2001-11-29 Paul Eggert <eggert@twinsun.com>
13253 * src/bison.simple (YYSTACK_REALLOC): Remove.
13254 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
13255 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
13257 (union yyalloc): New type.
13258 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
13259 an arbitrary restriction on hosts where size_t is wider than int.
13261 (yyparse): Don't dump core if alloca or malloc fails; instead, report
13262 a parser stack overflow. Allocate just one block of memory for all
13263 three stacks, instead of allocating three blocks; this typically is
13264 faster and reduces fragmentation.
13266 Do not limit the number of items in the stack to a value that fits
13267 in 'int', as this is an arbitrary limit on hosts with 64-bit
13268 size_t and 32-bit int.
13270 2001-11-29 Marc Autret <autret_m@epita.fr>
13272 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
13273 of defining YYERROR_VERBOSE.
13274 [AT_DATA]: $4 is now out of C declarations in the prologue.
13276 2001-11-28 Marc Autret <autret_m@epita.fr>
13278 * src/reader.c (parse_dquoted_param): New.
13279 (parse_skel_decl): Use it.
13280 * src/lex.h: Add its prototype.
13281 * src/lex.c (literalchar): Become not static.
13283 2001-11-28 Marc Autret <autret_m@epita.fr>
13285 * src/output.h: And put its extern declaration here.
13286 * src/output.c (error_verbose): Define here.
13287 (prepare): Echo name modification.
13288 * src/getargs.h: Clean its extern declaration.
13289 * src/getargs.c (error_verbose_flag): Remove.
13290 (getargs): Remove case 'e'.
13291 * src/options.c (option_table): 'error-verbose' is now seen as simple
13295 * src/reader.c (read_declarations): Remove case tok_include.
13296 (parse_include_decl): Remove.
13297 * src/lex.h (token_t): Remove tok_include.
13298 * src/options.c (option_table): 'include' is now a simple command line
13301 2001-11-28 Marc Autret <autret_m@epita.fr>
13303 * src/bison.simple: Adjust muscle names.
13304 * src/muscle_tab.c (muscle_init): Also rename the muscles.
13305 * src/output.c (prepare): s/_/-/ for the muscles names.
13306 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
13308 2001-11-28 Marc Autret <autret_m@epita.fr>
13310 * src/bison.simple: Fix debug.
13311 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
13313 2001-11-28 Akim Demaille <akim@epita.fr>
13315 * src/LR0.c (shifts_new): New.
13316 (save_shifts, insert_start_shift, augment_automaton): Use it.
13318 2001-11-28 Akim Demaille <akim@epita.fr>
13320 * src/closure.c (closure): `b' and `ruleno' denote the same value:
13323 2001-11-28 Akim Demaille <akim@epita.fr>
13325 * src/closure.c (closure): Instead of looping over word in array
13326 then bits in words, loop over bits in array.
13328 2001-11-28 Akim Demaille <akim@epita.fr>
13330 * src/closure.c (closure): No longer optimize the special case
13331 where all the bits of `ruleset[r]' are set to 0, to make the code
13334 2001-11-28 Akim Demaille <akim@epita.fr>
13336 * src/closure.c (closure): `r' and `c' are new variables, used to
13337 de-obfuscate accesses to RULESET and CORE.
13339 2001-11-28 Akim Demaille <akim@epita.fr>
13341 * src/reduce.c (reduce_print): Use ngettext.
13342 (dump_grammar): Improve the trace accuracy.
13344 2001-11-28 Akim Demaille <akim@epita.fr>
13346 * src/reduce.c (dump_grammar): Don't translate trace messages.
13348 2001-11-28 Akim Demaille <akim@epita.fr>
13350 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
13351 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
13352 as all tags are free'ed afterwards.
13353 From Enrico Scholz.
13355 2001-11-27 Paul Eggert <eggert@twinsun.com>
13357 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
13358 use alloca when we didn't want to, and vice versa.
13360 2001-11-27 Marc Autret <autret_m@epita.fr>
13362 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
13364 * src/output.c (prepare): Remove its update.
13366 2001-11-27 Marc Autret <autret_m@epita.fr>
13368 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
13369 Use %error-verbose.
13371 2001-11-27 Marc Autret <autret_m@epita.fr>
13373 * src/bison.simple: Remove YYERROR_VERBOSE using.
13374 Use %%error_verbose.
13375 (yyparse): Likewise.
13376 * src/output.c (prepare): Give its final value.
13377 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
13378 * src/getargs.h: Add its extern declaration.
13379 * src/getargs.c (error_verbose_flag): New int.
13380 (getargs): Update to catch new case.
13381 * src/options.c (option_table): 'error-verbose' is a new option.
13382 (shortopts): Update.
13384 2001-11-27 Akim Demaille <akim@epita.fr>
13386 * src/system.h: Use intl/libgettext.h.
13387 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
13389 2001-11-27 Akim Demaille <akim@epita.fr>
13391 * tests/torture.at (Exploding the Stack Size with Malloc):
13392 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
13394 2001-11-27 Akim Demaille <akim@epita.fr>
13396 * src/files.c: Include error.h.
13397 Reported by Hans Aberg.
13399 2001-11-26 Marc Autret <autret_m@epita.fr>
13401 * src/reader.c (parse_include_decl): New, not yet implemented.
13402 (read_declarations): Add case tok_include.
13403 * src/getargs.h (include): Add its extern definition.
13404 * src/getargs.c (include): New const char *.
13405 (getargs): Add case '-I'.
13406 * src/options.c (option_table): Add include as command line and
13408 * src/lex.h (token_t): Add tok_include.
13410 2001-11-26 Akim Demaille <akim@epita.fr>
13412 * src/reader.c (readgram): Make sure rules for mid-rule actions
13413 have a lineno equal to that of their host rule.
13414 Reported by Hans Aberg.
13415 * tests/regression.at (Rule Line Numbers): New.
13417 2001-11-26 Akim Demaille <akim@epita.fr>
13419 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
13422 2001-11-26 Akim Demaille <akim@epita.fr>
13424 * src/complain.c, src/complain.h (error): Remove, provided by
13427 2001-11-26 Akim Demaille <akim@epita.fr>
13429 * src/reader.c (read_declarations): Don't abort on tok_illegal,
13430 issue an error message.
13431 * tests/regression.at (Invalid %directive): New.
13432 Reported by Hans Aberg.
13434 2001-11-26 Akim Demaille <akim@epita.fr>
13436 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
13437 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13439 2001-11-26 Akim Demaille <akim@epita.fr>
13441 * src/conflicts.c (conflicts_print): Don't complain at all when
13442 there are no reduce/reduce conflicts, and as many shift/reduce
13443 conflicts as expected.
13444 * tests/regression.at (%expect right): Adjust.
13446 2001-11-23 Akim Demaille <akim@epita.fr>
13448 * lib/alloca.c: Update, from fileutils.
13450 2001-11-23 Akim Demaille <akim@epita.fr>
13452 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
13454 2001-11-23 Akim Demaille <akim@epita.fr>
13456 * src/system.h: Include alloca.h.
13457 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
13459 2001-11-23 Akim Demaille <akim@epita.fr>
13461 * src/print_graph.c (print_actions): Remove `rule', unused.
13462 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
13463 pacify GCC's signed < unsigned warnings.
13464 * src/closure.c (itemsetsize): Likewise.
13465 * src/reader.c (symbol_list_new): Static.
13467 2001-11-23 Akim Demaille <akim@epita.fr>
13469 Attaching lineno to buckets is stupid, since only one copy of each
13470 symbol is kept, only the line of the first occurrence is kept too.
13472 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
13473 * src/reader.c (rline_allocated): Remove, unused.
13474 (symbol_list): Have a `line' member.
13475 (symbol_list_new): New.
13476 (readgram): Use it.
13477 * src/print.c (print_grammar): Output the rule line numbers.
13478 * tests/regression.at (Solved SR Conflicts)
13479 (Unresolved SR Conflicts): Adjust.
13480 Reported by Hans Aberg.
13482 2001-11-22 Marc Autret <autret_m@epita.fr>
13484 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
13486 2001-11-22 Marc Autret <autret_m@epita.fr>
13488 * src/muscle_tab.c (muscle_init): Remove initialization of
13490 * src/output.c (output_master_parser): Do it here.
13492 2001-11-20 Akim Demaille <akim@epita.fr>
13495 * configure.in (ALL_LINGUAS): Adjust.
13496 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
13497 longer contains strings to translate.
13499 2001-11-19 Akim Demaille <akim@epita.fr>
13501 * src/conflicts.c (conflicts_print): Add a missing \n.
13503 2001-11-19 Akim Demaille <akim@epita.fr>
13505 * src/nullable.c (nullable_print): New.
13506 (set_nullable): Call it when tracing.
13507 Better locality of variables.
13509 2001-11-19 Akim Demaille <akim@epita.fr>
13511 * src/print.c (print_actions): Better locality of variables.
13513 2001-11-19 Akim Demaille <akim@epita.fr>
13515 * src/derives.c (print_derives): Fix and enrich.
13516 * src/closure.c (print_fderives): Likewise.
13518 2001-11-19 Akim Demaille <akim@epita.fr>
13520 * src/closure.c (itemsetend): Remove, replaced with...
13521 (itemsetsize): new.
13523 2001-11-19 Akim Demaille <akim@epita.fr>
13525 * src/LR0.c (kernel_end): Remove, replaced with...
13526 (kernel_size): new.
13528 2001-11-19 Akim Demaille <akim@epita.fr>
13530 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
13533 2001-11-19 Akim Demaille <akim@epita.fr>
13535 * src/closure.c (closure): Use arrays instead of pointers to clarify.
13537 2001-11-19 Akim Demaille <akim@epita.fr>
13539 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
13541 * src/LR0.c: Likewise.
13542 (allocate_itemsets): Use arrays instead of pointers to clarify.
13544 2001-11-19 Akim Demaille <akim@epita.fr>
13546 * src/getargs.c (statistics_flag): Replace with...
13548 (longopts): Accept --trace instead of --statistics.
13549 * src/getargs.h, src/options.c: Adjust.
13550 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
13551 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
13553 2001-11-19 Akim Demaille <akim@epita.fr>
13555 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
13556 pointers to clarify the code.
13557 (save_reductions, save_shifts): Factor common parts of alternatives.
13559 2001-11-19 Akim Demaille <akim@epita.fr>
13561 * src/LR0.c (new_state, get_state): Complete TRACE code.
13562 * src/closure.c: Include `reader.h' to get `tags', needed by the
13564 Rename the conditional DEBUG as TRACE.
13565 Output consistently TRACEs to stderr, not stdout.
13566 * src/derives.c: Likewise.
13567 * src/reduce.c: (inaccessable_symbols): Using if is better style
13569 Use `#if TRACE' instead of `#if 0' for tracing code.
13571 2001-11-19 Akim Demaille <akim@epita.fr>
13573 * src/system.h (LIST_FREE, shortcpy): New.
13574 * src/LR0.c: Use them.
13575 * src/output.c (free_itemsets, free_reductions, free_shifts):
13576 Remove, replaced by LIST_FREE.
13578 2001-11-19 Akim Demaille <akim@epita.fr>
13580 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
13581 (REDUCTIONS_ALLOC): New.
13582 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
13585 2001-11-19 Akim Demaille <akim@epita.fr>
13587 * src/LR0.c (new_state): Complete trace code.
13588 * src/nullable.c (set_nullable): Don't translate traces.
13590 2001-11-19 Akim Demaille <akim@epita.fr>
13592 * src/print_graph.c (print_core): Better locality of variables.
13593 * src/print.c (print_core): Likewise.
13595 2001-11-19 Akim Demaille <akim@epita.fr>
13597 * src/vcg.c: You do the output, so you are responsible of the
13598 handling of VCG syntax, in particular: use quotearg.
13599 * src/print_graph.c: Don't.
13600 (print_actions): Don't output the actions as part of the nodes,
13601 since that's the job of the edges.
13602 (print_state): Don't output by hand: fill the node description,
13603 and ask for its output.
13605 2001-11-19 Akim Demaille <akim@epita.fr>
13607 * src/bison.simple (yyparse): When verbosely reporting an error,
13608 no longer put additional quotes around token names.
13609 * tests/calc.at: Adjust.
13611 2001-11-19 Akim Demaille <akim@epita.fr>
13613 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
13614 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
13615 * src/output.c: Adjust.
13617 2001-11-19 Akim Demaille <akim@epita.fr>
13619 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
13621 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
13623 2001-11-19 Akim Demaille <akim@epita.fr>
13625 * src/gram.h (rule_t): New.
13627 (rrhs, rlhs): Remove, part of state_t.
13628 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
13629 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13630 * src/reader.c, src/reduce.c: Adjust.
13632 2001-11-19 Akim Demaille <akim@epita.fr>
13634 * src/reader.c (symbols_output): New, extracted from...
13635 (packsymbols): Here.
13638 2001-11-19 Akim Demaille <akim@epita.fr>
13640 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
13641 (maxrhs): this new function.
13643 2001-11-19 Akim Demaille <akim@epita.fr>
13645 * src/lalr.c (F): New macro to access the variable F.
13648 2001-11-19 Akim Demaille <akim@epita.fr>
13650 * src/lalr.h (LA): New macro to access the variable LA.
13651 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13652 * src/lalr.c: Adjust.
13654 2001-11-19 Akim Demaille <akim@epita.fr>
13656 * src/lalr.c (initialize_LA): Only initialize LA. Let...
13657 (set_state_table): handle the `lookaheads' members.
13659 2001-11-19 Akim Demaille <akim@epita.fr>
13661 * src/lalr.h (lookaheads): Removed array, whose contents is now
13663 (state_t): this structure.
13664 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13667 2001-11-19 Akim Demaille <akim@epita.fr>
13669 * src/lalr.h (consistent): Removed array, whose contents is now
13671 (state_t): this structure.
13672 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13675 2001-11-19 Akim Demaille <akim@epita.fr>
13677 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
13678 contents are now members of...
13679 (state_t): this structure.
13680 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13683 2001-11-19 Akim Demaille <akim@epita.fr>
13685 * src/lalr.h (state_t): New.
13686 (state_table): Be a state_t * instead of a core **.
13687 (accessing_symbol): Remove, part of state_t.
13688 * src/lalr.c: Adjust.
13689 (set_accessing_symbol): Merge into...
13690 (set_state_table): this.
13691 * src/print_graph.c, src/conflicts.c: Adjust.
13693 2001-11-14 Akim Demaille <akim@epita.fr>
13695 * tests/calc.at, tests/output.at, tests/regression.at,
13696 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
13697 now the tests are run in private dirs, therefore AC_CLEANUP and
13698 family can be simplified to 0-ary.
13699 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
13700 use abs. path to find config.h.
13701 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
13702 stderr, there can be way too much random noise.
13703 Instead pass -Werror to GCC and rely on the exit status.
13704 Reported by Wolfram Wagner.
13706 2001-11-14 Akim Demaille <akim@epita.fr>
13708 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
13709 defined only if yyoverflow is defined, to avoid `warning: unused
13711 Reported by The Test Suite.
13713 2001-11-14 Akim Demaille <akim@epita.fr>
13715 * src/print.c: Include reduce.h.
13716 Reported by Hans Aberg.
13718 2001-11-14 Akim Demaille <akim@epita.fr>
13720 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
13721 Revert a previous patch: these are really const.
13722 * src/conflicts.c (conflict_report): Additional useless pair of
13723 braces to pacify GCC's warnings for `if () if () {} else {}'.
13724 * src/lex.c (parse_percent_token): Replace equal_offset with
13727 Be sure to strdup `arg' when used, since there is no reason for
13728 token_buffer not to change.
13730 2001-11-14 Akim Demaille <akim@epita.fr>
13732 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
13734 * src/main.c (main): Use them.
13735 Suggested by Hans Aberg.
13737 2001-11-12 Akim Demaille <akim@epita.fr>
13739 * src/system.h (ngettext): Now that we use ngettext, be sure to
13740 provide a default definition when NLS are not used.
13742 2001-11-12 Akim Demaille <akim@epita.fr>
13744 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
13745 Use @kbd to denote user input.
13746 (Language and Grammar): ANSIfy the example.
13747 Adjust its layout for info/notinfo.
13748 (Location Tracking Calc): Output error messages to stderr.
13749 Output locations in a more GNUtically correct way.
13750 Fix a couple of Englishos.
13751 Adjust @group/@end group pairs.
13753 2001-11-12 Akim Demaille <akim@epita.fr>
13755 %expect was not functioning at all.
13757 * src/conflicts.c (expected_conflicts): Set to -1.
13758 (conflict_report): Use ngettext.
13759 (conflicts_print): Check %expect and make its violation an error.
13760 * doc/bison.texinfo (Expect Decl): Adjust.
13761 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
13762 * tests/regression.at (%expect not enough, %expect right)
13763 (%expect too much): New.
13765 2001-11-12 Akim Demaille <akim@epita.fr>
13767 * tests/regression.at (Conflicts): Rename as...
13768 (Unresolved SR Conflicts): this.
13769 (Solved SR Conflicts): New.
13771 2001-11-12 Akim Demaille <akim@epita.fr>
13773 * src/reduce.c (print_results): Rename as...
13774 (reduce_output): This.
13775 Output to OUT, passed as argument, instead of output_obstack.
13776 (dump_grammar): Likewise.
13777 (reduce_free): New.
13779 (reduce_grammar): No longer call reduce_output, since...
13780 * src/print.c (print_results): do it.
13781 * src/main.c (main): Call reduce_free;
13783 2001-11-12 Akim Demaille <akim@epita.fr>
13785 * src/conflicts.c (print_reductions): Accept OUT as argument.
13786 Output to it, not to output_obstack.
13787 * src/print.c (print_actions): Adjust.
13789 2001-11-12 Akim Demaille <akim@epita.fr>
13791 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
13792 the result instead of using...
13793 (src_total, rrc_total, src_count, rrc_count): Remove.
13794 (any_conflicts): Remove.
13795 (print_conflicts): Split into...
13796 (conflicts_print, conflicts_output): New.
13797 * src/conflicts.h: Adjust.
13798 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
13799 * src/print.c (print_grammar): Issue `\n' between two rules.
13800 * tests/regression.at (Conflicts): New.
13801 Reported by Tom Lane.
13803 2001-11-12 Akim Demaille <akim@epita.fr>
13805 * tests/regression.at (Invalid input): Remove, duplicate with
13806 ``Invalid input: 1''.
13808 2001-11-12 Akim Demaille <akim@epita.fr>
13810 * tests/torture.at (AT_DATA_STACK_TORTURE)
13811 (Exploding the Stack Size with Alloca)
13812 (Exploding the Stack Size with Malloc): New.
13814 2001-11-12 Akim Demaille <akim@epita.fr>
13816 * src/bison.simple (YYSTACK_REALLOC): New.
13817 (yyparse) [!yyoverflow]: Use it and free the old stack.
13818 Reported by Per Allansson.
13820 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
13822 * src/bison.simple: Define type yystype instead of YYSTYPE, and
13823 define CPP macro, which substitute YYSTYPE by yystype.
13824 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
13825 with yyltype/YYLTYPE. This allows inclusion of the generated
13826 header within the parser if the compiler, such as GGC, accepts
13827 multiple equivalent #defines.
13830 2001-11-05 Akim Demaille <akim@epita.fr>
13832 * src/reader.c (symbols_output): New, extracted from...
13833 (packsymbols): here.
13836 2001-11-05 Akim Demaille <akim@epita.fr>
13838 * src/lex.c (parse_percent_token): s/quotearg/quote/.
13840 2001-11-05 Akim Demaille <akim@epita.fr>
13842 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
13845 2001-11-05 Akim Demaille <akim@epita.fr>
13847 * src/options.h (struct option_table_struct): set_flags is void*.
13848 * src/options.c (longopts): Support `--output' and `%output'.
13850 * src/lex.h (tok_setopt): Remove, replaced with...
13851 (tok_intopt, tok_stropt): these new guys.
13852 * src/lex.c (getopt.h): Not needed.
13853 (token_buffer, unlexed_token_buffer): Not const.
13854 (percent_table): Promote `-' over `_' in directive names.
13855 Active `%name-prefix', `file-prefix', and `output'.
13856 (parse_percent_token): Accept possible arguments to directives.
13857 Promote `-' over `_' in directive names.
13859 2001-11-04 Akim Demaille <akim@epita.fr>
13861 * doc/bison.texinfo (Decl Summary): Split the list into
13862 `directives for grammars' and `directives for bison'.
13864 Add description of `%name-prefix', `file-prefix', and `output'.
13865 Promote `-' over `_' in directive names.
13866 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
13867 Simplify the description of `--name-prefix'.
13868 Promote `-' over `_' in directive names.
13869 Promote `--output' over `--output-file'.
13870 Fix the description of `--defines'.
13871 * tests/output.at: Exercise %file-prefix and %output.
13873 2001-11-02 Akim Demaille <akim@epita.fr>
13875 * doc/refcard.tex: Update.
13877 2001-11-02 Akim Demaille <akim@epita.fr>
13879 * src/symtab.h (SUNDEF): New.
13880 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
13881 stand for `uninitialized', instead of 0.
13882 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
13883 * src/lex.c (lex): Adjust.
13885 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
13887 Let yylex return it instead of a plain 0.
13888 Reported by Dick Streefland.
13890 2001-11-02 Akim Demaille <akim@epita.fr>
13892 * tests/regression.at (Mixing %token styles): New test.
13894 2001-11-02 Akim Demaille <akim@epita.fr>
13896 * src/reader.c (parse_thong_decl): Formatting changes.
13897 (token_translations_init): New, extracted from...
13898 (packsymbols): Here.
13901 2001-11-01 Akim Demaille <akim@epita.fr>
13903 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
13904 Check that `9foo.y' produces correct cpp guards.
13905 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
13909 2001-11-01 Akim Demaille <akim@epita.fr>
13911 * tests/regression.at (Invalid input: 2): New.
13912 * src/lex.c (unlexed_token_buffer): New.
13913 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
13917 2001-11-01 Akim Demaille <akim@epita.fr>
13919 * tests/calc.at: Catch up with 1.30.
13920 * configure.in: Bump to 1.49a.
13921 Adjust to newer Autotest.
13923 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
13925 * src/conflicts.c: Move global variables rrc_total and src_total ...
13926 (print_conflicts): here.
13927 * src/output.c (output): Free global variable user_toknums.
13928 * src/lex.c (token_obstack): Become static.
13930 2001-10-18 Akim Demaille <akim@epita.fr>
13932 * tests/atlocal.in (GCC): Add.
13933 * tests/calc.at: s/m4_match/m4_bmatch/.
13934 s/m4_patsubst/m4_bpatsubst/.
13935 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
13936 * configure.in: AC_SUBST(GCC).
13938 2001-10-14 Marc Autret <autret_m@epita.fr>
13940 * src/options.c (create_long_option_table): Fix.
13942 2001-10-10 Akim Demaille <akim@epita.fr>
13944 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
13946 2001-10-04 Akim Demaille <akim@epita.fr>
13948 * src/reader.c (parse_union_decl): Push the caracters in
13949 union_obstack, not attrs_obstack.
13951 2001-10-04 Akim Demaille <akim@epita.fr>
13953 Merge in the branch 1.29.
13955 * src/reader.c (packsymbols): Use a temporary obstack for
13956 `%%tokendef', since output_stack is already used elsewhere.
13958 2001-10-02 Akim Demaille <akim@epita.fr>
13962 2001-10-02 Akim Demaille <akim@epita.fr>
13966 2001-10-02 Akim Demaille <akim@epita.fr>
13968 * tests/regression.at (Invalid CPP headers): New.
13969 From Alexander Belopolsky.
13970 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
13972 2001-10-02 Akim Demaille <akim@epita.fr>
13974 * tests/regression.at (Invalid input): New.
13975 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
13978 2001-10-02 Akim Demaille <akim@epita.fr>
13980 * tests/calc.at: Now that --debug works, the tests must be adjusted.
13982 2001-10-02 Akim Demaille <akim@epita.fr>
13984 * src/output.c (output_parser): Assert `skeleton'.
13985 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
13989 2001-10-01 Marc Autret <autret_m@epita.fr>
13991 * src/lex.h: Echo modifications.
13992 * src/lex.c (unlex): Parameter is now token_t.
13995 2001-10-01 Marc Autret <autret_m@epita.fr>
13997 * src/main.c: Include lex.h.
14000 2001-09-29 Akim Demaille <akim@epita.fr>
14002 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
14004 2001-09-28 Akim Demaille <akim@epita.fr>
14006 * tests/testsuite.at: Update to newer Autotest.
14007 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
14009 2001-09-27 Akim Demaille <akim@epita.fr>
14011 Position independent wrapper.
14013 * tests/bison: Remove.
14014 * tests/bison.in: New.
14015 * configure.in: Adjust.
14017 2001-09-27 Paul Eggert <eggert@twinsun.com>
14019 Port quotearg fixes from tar 1.13.24.
14021 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
14023 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
14024 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
14026 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
14027 * m4/mbrtowc.m4: New file.
14028 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
14029 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
14031 2001-09-27 Akim Demaille <akim@epita.fr>
14035 2001-09-27 Akim Demaille <akim@epita.fr>
14039 2001-09-25 Akim Demaille <akim@epita.fr>
14041 * src/system.h: Include `xalloc.h'.
14042 Remove it from the C files.
14043 * src/files.c (output_files): Free the obstacks.
14044 * src/lex.c (init_lex): Rename as...
14047 * src/main.c (main): Use it.
14049 2001-09-24 Marc Autret <autret_m@epita.fr>
14051 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
14052 to output informations in fout (FILE*).
14053 (open_graph, close_graph): Likewise.
14054 (output_graph, output_edge, output_node): Likewise.
14055 * src/vcg.h: Update function prototypes.
14056 * src/print_graph.c (print_graph): Open output graph file.
14057 (print_actions): Adjust.
14058 * src/files.h: Remove extern declaration.
14059 * src/files.c: Remove graph_obstack declaration.
14060 (open_files): Remove graph_obstack initialization.
14061 (output_files): Remove graph_obstack saving.
14063 2001-09-24 Marc Autret <autret_m@epita.fr>
14065 * src/files.c (compute_output_file_names): Fix.
14067 2001-09-24 Marc Autret <autret_m@epita.fr>,
14068 Akim Demaille <akim@epita.fr>
14070 * src/reader.c (reader): Remove call to free_symtab ().
14071 * src/main.c (main): Call it here.
14073 * src/conflicts.c (initialize_conflicts): Rename as...
14074 (solve_conflicts): this.
14075 * src/print.c (print_core, print_actions, print_state)
14076 (print_grammar): Dump to a file instead a `output_obstack'.
14077 (print_results): Dump `output_obstack', and then proceed with the
14079 * src/files.c (compute_output_file_names, close_files): New.
14080 (output_files): Adjust.
14081 * src/main.c (main): Adjust.
14083 2001-09-23 Marc Autret <autret_m@epita.fr>
14085 * src/files.c (compute_header_macro): Computes header macro name
14086 from spec_defines_file when given.
14088 2001-09-23 Marc Autret <autret_m@epita.fr>
14090 * src/files.c (output_files): Add default extensions.
14092 2001-09-22 Akim Demaille <akim@epita.fr>
14094 * src/conflicts.c (finalize_conflicts): Rename as...
14095 (free_conflicts): this.
14097 2001-09-22 Akim Demaille <akim@epita.fr>
14099 * src/gram.c (gram_free): Rename back as...
14101 (output_token_translations): Free `token_translations'.
14102 * src/symtab.c (free_symtab): Free the tag field.
14104 2001-09-22 Akim Demaille <akim@epita.fr>
14106 Remove `translations' as it is always set to true.
14108 * src/gram.h: Adjust.
14109 * src/reader.c (packsymbols, parse_token_decl): Adjust
14110 * src/print.c (print_grammar): Adjust.
14111 * src/output.c (output_token_translations): Adjust.
14112 * src/lex.c (lex): Adjust.
14113 * src/gram.c: Be sure the set pointers to NULL.
14114 (dummy): Rename as...
14117 2001-09-22 Akim Demaille <akim@epita.fr>
14119 * configure.in: Invoke AM_LIB_DMALLOC.
14120 * src/system.h: Use dmalloc.
14121 * src/LR0.c: Be sure to have pointers initialized to NULL.
14122 (allocate_itemsets): Allocate kernel_items only if needed.
14124 2001-09-22 Akim Demaille <akim@epita.fr>
14126 * configure.in: Bump to 1.29b.
14127 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
14128 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
14129 need xmalloc.c in calc.y.
14132 2001-09-21 Akim Demaille <akim@epita.fr>
14135 * Makefile.maint, config/config.guess, config/config.sub,
14136 * config/missing: Update from masters.
14137 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
14139 * configure.in (ALL_LINGUAS): Add `tr'.
14141 2001-09-21 Akim Demaille <akim@epita.fr>
14143 * tests/Makefile.am (package.m4): Move to...
14144 ($(srcdir)/$(TESTSUITE)): here.
14146 2001-09-20 Akim Demaille <akim@epita.fr>
14148 * src/complain.c: No longer try to be standalone: use system.h.
14149 Don't assume __STDC__ is defined to 1. Just test if it is defined.
14150 * src/complain.h: Likewise.
14151 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
14152 Remove the unused variable `n'.
14153 From Albert Chin-A-Young.
14155 2001-09-18 Marc Autret <autret_m@epita.fr>
14157 * doc/bison.1: Update.
14158 * doc/bison.texinfo (Bison Options): Update --defines and --graph
14160 (Option Cross Key): Update.
14163 2001-09-18 Marc Autret <autret_m@epita.fr>
14165 * tests/regression.at: New test (comment in %union).
14167 2001-09-18 Marc Autret <autret_m@epita.fr>
14169 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
14171 Reported by Keith Browne.
14173 2001-09-18 Marc Autret <autret_m@epita.fr>
14175 * tests/output.at: Add tests for --defines and --graph.
14177 2001-09-18 Marc Autret <autret_m@epita.fr>
14179 * tests/output.at: Removes tests of %{header,src}_extension features.
14181 2001-09-18 Akim Demaille <akim@epita.fr>
14183 * tests/Makefile.am (package.m4): New.
14184 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
14185 (_AT_CHECK_CALC_ERROR): Likewise.
14186 Factor the `, ' part of verbose error messages.
14188 2001-09-18 Marc Autret <autret_m@epita.fr>
14190 * src/getargs.c (longopts): Declare --defines and --graph as options
14191 with optional arguments.
14192 * src/files.h: Add extern declarations.
14193 * src/files.c (spec_graph_file, spec_defines_file): New.
14194 (output_files): Update.
14195 Remove CPP-outed code.
14197 2001-09-18 Marc Autret <autret_m@epita.fr>
14199 Turn off %{source,header}_extension feature.
14201 * src/files.c (compute_exts_from_gf): Update.
14202 (compute_exts_from_src): Update.
14203 (output_files): CPP-out useless code.
14204 * src/files.h: Remove {header,source}_extension extern declarations.
14205 * src/reader.c (parse_dquoted_param): CPP-out.
14206 (parse_header_extension_decl): Remove.
14207 (parse_source_extension_decl): Remove.
14208 (read_declarations): Remove cases tok_{hdrext,srcext}.
14209 * src/lex.c (percent_table): Remove {header,source}_extension entries.
14210 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
14212 2001-09-10 Akim Demaille <akim@epita.fr>
14214 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
14215 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
14216 (AT_CHECK_OUTPUT): this.
14217 Merely check ls' exit status, its output is useless.
14219 2001-09-10 Akim Demaille <akim@epita.fr>
14221 * tests/calc.at: Use m4_match.
14222 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
14224 2001-09-10 Marc Autret <autret_m@epita.fr>,
14225 Akim Demaille <akim@epita.fr>
14227 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
14229 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
14231 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
14232 * src/lex.h: Adjust prototype.
14233 (token_t): Add `tok_undef'.
14234 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
14235 (parse_percent_token): Now returns token_t.
14236 Add default statement in switch.
14237 (lex): Separate `c' as an input variable, from the token_t result
14239 (unlexed): Is a token_t.
14241 2001-09-10 Akim Demaille <akim@epita.fr>
14243 * configure.in: Bump to 1.29a.
14245 2001-09-07 Akim Demaille <akim@epita.fr>
14249 2001-08-30 Akim Demaille <akim@epita.fr>
14251 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
14252 * m4/atconfig.m4: Remove.
14253 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
14254 * tests/bison: New.
14255 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
14256 m4_if, m4_patsubst, and m4_regexp.
14257 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
14258 `input' file instead of echo.
14260 2001-08-29 Akim Demaille <akim@epita.fr>
14264 2001-08-29 Akim Demaille <akim@epita.fr>
14268 2001-08-29 Paul Eggert <eggert@twinsun.com>
14270 * src/bison.simple (yyparse): Don't take the address of an
14271 item before the start of an array, as that doesn't conform to
14274 2001-08-29 Robert Anisko <anisko_r@epita.fr>
14276 * doc/bison.texinfo (Location Tracking Calc): New node.
14278 2001-08-29 Paul Eggert <eggert@twinsun.com>
14280 * src/output.c (output): Do not define const, as this now
14281 causes more problems than it cures.
14283 2001-08-29 Akim Demaille <akim@epita.fr>
14285 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
14287 Be sure to tag the `detailmenu'.
14289 2001-08-29 Akim Demaille <akim@epita.fr>
14291 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
14292 download in a tmp dir.
14294 2001-08-28 Marc Autret <autret_m@epita.fr>
14296 * config/depcomp: New file.
14298 2001-08-28 Marc Autret <autret_m@epita.fr>
14300 * doc/bison.1 (mandoc): Adjust.
14301 From Juan Manuel Guerrero.
14303 2001-08-28 Marc Autret <autret_m@epita.fr>
14305 * src/print_graph.c (print_state): Fix.
14307 2001-08-27 Marc Autret <autret_m@epita.fr>
14309 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
14311 Echo modifications to the functions prototypes.
14312 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
14314 2001-08-27 Marc Autret <autret_m@epita.fr>
14316 * src/vcg.c: Include `xalloc.h'.
14317 (add_colorentry): New.
14318 (add_classname): New.
14319 (add_infoname): New.
14320 * src/vcg.h: Add new prototypes.
14322 2001-08-27 Akim Demaille <akim@epita.fr>
14324 * Makefile.maint: Sync. again with CVS Autoconf.
14326 2001-08-27 Akim Demaille <akim@epita.fr>
14328 * Makefile.maint: Formatting changes.
14329 (po-update, cvs-update, update): New targets.
14332 2001-08-27 Akim Demaille <akim@epita.fr>
14334 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
14335 * Makefile.maint: Sync. with CVS Autoconf.
14337 2001-08-27 Marc Autret <autret_m@epita.fr>
14339 * src/vcg.h (struct infoname_s): New.
14340 (struct colorentry_s): New.
14341 (graph_s): New fields {vertical,horizontal}_order in structure.
14342 Add `infoname' field.
14343 Add `colorentry' field;
14344 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
14345 (G_HORIZONTAL_ORDER): New.
14347 (G_COLORENTRY): New.
14348 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
14349 Add output of `infoname'.
14350 Add output of `colorentry'.
14352 2001-08-27 Marc Autret <autret_m@epita.fr>
14354 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
14355 This one shadowed a global parameter.
14357 2001-08-24 Marc Autret <autret_m@epita.fr>
14359 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
14360 instead of `unsigned'.
14361 (print_state): Do not call obstack_object_size () in obstack_grow ()
14362 to avoid macro variables shadowing.
14364 2001-08-23 Marc Autret <autret_m@epita.fr>
14366 * src/lex.c (percent_table): Typo: s/naem/name/.
14368 Normalize new options declarations.
14370 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
14372 * tests/suite.at: Exercise %header_extension and %source_extension.
14374 2001-08-16 Marc Autret <autret_m@epita.fr>
14376 * src/reader.c (parse_dquoted_param): New.
14377 (parse_header_extension_decl): Use it.
14378 (parse_source_extension_decl): Likewise.
14380 2001-08-16 Marc Autret <autret_m@epita.fr>
14382 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
14383 (get_xxxx_str): Use assert () instead of complain ().
14384 Remove return invokations in default cases.
14385 (get_decision_str): Modify default behaviour. Remove second argument.
14386 Echo modifications on calls.
14387 (output_graph): Fix.
14389 2001-08-16 Marc Autret <autret_m@epita.fr>
14391 * src/getargs.c (usage): Update with ``-g, --graph''.
14393 2001-08-16 Marc Autret <autret_m@epita.fr>
14395 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
14396 (Option Cross Key): Likewise.
14397 * doc/bison.1: Update.
14399 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
14401 * src/output.c (output_master_parser): Don't finish action_obstack.
14402 (output_parser): Don't care about the muscle action, here.
14403 (prepare): Copy the action_obstack in the action muscle.
14404 (output): Free action_obstack.
14406 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
14408 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
14409 will contain `%union' declaration.
14410 (parse_union_decl): Delete #line directive output.
14411 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
14412 informations about %union.
14413 (parse_union_decl): Copy the union_obstack in the muscle stype.
14414 * src/bison.simple: Add new #line directive.
14415 Add typdef %%stype YYSTYPE.
14417 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
14419 * src/bison.simple: Add new `#line' directive.
14421 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
14423 * src/bison.simple: New `#line' directive.
14424 * src/output.c (output_parser): Support new dynamic muscle input_line.
14426 2001-09-22 Marc Autret <autret_m@epita.fr>
14428 * src/output.c (output_master_parser): New.
14429 (output_parser): Be more re-entrant.
14431 2001-09-21 Marc Autret <autret_m@epita.fr>
14433 * src/reader.c (copy_definition, parse_union_decl): Update and use
14435 (copy_action): Likewise.
14436 Use obstack_1grow ().
14437 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
14439 2001-09-21 Marc Autret <autret_m@epita.fr>
14441 * src/options.c (option_table): Adjust.
14442 * src/lex.c (parse_percent_token): Fix.
14444 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
14446 * src/options.c (symtab.h): Include it, need by lex.h.
14448 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
14450 * src/lex.c (parse_percent_token): Change type of variable `tx', which
14451 is now an option_table_struct*.
14452 (option_strcmp): New function option_strcmp.
14453 (parse_percent_token): Call option_strcmp.
14454 * src/getargs.c (xalloc.h, options.h): Include it.
14455 (getargs): Call create_long_option_table.
14456 (getargs): Free longopts at the end of the function.
14457 (shortopts): Move in options.c.
14458 * src/options.c (create_long_option_table): New function. Convert
14459 information from option_table to option structure.
14460 * src/reader.c (options.h): Include it.
14462 * src/Makefile.am: Adjust.
14463 * src/options.c (option_table): Create from longopts and percent_table.
14464 * src/getargs.c (longopts): Delete.
14465 * src/lex.c (struct percent_table_struct): Delete.
14466 (percent_table): Delete.
14467 (options.h): Include it.
14468 * src/options.c: Create.
14469 * src/options.h: Create.
14470 Declare enum opt_access_e.
14471 Define struct option_table_struct.
14473 2001-09-20 Marc Autret <autret_m@epita.fr>
14475 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
14478 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
14480 * src/bison.simple: s/%%filename/%%skeleton.
14481 * src/muscle_tab.c (getargs.h): Include it.
14482 (muscle_init): Insert new muscle skeleton.
14484 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
14486 * src/output.c (output_parser): Delete unused variable actions_dumped.
14488 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
14490 * src/output.c (output): Delete call to reader_output_yylsp.
14491 * src/reader.c (reader): Likewise.
14492 * src/reader.h: Delete declaration of reader_output_yylsp.
14494 2001-09-02 Marc Autret <autret_m@epita.fr>
14496 * src/reader.c: Include muscle_tab.h.
14497 (parse_union_decl): Update.
14498 (parse_macro_decl): Rename parse_muscle_decl.
14499 Update to use renamed functions and variable.
14500 (read_declarations, copy_action, read_additionnal_code, : Updated
14501 with correct variables and functions names.
14502 (packsymbols, reader): Likewise.
14504 * src/reader.h (muscle_obstack): Extern declaration update.
14506 * src/output.c: Include muscle_tab.h
14507 In all functions using macro_insert, change by using muscle_insert ().
14508 (macro_obstack): Rename muscle_obstack.
14509 Echo modifications in the whole file.
14510 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
14511 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
14512 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
14514 * src/muscle_tab.h: Update double inclusion macros.
14515 (macro_entry_s): Rename muscle_entry_s.
14518 * src/muscle_tab.c: Include muscle_tab.h.
14519 Rename macro_tabble to muscle_table.
14520 (mhash1, mhash2, mcmp): Use muscle_entry.
14521 (macro_init): Rename muscle_init. Update.
14522 (macro_insert): Rename muscle_insert. Update.
14523 (macro_find): Rename muscle_find. Update.
14525 * src/main.c: Include muscle_tab.h.
14526 (main): Call muscle_init ().
14527 * src/Makefile.am (bison_SOURCES): Echo modifications.
14529 2001-09-02 Marc Autret <autret_m@epita.fr>
14531 Now the files macro_tab.[ch] are named muscle_tab.[ch].
14533 * src/muscle_tab.c, src/muscle_tab.h: Add files.
14535 2001-09-02 Marc Autret <autret_m@epita.fr>
14537 * src/macrotab.c, src/macrotab.h: Remove.
14539 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
14541 * src/reader.c (copy_guard): Use muscle to specify the `#line'
14544 2001-09-01 Marc Autret <autret_m@epita.fr>
14546 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
14547 to an explicit value to activate the feature. We do it here.
14549 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
14551 * src/output.c (prepare): Delete the `filename' muscule insertion.
14552 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
14553 (parse_union_decl): Likewise.
14554 * src/macrotab.c (macro_init): Initialize filename by infile.
14556 2001-08-31 Marc Autret <autret_m@epita.fr>
14558 * src/bison.simple (YYLSP_NEEDED): New definition.
14559 * src/output.c (prepare): Add macro insertion of `locations_flag'
14561 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
14563 * src/output.c (prepare): Delete insertion of previous muscles,
14564 and insert the `prefix' muscles.
14565 * src/macrotab.c (macro_init): Likewise.
14566 (macro_init): Initialization prefix directive by `yy'.
14567 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
14568 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
14569 yylval, yydebug, yyerror, yynerrs and yyparse.
14570 New directive `#define' to substitute yydebug, ... with option
14573 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
14575 * src/main.c (main): Standardize.
14576 * src/output.c (output_table_data, output_parser): Likewise.
14577 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
14579 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
14581 * src/reader.c (read_additionnal_code): Rename %%user_code to
14583 * src/output.c (output): Rename %%declarations to %%prologue.
14584 * src/bison.simple: Echo modifications.
14586 2001-08-31 Marc Autret <autret_m@epita.fr>
14588 * src/reader.c (readgram): CleanUp.
14589 (output_token_defines): Likewise.
14590 (packsymbols): Likewise.
14591 (reader): Likewise.
14592 * src/output.c (output): CPP-out useless code.
14594 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
14596 * src/reader.c (reader): Delete obsolete call to function
14597 output_trailers and output_headers.
14598 * src/output.h: Remove obsolete functions prototypes of output_headers
14599 and output_trailers.
14601 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
14603 * src/main.c: Include macrotab.h.
14604 * src/macrotab.h (macro_entry_s): Constify fields.
14605 Adjust functions prototypes.
14606 * src/macrotab.c (macro_insert): Constify key and value.
14607 (macro_find): Constify key.
14608 (macro_insert): Include 'xalloc.h'
14609 (macro_insert): Use XMALLOC.
14610 (macro_find): Constify return value.
14611 * src/output.c (output_table_data): Rename table to table_data.
14612 (output_parser): Constify macro_key, macro_value.
14614 2001-08-30 Marc Autret <autret_m@epita.fr>
14616 * src/reader.c (parse_skel_decl): New.
14617 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
14618 * src/lex.h (token_t): New token `tok_skel'.
14619 * src/lex.c (percent_table): Add skeleton option entry.
14622 2001-08-29 Marc Autret <autret_m@epita.fr>
14624 * src/bison.simple: Add %%user_code directive at the end.
14625 * src/reader.c (read_additionnal_code): New.
14627 * src/output.c (output_program): Remove.
14630 2001-08-28 Marc Autret <autret_m@epita.fr>
14632 * src/output.c (output_actions): Clean up.
14633 (output_gram): CPP-out useless code.
14634 * src/reader.c (reader): Clean up, CPP-out useless code.
14636 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
14638 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
14640 * src/bison.simple: Add `%%definitions'.
14642 2001-08-28 Marc Autret <autret_m@epita.fr>
14644 * config/depcomp: New file.
14646 2001-08-27 Paul Eggert <eggert@twinsun.com>
14648 * src/bison.simple (yyparse): Don't take the address of an
14649 item before the start of an array, as that doesn't conform to
14652 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
14654 * src/output.c (output): Remove the initialization of the macro
14655 obstack. It was done too late here.
14657 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
14659 (reader): Initialize the macro obstack here, since we need it to grow
14660 '%define' directives.
14662 * src/reader.h: Declare the macro obstack as extern.
14664 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
14666 * src/output.c (output_parser): Fix. Store single '%' characters in
14667 the output obstack instead of throwing them away.
14669 2001-08-27 Akim Demaille <akim@epita.fr>
14671 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
14673 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
14675 * lib/Makefile.am: Adjust.
14677 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
14679 * src/bison.simple: Update and add '%%' directives.
14681 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
14683 * src/reader.c (reader): Remove calls to 'output_headers' and
14684 'output_trailers'. Remove some C output.
14685 (readgram): Disable a piece of code that was writing a default
14686 definition for 'YYSTYPE'.
14687 (reader_output_yylsp): Remove.
14688 (packsymbols): Output token defintions to a macro.
14689 (copy_definition): Disable C output.
14691 * src/reader.c (parse_macro_decl): New function used to parse macro
14693 (copy_string2): Put the body of copy_string into this new function.
14694 Add a parameter to let the caller choose whether he wants to copy the
14695 string delimiters or not.
14696 (copy_string): Be a simple call to copy_string2 with the last argument
14698 (read_declarations): Add case for macro definition.
14699 (copy_identifier): New.
14700 (parse_macro_decl): Read macro identifiers using copy_identifier
14703 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
14705 * src/output.c (prepare): Add prefixed names.
14706 (output_parser): Output semantic actions.
14707 (output_parser): Fix bug on '%%line' directives.
14709 * src/output.c (output_headers): Remove. The C code printed by this
14710 function should now be in the skeletons.
14711 (output_trailers): Remove.
14712 (output): Disable call to 'reader_output_yylsp'.
14713 (output_rule_data): Do not output tables to the table obstack.
14715 * src/output.c: Remove some C dedicated output.
14716 Improve the use of macro and output obstacks.
14717 (output_defines): Remove.
14719 * src/output.c (output_token_translations): Associate 'translate'
14720 table with a macro. No output to the table obstack.
14721 (output_gram): Same for 'rhs' and 'prhs'.
14722 (output_stos): Same for 'stos'.
14723 (output_rule_data): Same for 'r1' and 'r2'.
14724 (token_actions): Same for 'defact'.
14725 (goto_actions): Same for 'defgoto'.
14726 (output_base): Same for 'pact' and 'pgoto'.
14727 (output_table): Same for 'table'.
14728 (output_check): Same for 'check'.
14730 * src/output.c (output_table_data): New function.
14731 (output_short_table): Remove.
14732 (output_short_or_char_table): Remove.
14734 * src/output.c (output_parser): Replace most of the skeleton copy code
14735 with something new. Skeletons are now processed character by character
14736 rather than line by line, and Bison looks for '%%' macros. This is the
14737 first step in making Bison's output process (a lot) more flexible.
14738 (output_parser): Use the macro table.
14740 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
14742 * src/main.c (main): Initialize the macro table.
14744 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
14746 * src/lex.c (percent_table): Add tok_define.
14747 * src/lex.h: Add tok_define.
14749 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
14751 * src/macrotab.c: New file.
14752 * src/macrotab.h: New file.
14753 * src/Makefile.am: Update.
14755 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
14757 * lib/hash.c: New file.
14758 * lib/hash.h: New file.
14759 * lib/Makefile.am: Update.
14761 2001-08-15 Akim Demaille <akim@epita.fr>
14765 2001-08-15 Marc Autret <autret_m@epita.fr>
14767 * src/reader.c (readgram): Indent output macro YYSTYPE.
14768 (packsymbols): Likewise.
14769 (output_token_defines): Likewise.
14770 * src/files.c: Standardize.
14771 (compute_header_macro): New.
14772 (defines_obstack_save): New. Use compute_header_macro.
14773 (output_files): Update. Use defines_obstack_save.
14775 2001-08-15 Akim Demaille <akim@epita.fr>
14777 * doc/bison.texinfo (Table of Symbols): Document
14778 YYSTACK_USE_ALLOCA.
14780 2001-08-15 Akim Demaille <akim@epita.fr>
14782 * missing: Update from CVS Automake.
14783 * config/config.guess, config/config.sub, config/texinfo.tex:
14784 Update from gnu.org.
14786 2001-08-15 Akim Demaille <akim@epita.fr>
14788 * Makefile.maint: Sync with CVS Autoconf.
14790 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
14792 * doc/bison.texinfo: Include GNU Free Documentation License from
14794 * doc/fdl.texi: Add to package.
14796 2001-08-14 Marc Autret <autret_m@epita.fr>
14798 Turn on %{source,header}_extension features.
14800 * src/lex.c (percent_table): Un-CPP out header_extension and
14802 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
14803 (compute_exts_from_src): Remove conditions. It restores priorities
14806 2001-08-14 Marc Autret <autret_m@epita.fr>
14808 * src/files.c (compute_base_names): Add extensions computing when
14809 `--file-prefix' used.
14810 Standardize function calls.
14812 2001-08-13 Marc Autret <autret_m@epita.fr>
14814 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
14815 defining it (defined but null disables alloca).
14817 2001-08-13 Marc Autret <autret_m@epita.fr>
14819 * src/bison.simple (_yy_memcpy): CPP reformat.
14821 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
14823 * tests/atconfig.in (CPPFLAGS): Fix.
14825 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
14827 * doc/bison.texinfo: Include GNU General Public License from
14829 * doc/gpl.texi: Add to package.
14831 2001-08-10 Marc Autret <autret_m@epita.fr>
14833 * src/print_graph.h: Fix.
14834 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
14836 2001-08-10 Akim Demaille <akim@epita.fr>
14838 * src/system.h: Provide default declarations for stpcpy, strndup,
14841 2001-08-10 Robert Anisko <anisko_r@epita.fr>
14843 * doc/bison.texinfo (Locations): Update @$ stuff.
14845 2001-08-09 Robert Anisko <anisko_r@epita.fr>
14847 * src/bison.simple (YYLLOC_DEFAULT): Update.
14850 2001-08-08 Marc Autret <autret_m@epita.fr>
14852 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
14853 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
14854 Reported by Fabrice Bauzac.
14856 2001-08-08 Marc Autret <autret_m@epita.fr>
14858 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
14859 * src/vcg.c (output_node): Fix.
14860 * src/vcg.h: Cleanup.
14861 * src/print_graph.c: Add comments.
14862 (node_output_size): New global variable. Simplify the formatting of
14863 the VCG graph output.
14864 (print_actions): Unused code is now used. It notifies the final state
14865 and no action states in the VCG graph. It also give the reduce actions.
14866 The `shift and goto' edges are red and the `go to state' edges are
14868 Get the current node name and node_obstack by argument.
14869 (node_obstack): New variable.
14870 (print_state): Manage node_obstack.
14871 (print_core): Use node_obstack given by argument.
14872 A node is not only computed here but in print_actions also.
14873 (print_graph): CPP out useless code instead of commenting it.
14875 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
14877 * tests/atconfig.in (CPPFLAGS): Fix.
14879 2001-08-07 Akim Demaille <akim@epita.fr>
14881 * src/print_graph.c (quote): New.
14882 (print_core): Use it.
14884 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
14886 * src/vcg.c (complain.h): Include it.
14887 Unepitaize `return' invocations.
14888 [NDEBUG] (main): Remove.
14889 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
14890 * src/files.c (open_files): Initialize graph_obstack.
14891 * src/print_graph.c (print_actions): CPP out useless code.
14892 (print_core): Don't output the last `\n' in labels.
14894 * src/files.c (output_files): Output the VCG file.
14895 * src/main.c (main): Invoke print_graph ();
14897 2001-08-06 Marc Autret <autret_m@epita.fr>
14899 Automaton VCG graph output.
14900 Using option ``-g'' or long option ``--graph'', you can generate
14901 a gram_filename.vcg file containing a VCG description of the LALR (1)
14902 automaton of your grammar.
14904 * src/main.c: Call to print_graph() function.
14905 * src/getargs.h: Update.
14906 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
14907 (graph_flag): New flag.
14908 (longopts): Update.
14909 (getargs): Add case `g'.
14910 * src/files.c (graph_obstack): New obstack struct.
14911 (open_files): Initialize new obstack.
14912 (output_files): Saves graph_obstack if required.
14913 * src/files.h (graph_obstack): New extern declaration.
14914 * src/Makefile.am: Add new source files.
14916 2001-08-06 Marc Autret <autret_m@epita.fr>
14918 * src/print_graph.c, src/print_graph.h (graph): New.
14919 * src/vcg.h: New file.
14920 * src/vcg.c: New file, VCG graph handling.
14922 2001-08-06 Marc Autret <autret_m@epita.fr>
14924 Add of %source_extension and %header_extension which specify
14925 the source or/and the header output file extension.
14927 * src/files.c (compute_base_names): Remove initialisation of
14928 src_extension and header_extension.
14929 (compute_exts_from_gf): Update.
14930 (compute_exts_from_src): Update.
14931 (output_files): Update.
14932 * src/reader.c (parse_header_extension_decl): New.
14933 (parse_source_extension_decl): New.
14934 (read_declarations): New case statements for the new tokens.
14935 * src/lex.c (percent_table): Add entries for %source_extension
14936 and %header_extension.
14937 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
14939 2001-08-06 Marc Autret <autret_m@epita.fr>
14941 * configure.in: Bump to 1.28c.
14942 * doc/bison.texinfo: Texinfo thingies.
14944 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
14946 * tests/atconfig.in (CPPFLAGS): Add.
14947 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
14949 2001-08-03 Akim Demaille <akim@epita.fr>
14953 2001-08-03 Akim Demaille <akim@epita.fr>
14955 * tests/Makefile.am (check-local): Ship testsuite.
14956 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
14957 Include `string.h'.
14959 2001-08-03 Akim Demaille <akim@epita.fr>
14961 * configure.in: Try using -Wformat when compiling.
14963 2001-08-03 Akim Demaille <akim@epita.fr>
14965 * configure.in: Bump to 1.28b.
14967 2001-08-03 Akim Demaille <akim@epita.fr>
14969 * src/complain.c: Adjust strerror_r portability issues.
14971 2001-08-03 Akim Demaille <akim@epita.fr>
14975 2001-08-03 Akim Demaille <akim@epita.fr>
14977 * src/getargs.c, src/getarg.h (skeleton)): Constify.
14978 * src/lex.c (literalchar): Avoid name clashes on `buf'.
14979 * src/getargs.c: Include complain.h.
14980 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
14981 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
14983 2001-08-03 Akim Demaille <akim@epita.fr>
14985 * src/reader.c (readgram): Display hidden chars in error messages.
14987 2001-08-03 Akim Demaille <akim@epita.fr>
14989 Update to gettext 0.10.39.
14991 2001-08-03 Akim Demaille <akim@epita.fr>
14993 * lib/strspn.c: New.
14995 2001-08-01 Marc Autret <autret_m@epita.fr>
14997 * doc/bison.texinfo: Update.
14998 * doc/bison.1 (mandoc): Update.
14999 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
15000 * src/files.c: Support output files extensions computing.
15001 (src_extension): New static variable.
15002 (header_extension): New static variable.
15003 (tr): New function.
15004 (get_extension_index): New function, gets the index of an extension
15005 filename in a string.
15006 (compute_exts_from_gf): New function, computes extensions from the
15007 grammar file extension.
15008 (compute_exts_from_src): New functions, computes extensions from the
15009 C source file extension, file given by ``-o'' option.
15010 (compute_base_names): Update.
15011 (output_files): Update.
15013 2001-08-01 Robert Anisko <anisko_r@epita.fr>
15015 * doc/bison.texi: Document @$.
15016 (Locations): New section.
15018 2001-07-18 Akim Demaille <akim@epita.fr>
15020 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
15021 * config/prev-version.txt, config/move-if-change: New.
15022 * Makefile.am: Adjust.
15024 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
15026 * src/bison.simple (yyparse): Suppress warning `comparaison
15027 between signed and unsigned'.
15029 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
15031 * src/getargs.h (raw_flag): Remove.
15032 * src/getargs.c: Die on `-r'/`--raw'.
15033 * src/lex.c (parse_percent_token): Die on `%raw'.
15034 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
15035 * tests/calc.at: Suppress test with option `--raw'.
15037 2001-07-14 Akim Demaille <akim@epita.fr>
15040 * configure.in: Require Autoconf 2.50.
15041 Update to gettext 0.10.38.
15043 2001-03-16 Akim Demaille <akim@epita.fr>
15045 * doc/bison.texinfo: ANSIfy the examples.
15047 2001-03-16 Akim Demaille <akim@epita.fr>
15049 * getargs.c (skeleton): New variable.
15050 (longopts): --skeleton is a new option.
15051 (shortopts, getargs): -S is a new option.
15052 * getargs.h: Declare skeleton.
15053 * output.c (output_parser): Use it.
15055 2001-03-16 Akim Demaille <akim@epita.fr>
15057 * m4/strerror_r.m4: New.
15058 * m4/error.m4: Run AC_FUNC_STRERROR_R.
15059 * lib/error.h, lib/error.c: Update.
15061 2001-03-16 Akim Demaille <akim@epita.fr>
15063 * src/getargs.c (longopts): Clean up.
15065 2001-02-21 Akim Demaille <akim@epita.fr>
15067 * src/reader.c (gensym): `gensym_count' is your own.
15068 Use a static buf to create the symbol name, as token_buffer is no
15071 2001-02-08 Akim Demaille <akim@epita.fr>
15073 * src/conflicts.c (conflict_report): Be sure not to append to res
15074 between two calls, which could happen if both first sprintf were
15075 skipped, but not the first cp += strlen.
15077 2001-02-08 Akim Demaille <akim@epita.fr>
15079 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
15080 New, from fileutils 4.0.37.
15081 * configure.in: Require Autoconf 2.49c. I took some time before
15082 making this decision. This is the only way out for portability
15083 issues in Bison, it would mean way too much duplicate effort to
15084 import in Bison features implemented in 2.49c since 2.13.
15085 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15087 2001-02-02 Akim Demaille <akim@epita.fr>
15089 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
15090 * lib/xalloc.h, lib/xmalloc.c: Update.
15092 2001-01-19 Akim Demaille <akim@epita.fr>
15094 Get rid of the ad hoc handling of token_buffer in the scanner: use
15097 * src/lex.c (token_obstack): New.
15098 (init_lex): Initialize it. No longer call...
15099 (grow_token_buffer): this. Remove it.
15100 Adjust all the places which used it to use the obstack.
15102 2001-01-19 Akim Demaille <akim@epita.fr>
15104 * src/lex.h: Rename all the tokens:
15105 s/\bENDFILE\b/tok_eof/g;
15106 s/\bIDENTIFIER\b/tok_identifier/g;
15108 Let them be enums, not #define, to ease debugging.
15109 Adjust all the code.
15111 2001-01-18 Akim Demaille <akim@epita.fr>
15113 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15114 * src/lex.c (maxtoken, grow_token_buffer): Static.
15116 2001-01-18 Akim Demaille <akim@epita.fr>
15118 Since we now use obstacks, more % directives can be enabled.
15120 * src/lex.c (percent_table): Also accept `%yacc',
15121 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15123 Handle the actions for `%semantic_parser' and `%pure_parser' here,
15124 instead of returning a token.
15125 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
15126 * src/reader.c (read_declarations): Adjust.
15127 * src/files.c (open_files): Don't call `compute_base_names', don't
15128 compute `attrsfile' since they depend upon data which might be
15129 *in* the input file now.
15130 (output_files): Do it here.
15131 * src/output.c (output_headers): Document the fact that this patch
15132 introduces a guaranteed SEGV for semantic parsers.
15133 * doc/bison.texinfo: Document them.
15134 * tests/suite.at: Exercise these %options.
15136 2000-12-20 Akim Demaille <akim@epita.fr>
15138 Also handle the output file (--verbose) with obstacks.
15140 * files.c (foutput): Remove.
15141 (output_obstack): New.
15142 Adjust all dependencies.
15143 * src/conflicts.c: Return a string.
15144 * src/system.h (obstack_grow_string): Rename as...
15145 (obstack_sgrow): this. Be ready to work with non literals.
15146 (obstack_fgrow4): New.
15148 2000-12-20 Akim Demaille <akim@epita.fr>
15150 * src/files.c (open_files): Fix the computation of short_base_name
15151 in the case of `-o foo.tab.c'.
15153 2000-12-20 Akim Demaille <akim@epita.fr>
15155 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
15156 (copy_dollar): Now that everything uses obstacks, get rid of the
15159 2000-12-20 Akim Demaille <akim@epita.fr>
15161 * src/files.c (open_files): Actually the `.output' file is based
15162 on the short_base_name, not base_name.
15163 * tests/suite.at (Checking output file names): Adjust.
15165 2000-12-20 Akim Demaille <akim@epita.fr>
15167 * src/bison.s1: Remove, we now use directly...
15168 * src/bison.simple: this.
15169 * src/Makefile.am: Use pkgdata instead of data.
15171 2000-12-20 Akim Demaille <akim@epita.fr>
15173 * src/files.c (guard_obstack): New.
15174 (open_files): Initialize it.
15175 (output_files): Dump it...
15176 * src/files.h: Export it.
15177 * src/reader.c (copy_guard): Use it.
15179 2000-12-19 Akim Demaille <akim@epita.fr>
15181 * src/files.c (outfile, defsfile, actfile): Removed as global
15183 (open_files): Don't compute them.
15184 (output_files): Adjust.
15185 (base_name, short_base_name): Be global.
15186 Adjust dependencies.
15188 2000-12-19 Akim Demaille <akim@epita.fr>
15190 * src/files.c (strsuffix): New.
15191 (stringappend): Be just like strcat but allocate.
15192 (base_names): Eve out from open_files.
15193 Try to simplify the rather hairy computation of base_name and
15195 (open_files): Use it.
15196 * tests/suite.at (Checking output file names): New test.
15198 2000-12-19 Akim Demaille <akim@epita.fr>
15200 * src/system.h (obstack_grow_literal_string): Rename as...
15201 (obstack_grow_string): this.
15202 * src/output.c (output_parser): Recognize `%% actions' instead of
15204 * src/bison.s1: s/$/%% actions/.
15205 * src/bison.hairy: Likewise.
15207 2000-12-19 Akim Demaille <akim@epita.fr>
15209 * src/output.c (output_parser): Compute the `#line' lines when
15211 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
15212 Suggested by Hans Aberg.
15214 2000-12-19 Akim Demaille <akim@epita.fr>
15216 Let the handling of the skeleton files be local to the procedures
15219 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
15221 (fparser, open_extra_files): Remove.
15222 (open_files, output_files): Don't take care of fparser.
15223 * src/files.h: Adjust.
15224 * src/output.c (output_parser): Open and close the file to the
15226 * src/reader.c (read_declarations): When %semantic_parser, open
15229 2000-12-19 Akim Demaille <akim@epita.fr>
15231 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
15232 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
15234 2000-12-19 Akim Demaille <akim@epita.fr>
15236 * src/files.c (open_files): Yipee! We no longer need all the code
15237 looking for `/tmp' since we have no tmp file.
15239 2000-12-19 Akim Demaille <akim@epita.fr>
15241 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
15243 * src/files.c (open_files): Less dependency on MSDOS etc.
15245 2000-12-14 Akim Demaille <akim@epita.fr>
15247 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
15248 Provide a default definition.
15249 Use it when executing the default @ action.
15250 * src/reader.c (reader_output_yylsp): No longer include
15251 `timestamp' and `text' in the default YYLTYPE.
15253 2000-12-12 Akim Demaille <akim@epita.fr>
15255 * src/reader.c (copy_definition, parse_union_decl, copy_action)
15256 (copy_guard): Quote the file names.
15257 Reported by Laurent Mascherpa.
15259 2000-12-12 Akim Demaille <akim@epita.fr>
15261 * src/output.c (output_headers, output_program, output): Be sure
15262 to escape special characters when outputting filenames.
15263 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
15264 (output_headers): Don't depend on them, Use ACTSTR.
15266 2000-11-17 Akim Demaille <akim@epita.fr>
15268 * lib/obstack.h: Formatting changes.
15269 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
15270 prevents type checking.
15271 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
15272 cast the value to (void *): assigning a `foo *' to a `void *'
15274 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
15275 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
15278 2000-11-17 Akim Demaille <akim@epita.fr>
15280 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
15282 (suite.m4, regression.m4, calc.m4): these.
15283 * tests/atgeneral.m4: Update from CVS Autoconf.
15285 2000-11-17 Akim Demaille <akim@epita.fr>
15287 * tests/regression.m4 (%union and --defines): New test,
15288 demonstrating a current bug in the obstack implementation.
15290 2000-11-17 Akim Demaille <akim@epita.fr>
15292 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
15294 Use them to declare the variables which are global or local to
15297 2000-11-17 Akim Demaille <akim@epita.fr>
15299 * acconfig.h: Remove, no longer used.
15301 2000-11-07 Akim Demaille <akim@epita.fr>
15303 * src: s/Copyright (C)/Copyright/g.
15305 2000-11-07 Akim Demaille <akim@epita.fr>
15307 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
15309 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
15311 2000-11-07 Akim Demaille <akim@epita.fr>
15313 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
15314 Merge in a single CPP if/else.
15316 2000-11-07 Akim Demaille <akim@epita.fr>
15318 * src/output.c (output): Remove useless variables.
15319 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
15320 argument `data' for consistency with the prototypes.
15321 Qualify it `const'.
15322 (obstack_copy, obstack_copy0): Rename the second argument as
15323 `address' for consistency. Qualify it `const'.
15324 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
15325 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
15326 `const' their input argument (`data' or `address').
15327 Adjust the corresponding macros to include `const' in casts.
15329 2000-11-03 Akim Demaille <akim@epita.fr>
15331 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
15332 s/PFILE1/BISON_HAIRY/.
15333 Adjust dependencies.
15335 2000-11-03 Akim Demaille <akim@epita.fr>
15337 For some reason, this was not applied.
15339 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
15340 `unlink': it's no longer used.
15342 2000-11-03 Akim Demaille <akim@epita.fr>
15344 * src/files.c (skeleton_find): New function, eved out of...
15345 (open_files, open_extra_files): here.
15347 2000-11-03 Akim Demaille <akim@epita.fr>
15349 Don't use `atexit'.
15351 * src/files.c (obstack_save): New function.
15352 (done): Rename as...
15353 (output_files): this.
15354 Use `obstack_save'.
15355 * src/main.c (main): Don't use `atexit' to register `done', since
15356 it no longer has to remove tmp files, just call `output_files'
15357 when there are no errors.
15359 2000-11-02 Akim Demaille <akim@epita.fr>
15361 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
15362 `unlink': it's no longer used.
15363 * src/files.h: Formatting changes.
15365 2000-11-02 Akim Demaille <akim@epita.fr>
15367 Remove the last uses of mktemp and unlink/delete.
15369 * src/files.c (fdefines, ftable): Removed.
15370 (defines_ostack, table_obstack): New.
15371 Adjust dependencies of the former into uses of the latter.
15372 * src/output.c (output_short_or_char_table, output_short_table):
15373 Convert to using obstacks.
15374 * src/reader.c (copy_comment2): Accept one FILE * and two
15376 (output_token_defines, reader_output_yylsp): Use obstacks.
15377 * src/system.h (obstack_fgrow3): New.
15378 * po/POTFILES.in: Adjust.
15380 2000-11-01 Akim Demaille <akim@epita.fr>
15382 Change each use of `fattrs' into a use of `attrs_obstack'.
15384 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
15385 * src/files.c (fattrs): Remove.
15386 (attrs_obstack): New.
15387 Adjust all dependencies.
15388 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
15390 2000-11-01 Akim Demaille <akim@epita.fr>
15392 Introduce obstacks.
15393 Change each use of `faction' into a use of `action_obstack'.
15395 * lib/obstack.h, lib/obstack.c: New files.
15396 * src/files.c (faction): Remove.
15397 (action_obstack): New.
15398 Adjust all dependencies.
15400 2000-10-20 Akim Demaille <akim@epita.fr>
15402 * lib/quote.h (PARAMS): New macro. Use it.
15404 2000-10-16 Akim Demaille <akim@epita.fr>
15406 * src/output.c (output_short_or_char_table): New function.
15407 (output_short_table, output_token_translations): Use it.
15408 (goto_actions): Use output_short_table.
15410 2000-10-16 Akim Demaille <akim@epita.fr>
15412 * src/symtab.c (bucket_new): New function.
15415 * src/output.c (output_short_table): New argument to display the
15416 comment associated with the table.
15417 Adjust dependencies.
15418 (output_gram): Use it.
15419 (output_rule_data): Nicer output layout for YYTNAME.
15421 2000-10-16 Akim Demaille <akim@epita.fr>
15423 * src/lex.c (read_typename): New function.
15425 * src/reader.c (copy_dollar): Likewise.
15427 2000-10-16 Akim Demaille <akim@epita.fr>
15429 * src/reader.c (copy_comment2): Expect the input stream to be on
15430 the `/' which is suspected to open a comment, instead of being
15431 called after `//' or `/*' was read.
15432 (copy_comment, copy_definition, parse_union_decl, copy_action)
15433 (copy_guard): Adjust.
15435 2000-10-16 Akim Demaille <akim@epita.fr>
15437 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
15438 `read_signed_integer'.
15440 2000-10-16 Akim Demaille <akim@epita.fr>
15442 * src/reader.c (copy_dollar): New function.
15443 (copy_guard, copy_action): Use it.
15445 2000-10-16 Akim Demaille <akim@epita.fr>
15447 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
15448 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
15449 New files, from Fileutils 4.0.27.
15450 * src/main.c (printable_version): Remove.
15451 * src/lex.c, src/reader.c: Use `quote'.
15453 2000-10-04 Akim Demaille <akim@epita.fr>
15455 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
15457 2000-10-04 Akim Demaille <akim@epita.fr>
15459 * doc/bison.texinfo: Various typos spotted by Neil Booth.
15461 2000-10-04 Akim Demaille <akim@epita.fr>
15463 When a literal string is used to define two different tokens,
15464 `bison -v' segfaults.
15465 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
15467 * tests/regression.m4: New file.
15468 Include the core of the sample provided by Piotr Gackiewicz.
15469 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
15472 2000-10-04 Akim Demaille <akim@epita.fr>
15474 * src/reader.c (parse_expect_decl): Keep `count' within the size
15478 2000-10-02 Paul Eggert <eggert@twinsun.com>
15480 * bison.s1 (yyparse): Assign the default value
15481 unconditionally, to avoid a GCC warning and make the parser a
15484 2000-10-02 Akim Demaille <akim@epita.fr>
15486 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
15489 2000-10-02 Akim Demaille <akim@epita.fr>
15491 * src/derives.c, src/print.c, src/reduce.c: To ease the
15492 translation, move some `\n' out of the translated strings.
15494 2000-10-02 Akim Demaille <akim@epita.fr>
15496 The location tracking mechanism is precious for parse error
15497 messages. Nevertheless, it is enabled only when `@n' is used in
15498 the grammar, which is a different issue (you can use it in error
15499 message, but not in the grammar per se). Therefore, there should
15500 be another means to enable it.
15502 * src/getargs.c (getargs): Support `--locations'.
15503 (usage): Report it.
15504 * src/getargs.h (locationsflag): Export it.
15505 * src/lex.c (percent_table): Support `%locations'.
15506 * src/reader.c (yylsp_needed): Remove this variable, now replaced
15507 with `locationsflag'.
15508 * doc/bison.texinfo: Document `--locations' and `%locations'.
15510 * tests/calc.m4: Test it.
15512 For regularity of the names, replace each
15513 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
15514 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
15515 In addition replace each `flag' with `_flag'.
15517 2000-10-02 Akim Demaille <akim@epita.fr>
15519 Also test parse error messages, including with YYERROR_VERBOSE.
15521 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
15523 Use it to check the computations.
15524 Use it to check `nonassoc' is honored.
15525 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
15526 `--yyerror-verbose'.
15527 (_AT_CHECK_CALC): Adjust to this option.
15528 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
15530 2000-10-02 Akim Demaille <akim@epita.fr>
15532 Test also `--verbose', `--defines' and `--name-prefix'. Testing
15533 the latter demonstrates a flaw in the handling of non debugging
15534 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
15535 was used in order to simplify:
15551 unfortunately this leads to a CPP conflict when
15552 `--name-prefix=foo' is used since it produces `#define yydebug
15555 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
15556 (YYDPRINTF): New macro.
15558 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
15560 Also test `--verbose', `--defines' and `--name-prefix'.
15562 2000-10-02 Akim Demaille <akim@epita.fr>
15564 Improve the readability of the produced parsers.
15566 * src/bison.s1: Formatting changes.
15567 Improve the comment related to the `$' mark.
15568 (yydefault): Don't fall through to `yyresume': `goto' there.
15569 * src/output.c (output_parser): When the `$' is met, skip the end
15571 New variable, `number_of_dollar_signs', to check there's exactly
15572 one `$' in the parser skeleton.
15574 2000-10-02 Akim Demaille <akim@epita.fr>
15576 * lib/xstrdup.c: New file, from the fileutils.
15577 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
15578 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
15579 instead of strlen + xmalloc + strcpy.
15580 * src/symtab.c (copys): Remove, use xstrdup instead.
15582 2000-10-02 Akim Demaille <akim@epita.fr>
15584 * src/gram.h (associativity): New enum type which replaces the
15585 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
15586 `right_assoc', `left_assoc' and `non_assoc'.
15587 Adjust all dependencies.
15588 * src/reader.c: Formatting changes.
15589 (LTYPESTR): Don't define it, use it as a literal in
15590 `reader_output_yylsp'.
15591 * src/symtab.h (symbol_class): New enum type which replaces the
15592 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
15593 `sunknown', `stoken and `snterm'.
15595 2000-10-02 Akim Demaille <akim@epita.fr>
15597 * src/getargs.c (fixed_outfiles): Rename as...
15598 (yaccflag): for consistency and accuracy.
15599 Adjust dependencies.
15601 2000-10-02 Akim Demaille <akim@epita.fr>
15603 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
15604 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
15605 difficult and introduced a lot of core dump. It turns out that
15606 Bison used an implementation of `xmalloc' based on `calloc', and
15607 at various places it does depend upon the initialization to 0. I
15608 have not tried to isolate the pertinent places, and all the former
15609 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
15610 someone should address this issue.
15612 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
15613 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
15615 Adjust dependencies.
15616 * src/warshall.h: New file.
15619 2000-10-02 Akim Demaille <akim@epita.fr>
15621 Various anti-`extern in *.c' changes.
15623 * src/system.h: Include `assert.h'.
15625 2000-10-02 Akim Demaille <akim@epita.fr>
15627 * src/state.h (nstates, final_state, first_state, first_shift)
15628 (first_reduction): Move their exportation from here...
15629 * src/LR0.h: to here.
15630 Adjust dependencies.
15631 * src/getargs.c (statisticsflag): New variable.
15632 Add support for `--statistics'.
15633 Adjust dependencies.
15635 Remove a lot of now useless `extern' statements in most files.
15637 2000-10-02 Akim Demaille <akim@epita.fr>
15639 * src/LR0.h: New file.
15642 2000-10-02 Akim Demaille <akim@epita.fr>
15644 * src/print.h: New file.
15646 * src/print.c: Formatting and ordering changes.
15647 (verbose, terse): Replace with...
15648 (print_results): this new function.
15649 Adjust dependencies.
15651 2000-10-02 Akim Demaille <akim@epita.fr>
15653 * src/conflicts.c (conflict_report): New function.
15654 (conflict_log, verbose_conflict_log): Replace with...
15655 (print_conflicts): this function.
15656 Adjust dependencies.
15657 * src/conflicts.h: New file.
15658 Propagate its inclusion.
15660 2000-10-02 Akim Demaille <akim@epita.fr>
15662 * src/nullable.h: New file.
15663 Propagate its inclusion.
15664 * src/nullable.c: Formatting changes.
15666 2000-10-02 Akim Demaille <akim@epita.fr>
15668 * src/reduce.h: New file.
15669 Propagate its inclusion.
15670 * src/reduce.c: Topological sort and other formatting changes.
15671 (bool, TRUE, FALSE): Move their definition to...
15672 * src/system.h: here.
15674 2000-10-02 Akim Demaille <akim@epita.fr>
15676 * src/files.c: Formatting changes.
15677 (tryopen, tryclose, openfiles): Rename as...
15678 (xfopen, xfclose, open_files): this.
15679 (stringappend): static.
15680 * src/files.h: Complete the list of exported symbols.
15683 2000-10-02 Akim Demaille <akim@epita.fr>
15685 * src/reader.h: New file.
15686 Propagate its use instead of tedious list of `extern' and
15688 * src/reader.c: Formatting changes, topological sort,
15691 2000-10-02 Akim Demaille <akim@epita.fr>
15693 * src/lex.h: Prototype `lex.c' exported functions.
15694 * src/reader.c: Adjust.
15695 * src/lex.c: Formatting changes.
15696 (safegetc): Rename as...
15699 2000-10-02 Akim Demaille <akim@epita.fr>
15701 * src/lalr.h: New file.
15702 Propagate its inclusion instead of prototypes and `extern'.
15703 * src/lalr.c: Formatting changes, topological sorting etc.
15705 2000-10-02 Akim Demaille <akim@epita.fr>
15707 * src/output.c (token_actions): Introduce a temporary array,
15708 YYDEFACT, that makes it possible for this function to use
15709 output_short_table.
15711 2000-10-02 Akim Demaille <akim@epita.fr>
15713 `user_toknums' is output as a `short[]' in `output.c', while it is
15714 defined as a `int[]' in `reader.c'. For consistency with the
15715 other output tables, `user_toknums' is now defined as a table of
15718 * src/reader.c (user_toknums): Be a short table instead of an int
15720 Adjust dependencies.
15722 Factor the short table outputs.
15724 * src/output.c (output_short_table): New function.
15725 * src/output.c (output_gram, output_stos, output_rule_data)
15726 (output_base, output_table, output_check): Use it.
15728 2000-10-02 Akim Demaille <akim@epita.fr>
15730 * src/output.c (output): Topological sort of the functions, in
15731 order to get rid of the `static' prototypes.
15732 No longer use `register'.
15733 * src/output.h: New file.
15734 Propagate its inclusion in files explicitly prototyping functions
15737 2000-09-21 Akim Demaille <akim@epita.fr>
15739 * src/atgeneral.m4: Update from Autoconf.
15741 2000-09-21 Akim Demaille <akim@epita.fr>
15743 * src/closure.h: New file.
15744 * src/closure.c: Formatting changes, topological sort over the
15745 functions, use of closure.h.
15746 (initialize_closure, finalize_closure): Rename as...
15747 (new_closure, free_closure): these. Adjust dependencies.
15748 * src/LR0.c: Formatting changes, topological sort, use of
15750 (initialize_states): Rename as...
15751 (new_states): this.
15752 * src/Makefile.am (noinst_HEADERS): Adjust.
15754 2000-09-20 Akim Demaille <akim@epita.fr>
15756 * src/acconfig.h: Don't protect config.h against multiple
15758 Don't define PARAMS.
15759 * src/system.h: Define PARAMS.
15760 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
15761 purpose of config.h. system.h must not try to fix wrong
15762 definitions in config.h.
15764 2000-09-20 Akim Demaille <akim@epita.fr>
15766 * src/derives.h: New file.
15767 * src/main.c, src/derives.h: Use it.
15768 Formatting changes.
15769 * src/Makefile.am (noinst_HEADERS): Adjust.
15771 2000-09-20 Akim Demaille <akim@epita.fr>
15773 * tests/atgeneral.m4: Update from Autoconf.
15774 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
15775 (AT_CHECK_CALC): New macros.
15776 Use these macros to test bison with options `', `--raw',
15777 `--debug', `--yacc', `--yacc --debug'.
15779 2000-09-19 Akim Demaille <akim@epita.fr>
15781 * src/output.c: Formatting changes.
15782 * src/machine.h: Remove, leaving its contents in...
15783 * src/system.h: here.
15785 Adjust all dependencies on stdio.h and machine.h.
15786 * src/getargs.h: New file.
15787 Let all `extern' declarations about getargs.c be replaced with
15788 inclusion of `getargs.h'.
15789 * src/Makefile.am (noinst_HEADERS): Adjust.
15791 * tests/calc.m4 (yyin): Be initialized in main, not on the global
15793 (yyerror): Returns void, not int.
15794 * doc/bison.texinfo: Formatting changes.
15796 2000-09-19 Akim Demaille <akim@epita.fr>
15798 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
15801 2000-09-18 Akim Demaille <akim@epita.fr>
15803 * configure.in: Append WARNING_CFLAGS to CFLAGS.
15804 * src/Makefile.am (INCLUDES): Don't.
15805 Be ready to fetch headers in lib/.
15807 2000-09-18 Akim Demaille <akim@epita.fr>
15809 * doc/bison.texinfo: Update the copyright.
15810 ANSIfy and GNUify the examples.
15811 Remove the old menu.
15813 2000-09-18 Akim Demaille <akim@epita.fr>
15815 First set of tests: use the `calc' example from the documentation.
15817 * src/bison.s1 (yyparse): Condition the code using `yytname' which
15818 is defined only when YYDEBUG is.
15819 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
15820 * src/files.c (tryopen, tryclose): Formatting changes.
15821 Move to the top and be static.
15822 * src/reader.c (read_signed_integer): Likewise.
15823 * tests/calc.m4: New file.
15824 * Makefile.am, suite.m4: Adjust.
15825 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
15827 2000-09-18 Akim Demaille <akim@epita.fr>
15829 Add support for an Autotest test suite for Bison.
15831 * m4/m4.m4, m4/atconfig.m4: New files.
15832 * m4/Makefile.am (EXTRA_DIST): Adjust.
15833 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
15835 * src/getargs.c: Display a more standard --version message.
15836 * src/reader.c (reader): Formatting changes.
15837 No longer depend upon VERSION_STRING.
15838 * configure.in: No longer use `dnl'.
15839 Set up the test suite and the new directory `tests/.
15840 (VERSION_STRING): Remove.
15842 2000-04-14 Akim Demaille <akim@epita.fr>
15844 * src/reader.c (copy_comment2): New function, same as former
15845 `copy_comment', but outputs into two FILE *.
15846 (copy_comment): Use it.
15847 (parse_union_decl): Use it.
15848 (get_type, parse_start_decl): Use the same `invalid' message.
15849 (parse_start_decl, parse_union_decl): Use the same `multiple'
15851 (parse_union_decl, copy_guard, copy_action): Use the same
15852 `unmatched' message.
15853 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
15855 2000-03-31 Akim Demaille <akim@epita.fr>
15857 * src/files.c (tryopen, tryclose): Move to the top.
15860 2000-03-31 Akim Demaille <akim@epita.fr>
15862 * src/main.c (main): Don't call `done', exit does it.
15864 2000-03-31 Akim Demaille <akim@epita.fr>
15866 * allocate.c: s/return (foo)/return foo/.
15867 * lalr.c: Likewise.
15869 * output.c: Likewise.
15870 * reader.c: Likewise.
15871 * symtab.c: Likewise.
15872 * vmsgetargs.c: Likewise.
15874 2000-03-31 Akim Demaille <akim@epita.fr>
15876 Clean up the error reporting functions.
15878 * src/report.c: New file.
15879 * src/report.h: Likewise.
15880 * src/Makefile.am: Adjust.
15881 * m4/error.m4: New file.
15882 * m4/Makefile.am: Adjust.
15883 * configure.in (jm_PREREQ_ERROR): Call it.
15884 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
15886 (fatal, fatals): Remove. All callers use complain.c::fatal.
15887 (warn, warni, warns, warnss, warnss): Remove. All callers use
15888 complain.c::complain.
15889 (toomany): Remove, use fatal instead.
15890 * src/files.c (done): No argument, use complain_message_count.
15891 * src/main.c (main): Register `done' to `atexit'.
15893 * src/getargs.c (usage): More `fputs', less `fprintf'.
15895 2000-03-28 Akim Demaille <akim@epita.fr>
15897 * lib/: New directory.
15898 * Makefile.am (SUBDIRS): Adjust.
15899 * configure.in: Adjust.
15900 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
15902 * src/alloca.c: Moved to lib/.
15903 * src/getopt.c: Likewise.
15904 * src/getopt1.c: Likewise.
15905 * src/getopt.h: Likewise.
15906 * src/ansi2knr.c: Likewise.
15907 * src/ansi2knr.1: Likewise.
15908 * src/Makefile.am: Adjust.
15909 * lib/Makefile.am: New file.
15911 2000-03-28 Akim Demaille <akim@epita.fr>
15913 * src/getargs.c (usage): Refresh the help message.
15915 2000-03-17 Akim Demaille <akim@epita.fr>
15917 * src/getopt1.c: Updated from textutils 2.0e
15918 * src/getopt.c: Likewise.
15919 * src/getopt.h: Likewise.
15921 2000-03-17 Akim Demaille <akim@epita.fr>
15923 * src/Makefile.am (bison.simple): Fix the awk program: quote only
15924 the file name, not the whole `#line LINE FILE'.
15926 2000-03-17 Akim Demaille <akim@epita.fr>
15928 On syntax errors, report the token on which we choked.
15930 * src/bison.s1 (yyparse): In the label yyerrlab, when
15931 YYERROR_VERBOSE, add yychar in msg.
15933 2000-03-17 Akim Demaille <akim@epita.fr>
15935 * src/reader.c (copy_at): New function.
15936 (copy_guard): Use it.
15937 (copy_action): Use it.
15939 2000-03-17 Akim Demaille <akim@epita.fr>
15941 Be kind to translators, save some useless translations.
15943 * src/main.c (banner): New function.
15944 (fatal_banner): Use it.
15945 (warn_banner): Use it.
15947 2000-03-17 Akim Demaille <akim@epita.fr>
15949 * src/reader.c (copy_definition): Use copy_string and
15950 copy_comment. Removed now unused `match', `ended',
15952 (copy_comment, copy_string): Moved, to be visible from
15955 2000-03-17 Akim Demaille <akim@epita.fr>
15957 * src/reader.c (copy_string): Declare `static inline'. No
15958 problems with inline, since it is checked by configure.
15959 (copy_comment): Likewise.
15961 2000-03-17 Akim Demaille <akim@epita.fr>
15963 * src/reader.c (packsymbols): Formatting changes.
15965 2000-03-17 Akim Demaille <akim@epita.fr>
15967 * src/reader.c (copy_comment): New function, factored out from:
15968 (copy_action): Use it. Removed now unused `match', `ended',
15970 (copy_guard): Likewise.
15972 2000-03-17 Akim Demaille <akim@epita.fr>
15974 * src/reader.c (copy_string): New function, factored out from:
15975 (copy_action): Use it.
15976 (copy_guard): Likewise.
15978 2000-03-17 Akim Demaille <akim@epita.fr>
15980 Change the handling of @s so that they behave exactly like $s.
15981 There is now a pseudo variable @$ (readble and writable), location
15982 of the lhs of the rule (by default ranging from the location of
15983 the first symbol of the rhs, to the location of the last symbol,
15984 or, if the rhs is empty, YYLLOC).
15986 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
15988 (yyparse): When providing a default semantic action, provide a
15989 default location action.
15990 (after the $): No longer change `*YYLSP', just stack YYLOC the
15991 same way you stack YYVAL.
15992 * src/reader.c (read_declarations): Use warns.
15993 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
15994 (copy_action, case '@'): Likewise.
15995 Use a standard error message, to save useless work from
15998 2000-03-17 Akim Demaille <akim@epita.fr>
16000 * src/bison.s1: Formatting and cosmetics changes.
16001 * src/reader.c: Likewise.
16002 Update the Copyright notice.
16004 2000-03-17 Akim Demaille <akim@epita.fr>
16006 * src/bison.s1 (#line): All set to `#line' only, since the
16007 Makefile now handles them.
16009 2000-03-16 Akim Demaille <akim@epita.fr>
16011 * src/output.c (output_rule_data): Output the documentation of
16012 some of the tables.
16013 (Copyright notice): Update.
16014 Formatting changes.
16016 2000-03-16 Akim Demaille <akim@epita.fr>
16018 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
16019 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
16020 One `#if YYDEBUG' remains, since it uses variables which are
16021 defined only if `YYDEBUG != 0'.
16023 2000-03-16 Akim Demaille <akim@epita.fr>
16025 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
16026 and related variables so that the similarities are highlighted.
16028 2000-03-16 Akim Demaille <akim@epita.fr>
16030 * src/bison.s1: Properly indent CPP directives.
16032 2000-03-16 Akim Demaille <akim@epita.fr>
16034 * src/bison.s1: Properly indent the `alloca' CPP section.
16036 2000-03-16 Akim Demaille <akim@epita.fr>
16038 Do not hard code values of directories in `configure.in'.
16039 Update the `configure' tool chain.
16041 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
16043 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
16044 (AC_OUTPUT): Add m4/Makefile.
16045 Bump to bison 1.28a, 1.29 has never been released.
16046 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
16047 handled via src/Makefile.am.
16048 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
16049 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
16051 * Makefile.am (SUBDIRS): Add m4.
16052 (ACLOCAL_AM_FLAGS): New variable.
16053 (AUTOMAKE_OPTIONS): Add check-news.
16054 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
16055 the proper line number and file name.
16056 (DEFS): Propagate the location of bison library files and of the
16058 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
16060 * acinclude.m4: Remove, replaced by the directory m4.
16061 * m4/Makefile.am (EXTRA_DIST): New variable.
16062 * m4/gettext.m4: New file, from the fileutils.
16063 * m4/lcmessage.m4: Likewise
16064 * m4/progtest.m4: Likewise.
16065 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
16067 2000-03-10 Akim Demaille <akim@epita.fr>
16070 Formatting changes of various comments.
16071 Respect the GNU coding standards at various places.
16072 Don't use `_()' when no translation is needed.
16074 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16077 OS/2 honors TMPDIR environment variable.
16079 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16081 * doc/bison.texinfo: Tweaked spelling and grammar.
16083 Removed reference to price of printed copy.
16084 Mention BISON_SIMPLE and BISON_HAIRY.
16086 1999-12-13 Jesse Thilo <jthilo@gnu.org>
16088 * configure.in, NEWS:
16089 Bison 1.29 released.
16091 1999-10-27 Jesse Thilo <jthilo@gnu.org>
16093 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16094 Added reference card.
16096 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16098 * po/ru.po: Added Russian translation.
16100 1999-07-26 Jesse Thilo <jthilo@gnu.org>
16102 * configure.in: Added Russian translation.
16104 1999-07-06 Jesse Thilo <jthilo@gnu.org>
16106 * configure.in, NEWS, README:
16107 Released version 1.28.
16109 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16112 Squashed redefinition warning on some systems.
16114 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16115 Have configure build version string instead of relying on ANSI string
16118 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16120 * po/POTFILES.in: Got rid of version.c.
16122 1999-06-14 Jesse Thilo <jthilo@gnu.org>
16124 * acconfig.h, configure.in:
16125 Have configure build version string instead of relying on ANSI string
16128 1999-06-08 Jesse Thilo <jthilo@gnu.org>
16131 Dropped mention of `+' for long-named options.
16133 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16135 * src/files.c: Added <unistd.h> for unlink().
16137 * src/Makefile.am, src/system.h:
16140 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16142 * README: Added a FAQ list.
16144 * configure.in, acconfig.h:
16147 1999-05-30 Jesse Thilo <jthilo@gnu.org>
16149 * doc/FAQ, doc/Makefile.am:
16152 1999-05-19 Jesse Thilo <jthilo@gnu.org>
16154 * src/alloc.h, src/symtab.h, src/version.c:
16155 Protected inclusion of "config.h" with HAVE_CONFIG_H.
16157 1999-04-18 Jesse Thilo <jthilo@gnu.org>
16159 * src/.cvsignore, src/Makefile.am:
16160 Reorganized: sources in `src', documentation in `doc'.
16162 * src/lex.c (literalchar):
16163 fixed the code for escaping double quotes (thanks
16166 1999-04-18 Jesse Thilo <jthilo@gnu.org>
16168 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
16169 Adjusted paths to reflect directory reorganization.
16171 1999-04-18 Jesse Thilo <jthilo@gnu.org>
16173 * doc/.cvsignore, doc/Makefile.am:
16174 Reorganized: sources in `src', documentation in `doc'.
16176 1999-04-18 Jesse Thilo <jthilo@gnu.org>
16179 Updated AC_INIT file to reflect directory reorganization.
16181 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
16182 Reorganized: sources in `src', documentation in `doc'.
16184 1999-04-13 Jesse Thilo <jthilo@gnu.org>
16187 Don't declare calloc() and realloc() if not necessary.
16189 1999-04-13 Jesse Thilo <jthilo@gnu.org>
16191 * configure.in, acconfig.h, acinclude.m4:
16192 Don't declare calloc() and realloc() if not necessary.
16194 1999-03-23 Jesse Thilo <jthilo@gnu.org>
16196 * po/.cvsignore: Added i18n support.
16198 1999-03-23 Jesse Thilo <jthilo@gnu.org>
16200 * acconfig.h, configure.in, Makefile.am:
16201 Added i18n support.
16203 1999-03-22 Jesse Thilo <jthilo@gnu.org>
16205 * src/bison.s1: Fixed #line numbers.
16207 1999-03-15 Jesse Thilo <jthilo@gnu.org>
16209 * po/es.po, po/fr.po, po/nl.po, po/de.po:
16210 Added PO files from Translation Project.
16212 1999-03-03 Jesse Thilo <jthilo@gnu.org>
16215 Added support for non-ANSI compilers (ansi2knr).
16217 1999-02-16 Jesse Thilo <jthilo@gnu.org>
16219 * configure.in: Bumped version number to 1.27.
16222 Added `bison.simple' to list of files removed by `make distclean'.
16224 1999-02-12 Jesse Thilo <jthilo@gnu.org>
16226 * src/files.c, src/files.h:
16227 Defined locations of parser files in config.h instead of Makefile.
16229 1999-02-12 Jesse Thilo <jthilo@gnu.org>
16231 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
16232 Defined locations of parser files in config.h instead of Makefile.
16234 1999-02-09 Jesse Thilo <jthilo@gnu.org>
16237 Removed inappropriate use of $< macro.
16239 1999-02-05 Jesse Thilo <jthilo@gnu.org>
16241 * po/Makefile.in.in, po/POTFILES.in:
16242 Add `po' directory skeleton.
16244 1999-01-27 Jesse Thilo <jthilo@gnu.org>
16246 * README: Document help-bison list.
16248 * configure.in: Add check for mkstemp().
16250 1999-01-20 Jesse Thilo <jthilo@gnu.org>
16252 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
16253 Hush a few compiler warnings.
16256 Add tryclose(), which verifies that fclose was successful.
16257 Hush a couple of compiler warnings.
16259 1999-01-20 Jesse Thilo <jthilo@gnu.org>
16261 * Makefile.am, OChangeLog:
16262 ChangeLog is now automatically generated. Include the old version as
16265 1999-01-14 Jesse Thilo <jthilo@gnu.org>
16267 * 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:
16268 Update FSF address.
16270 1999-01-14 Jesse Thilo <jthilo@gnu.org>
16272 * doc/bison.texinfo: Fix formatting glitch.
16274 * doc/bison.texinfo: Update FSF address.
16276 1999-01-14 Jesse Thilo <jthilo@gnu.org>
16278 * acconfig.h: Update FSF address.
16280 1999-01-08 Jesse Thilo <jthilo@gnu.org>
16283 Don't define PACKAGE here, since config.h defines it.
16285 1998-12-30 Jesse Thilo <jthilo@gnu.org>
16287 * src/reader.c: Update copyright date.
16290 Ditch sprintf to statically-sized buffers in fatal/warn functions in
16291 favor of output directly to stderr (avoids buffer overruns).
16293 * src/reader.c: Some checks for premature EOF.
16295 * 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:
16296 Use prototypes if the compiler understands them.
16298 * src/files.c: Honor TMPDIR on Unix hosts.
16299 Use prototypes if the compiler understands them.
16302 Fix a couple of buffer overrun bugs.
16303 Use prototypes if the compiler understands them.
16305 * src/system.h: Include unistd.h and ctype.h.
16306 Use #ifdef instead of #if for NLS symbols.
16308 1998-12-30 Jesse Thilo <jthilo@gnu.org>
16310 * doc/bison.texinfo:
16311 Delete comment "consider using @set for edition number, etc..." since
16312 we now are doing so.
16314 1998-12-30 Jesse Thilo <jthilo@gnu.org>
16317 Use prototypes if the compiler understands them.
16319 * NEWS: Document 1.26 highlights.
16321 * Makefile.am: Require Automake 1.3 or later.
16324 Use prototypes if the compiler understands them.
16326 1998-12-29 Jesse Thilo <jthilo@gnu.org>
16329 Use VERSION symbol from automake for version number.
16331 1998-12-29 Jesse Thilo <jthilo@gnu.org>
16333 * acconfig.h, configure.in, version.cin:
16334 Use VERSION symbol from automake for version number.
16336 1998-11-28 Jesse Thilo <jthilo@gnu.org>
16339 Distribute original version of simple parser (bison.s1), not built
16340 version (bison.simple).
16342 1998-11-28 Jesse Thilo <jthilo@gnu.org>
16344 * doc/bison.texinfo: Add info dir entry.
16346 * doc/bison.texinfo:
16347 Let automake put version number into documentation.
16349 1998-11-26 Jesse Thilo <jthilo@gnu.org>
16351 * src/bison.cld, src/build.com, src/vmshlp.mar:
16352 Add non-RCS files from /gd/gnu/bison.
16354 1998-11-26 Jesse Thilo <jthilo@gnu.org>
16357 Document the BISON_HAIRY and BISON_SIMPLE variables.
16359 1998-11-25 Jesse Thilo <jthilo@gnu.org>
16361 * src/version.c: Build version.c automatically.
16364 Fix token numbering (used to start at 258, not 257).
16366 * src/system.h: Include config.h.
16368 * src/getargs.c: Update bug report address.
16370 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
16371 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
16373 1998-11-25 Jesse Thilo <jthilo@gnu.org>
16376 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
16378 * configure.in, version.cin:
16379 Build version.c automatically.
16381 * AUTHORS: Add AUTHORS file.
16383 * README: Update bug report address.
16386 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
16388 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
16389 Add automake stuff.
16391 1998-11-25 Jesse Thilo <jthilo@gnu.org>
16393 * doc/bison.texinfo: Clean up some formatting.
16395 1998-05-05 Richard Stallman <rms@gnu.org>
16397 * doc/bison.texinfo:
16398 Explain better why to make a pure parser.
16400 1998-01-05 Richard Stallman <rms@gnu.org>
16402 * src/files.c (openfiles):
16403 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
16404 find a temporary directory, if possible. Do not unlink files while
16407 1997-08-25 Richard Stallman <rms@gnu.org>
16409 * src/reader.c (stack_offset;):
16410 Change some warni to warns.
16412 * src/lex.c (literalchar): Use warns, not warni.
16414 1997-06-28 Richard Stallman <rms@gnu.org>
16416 * src/bison.s1: Add a Bison version comment.
16418 * src/main.c (fatal, warn, berror):
16421 1997-06-28 Richard Stallman <rms@gnu.org>
16423 * Makefile.in (bison_version): New variable.
16424 (dist): Use that variable.
16425 (bison.s1): Substitute the Bison version into bison.simple.
16427 * bison.simple: Add a Bison version comment.
16429 1997-06-18 Richard Stallman <rms@gnu.org>
16431 * src/main.c (fatal, warn, berror):
16432 Make error messages standard.
16433 (toomany): Improve error message text.
16435 * 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:
16436 new.h renamed to alloc.h.
16438 1997-06-18 Richard Stallman <rms@gnu.org>
16440 * Makefile.in: new.h renamed to alloc.h.
16442 1997-05-24 Richard Stallman <rms@gnu.org>
16444 * src/lex.c (literalchar):
16445 Fix the code for escaping \, " and '.
16447 (lex): Avoid trouble when there are many chars
16448 to discard in a char literal with just several chars in it.
16450 1997-05-17 Richard Stallman <rms@gnu.org>
16453 Use malloc, if using alloca is troublesome.
16454 (YYSTACK_USE_ALLOCA): New flag macro.
16455 Define it for some systems and compilers.
16456 (YYSTACK_ALLOC): New macro.
16457 (yyparse): Use YYSTACK_ALLOC to allocate stack.
16458 If it was malloc'd, free it.
16460 1997-05-17 Richard Stallman <rms@gnu.org>
16463 Use malloc, if using alloca is troublesome.
16464 (YYSTACK_USE_ALLOCA): New flag macro.
16465 Define it for some systems and compilers.
16466 (YYSTACK_ALLOC): New macro.
16467 (yyparse): Use YYSTACK_ALLOC to allocate stack.
16468 If it was malloc'd, free it.
16470 1997-04-23 Richard Stallman <rms@gnu.org>
16473 (alloca) [__hpux]: Always define as __builtin_alloca.
16475 1997-04-23 Richard Stallman <rms@gnu.org>
16478 (alloca) [__hpux]: Always define as __builtin_alloca.
16480 1997-04-22 Richard Stallman <rms@gnu.org>
16483 [__hpux]: Include alloca.h (right for HPUX 10)
16484 instead of declaring alloca (right for HPUX 9).
16486 * src/bison.s1 (__yy_memcpy):
16487 Declare arg `count' as unsigned int.
16488 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
16490 1997-04-22 Richard Stallman <rms@gnu.org>
16493 [__hpux]: Include alloca.h (right for HPUX 10)
16494 instead of declaring alloca (right for HPUX 9).
16496 * bison.simple (__yy_memcpy):
16497 Declare arg `count' as unsigned int.
16498 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
16500 1997-01-03 Richard Stallman <rms@gnu.org>
16502 * src/allocate.c: [__STDC__ or _MSC_VER]:
16503 Declare calloc and realloc to return void *.
16505 1997-01-02 Richard Stallman <rms@gnu.org>
16508 [_MSC_VER]: Include stdlib.h and process.h.
16509 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
16511 * src/main.c (main): Return FAILURE as a value.
16512 (printable_version): Declare arg as int, not char.
16514 1997-01-02 Richard Stallman <rms@gnu.org>
16516 * Makefile.in (dist):
16517 Explicitly check for symlinks, and copy them.
16519 1996-12-19 Richard Stallman <rms@gnu.org>
16522 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
16524 1996-12-18 Paul Eggert <eggert@gnu.org>
16526 * src/bison.s1 (yyparse):
16527 If __GNUC__ and YYPARSE_PARAM are both defined,
16528 declare yyparse to have a void * argument.
16530 1996-12-18 Paul Eggert <eggert@gnu.org>
16532 * bison.simple (yyparse):
16533 If __GNUC__ and YYPARSE_PARAM are both defined,
16534 declare yyparse to have a void * argument.
16536 1996-12-17 Richard Stallman <rms@gnu.org>
16538 * src/reduce.c (nbits): Add some casts.
16540 1996-08-12 Richard Stallman <rms@gnu.org>
16542 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
16544 1996-08-12 Richard Stallman <rms@gnu.org>
16546 * bison.simple: Test _MSDOS as well as _MSDOS_.
16548 1996-07-31 Richard Stallman <rms@gnu.org>
16551 [__sun && __i386]: Include alloca.h.
16553 1996-07-31 Richard Stallman <rms@gnu.org>
16556 [__sun && __i386]: Include alloca.h.
16558 1996-07-30 Richard Stallman <rms@gnu.org>
16560 * src/bison.s1: Comment change.
16562 * src/bison.s1: Test _MSDOS_, not MSDOS.
16564 1996-07-30 Richard Stallman <rms@gnu.org>
16566 * bison.simple: Comment change.
16568 * bison.simple: Test _MSDOS_, not MSDOS.
16570 1996-06-01 Richard Stallman <rms@gnu.org>
16572 * 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:
16573 Insert `_' macro around many string constants.
16576 Insert `_' macro around many string constants.
16578 (main): Call setlocale, bindtextdomain and textdomain.
16580 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
16581 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
16582 [ENABLE_NLS]: Include libintl.h.
16583 [ENABLE_NLS] (gettext): Define.
16584 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
16585 (N_, PACKAGE, LOCALEDIR): New macros.
16587 1996-06-01 Richard Stallman <rms@gnu.org>
16589 * POTFILES.in: New file.
16591 * Makefile.in (allocate.o):
16592 Define target explicitly.
16594 * Makefile.in (CFLAGS): Set to @CFLAGS@.
16595 (LDFLAGS): Set to @LDFLAGS@.
16596 (configure): Run autoconf only if preceding `cd' succeeds.
16597 (bison.s1): Redirect output to temporary file then move the
16598 temporary to the target, rather than redirecting directly to bison.s1.
16599 (clean): Remove config.status and config.log.
16600 (distclean): Don't remove config.status here.
16602 1996-05-12 Richard Stallman <rms@gnu.org>
16605 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
16607 1996-05-12 Richard Stallman <rms@gnu.org>
16610 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
16612 1996-05-11 Richard Stallman <rms@gnu.org>
16614 * src/bison.s1 (__yy_memcpy):
16615 Really reorder the args, as was supposedly done on Feb 14 1995.
16616 (yyparse): Calls changed accordingly.
16618 1996-05-11 Richard Stallman <rms@gnu.org>
16620 * Makefile.in (dist): Don't use $(srcdir).
16622 * bison.simple (__yy_memcpy):
16623 Really reorder the args, as was supposedly done on Feb 14 1995.
16624 (yyparse): Calls changed accordingly.
16626 1996-01-27 Richard Stallman <rms@gnu.org>
16628 * src/output.c (output_rule_data):
16629 Test YYERROR_VERBOSE in the conditional
16630 around the definition of ttyname.
16632 1995-12-29 Richard Stallman <rms@gnu.org>
16635 Fix line numbers in #line commands.
16637 1995-12-29 Richard Stallman <rms@gnu.org>
16640 Fix line numbers in #line commands.
16642 1995-12-27 Richard Stallman <rms@gnu.org>
16644 * src/bison.s1 (YYPARSE_PARAM_DECL):
16645 In C++, make it always null.
16646 (YYPARSE_PARAM_ARG): New macro.
16647 (yyparse): Use YYPARSE_PARAM_ARG.
16649 1995-12-27 Richard Stallman <rms@gnu.org>
16651 * bison.simple (YYPARSE_PARAM_DECL):
16652 In C++, make it always null.
16653 (YYPARSE_PARAM_ARG): New macro.
16654 (yyparse): Use YYPARSE_PARAM_ARG.
16656 1995-11-29 Richard Stallman <rms@gnu.org>
16658 * doc/bison.texinfo:
16659 Describe literal string tokens, %raw, %no_lines, %token_table.
16661 1995-11-29 Daniel Hagerty <hag@gnu.org>
16663 * doc/bison.texinfo: Fixed update date
16665 1995-10-16 Richard Stallman <rms@gnu.org>
16667 * src/version.c: Version 1.25.
16669 1995-10-16 Richard Stallman <rms@gnu.org>
16671 * NEWS: *** empty log message ***
16673 1995-10-16 Richard Stallman <rms@gnu.org>
16675 * doc/bison.1, doc/bison.rnh:
16678 1995-10-15 Richard Stallman <rms@gnu.org>
16680 * src/vmsgetargs.c, src/getargs.c:
16681 Added -n, -k, and -raw switches.
16682 (noparserflag, toknumflag, rawtoknumflag): New variables.
16684 * src/symtab.h (SALIAS):
16685 New #define for adding aliases to %token.
16686 (struct bucket): Added `alias' field.
16688 * src/reduce.c (reduce_grammar):
16689 Revise error message.
16690 (print_notices): Remove final `.' from error message.
16692 * src/reader.c (reader_output_yylsp):
16694 (readgram): Use `#if 0' around code that accepted %command
16695 inside grammar rules: The documentation doesn't allow it,
16696 and it will fail since the %command processors scan for the next %.
16697 (parse_token_decl): Extended the %token
16698 declaration to allow a multi-character symbol as an alias.
16699 (parse_thong_decl): New function.
16700 (read_declarations): Added %thong declarations.
16701 (read_declarations): Handle NOOP to deal with allowing
16702 % declarations as another means to specify the flags.
16703 (readgram): Allow %prec prior to semantics embedded in a rule.
16704 (skip_to_char, read_declarations, copy_definition)
16705 (parse_token_decl, parse_start_decl, parse_type_decl)
16706 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
16707 (get_type_name, copy_guard, copy_action, readgram)
16708 (get_type, packsymbols): Revised most error messages.
16709 Changed `fatal' to `warnxxx' to avoid aborting for error.
16710 Revised and use multiple warnxxx functions to avoid using VARARGS1.
16711 (read_declarations): Improve the error message for
16712 an invalid character. Do not abort.
16713 (read_declarations, copy_guard, copy_action): Use
16714 printable_version to avoid unprintable characters in printed output.
16715 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
16716 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
16717 Allow the type of a non-terminal can be given
16718 more than once, as long as all specifications give the same type.
16721 (output_headers, output_trailers, output, output_gram)
16722 (output_rule_data): Implement noparserflag variable.
16723 Implement toknumflag variable.
16724 (output): Call reader_output_yylsp to output LTYPESTR.
16726 * src/main.c (main):
16727 If reader sees an error, don't process the grammar.
16728 (fatals): Updated to not use VARARGS1.
16729 (printable_version, int_to_string, warn, warni, warns, warnss)
16730 (warnsss): New error reporting functions. Avoid abort for error.
16733 Added THONG and NOOP for alias processing.
16734 Added SETOPT for the new code that allows setting options with %flags.
16737 Include getopt.h. Add some extern decls.
16738 (safegetc): New function to deal with EOF gracefully.
16739 (literalchar); new function to deal with reading \ escapes.
16740 (lex): Use literalchar.
16741 (lex): Implemented "..." tokens.
16742 (literalchar, lex, parse_percent_token): Made tokenbuffer
16743 always contain the token. This includes growing the token
16744 buffer while reading an integer.
16745 (parse_percent_token): Replaced if-else statement with percent_table.
16746 (parse_percent_token): Added % declarations as another
16747 way to specify the flags -n, -l, and -r. Also added hooks for
16748 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
16749 major changes to files.c.
16750 (lex) Retain in the incoming stream a character following
16752 (skip_white_space, lex): Revised most error messages
16753 and changed fatal to warn to avoid aborting.
16754 (percent_table): Added %thong declarations.
16756 * src/gram.h: Comment changes.
16758 * src/files.c (openfiles, open_extra_files, done):
16760 and actfile file. Handle noparserflag. Both for -n switch.
16762 * src/conflicts.c (resolve_sr_conflict):
16763 Remove use of alloca.
16765 1995-06-01 Jim Meyering <meyering@gnu.org>
16767 * doc/bison.texinfo: *** empty log message ***
16769 1995-05-06 Richard Stallman <rms@gnu.org>
16771 * src/bison.s1: Comment change.
16773 1995-05-06 Richard Stallman <rms@gnu.org>
16775 * bison.simple: Comment change.
16777 1995-05-03 Richard Stallman <rms@gnu.org>
16779 * src/version.c: Version now 1.24.
16781 * src/bison.s1: Change distribution terms.
16783 * src/version.c: Version now 1.23.
16785 1995-05-03 Richard Stallman <rms@gnu.org>
16787 * doc/bison.texinfo:
16788 Rewrite "Conditions for Using Bison".
16789 Update version to 1.24.
16791 1995-05-03 Richard Stallman <rms@gnu.org>
16793 * bison.simple: Change distribution terms.
16795 1995-02-23 Richard Stallman <rms@gnu.org>
16797 * src/files.c: Test __VMS_POSIX as well as VMS.
16799 1995-02-14 Jim Meyering <meyering@gnu.org>
16801 * src/bison.s1 (__yy_memcpy):
16802 Renamed from __yy_bcopy to avoid
16803 confusion. Reverse FROM and TO arguments to be consistent with
16806 1995-02-14 Jim Meyering <meyering@gnu.org>
16808 * bison.simple (__yy_memcpy):
16809 Renamed from __yy_bcopy to avoid
16810 confusion. Reverse FROM and TO arguments to be consistent with
16813 1994-11-10 David J. MacKenzie <djm@gnu.org>
16819 * Makefile.in (DISTFILES): Include NEWS.
16821 * Makefile.in (DISTFILES):
16822 Include install-sh, not install.sh.
16824 * configure.in: Update to Autoconf v2 macro names.
16826 1994-10-05 David J. MacKenzie <djm@gnu.org>
16828 * Makefile.in: fix typo
16830 * Makefile.in (prefix, exec_prefix):
16831 Let configure set them.
16833 1994-09-28 David J. MacKenzie <djm@gnu.org>
16835 * Makefile.in: Set datadir to $(prefix)/share.
16837 1994-09-15 Richard Stallman <rms@gnu.org>
16840 Update copyright notice and GPL version.
16842 1994-09-15 Richard Stallman <rms@gnu.org>
16845 Update copyright notice and GPL version.
16847 1994-07-12 Richard Stallman <rms@gnu.org>
16849 * src/reduce.c, src/reader.c:
16852 1994-05-05 David J. MacKenzie <djm@gnu.org>
16854 * Makefile.in: entered into RCS
16856 1994-03-26 Richard Stallman <rms@gnu.org>
16858 * src/bison.s1: entered into RCS
16860 1994-03-26 Richard Stallman <rms@gnu.org>
16862 * bison.simple: entered into RCS
16864 1994-03-25 Richard Stallman <rms@gnu.org>
16866 * src/main.c: entered into RCS
16868 1994-03-24 Richard Stallman <rms@gnu.org>
16870 * src/conflicts.c: entered into RCS
16872 1994-01-02 Richard Stallman <rms@gnu.org>
16874 * Makefile.in: *** empty log message ***
16876 1993-11-21 Richard Stallman <rms@gnu.org>
16878 * src/bison.s1: *** empty log message ***
16880 1993-11-21 Richard Stallman <rms@gnu.org>
16882 * doc/bison.texinfo: entered into RCS
16884 * doc/bison.texinfo: *** empty log message ***
16886 1993-11-21 Richard Stallman <rms@gnu.org>
16888 * bison.simple: *** empty log message ***
16890 1993-10-25 David J. MacKenzie <djm@gnu.org>
16892 * doc/bison.texinfo: *** empty log message ***
16894 1993-10-19 Richard Stallman <rms@gnu.org>
16896 * src/bison.s1: *** empty log message ***
16898 1993-10-19 Richard Stallman <rms@gnu.org>
16900 * bison.simple: *** empty log message ***
16902 1993-10-14 Richard Stallman <rms@gnu.org>
16904 * src/bison.s1: *** empty log message ***
16906 1993-10-14 Richard Stallman <rms@gnu.org>
16908 * bison.simple: *** empty log message ***
16910 1993-09-14 David J. MacKenzie <djm@gnu.org>
16912 * doc/bison.texinfo: *** empty log message ***
16914 1993-09-13 Noah Friedman <friedman@gnu.org>
16916 * Makefile.in: *** empty log message ***
16918 1993-09-10 Richard Stallman <rms@gnu.org>
16920 * src/conflicts.c: *** empty log message ***
16922 * src/system.h: entered into RCS
16924 1993-09-10 Richard Stallman <rms@gnu.org>
16926 * doc/bison.1: entered into RCS
16928 1993-09-06 Noah Friedman <friedman@gnu.org>
16930 * src/version.c: entered into RCS
16932 1993-09-06 Noah Friedman <friedman@gnu.org>
16934 * Makefile.in: *** empty log message ***
16936 1993-07-30 David J. MacKenzie <djm@gnu.org>
16938 * Makefile.in: *** empty log message ***
16940 1993-07-24 Richard Stallman <rms@gnu.org>
16942 * src/bison.s1: *** empty log message ***
16944 1993-07-24 Richard Stallman <rms@gnu.org>
16946 * bison.simple: *** empty log message ***
16948 1993-07-08 David J. MacKenzie <djm@gnu.org>
16950 * Makefile.in: *** empty log message ***
16952 1993-07-04 Richard Stallman <rms@gnu.org>
16954 * src/bison.s1: *** empty log message ***
16956 1993-07-04 Richard Stallman <rms@gnu.org>
16958 * bison.simple: *** empty log message ***
16960 1993-06-26 David J. MacKenzie <djm@gnu.org>
16962 * src/getargs.c: entered into RCS
16964 1993-06-26 David J. MacKenzie <djm@gnu.org>
16966 * doc/bison.texinfo: *** empty log message ***
16968 * doc/bison.1: New file.
16970 1993-06-25 Richard Stallman <rms@gnu.org>
16972 * src/getargs.c: New file.
16974 1993-06-16 Richard Stallman <rms@gnu.org>
16976 * src/bison.s1: *** empty log message ***
16978 1993-06-16 Richard Stallman <rms@gnu.org>
16980 * bison.simple: *** empty log message ***
16982 1993-06-03 Richard Stallman <rms@gnu.org>
16984 * src/bison.s1: New file.
16986 1993-06-03 Richard Stallman <rms@gnu.org>
16988 * doc/bison.texinfo: *** empty log message ***
16990 1993-06-03 Richard Stallman <rms@gnu.org>
16992 * bison.simple: New file.
16994 1993-05-19 Richard Stallman <rms@gnu.org>
16996 * doc/bison.texinfo: New file.
16998 1993-05-07 Noah Friedman <friedman@gnu.org>
17000 * Makefile.in: *** empty log message ***
17002 1993-04-28 Noah Friedman <friedman@gnu.org>
17004 * src/reader.c: *** empty log message ***
17006 1993-04-23 Noah Friedman <friedman@gnu.org>
17008 * src/alloc.h: entered into RCS
17010 1993-04-20 David J. MacKenzie <djm@gnu.org>
17012 * src/version.c: *** empty log message ***
17014 * src/files.c, src/allocate.c:
17017 * src/reader.c: *** empty log message ***
17019 * src/lex.c: entered into RCS
17021 * src/conflicts.c: New file.
17023 * src/symtab.c: entered into RCS
17025 * src/alloc.h: New file.
17027 * src/LR0.c: entered into RCS
17029 1993-04-18 Noah Friedman <friedman@gnu.org>
17031 * src/reader.c: New file.
17033 * src/version.c: *** empty log message ***
17035 1993-04-18 Noah Friedman <friedman@gnu.org>
17037 * Makefile.in: *** empty log message ***
17039 1993-04-17 Noah Friedman <friedman@gnu.org>
17041 * Makefile.in: *** empty log message ***
17043 1993-04-15 Richard Stallman <rms@gnu.org>
17045 * src/main.c, src/files.c:
17048 1993-04-15 Noah Friedman <friedman@gnu.org>
17050 * configure.in: entered into RCS
17052 * configure.in: *** empty log message ***
17054 * configure.in: New file.
17056 1993-04-14 Richard Stallman <rms@gnu.org>
17058 * Makefile.in: New file.
17060 1993-04-13 Richard Stallman <rms@gnu.org>
17062 * src/version.c: New file.
17064 1993-03-25 Richard Stallman <rms@gnu.org>
17066 * src/output.c: entered into RCS
17068 1992-09-25 Richard Stallman <rms@gnu.org>
17070 * configure.bat: entered into RCS
17072 1992-06-22 Richard Stallman <rms@gnu.org>
17074 * src/vmsgetargs.c: entered into RCS
17076 1992-06-22 Richard Stallman <rms@gnu.org>
17078 * doc/bison.rnh: entered into RCS
17080 1992-04-20 David J. MacKenzie <djm@gnu.org>
17082 * README: entered into RCS
17084 1992-01-22 Richard Stallman <rms@gnu.org>
17086 * src/machine.h: entered into RCS
17088 1991-12-21 Richard Stallman <rms@gnu.org>
17090 * src/lalr.c, src/closure.c:
17093 1991-12-20 Richard Stallman <rms@gnu.org>
17095 * src/state.h: entered into RCS
17097 1991-12-18 Richard Stallman <rms@gnu.org>
17099 * src/print.c, src/nullable.c, src/derives.c:
17102 1991-11-03 David J. MacKenzie <djm@gnu.org>
17104 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17107 1988-09-09 Richard Stallman <rms@gnu.org>
17109 * src/bison.hairy: entered into RCS
17111 1987-12-16 Richard Stallman <rms@gnu.org>
17113 * REFERENCES: entered into RCS
17118 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
17119 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17120 Software Foundation, Inc.
17122 Copying and distribution of this file, with or without
17123 modification, are permitted provided the copyright notice and this
17124 notice are preserved.