]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Whether the default %destructor/%printer applies to a particular symbol
[bison.git] / ChangeLog
... / ...
CommitLineData
12006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Whether the default %destructor/%printer applies to a particular symbol
4 isn't a question of whether the user *declares* that symbol (in %token,
5 for example). It's a question of whether the user by any means
6 *defines* the symbol at all (by simply using a char token, for
7 example). $end is defined by Bison whereas any other token with token
8 number 0 is defined by the user. The error token is always defined by
9 Bison regardless of whether the user declares it with %token, but we
10 may one day let the user define error as a nonterminal instead.
11 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
12 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
13 the meaning of "user-defined".
14 * tests/actions.at (Default %printer and %destructor for user-declared
15 end token): Rename to...
16 (Default %printer and %destructor for user-defined end token): ...
17 this.
18
19 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
20 computation of whether to apply the default, don't maintain a list of
21 every Bison-defined symbol. Instead, just check for a first character
22 of '$', which a user symbol cannot have, and check for the error token.
23
242006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
25
26 Don't apply the default %destructor or %printer to the error token,
27 $undefined, or $accept. This change fits the general rule that the
28 default %destructor and %printer are only for user-declared symbols,
29 and it solves several difficulties that are described in the new test
30 cases listed below.
31 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
32 * tests/actions.at (Default %printer and %destructor are not for error
33 or $undefined, Default %printer and %destructor are not for $accept):
34 New test cases.
35
362006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
37
38 Allow %start after the first rule.
39 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
40 when parsing the first rule.
41 (check_and_convert_grammar): Search for it here after all grammar
42 declarations have been parsed. Skip midrules, which have dummy LHS
43 nonterminals.
44 * src/symtab.c (symbol_is_dummy): New function.
45 * src/symtab.h (symbol_is_dummy): Declare it.
46 * tests/input.at (%start after first rule): New test.
47
482006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
49
50 Redo some of the previous commit: add back the ability to use
51 non-aliased/undeclared string literals since it might be useful to
52 those declaring %token-table.
53 * src/reader.c (check_and_convert_grammar): Undo changes in previous
54 commit: don't worry about complaints from symbols_pack.
55 * src/symtab.c (symbol_new, symbol_class_set,
56 symbol_check_alias_consistency): Undo changes in previous commit: count
57 each string literal as a new symbol and token, assign it a symbol
58 number, and don't complain about non-aliased string literals.
59 (symbols_pack): Since symbol_make_alias still does not decrement symbol
60 and token counts but does still set aliased tokens to the same number,
61 symbol_pack_processor now leaves empty slots in the symbols array.
62 Remove those slots.
63 * tests/regression.at (Undeclared string literal): Remove test case
64 added in previous commit since non-aliased string literals are allowed
65 again.
66 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
67 remove unnecessary string literal declarations.
68 * tests/sets.at (Firsts): Likewise.
69
702006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
71
72 Don't allow an undeclared string literal, but allow a string literal to
73 be used before its declaration.
74 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
75 symbols_pack complained.
76 * src/symtab.c (symbol_new): Don't count a string literal as a new
77 symbol.
78 (symbol_class_set): Don't count a string literal as a new token, and
79 don't assign it a symbol number since symbol_make_alias does that.
80 (symbol_make_alias): It's not necessary to decrement the symbol and
81 token counts anymore. Don't assume that an alias declaration occurs
82 before any uses of the identifier or string, and thus don't assert that
83 one of them has the highest symbol number so far.
84 (symbol_check_alias_consistency): Complain if there's a string literal
85 that wasn't declared as an alias.
86 (symbols_pack): Bail if symbol_check_alias_consistency failed since
87 symbol_pack asserts that every token has been assigned a symbol number
88 although undeclared string literals have not.
89 * tests/regression.at (String alias declared after use, Undeclared
90 string literal): New test cases.
91 (Characters Escapes, Web2c Actions): Declare string literals as
92 aliases.
93 * tests/sets.at (Firsts): Likewise.
94
952006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
96
97 In the grammar scanner, STRING_FINISH unclosed constructs and return
98 them to the parser in order to improve error messages.
99 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
100 SC_BRACED_CODE, SC_PROLOGUE): Implement.
101 * tests/input.at (Unclosed constructs): New test case.
102 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
103 seen.
104
105 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
106 unused global.
107
1082006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
109
110 Handle string aliases for character tokens correctly.
111 * src/symtab.c (symbol_user_token_number_set): If the token has an
112 alias, check and set its alias's user token number instead of its own,
113 which is set to indicate the alias. Previously, every occurrence of
114 the character token in the grammar overwrote that alias indicator with
115 the character code.
116 * tests/input.at (String aliases for character tokens): New test.
117
1182006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
119
120 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
121
1222006-08-11 Paul Eggert <eggert@cs.ucla.edu>
123
124 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
125 to prevent failures when building on older platforms.
126 Check for autopoint failure.
127 Set XGETTEXT_OPTIONS to values that check for C format strings,
128 so that translators are warned about them (this also helps
129 prevent core dumps).
130
131 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
132 function, since it simplifies our code a bit.
133
134 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
135 rather than -W, so we don't get bogus warnings about sign comparisons.
136 Add -Wpointer-arith, since that warning is useful (it reports code
137 that does not conform to C89 and that some compilers reject).
138 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
139 since it's no longer needed.
140
1412006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
142
143 Clean up scanners a bit.
144 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
145 definitions so gcc won't warn when obstack_for_string is unused.
146 * src/scan-code.l: config.h and system.h are already #include'd by
147 scan-code-c.c, so get rid of them here.
148 * src/scan-gram.l: Likewise.
149 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
150 definitions rather than duplicating the rest of it.
151 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
152
1532006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
154
155 Suppress signed/unsigned comparison warnings for yycheck.
156 * data/c.m4 (b4_safest_int_type): New macro.
157 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
158 a signed int type, cast it to b4_safest_int_type first.
159 * data/yacc.c: Likewise.
160 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
161 also overwritten.
162
1632006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
164
165 * doc/bison.texinfo: Fix some typos.
166
1672006-08-02 Paul Eggert <eggert@cs.ucla.edu>
168
169 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
170 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
171
172 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
173 the latest gnulib does this a different way.
174 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
175 translation was patched, so stop omitting it.
176
1772006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
178
179 Enable declaration of default %printer/%destructor. Make the parser
180 use these for all user-declared grammar symbols for which the user does
181 not declare a specific %printer/%destructor. Thus, the parser uses it
182 for token 0 if the user declares it but not if Bison generates it as
183 $end. Discussed starting at
184 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
185 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
186 and
187 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
188 * NEWS (2.3+): Mention.
189 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
190 declare a %destructor for a mid-rule's semantic value. It's just
191 impossible to declare one specific to it.
192 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
193 code. Describe default %destructor form.
194 * src/parse-gram.y (grammar_declaration): Parse default
195 %printer/%destructor declarations.
196 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
197 and symbol_destructor_location_get rather than accessing the destructor
198 and destructor_location members of struct symbol.
199 (symbol_printers_output): Likewise but for %printer's.
200 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
201 again.
202 * src/symtab.c (default_destructor, default_destructor_location,
203 default_printer, default_printer_location): New static global
204 variables to record the default %destructor and %printer.
205 (symbol_destructor_get, symbol_destructor_location_get,
206 symbol_printer_get, symbol_printer_location_get): New functions to
207 compute the appropriate %destructor and %printer for a symbol.
208 (default_destructor_set, default_printer_set): New functions to set the
209 default %destructor and %printer.
210 * src/symtab.h: Prototype all those new functions.
211 * tests/actions.at (Default %printer and %destructor): New test to
212 check that the right %printer and %destructor are called, that they're
213 not called for $end, and that $$ and @$ work correctly.
214 (Default %printer and %destructor for user-declared end token): New
215 test to check that the default %printer and %destructor are called for
216 a user-declared end token.
217 * tests/input.at (Default %printer and %destructor redeclared, Unused
218 values with default %destructor): New tests to check related grammar
219 warnings and errors.
220
2212006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
222
223 Clean up handling of %destructor for the end token (token 0).
224 Discussed starting at
225 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
226 and
227 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
228
229 Make the skeletons consistent in how they pop the end token and invoke
230 its %destructor.
231 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
232 state, which has token number 0, since this would invoke the
233 %destructor for the end token.
234 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
235 until after shifting the end token, or else it won't be popped.
236 * data/yacc.c (yyparse): Likewise.
237
238 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
239 it's the end token. Upon termination, destroy an unshifted lookahead
240 even when it's the end token.
241 * data/lalr1.cc (yy::parser::parse): Likewise.
242 * data/yacc.c (yyparse): Likewise.
243
244 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
245 value warnings for the end token when the user gives the end token a
246 %destructor.
247
248 * tests/actions.at (Printers and Destructors): Test all the above.
249
2502006-07-24 Paul Eggert <eggert@cs.ucla.edu>
251
252 Update to latest gnulib and gettext versions.
253 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
254 Add fopen-safer.
255 (gnulib_files): Add m4/warning.m4. Don't worry about files
256 overwritten by autopoint.
257 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
258 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
259 rejects them.
260 Don't use autoreconf; instead, invoke autopoint etc. by hand,
261 so that we can remove the intl files at a better time.
262 (intl_files_to_remove): Remove aclocal.m4, since it gets
263 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
264 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
265 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
266 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
267 Remove datarootdir hack; no longer needed.
268 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
269 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
270 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
271 strdup.h.
272 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
273 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
274
2752006-07-20 Paul Eggert <eggert@cs.ucla.edu>
276
277 * bootstrap: Adjust to today's change to gnulib-tool by invoking
278 it with --assume-autoconf='latest-stable'.
279
2802006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
281
282 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
283 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
284 YYSTYPE' and `{'.
285 * src/muscle_tab.h (muscle_grow): Replace the header comments with
286 those from muscle_tab.c since the old ones are misleading.
287
2882006-07-13 Akim Demaille <akim@epita.fr>
289
290 Support %define "KEY" {VALUE}.
291 * src/scan-code.h, src/scan-code.l (translate_action)
292 (translate_rule_action, translate_symbol_action, translate_code):
293 Return char *, not const char *.
294 * src/parse-gram.y (declaration): Rename as...
295 (prologue_declaration): this.
296 (string_content): Remove this nonterminal, use STRING.
297 (braceless, content, content.opt): New nonterminal.
298 Use them.
299 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
300 as value.
301 * src/scan-gram.l (getargs.h): Don't include it.
302
3032006-07-12 Paul Eggert <eggert@cs.ucla.edu>
304
305 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
306 rather than a for-loop that declares a local bool variable. This
307 should work around a compatibility problem with a Cray x1e C++
308 compiler reported by Hung Nguyen in
309 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
310 The for-loop was introduced in the 2004-11-17 change but I don't
311 know why it was needed.
312
3132006-07-12 Akim Demaille <akim@epita.fr>
314
315 * data/c.m4: Comment changes.
316
3172006-07-10 Akim Demaille <akim@lrde.epita.fr>
318
319 * src/complain.c (error_message, ERROR_MESSAGE): New.
320 To factor...
321 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
322 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
323
3242006-07-09 Paul Eggert <eggert@cs.ucla.edu>
325
326 * NEWS: Instead of %union, you can define and use your own union type
327 YYSTYPE if your grammar contains at least one <type> tag.
328 Your YYSTYPE need not be a macro; it can be a typedef.
329 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
330 (Union Decl, Decl Summary): Document this.
331 * data/glr.c (YYSTYPE): Implement this.
332 * data/glr.cc (YYSTYPE): Likewise.
333 * data/lalr1.cc (YYSTYPE): Likewise.
334 * data/yacc.c (YYSTYPE): Likewise.
335 * src/output.c (prepare): Output tag_seen_flag.
336 * src/parse-gram.y (declaration, grammar_declaration):
337 Use 'union_seen' rather than 'typed' to determine whether
338 %union has been seen, since grammars can now be typed without
339 %union.
340 (symbol_declaration, type.opt, symbol_def):
341 Keep track of whether a tag has been seen.
342 * src/reader.c (union_seen, tag_seen): New vars.
343 (typed): remove.
344 * src/reader.h (union_seen, tag_seen, typed): Likewise.
345 * src/scan-code.l (untyped_var_seen): New variable.
346 (handle_action_dollar): Adjust to above changes.
347 (handle_action_dollar, handle_action_at):
348 Improve overflow checking for outlandish numbers.
349 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
350 avoid new diagnostics generated by above changes.
351 * tests/regression.at (YYSTYPE typedef): Add test to check
352 for type tags without %union.
353
354 * src/symlist.c (symbol_list_length): Return int, not unsigned
355 int, since callers expect int. This may need to get revisited
356 once we have proper integer overflow checking.
357
358 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
359 object is now static.
360
361 * src/getargs.c (flags_argmatch): Return void, not int,
362 to pacify ./configure --enable-gcc-warnings.
363
364 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
365 since last_string is already defined to FLEX_PREFIX (last_string).
366
3672006-07-09 Akim Demaille <akim@lrde.epita.fr>
368
369 Implement --warnings/-W.
370 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
371 replaced by...
372 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
373 Adjust callers.
374 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
375 (warnings_args, warnings_types): New.
376 (getargs, short_options, long_options): Accept -W/--warnings.
377 Sort the options by alphabetical order, upper case letter right
378 before its lower case.
379
3802006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
381
382 Change %merge result type clash warnings to errors. Discussed at
383 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
384 * src/reader.c (record_merge_function_type): Use complain_at.
385 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
386 declared later): Update test case results.
387
3882006-07-09 Akim Demaille <akim@lrde.epita.fr>
389
390 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
391 to be in alphabetical order.
392 (trace_args): Spelling fixes.
393
3942006-07-09 Paul Eggert <eggert@cs.ucla.edu>
395
396 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
397 so they don't collide with user-defined macros.
398 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
399 this was never guaranteed, and now that we're using gnulib stdint,
400 which defines int_fast16_t to long int, the problem is exposed.
401
4022006-07-08 Paul Eggert <eggert@cs.ucla.edu>
403
404 * data/c.m4 (b4_basename): Simplify a bit, since we don't
405 need the full POSIX semantics (and weren't implementing them
406 anyway).
407
408 Adjust to Autoconf 2.60 and today's gnulib.
409 * bootstrap (gnulib_modules): Add stdint.
410 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
411 no longer copies it.
412 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
413 since stdint needs the former and wcwidth (which is now required
414 by mbswidth) needs the latter.
415 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
416 work around a compatibility glitch between gettext 0.14.6 and
417 Autoconf 2.60.
418 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
419 Do not check for uintptr_t, since new stdint module does the right
420 thing.
421 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
422 Add stdint.h, stdint_.h, wcwidth.h.
423 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
424 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
425 stdint.m4, wchar_t.m4, wcwidth.m4.
426 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
427 usual order for ../lib/*.h files.
428 (file_name_split): Use last_component, not base_name, to adjust
429 to gnulib changes.
430 * src/parse-gram.h: Include <strverscmp.h> in the usual order
431 for ../lib/*.h files.
432 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
433 Define unconditionally, since we now assume the stdint module.
434 * src/scan-skel.l: Include <dirname.h>.
435 (BASE_QPUTS): Use last_component, not base_name.
436 * src/system.h: Include <unlocked-io.h> in the usual order
437 for ../lib/*.h files. Include <stdint.h> unconditionally,
438 since we now use the stdint module.
439 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
440 HAVE_UINTPTR_T, since we now use the stdint module.
441 (base_name): Remove decl, since files now include <dirname.h>
442 to get the decl.
443
4442006-07-08 Akim Demaille <akim@lrde.epita.fr>
445
446 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
447 New, default to 1.
448 * data/yacc.c, data/glr.c, data/location.cc: Use them.
449 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
450 default.
451 * tests/calc.at: Adjust.
452
4532006-07-08 Akim Demaille <akim@lrde.epita.fr>
454
455 * data/c.m4 (b4_basename): New.
456 (b4_syncline): Also output the location of its invocation (from
457 the skeleton).
458 (b4_user_action, b4_define_user_action, b4_user_actions)
459 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
460 (b4_user_stype): New.
461 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
462
4632006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
464
465 In the grammar file, the first column is 1 not 0 on the first line as
466 on every other line.
467 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
468 * tests/input.at (Torturing the Scanner): Update output.
469
470 * src/scan-gram.l (scanner_cursor): Declare it static.
471
4722006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
473
474 In warnings, say "previous declaration" rather than "first
475 declaration".
476 * src/symtab.c (redeclaration): Do that here.
477 * src/reader.c (record_merge_function_type): In the case of a result
478 type clash, report the previous declaration rather than the very first
479 one in the grammar file.
480 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
481 declared later): Add a third declaration to check this behavior.
482 * tests/input.at (Incompatible Aliases): Update output.
483
4842006-06-27 Akim Demaille <akim@epita.fr>
485
486 * doc/Doxyfile.in: New.
487 * doc/Makefile.am: Use it.
488 * src/lalr.h, src/symtab.h: Initial doxygenation.
489
4902006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
491
492 Don't miss %merge result type warnings just because the LHS types are
493 declared after the %merge. This continues the effort of the previous
494 patch.
495 * src/reader.c (get_merge_function): Don't set the merger type yet.
496 (record_merge_function_type): New function for setting the merger type
497 and checking for clashes.
498 (grammar_current_rule_merge_set): Set the location of the %merge for
499 the current rule.
500 (packgram): Invoke record_merge_function_type for each rule now that
501 all symbol type declarations have been parsed.
502 * src/reader.h (merger_list.type_declaration_location): New member
503 storing the location of the first %merge from which the type for this
504 merging function was derived.
505 * src/symlist.h (symbol_list.merger_declaration_location): New member
506 storing the location of a rule's %merge, if any.
507 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
508 declared later): New test to catch the error fixed by the above patch.
509
5102006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
511
512 Get action warnings (grammar_rule_check) right even when symbol
513 declarations appear after the rules. Discussed at
514 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
515 and
516 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
517 Don't mistake the type of $$ in a midrule to be that of its parent
518 rule's $$.
519 * src/reader.c (grammar_current_rule_end): Don't invoke
520 grammar_rule_check yet since not all symbol declarations may have been
521 parsed yet.
522 (grammar_midrule_action): Likewise.
523 Don't record whether the midrule's $$ has been used yet since actions
524 haven't been translated yet.
525 Record the midrule's parent rule and its RHS index within the parent
526 rule.
527 (grammar_current_rule_action_append): Don't translate the action yet
528 since not all symbol declarations may have been parsed yet and, thus,
529 warnings about types for $$, $n, @$, and @n can't be reported yet.
530 (packgram): Translate the action and invoke grammar_rule_check now that
531 all symbol declarations have been parsed.
532 * src/scan-code.l (handle_action_dollar): Now that this is invoked
533 after parsing the entire grammar file, the symbol list here in the case
534 of a midrule is actually the midrule's empty RHS, so reference its
535 parent rule's RHS where necessary.
536 On the other hand, now that you can already know it's a midrule, you
537 aren't forced to think $$ has the same type as its parent rule's $$.
538 (handle_action_at): In the case of a midrule, reference the parent rule
539 where necessary.
540 * src/symlist.c (symbol_list_new): Initialize new midrule-related
541 members.
542 (symbol_list_length): Now that this is invoked after all rules have
543 been parsed, a NULL symbol (rather than a NULL symbol list node)
544 terminates a rule. symbol_list_print already does this correctly.
545 * src/symlist.h (symbol_list.midrule_parent_rule,
546 symbol_list.midrule_parent_rhs_index): New members so that midrules can
547 remember their relationships with their parents.
548 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
549 fixed by the above patch.
550 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
551 implementing...
552 (Unused values): ... this old test case and...
553 (Unused values before symbol declarations): ... this new test case.
554 This one is the same as `Unused values' except that all symbol
555 declarations appear after the rules in order to catch the rest of the
556 errors fixed by the above patch.
557
5582006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
559
560 More cleanup.
561 * src/reader.c (current_rule): Declare it static since it's no longer
562 used outside this file.
563 (grammar_current_rule_action_append): Remove redundant arguments from
564 translate_rule_action invocation.
565 * src/reader.h (current_rule): Remove this unused extern.
566 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
567 * src/scan-code.l (translate_rule_action): Likewise.
568
5692006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
570
571 Clean up yesterday's patch.
572 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
573 to...
574 * src/reader.c (grammar_current_rule_action_append): ... here for
575 consistency with grammar_current_rule_symbol_append.
576 * tests/regression.at (Braced code in declaration in rules section):
577 Make yyerror and yylex static as usual.
578
5792006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
580
581 Fix bug that mistakes braced code in a declaration in the rules section
582 to be a rule action. Mentioned at
583 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
584 * src/scan-gram.l: Move midrule action detection from the start of the
585 scanning of any braced code to...
586 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
587 action. For readability, use $2 and @2 rather than the equivalent
588 global variables.
589 * tests/regression.at (Braced code in declaration in rules section):
590 New test to catch the error fixed by the above patch.
591
592 Work on code readability some.
593 * src/scan-code.l (current_rule): Get rid of this misleading and
594 redundant declaration: it's actually extern'ed in reader.h.
595 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
596 translate_action): Add a rule argument and use it instead of the global
597 current_rule.
598 (translate_rule_action): This already receives current_rule through an
599 argument, so pass it on to translate_action instead of assigning
600 current_rule to current_rule.
601 (translate_symbol_action, translate_code): Pass rule = NULL to
602 translate_action.
603
6042006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
605
606 Rename %before-definitions to %start-header and %after-definitions to
607 %end-header. Don't use these declarations to separate pre-prologue
608 blocks from post-prologue blocks. Add new order-independent
609 declarations %before-header and %after-header as alternatives to the
610 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
611 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
612 * NEWS (2.3+): Update for these changes.
613 * data/glr.c (b4_before_definitions): Update to...
614 (b4_start_header): ... this.
615 (b4_after_definitions): Update to...
616 (b4_end_header): ... this.
617 * data/glr.cc: Likewise.
618 * data/lalr1.cc: Likewise.
619 * data/yacc.c: Likewise.
620 * doc/bison.texinfo (The prologue): Update names, and replace remaining
621 prologue blocks with %*-header declarations.
622 (Calc++ Parser): Likewise.
623 (Bison Declaration Summary): Update names.
624 (Bison Symbols): Update description.
625 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
626 (PERCENT_END_HEADER): ... this.
627 (PERCENT_BEFORE_DEFINITIONS): Update to...
628 (PERCENT_START_HEADER): ... this.
629 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
630 (declaration): Update token names and m4 macro names.
631 When parsing %end-header and %start-header, invoke translate_code
632 before muscle_code_grow, and no longer set global booleans to remember
633 whether these declarations have been seen.
634 Parse new %after-header and %before-header.
635 * src/reader.c (before_definitions, after_definitions): Remove.
636 (prologue_augment): Accept a new bool argument to specify whether to
637 augment the pre-prologue or post-prologue.
638 * src/reader.h (before_definitions, after_definitions): Remove these
639 extern's.
640 (prologue_augment): Add new bool argument.
641 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
642 (PERCENT_END_HEADER): ... this.
643 (PERCENT_BEFORE_DEFINITIONS): Update to...
644 (PERCENT_START_HEADER): ... this.
645 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
646 * tests/actions.at (Printers and Destructors): Update names.
647
6482006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
649
650 Add comparison operators for C++ location classes. Discussed at
651 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
652 * data/c++.m4 (b4_define_location_comparison): New boolean %define
653 declaration indicating whether filename_type has an operator==. If
654 filename_type is `std::string', it defaults to `1', `0' otherwise.
655 * data/location.cc: Iff b4_define_location_comparison is `1', add
656 operator== and operator!= for class position and for class location.
657
658 Some minor fixes.
659 * src/scan-action.l: Remove unused file.
660 * src/symtab.c (symbol_printer_set): Use printer_location not
661 destructor_location.
662 * src/symtab.h (struct symbol): Replace incorrect source comment for
663 printer members.
664 * tests/input.at (Incompatible Aliases): Update output with correct
665 printer location.
666
6672006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
668
669 Don't put the pre-prologue in the header file. For the yacc.c code
670 file and the glr.c header and code files, move the pre-prologue before
671 the token definitions. Add new %before-definitions and
672 %after-definitions to declare code that will go in both the header file
673 and code file. Discussed at
674 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
675 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
676 and
677 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
678 * NEWS (2.3+): Describe these changes.
679 * data/glr.c (b4_pre_prologue): Move from within to before...
680 (b4_shared_declarations): ... this.
681 Add new b4_before_definitions before b4_token_enums.
682 Add new b4_after_definitions at the end.
683 * data/glr.cc (b4_pre_prologue): Replace with...
684 (b4_before_definitions): ... this in the header file.
685 (b4_after_definitions): New near the end of the header file.
686 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
687 code file right before including the header file.
688 (b4_before_definitions): New in the previous position of
689 b4_pre_prologue in the header file.
690 (b4_after_definitions): New near the end of the header file.
691 * data/yacc.c: Clean up some m4 quoting especially in the header file.
692 (b4_token_enums_defines): In the code file, move to right before
693 YYSTYPE for consistency with the header file.
694 (b4_before_definitions): New right before b4_token_enums_defines in
695 both the header and code file.
696 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
697 header and code file.
698 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
699 of prologues for %union dependencies.
700 (Bison Declaration Summary): In %defines description, mention the
701 effect of %before-definitions and %after-definitions on the header
702 file.
703 (Calc++ Parser): Forward declare driver in a %before-definitions rather
704 than in the pre-prologue so that make check succeeds.
705 (Bison Symbols): Add entries for %before-definitions and
706 %after-definitions.
707 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
708 %before-definitions.
709 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
710 (declaration): Parse those declarations and append to
711 b4_before_definitions and b4_after_definitions, respectively.
712 * src/reader.c (before_definitions, after_definitions): New bools to
713 track whether those declarations have been seen.
714 (prologue_augment): Add to the post-prologue if %union,
715 %before-definitions, or %after-definitions has been seen.
716 * src/reader.h (before_definitions, after_definitions): New extern's.
717 * src/scan-gram.l: Scan the new declarations.
718 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
719 prologue block in a %before-definitions or a %after-definitions based
720 on whether the %union is declared.
721 * tests/regression.at (Early token definitions with --yacc, Early token
722 definitions without --yacc): Move tests for token definitions into the
723 post-prologue since token names are no longer defined in the
724 pre-prologue.
725
7262006-06-20 Akim Demaille <akim@epita.fr>
727
728 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
729 (symbol_get): Use it.
730 * src/parse-gram.y: Use it.
731
7322006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
733
734 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
735 build succeeds when configured with --enable-gcc-warnings.
736
7372006-06-19 Paul Eggert <eggert@cs.ucla.edu>
738
739 * src/parse-gram.y (char_name): New function.
740 (CHAR, STRING, string_content): For %printer, properly escape.
741 (ID): Prefer fputs to fprintf.
742 (id): Reindent to be consistent with other rules.
743 Properly quote char.
744
745 The Translation Project changed its way of publishing translations
746 to maintainers. I haven't received any responses to my request
747 for supporting the old way, or for documenting the new way. I
748 have modified 'bootstrap' to use screen scraping
749 (in this case, HTML scraping). This is unreliable and inelegant,
750 but I don't see any better way. Yuck.
751 * bootstrap (TP_URL, WGET_COMMAND): New vars.
752 (get_translations): New function, which uses HTML scraping to
753 deduce locations of latest translations.
754 Use this function to grab both bison and bison-runtime .po files.
755 Don't bother priming the pump for the runtime-po domain any more,
756 as it's now translated better than bison is.
757
7582006-06-19 Akim Demaille <akim@epita.fr>
759
760 * src/scan-gram.l: No longer "parse" things after `%union' until
761 `{'. Rather, return a single "%union" token.
762 No longer make symbols: return strings, and leave the conversion
763 to symbols to the parser.
764 (SC_PRE_CODE, token_type): Remove.
765 * src/parse-gram.y (%union): New field `character'.
766 Sort tokens.
767 (CHAR): New token.
768 (ID, ID_COLON): Now that the scanner no longer makes them
769 identifiers, adjust all uses to invoke symbol_get.
770 (id_colon): New, wraps the conversion from string to symbol.
771 (%union): Accept a possible union_name.
772 (symbol): Now can be a char.
773 * data/c.m4 (b4_union_name): Leave a default value.
774 * data/glr.c, data/yacc.c: Use it.
775
7762006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
777
778 For associating token numbers with token names for "yacc.c", don't use
779 #define statements unless `--yacc' is specified; always use enum
780 yytokentype. Most important discussions start at:
781 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
782 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
783 and
784 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
785 * NEWS (2.3+): Mention.
786 * data/c.m4 (b4_yacc_if): New.
787 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
788 token #define's.
789 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
790 on token name definitions.
791 * src/getargs.c (usage): Capitalize `Yacc' in English.
792 * src/output.c (prepare): Define b4_yacc_flag.
793 * tests/regression.at (Early token definitions): Test that tokens names
794 are defined before the pre-prologue not just before the post-prologue.
795 Remove this test case and copy to...
796 (Early token definitions with --yacc): ... this to test #define's.
797 (Early token definitions without --yacc): ... and this to test enums.
798
7992006-06-11 Paul Eggert <eggert@cs.ucla.edu>
800
801 * NEWS: Reword the post-2.3 change to not be so optimistic about
802 removing the old "look-ahead" spelling.
803 Update previous look-ahead/lookahead change reports.
804 * REFERENCES: look-ahead -> lookahead (since that's
805 what he actually wrote).
806 * doc/refcard.tex: look ahead -> lookahead,
807 look-ahead -> lookahead
808
8092006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
810
811 For consistency, use `lookahead' instead of `look-ahead' or
812 `look_ahead'. Discussed starting at
813 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
814 and then at
815 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
816 * NEWS: For the next release, note the change to `--report'.
817 * TODO, doc/bison.1: Update English.
818 * doc/bison.texinfo: Update English.
819 (Understanding Your Parser, Bison Options): Document as
820 `--report=lookahead' rather than `--report=look-ahead'.
821 * src/conflicts.c: Update English in comments.
822 (lookahead_set): Rename from look_ahead_set.
823 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
824 (resolve_sr_conflict): Rename local look_ahead_tokens to
825 lookahead_tokens, and update other uses.
826 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
827 count_rr_conflicts, conflicts_free): Update uses.
828 * src/getargs.c (report_args): Move "lookahead" before alternate
829 spellings.
830 (report_types): Update uses.
831 (usage): For `--report' usage description, state `lookahead' spelling
832 rather than `look-ahead'.
833 * src/getargs.h (report.report_lookahead_tokens): Rename from
834 report_look_ahead_tokens.
835 * src/lalr.c: Update English in comments.
836 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
837 (state_lookahead_tokens_count): Rename from
838 state_look_ahead_tokens_count.
839 Rename local n_look_ahead_tokens to n_lookahead_tokens.
840 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
841 Rename local n_look_ahead_tokens to n_lookahead_tokens.
842 Update other uses.
843 Update English in output.
844 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
845 * src/print.c: Update English in comments.
846 (lookahead_set): Rename from look_ahead_set.
847 (print_reduction): Rename argument lookahead_token from
848 look_ahead_token.
849 (print_core, state_default_rule, print_reductions, print_results):
850 Update uses.
851 * src/print_graph.c: Update English in comments.
852 (print_core): Update uses.
853 * src/state.c: Update English in comments.
854 (reductions_new): Update uses.
855 (state_rule_lookahead_tokens_print): Rename from
856 state_rule_look_ahead_tokens_print, and update other uses.
857 * src/state.h: Update English in comments.
858 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
859 (state_rule_lookahead_tokens_print): Rename from
860 state_rule_look_ahead_tokens_print.
861 * src/tables.c: Update English in comments.
862 (conflict_row, action_row): Update uses.
863 * tests/glr-regression.at
864 (Incorrect lookahead during deterministic GLR,
865 Incorrect lookahead during nondeterministic GLR): Rename
866 print_look_ahead to print_lookahead.
867 * tests/torture.at: Update English in comments.
868 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
869 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
870 (Many lookahead tokens): Update uses.
871 * data/glr.c: Update English in comments.
872 * lalr1.cc: Likewise.
873 * yacc.c: Likewise.
874 * src/conflicts.h: Likewise.
875 * src/lalr.h: Likewise.
876 * src/main.c: Likewise.
877 * src/output.c: Likewise.
878 * src/parse-gram.c: Likewise.
879 * src/tables.h: Likewise.
880 * tests/calc.at: Likewise.
881
8822006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
883
884 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
885
8862006-06-07 Paul Eggert <eggert@cs.ucla.edu>
887
888 * TODO: Add request from Nelson H. F. Beebe to be able to install
889 Bison without installing the yacc script.
890
8912006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
892
893 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
894 and yytext if they're already #define'd.
895 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
896 * src/scan-code-c.c: ... here.
897 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
898 <config.h>.
899
9002006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
901
902 Get Bison to build again when configured with --enable-gcc-warnings.
903 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
904 missing #include's.
905 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
906 loc argument as it shadows a global.
907 * src/scan-gram.l: Remove stray comma that prevents boundary_set
908 invocation.
909
910 * src/.cvsignore: Add scan-code.c.
911
9122006-06-07 Akim Demaille <akim@epita.fr>
913
914 * src/scan-gram.l: Move the "add a trailing ; to actions" code
915 to...
916 * src/scan-code.l: here.
917 * tests/input.at (Torturing the Scanner): Fix another location
918 error.
919
9202006-06-07 Akim Demaille <akim@epita.fr>
921
922 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
923
9242006-06-06 Akim Demaille <akim@epita.fr>
925
926 Extract the parsing of user actions from the grammar scanner.
927 As a consequence, the relation between the grammar scanner and
928 parser is much simpler. We can also split "composite tokens" back
929 into simple tokens.
930 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
931 * src/scan-gram.l (add_column_width, adjust_location): Move to and
932 rename as...
933 * src/location.h, src/location.c (add_column_width)
934 (location_compute): these.
935 Fix the column count: the initial column is 0.
936 (location_print): Be robust to ending column being 0.
937 * src/location.h (boundary_set): New.
938 * src/main.c: Adjust to scanner_free being renamed as
939 gram_scanner_free.
940 * src/output.c: Include scan-code.h.
941 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
942 Use boundary_set.
943 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
944 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
945 which is now, again, a separate token.
946 Adjust all dependencies.
947 Whereever actions with $ and @ are used, use translate_code.
948 (action): Remove this nonterminal which is now useless.
949 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
950 (grammar_current_rule_action_append): Use translate_code.
951 (packgram): Bound check ruleno, itemno, and rule_length.
952 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
953 (last_string, last_braced_code_loc, max_left_semantic_context)
954 (scanner_initialize, scanner_free, scanner_last_string_free)
955 (gram_out, gram_lineno, YY_DECL_): Move to...
956 * src/scan-gram.h: this new file.
957 (YY_DECL): Rename as...
958 (GRAM_DECL): this.
959 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
960 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
961 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
962 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
963 Move these declarations, and...
964 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
965 these to...
966 * src/flex-scanner.h: this new file.
967 * src/scan-gram.l (rule_length, rule_length_overflow)
968 (increment_rule_length): Remove.
969 (last_braced_code_loc): Rename as...
970 (gram_last_braced_code_loc): this.
971 Adjust to the changes of the parser.
972 Move all the handling of $ and @ into...
973 * src/scan-code.l: here.
974 * src/scan-gram.l (handle_dollar, handle_at): Remove.
975 (handle_action_dollar, handle_action_at): Move to...
976 * src/scan-code.l: here.
977 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
978 scan-code.h, scan-code-c.c, scan-gram.h.
979 (EXTRA_bison_SOURCES): Add scan-code.l.
980 (BUILT_SOURCES): Add scan-code.c.
981 (yacc): Be robust to white spaces.
982
983 * tests/conflicts.at, tests/input.at, tests/reduce.at,
984 * tests/regression.at: Adjust the column numbers.
985 * tests/regression.at: Adjust the error message.
986
9872006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
988
989 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
990 Use Akim's wording from
991 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
992
9932006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
994
995 Between Bison releases, manually append `+' to the previous Bison
996 release number, and use that as a signal to automatically print the
997 ChangeLog's CVS Id keyword from --version. Discussed starting at
998 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
999 * ChangeLog: Add Id header.
1000 * configure.ac (AC_INIT): Append `+' to `2.3'.
1001 * src/.cvsignore: Add revision.c.
1002 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
1003 (BUILT_SOURCES): Add revision.c.
1004 (revision.c): New target rule. This file defines a new global variable
1005 named revision. It initializes it with either the Id from ChangeLog
1006 or, if VERSION doesn't contain `+', with the empty string.
1007 * src/getargs.c (version): Print the value of revision.
1008 * src/revision.h: Extern revision.
1009
10102006-06-05 Paul Eggert <eggert@cs.ucla.edu>
1011
1012 * NEWS: Version 2.3.
1013 * configure.ac (AC_INIT): Likewise.
1014
10152006-05-30 Paul Eggert <eggert@cs.ucla.edu>
1016
1017 * data/glr.c (YYRECOVERING): Define to be a function-like macro
1018 with no arguments, not as an object-like macro. This is for
1019 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
1020 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
1021 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
1022 Document this.
1023
10242006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
1025
1026 * src/getargs.c (usage): Back out yesterday's modification of the
1027 --help output so that we don't have to wait for translation before
1028 releasing 2.3.
1029
10302006-05-29 Paul Eggert <eggert@cs.ucla.edu>
1031
1032 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
1033 Problem reported by Akim Demaille.
1034
10352006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1036
1037 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
1038
10392006-05-26 Paul Eggert <eggert@cs.ucla.edu>
1040
1041 * data/yacc.c (yy_reduce_print): Omit trailing white space in
1042 generated source code. Problem reported by Frans Englich in
1043 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
1044
10452006-05-22 Paul Eggert <eggert@cs.ucla.edu>
1046
1047 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
1048 shell, not within 'make', so that 'make' by an ordinary builder
1049 (using GNU make) does not worry about configuring gzip. This also
1050 works around a bug reported independently by Keith Thompson and by
1051 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
1052 stderr rather than stdout, messing up the build logs.
1053
10542006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1055
1056 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
1057 to make sure that YYID will never be unused. This fixes a 'make
1058 maintainer-check' failure caused by the recent changes to the 'Trivial
1059 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
1060 not used.
1061 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
1062
10632006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
1064
1065 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
1066 state before an empty RHS is always resolved here. Only the location
1067 of that state is guaranteed to be resolved, and that's enough. This
1068 fixes the remaining bug reported by Derek M. Jones in
1069 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1070 * tests/glr-regression.at (Uninitialized location when reporting
1071 ambiguity): Test the above case.
1072 Also, the embedded comments in this test case claim it checks the case
1073 of an empty RHS that has inherited the initial location. However, the
1074 corresponding LHS was already resolved, so yyresolveLocations didn't
1075 actually have reason to modify it. Fix this by forcing
1076 nondeterministic operation at the beginning of the parse.
1077
10782006-05-20 Paul Eggert <eggert@cs.ucla.edu>
1079
1080 * data/c.m4 (b4_yy_symbol_print_generate):
1081 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
1082 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
1083 of the bugs reported today by Derek M Jones in
1084 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
1085 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
1086 defined to be a type name without parens or brackets.
1087 (Location Type): Similarly for YYLTYPE.
1088 * tests/regression.at (Trivial grammars): Put in a test for this
1089 bug that will be caught by 'make maintainer-check' (though not,
1090 alas, by 'make check' unless your compiler is picky).
1091
10922006-05-19 Paul Eggert <eggert@cs.ucla.edu>
1093
1094 * NEWS: Version 2.2.
1095 * configure.ac (AC_INIT): Likewise.
1096
10972006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
1098
1099 * data/glr.c (yyreportTree): Make room in yystates for the state
1100 preceding the RHS. This fixes the segmentation fault reported by Derek
1101 M. Jones in
1102 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
1103 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
1104 to the user. Reported for yyreportTree by Derek M. Jones later in the
1105 same thread.
1106 * THANKS: Add Derek M. Jones.
1107 Update my email address.
1108 Fix typo in Steve Murphy's name.
1109
11102006-05-14 Paul Eggert <eggert@cs.ucla.edu>
1111
1112 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
1113 checking against YYLAST that caused the parser to miss a potential
1114 alternative in its diagnostic.
1115 Problem reported by Maria Jose Moron Fernandez in
1116 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
1117 * data/lalr1.cc (yysyntax_error_): Likewise.
1118 * data/yacc.c (yysyntax_error): Likewise.
1119 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
1120 tokens, in case we run into an older C compiler.
1121 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
1122 Use them to check for the off-by-one error fixed above.
1123
1124 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
1125 YYSIZE_T, not size_t.
1126 * tests/regression.at (Trivial grammars): New test, to catch
1127 the error fixed by the above patch.
1128
11292006-05-14 Akim Demaille <akim@lrde.epita.fr>
1130
1131 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
1132 scheme.
1133 Reported by Steve Murphy.
1134
11352006-05-14 Akim Demaille <akim@lrde.epita.fr>
1136
1137 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
1138 * data/glr.cc: b4_location_flag is now b4_locations_flag.
1139
11402006-05-14 Akim Demaille <akim@lrde.epita.fr>
1141
1142 Implement --trace=m4.
1143 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
1144 * src/output.c (output_skeleton): When set, pass -dV to m4.
1145
1146 Factor the handling of flags in m4.
1147 * src/output.c (prepare): Rename the muscle names debug, defines,
1148 error_verbose to debug_flag, defines_flag, error_verbose_flag.
1149 * data/c.m4: Adjust.
1150 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
1151 Use b4_define_flag_if to define other b4_FLAG_if macros.
1152 (b4_location_if): As a consequence, rename as...
1153 (b4_locations_if): this, for consistency.
1154 Adjust all the skeletons.
1155
11562006-05-14 Akim Demaille <akim@lrde.epita.fr>
1157
1158 * etc/bench.pm: Shorten bench names.
1159
11602006-05-14 Akim Demaille <akim@lrde.epita.fr>
1161
1162 * src/output.h, src/output.c (error_verbose): Move to...
1163 * src/getargs.h, src/getargs.c: here.
1164 Sort the flags.
1165 Adjust dependencies.
1166
11672006-05-13 Paul Eggert <eggert@cs.ucla.edu>
1168
1169 * data/c.m4 (b4_copyright): Put the special exception for Bison
1170 skeletons here, so we don't have to put it in each skeleton. All
1171 uses changed. Suggested by Akim Demaille. Also, wrap the
1172 copyright notice, in case it is longer than 80 columns. Replace
1173 comma by newline after title.
1174
11752006-05-11 Paul Eggert <eggert@cs.ucla.edu>
1176
1177 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
1178 incompatibility, not a bug. Mention that it wasn't fixed as of
1179 flex 2.5.33.
1180
11812006-05-11 Akim Demaille <akim@lrde.epita.fr>
1182
1183 * examples/extexi: Enforce the precedence of concatenation over
1184 >>.
1185 Reported by Tommy Nordgren.
1186
11872006-05-11 Akim Demaille <akim@lrde.epita.fr>
1188
1189 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
1190 with the member "token".
1191 Reported by Martin Nylin.
1192
11932006-05-08 Paul Eggert <eggert@cs.ucla.edu>
1194
1195 * data/glr.c: Switch to Bison 2.2 special-exception language in
1196 the copyright notice. Use more-regular format for titles and
1197 copyright notices.
1198 * data/glr.cc: Likewise.
1199 * data/location.cc: Likewise.
1200 * data/yacc.cc: Likewise.
1201 * doc/bison.texinfo (Conditions): Document this.
1202 * NEWS: likewise. Upgrade version to 2.2.
1203
12042006-04-27 Akim Demaille <akim@lrde.epita.fr>
1205
1206 * data/glr.cc: Remove dead code.
1207
12082006-04-25 Paul Eggert <eggert@cs.ucla.edu>
1209
1210 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
1211 that variable and the line breaks the bootstrap. Problem reported
1212 by Juan M. Guerrero.
1213
12142006-04-24 Akim Demaille <akim@lrde.epita.fr>
1215
1216 * doc/bison.texinfo (Multiple start-symbols): New.
1217
12182006-04-24 Akim Demaille <akim@lrde.epita.fr>
1219
1220 * etc/README, etc/bench.pl: New.
1221
12222006-04-03 Akim Demaille <akim@lrde.epita.fr>
1223
1224 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
1225 rule.
1226 Reported by Mickael Labau.
1227 * tests/input.at (Torturing the Scanner): Test it.
1228
12292006-03-16 Paul Eggert <eggert@cs.ucla.edu>
1230
1231 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
1232 Problem reported by Bob Rossi.
1233
12342006-03-13 Paul Eggert <eggert@cs.ucla.edu>
1235
1236 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
1237 and didn't really work.
1238 For the index, use @ifnotinfo, not @iftex.
1239 Minor cleanups of spacing and terminology.
1240
12412006-03-12 Akim Demaille <akim@lrde.epita.fr>
1242
1243 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
1244 of AT_NAME_PREFIX when %name-prefix is not used.
1245
12462006-03-12 Akim Demaille <akim@lrde.epita.fr>
1247
1248 Apply --prefix to C++ skeletons too: they change the namespace.
1249 The test suite already exercize these cases.
1250 * data/c++.m4 (b4_namespace): New.
1251 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
1252 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
1253 * data/yacc.c, data/glr.c: Remove a useless `[]'.
1254 * doc/bison.texinfo: Document it.
1255 (Option Cross Key): Use @multitable in all formats. It looks
1256 nicer, even in TeX outputs.
1257 (Rules): Use the same code whatever the output type is.
1258 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
1259 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
1260 * tests/calc.at: Use it, instead of hard coding `yy'.
1261
12622006-03-10 Akim Demaille <akim@lrde.epita.fr>
1263
1264 * TODO: Remove dead items.
1265
12662006-03-10 Akim Demaille <akim@lrde.epita.fr>
1267
1268 * doc/FAQ: Remove, merged into...
1269 * doc/bison.texinfo (FAQ): this.
1270 * doc/Makefile.am (EXTRA_DIST): Adjust.
1271
12722006-03-10 Akim Demaille <akim@lrde.epita.fr>
1273
1274 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
1275 even if empty.
1276 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
1277 * doc/bison.texinfo (Calc++ Scanner): Use it.
1278
12792006-03-09 Paul Eggert <eggert@cs.ucla.edu>
1280
1281 Fix two nits reported by twlevo, plus one more that I discovered.
1282
1283 * src/assoc.h (assoc_to_string): Give a name to the arg, as
1284 this is the usual Bison style.
1285 * src/location.h (location_print): Likewise.
1286
1287 * src/reader.h (token_name): Likewise.
1288
12892006-03-08 Paul Eggert <eggert@cs.ucla.edu>
1290
1291 Fix some nits reported by twlevo.
1292 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
1293 and "POSIX". Use more-modern syntax for URLs. Mention C++
1294 and ask for Java. Don't hardwire OS version numbers. Add
1295 copyright notice.
1296 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
1297 * src/conflicts.c (solved_conflicts_obstack): Now static.
1298
12992006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
1300
1301 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
1302 page. Say "you can use it" not "you may use it" as on the web page;
1303 we're describing capabilities not granting permission.
1304
13052006-03-06 Paul Eggert <eggert@cs.ucla.edu>
1306
1307 * data/glr.c (yyresolveLocations): Rename local variables to avoid
1308 shadowing warnings. Use usual patter for iterating through RHS.
1309 * tests/glr-regression.at
1310 (Uninitialized location when reporting ambiguity):
1311 Modify yylex so that it uses its argument, rather than trying
1312 to rely on ARGSUSED (which doesn't work for gcc with warnings).
1313 const char -> char const.
1314
1315 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
1316 Don't use tabs inside commands; it messes up 'ps'.
1317 Problem reported by twlevo.
1318
13192006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
1320
1321 * tests/glr-regression.at (Uninitialized location when reporting
1322 ambiguity): New test case.
1323 * data/glr.c (yyresolveLocations): New function, which uses
1324 YYLLOC_DEFAULT.
1325 (yyresolveValue): Invoke yyresolveLocations before reporting an
1326 ambiguity.
1327 * doc/bison.texinfo (Default Action for Locations): Note
1328 YYLLOC_DEFAULT's usage for ambiguity locations.
1329 (GLR Semantic Actions): Cross-reference those notes.
1330
13312006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
1332
1333 * tests/glr-regression.at (Leaked semantic values when reporting
1334 ambiguity): Remove unnecessary union and type declarations.
1335 (Leaked lookahead after nondeterministic parse syntax error): New test
1336 case.
1337 * data/glr.c (yyparse): Check for zero stacks remaining before
1338 attempting to shift the lookahead so that you don't lose it.
1339
13402006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1341
1342 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
1343 * tests/glr-regression.at (Leaked semantic values when reporting
1344 ambiguity): New test case.
1345 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
1346 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
1347 now unnecessary yystackp parameter.
1348 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
1349 destructors can be called.
1350
1351 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
1352 in existing testcases.
1353
13542006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1355
1356 Don't leak semantic values for parent RHS when a user action cuts the
1357 parser, and clean up related code a bit.
1358 * tests/glr-regression.at (Leaked merged semantic value if user action
1359 cuts parse): Rename to...
1360 (Leaked semantic values if user action cuts parse): ... this. Add check
1361 for leaked parent RHS values.
1362 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
1363 between an unresolved state (non-empty chain of semantic options) and
1364 an incomplete one (signaled by an empty chain).
1365 (yyresolveStates): Document the interface. Move all manipulation of a
1366 successfully or unsuccessfully resolved yyGLRState to...
1367 (yyresolveValue): ... here so that yyresolveValue always leaves a
1368 yyGLRState with consistent data and thus is easier to understand.
1369 Remove the yyvalp and yylocp parameters since they are always just
1370 taken from the yys parameter. When reporting a discarded merged value
1371 in debugging output, note that it is incompletely merged. Document the
1372 interface.
1373 (yyresolveAction): If resolving any of the RHS states fails, destroy
1374 them all rather than leaking them. Thus, as long as user actions are
1375 written to clean up the RHS correctly, yyresolveAction always cleans up
1376 the RHS of a semantic option. Document the interface.
1377
13782006-02-27 Paul Eggert <eggert@cs.ucla.edu>
1379
1380 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
1381 led to a segmentation fault in GNU Pascal. Problem reported
1382 by Waldek Hebisch.
1383
13842006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
1385
1386 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
1387 mid-rule action inside a nonterminal symbol in order to declare a
1388 destructor for its semantic value.
1389
13902006-02-16 Paul Eggert <eggert@cs.ucla.edu>
1391
1392 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
1393 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
1394 __cplusplus && ! defined _STDLIB_H && !
1395 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
1396 defined free))]: Include <stdlib.h> rather than rolling our own
1397 declarations of malloc and free, to avoid problems with
1398 incompatible declarations (using 'throw') C++'s stdlib.h. This
1399 should fix Debian bug 340012
1400 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
1401 reported by Guillaume Melquiond.
1402
14032006-02-13 Paul Eggert <eggert@cs.ucla.edu>
1404
1405 * NEWS: Clarify symbols versus types in unused-value warnings.
1406
1407 * configure.ac (AC_INIT): Bump version number.
1408
14092006-02-13 Paul Eggert <eggert@cs.ucla.edu>
1410
1411 * NEWS: Version 2.1a.
1412 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
1413 since C99 requires this.
1414
14152006-02-11 Paul Eggert <eggert@cs.ucla.edu>
1416
1417 * m4/c-working.m4: New file.
1418 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
1419
14202006-02-10 Paul Eggert <eggert@cs.ucla.edu>
1421
1422 * Makefile.maint: Merge from coreutils.
1423
14242006-02-09 Paul Eggert <eggert@cs.ucla.edu>
1425
1426 More portability fixes for problems summarized by Nelson H. F. Beebe.
1427
1428 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
1429 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
1430 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
1431 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
1432 messes up because C++ code is compiled in 32-bit mode but linked
1433 in 64-bit mode.
1434
14352006-02-08 Paul Eggert <eggert@cs.ucla.edu>
1436
1437 More portability fixes for problems summarized by Nelson H. F. Beebe.
1438
1439 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
1440 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
1441
1442 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
1443 nodist_PROGRAMS, since we don't need to actually compile the
1444 example if we're just doing a plain 'make'. This avoids bothering
1445 the installer unnecessarily about problems due to weird C++
1446 compilers.
1447
14482006-02-06 Paul Eggert <eggert@cs.ucla.edu>
1449
1450 More portability fixes for problems summarized by Nelson H. F. Beebe.
1451
1452 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
1453 than #include "...", and compile with -I'.'. The old method was
1454 not portable, according to Posix and the C standard, and it does
1455 not work with Sun C 5.7, where previous #line directives affect
1456 the working directory used in later #include "..." directives.
1457
14582006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1459
1460 Various DJGGP specific issues in /djgpp
1461
14622006-02-02 Paul Eggert <eggert@cs.ucla.edu>
1463
1464 More portability fixes for problems summarized by Nelson H. F. Beebe.
1465
1466 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
1467 '#include <map>' works and that you can apply ++ to iterators.
1468
14692006-02-01 Paul Eggert <eggert@cs.ucla.edu>
1470
1471 Work around portability problems summarized by Nelson H. F. Beebe in
1472 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
1473
1474 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
1475 that '#include <string>' works.
1476
1477 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
1478 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
1479 "warning: sorry: semantics of inline function static data `const
1480 unsigned char translate_table[262]' are wrong (you'll wind up with
1481 multiple copies)".
1482
1483 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
1484 or, xor to not_, and_, or_, and xor_, respectively. This works
1485 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
1486 random system header somewhere that includes the equivalent of
1487 <iso646.h>.
1488
1489 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
1490 -E" works; it apparently doesn't work with PathScale EKO Compiler
1491 Suite Version 2.0.
1492
14932006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
1494
1495 During deterministic GLR operation, user actions should be able to
1496 influence the parse by changing yychar. To make this easier to fix and
1497 to make glr.c easier to evolve in general, don't maintain yytoken in
1498 parallel with yychar; just compute yytoken when needed.
1499 * tests/glr-regression.at (Incorrect lookahead during deterministic
1500 GLR): Check that setting yychar in a user action has the intended
1501 effect.
1502 * data/glr.c (yyGLRStack): Remove yytokenp member.
1503 (yyclearin): Don't set *yytokenp.
1504 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
1505 yychar rather than *yytokenp to determine the current lookahead.
1506 Compute yytoken locally when needed.
1507 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
1508 point to.
1509
1510 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
1511 after `--report' documentation.
1512
15132006-01-30 Paul Eggert <eggert@cs.ucla.edu>
1514
1515 * src/parse-gram.y (grammar_declaration): Location of printer
1516 symbol is @1, not list->location. Bug reported by twlevo.
1517 * tests/input.at (Incompatible Aliases): Adjust to above change.
1518
15192006-01-29 Paul Eggert <eggert@cs.ucla.edu>
1520
1521 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
1522 all the test at once. This makes the output easier to read in the
1523 normal case.
1524
1525 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
1526 got from <http://bro-ids.org/download.html>. The bug is that
1527 when two actions appeared in succession, the second one was
1528 scanned before the first one was added to the grammar rule
1529 as a midrule action. Bison then output the incorrect warning
1530 "parse.y:905.17-906.36: warning: unused value: $3".
1531 * src/parse-gram.y (BRACED_CODE, action): These are no longer
1532 associated with a value.
1533 (rhs): Don't invoke grammar_current_rule_action_append.
1534 (action): Invoke it here instead.
1535 * src/reader.c (grammar_midrule_action): Now extern.
1536 (grammar_current_rule_action_append): Don't invoke
1537 grammar_midrule_action; that is now the scanner's job.
1538 * src/reader.h (last_string, last_braced_code_loc):
1539 (grammar_midrule_action): New decls.
1540 * src/scan-gram.l (last_string): Now extern, sigh.
1541 (last_braced_code_loc): New extern variable.
1542 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
1543 rule already has an action.
1544 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
1545 * tests/input.at (AT_CHECK_UNUSED_VALUES):
1546 Add some tests to check that the above changes fixed the bug.
1547
15482006-01-27 Paul Eggert <eggert@cs.ucla.edu>
1549
1550 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
1551 All used changed. Check whether the symbol has a destructor,
1552 not whether it is typed.
1553 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
1554 that the values are still reported as unused. All line numbers
1555 adjusted.
1556
15572006-01-23 Paul Eggert <eggert@cs.ucla.edu>
1558
1559 Work around a bug in bro 0.8, which underparenthesizes its
1560 definition of YYLLOC_DEFAULT.
1561 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
1562 their arguments.
1563 * data/lalr1.cc: Likewise.
1564 * data/yacc.cc: Likewise.
1565
15662006-01-22 Paul Eggert <eggert@cs.ucla.edu>
1567
1568 Work around a bug in Pike 7.0, and give the Pike folks a
1569 better way to override the usual int widths.
1570 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
1571 user can override the types.
1572 (short): #undef, to work around a bug in Pike 7.0.
1573 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
1574 (union yyalloc.yyss): Use yytype_int16 rather than short.
1575 All uses changed.
1576 (yysigned_char): Remove.
1577 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
1578 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
1579 * tests/regression.at (Web2c Actions): Adjust to above changes.
1580
1581 * src/reader.c (check_and_convert_grammar): New function.
1582 (reader): Close the input file even if something went wrong during
1583 parsing. Minor file descriptor leak reported by twlevo.
1584
1585 * src/assoc.c (assoc_to_string): Use a default: abort (); case
1586 to pacify gcc -Wswitch-default.
1587 * src/scan-gram.l (adjust_location): Use a default: break; case
1588 to pacify gcc -Wswitch-default.
1589 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
1590 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
1591 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
1592 Move these decls to scan-skel.l, since they don't need to be
1593 visible elsewhere.
1594 * src/scan-skel.l: Accept the above decls.
1595 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
1596 is used.
1597
15982006-01-21 Paul Eggert <eggert@cs.ucla.edu>
1599
1600 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
1601 since we don't want to insist on a version number at the start
1602 of the changelog every time.
1603 * Makefile.maint: Sync from coreutils a bit better.
1604 (sc_trailing_blank): Renamed from sc_trailing_space.
1605 All uses changed.
1606 (sc_no_if_have_config_h, sc_require_config_h):
1607 (sc_prohibit_assert_without_use): New rules.
1608 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
1609 (sc_dd_max_sym_length): Fix leading spaces in rule.
1610 (sc_system_h_headers): Prefix with @.
1611 (sc_useless_cpp_parens, m4-check): Output line numbers.
1612 (changelog-check): Allow version only in head.
1613 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
1614 satisfy new Makefile.maint rule.
1615 * data/glr.c: Likewise.
1616 * data/glr.cc: Likewise.
1617 * data/lalr1.cc: Likewise.
1618 * data/yacc.c: Likewise.
1619 * lib/ebitsetv.c: Likewise.
1620 * lib/lbitset.c: Likewise.
1621 * lib/subpipe.c: Likewise.
1622 * lib/timevar.c: Likewise.
1623 * src/system.h: Likewise.
1624 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
1625 * djgpp/Makefile.maint: Add copyright notice.
1626 * djgpp/README.in: Likewise.
1627 * djgpp/config.bat: Likewise.
1628 * djgpp/config.site: Likewise.
1629 * djgpp/config_h.sed: Likewise.
1630 * djgpp/djunpack.bat: Likewise.
1631 * djgpp/config.sed: Fix copyright notice to match standard format.
1632 * djgpp/subpipe.h: Likewise.
1633 * lib/bitsetv-print.c: Likewise.
1634 * lib/bitsetv.c: Likewise.
1635 * lib/subpipe.h: Likewise.
1636 * lib/timevar.c: Likewise.
1637 * lib/timevar.h: Likewise.
1638 * djgpp/subpipe.c: Use standard recipe for config.h.
1639 * lib/abitset.c: Likewise.
1640 * lib/bitset.c: Likewise.
1641 * lib/bitset_stats.c: Likewise.
1642 * lib/bitsetv-print.c: Likewise.
1643 * lib/bitsetv.c: Likewise.
1644 * lib/ebitsetv.c: Likewise.
1645 * lib/get-errno.c: Likewise.
1646 * lib/lbitset.c: Likewise.
1647 * lib/subpipe.c: Likewise.
1648 * lib/timevar.c: Likewise.
1649 * lib/vbitset.c: Likewise.
1650 * tests/local.at: Likewise.
1651 * src/scan-gram.l: Don't include verify.h, since system.h does
1652 that for us.
1653 * .x-sc_require_config_h: New file.
1654 * .x-sc_unmarked_diagnostics: New file.
1655
16562006-01-20 Paul Eggert <eggert@cs.ucla.edu>
1657
1658 Be a bit more systematic about using 'abort'.
1659 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
1660 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
1661 Put 'default: abort ();' before some other case, to satisfy older
1662 pedantic compilers.
1663 * lib/bitset_stats.c (bitset_stats_init): Likewise.
1664 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
1665 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
1666 * src/conflicts.c (resolve_sr_conflict): Likewise.
1667 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
1668 (get_decision_str, get_orientation_str, get_node_alignment_str):
1669 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
1670 (get_linestyle_str, get_arrowstyle_str): Likewise.
1671 * src/conflicts.c (resolve_sr_conflict):
1672 Use a default case rather than one for the one remaining enum
1673 value, to catch invalid enum values as well.
1674 * src/lalr.c (set_goto_map, map_goto):
1675 Prefer "assert (FOO);" to "if (!FOO) abort ();".
1676 * src/nullable.c (nullable_compute, token_definitions_output):
1677 Likewise.
1678 * src/reader.c (packgram, reader): Likewise.
1679 * src/state.c (transitions_to, state_new, state_reduction_find):
1680 Likewise.
1681 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
1682 (symbol_pack): Likewise.
1683 * src/tables.c (conflict_row, pack_vector): Likewise.
1684 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
1685 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
1686 * src/system.h: Don't include <assert.h>.
1687 (assert): New macro.
1688
1689 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
1690 (Destructor Decl, Parser Function, Pure Calling):
1691 Describe rules for braces inside C code more carefully.
1692
16932006-01-19 Paul Eggert <eggert@cs.ucla.edu>
1694
1695 Fix some porting glitches found by Nelson H. F. Beebe.
1696 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
1697 compilers that don't understand that abort () does not return.
1698 * src/state.c (transitions_to): Likewise.
1699 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
1700 that '#include <cstdlib>' works.
1701 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
1702 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
1703 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
1704 for the benefit of some pre-C99 compilers.
1705
1706 * bootstrap: Undo changes to gnulib files that autoreconf made.
1707
1708 Minor fixups to get 'make maintainer-check' to work.
1709 * configure.ac: Don't use -Wnested-externs, as it's incompatible
1710 with the new verify.h implementation.
1711 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
1712 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
1713 * data/yacc.c (YYUSE): Likewise.
1714 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
1715 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
1716 * src/parse-gram.y (declaration): Don't pass a string constant
1717 to a function that expects char *, since GCC might complain
1718 about the constant value.
1719 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
1720 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
1721 before #defining them.
1722 * tests/glr-regression.at
1723 (Incorrectly initialized location for empty right-hand side in GLR):
1724 In yyerror, use the msg arg.
1725 (Corrupted semantic options if user action cuts parse):
1726 (Incorrect lookahead during deterministic GLR):
1727 (Incorrect lookahead during nondeterministic GLR):
1728 Don't name a local var 'index'; it shadows string.h's 'index'.
1729
17302006-01-19 Akim Demaille <akim@epita.fr>
1731
1732 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
1733 location, not just parts of it.
1734
17352006-01-18 Paul Eggert <eggert@cs.ucla.edu>
1736
1737 * NEWS: Document the fact that multiple %unions are now allowed.
1738 * doc/bison.texinfo (Union Decl): Likewise.
1739 * TODO: This feature is now implemented, so remove it from
1740 the wishlist.
1741
1742 * Makefile.maint: Merge with coreutils Makefile.maint.
1743 (CVS_LIST): Use build-aux version if available.
1744 (VERSION_REGEXP): New macro.
1745 (syntax-check-rules): Add sc_no_if_have_config_h,
1746 sc_prohibit_assert_without_use, sc_require_config_h,
1747 sc_useless_cpp_parens.
1748 (sc_obsolete_symbols): Check for O_NDELAY.
1749 (sc_dd_max_sym_length): Track coreutils.
1750 (sc_unmarked_diagnostics): Look in all files, not just *.c.
1751 (sc_useless_cpp_parens): New rule.
1752 (news-date-check): Look for version or today's date.
1753 (changelog-check): Don't require version number near head.
1754 (copyright-check): Use current year instead of hardwiring 2005.
1755 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
1756 (announcement): Add --gpg-key-ID.
1757
1758 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
1759 with "file system".
1760
1761 Avoid undefined behavior that addressed just before the start of an
1762 array. Problem reported by twlevo.
1763 * src/reader.c (packgram): Prepend a new sentinel before ritem.
1764 * src/lalr.c (build_relations): Rely on new sentinel.
1765 * src/gram.c (gram_free): Adjust to new sentinel.
1766
17672006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
1768
1769 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
1770 yylookaheadNeeds. All uses updated.
1771 (yysplitStack): Rename local yynewLookaheadStatuses to
1772 yynewLookaheadNeeds.
1773 * data/glr-regression.at (Incorrect lookahead during nondeterministic
1774 GLR): In comments, change `lookahead status' to `lookahead need'.
1775
17762006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
1777
1778 * data/glr.c (yysplitStack): A little stylistic rewrite.
1779
17802006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
1781
1782 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
1783
17842006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
1785
1786 * doc/bison.texinfo: Fix some typos.
1787 (GLR Semantic Actions): New subsection discussing special
1788 considerations because GLR semantic actions might be deferred.
1789 (Actions): Mention look-ahead usage of yylval.
1790 (Actions and Locations): Mention look-ahead usage of yylloc.
1791 (Special Features for Use in Actions): Add YYEOF entry and mention it
1792 in the yychar entry.
1793 In the yychar entry, remove mention of the local yychar case (pure
1794 parser) since this is irrelevant information when writing semantic
1795 actions and since it's already discussed in `Bison Symbols' where
1796 yychar is otherwise described as an external variable.
1797 In the yychar entry, don't call it the `current' look-ahead since it
1798 isn't when semantic actions are deferred.
1799 In the yychar and yyclearin entries, add note about deferred semantic
1800 actions.
1801 Add yylloc and yylval entries discussing look-ahead usage.
1802 (Look-Ahead Tokens): When discussing yychar, don't call it the
1803 `current' look-ahead, and do mention yylval and yylloc.
1804 (Error Recovery): Cross-reference `Action Features' when mentioning
1805 yyclearin.
1806 (Bison Symbols): In the yychar entry, don't call it the `current'
1807 look-ahead.
1808 In the yylloc and yylval entries, mention look-ahead usage.
1809
18102006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1811
1812 * tests/glr-regression.at: Update copyright year to 2006.
1813
18142006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1815
1816 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
1817 use during nondeterministic operation to track which stacks have
1818 actually needed the current lookahead.
1819 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
1820 Allocate, deallocate, resize, and otherwise shuffle space for
1821 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
1822 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
1823 appropriately during nondeterministic operation.
1824 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
1825 members to store the current lookahead to be used by the deferred
1826 user action.
1827 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
1828 from which the RHS is taken. Set the lookahead members of the new
1829 yySemanticOption according to the lookahead status for stack yyk.
1830 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
1831 yyaddDeferredAction.
1832 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
1833 members of yySemanticOption before invoking yyuserAction, and then set
1834 them back to their current values afterward.
1835 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
1836 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
1837 * tests/glr-regression.at: Remove `.' from the ends of recent test case
1838 titles for consistency.
1839 (Leaked merged semantic value if user action cuts parse): In order to
1840 suppress lint warnings, use arguments in merge function, and assign
1841 char value < 128 in main.
1842 (Incorrect lookahead during deterministic GLR): New test case.
1843 (Incorrect lookahead during nondeterministic GLR): New test case.
1844
18452006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1846
1847 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
1848 !yyvaluep as signal that no semantic value is available to print.
1849 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
1850 to print a semantic value.
1851
18522006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1853
1854 * tests/glr-regression.at: For consistency with my newer test cases,
1855 don't thank myself.
1856
18572006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1858
1859 * data/glr.c (yyresolveValue): When merging semantic options, if at
1860 least one user action succeeds but a later one cuts the parse, then
1861 destroy the semantic value before returning rather than leaking it.
1862 (yyresolveStates): If a user action cuts the parse and thus
1863 yyresolveValue fails, ignore the (unset) semantic value rather than
1864 corrupting the yyGLRState, and empty the semantic options list since
1865 the user actions should have called all necessary destructors.
1866 Simplify code with YYCHK.
1867 * tests/glr-regression.at (Corrupted semantic options if user action
1868 cuts parse): New test case.
1869 (Undesirable destructors if user action cuts parse): New test case.
1870 Before applying any of this patch, this test case never actually failed
1871 for me... but only because the corrupted semantic options usually
1872 masked this bug.
1873 (Leaked merged semantic value if user action cuts parse): New test
1874 case.
1875
18762006-01-05 Akim Demaille <akim@epita.fr>
1877
1878 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
1879
18802006-01-04 Paul Eggert <eggert@cs.ucla.edu>
1881
1882 * data/c.m4 (b4_c_modern): New macro, with a new provision for
1883 _MSC_VER. Problem reported by Cenzato Marco.
1884 (b4_c_function_def): Use it.
1885 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
1886 b4_c_modern.
1887 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
1888 than rolling our own.
1889
18902006-01-04 Akim Demaille <akim@epita.fr>
1891
1892 Also warn about non-used mid-rule values.
1893 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
1894 member.
1895 (symbol_list_new): Adjust.
1896 * src/reader.c (symbol_typed_p): New.
1897 (grammar_rule_check): Use it.
1898 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
1899 Check its rule.
1900 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
1901 Use it.
1902 * tests/actions.at (Exotic Dollars): Adjust.
1903
19042006-01-04 Akim Demaille <akim@epita.fr>
1905
1906 * src/reader.c (grammar_midrule_action): If $$ is set in a
1907 mid-rule, move the `used' bit to its lhs.
1908 * tests/input.at (Unused values): New.
1909 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
1910
19112006-01-03 Paul Eggert <eggert@cs.ucla.edu>
1912
1913 * doc/bison.texinfo (Bison Options): Say more accurately what
1914 --yacc does.
1915 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
1916 about declarations in the grammar when in Yacc mode, as POSIX does
1917 not require a diagnostic when the grammar uses extensions.
1918
1919 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
1920
1921 Warn about dubious constructions like "%token T T".
1922 Reported by twlevo.
1923 * src/symtab.h (struct symbol.declared): New member.
1924 * src/symtab.c (symbol_new): Initialize it to false.
1925 (symbol_class_set): New arg DECLARING, specifying whether
1926 this is a declaration that we want to warn about, if there
1927 is more than one of them. All uses changed.
1928
1929 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
1930 Allow multiple %union directives, whose contents concatenate.
1931 * src/parse-gram.y (grammar_declaration): Likewise.
1932 Use muscle_code_grow, so that we don't need stype_line any more.
1933 All uses changed.
1934
1935 * src/muscle_tab.c (muscle_grow): Fix comment.
1936
1937 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
1938 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
1939 Update copyright year to 2006.
1940
19412006-01-03 Akim Demaille <akim@epita.fr>
1942
1943 Have glr.cc pass (some of) the calc.at tests.
1944 * data/glr.cc (b4_parse_param_orig): New.
1945 (b4_parse_param): Improve its definition, and bound it more
1946 clearly in the skeleton.
1947 (b4_epilogue): Append, instead of prepending, in order to keep
1948 #line consistency.
1949 Simplify the generation of auxiliary functions: locations and
1950 purity are mandated.
1951 (b4_global_tokens_and_yystype): Honor it.
1952 * data/location.cc (c++.m4): Don't include it.
1953 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
1954 and AT_SKEL_CC_IF.
1955 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
1956 AT_LALR1_CC_IF.
1957 Be sure to initialize the first position's filename.
1958 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
1959 mandated anyway.
1960 (AT_CHECK_CALC_GLR_CC): New.
1961 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
1962
19632006-01-02 Akim Demaille <akim@epita.fr>
1964
1965 * src/output.c (output_skeleton): Don't hard wire the inclusion of
1966 c.m4.
1967 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
1968 * data/glr.cc: Do not include stack.hh.
1969
19702006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1971
1972 * data/glr.c: Reformat whitespace with tabs.
1973 (b4_lpure_formals): Remove this unused m4 macro.
1974 * tests/cxx-type.at: Reformat whitespace with tabs.
1975 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
1976 since it's a member. Rename type to isNterm for clarity.
1977
19782005-12-29 Akim <akim@sulaco.local>
1979
1980 Let glr.cc catch up with symbol_value_print.
1981 * data/glr.cc (b4_yysymprint_generate): Replace by...
1982 (b4_yy_symbol_print_generate): this.
1983 (yy_symbol_print, yy_symbol_value_print): Declare them.
1984
19852005-12-28 Paul Eggert <eggert@cs.ucla.edu>
1986
1987 * src/location.h (boundary): Note that a line or column equal
1988 to INT_MAX indicates an overflow.
1989 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
1990 (rule_length_overflow, increment_rule_length, add_column_width):
1991 New functions.
1992 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
1993 (<SC_BRACED_CODE>"}"):
1994 Use increment_rule_length rather than incrementing it by hand.
1995 (adjust_location, handle_syncline): Diagnose overflow.
1996 (handle_action_dollar, handle_action_at):
1997 Fix bug with monstrosities like $-2147483648.
1998 Remove now-unnecessary checks.
1999 (scan_integer): Verify assumptions and remove now-unnecessary checks.
2000 (convert_ucn_to_byte): Verify assumptions.
2001 (handle_syncline): New arg LOC. All callers changed.
2002 Don't store through a value derived from char const * pointer.
2003
2004 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
2005 GCC warnings.
2006
20072005-12-27 Paul Eggert <eggert@cs.ucla.edu>
2008
2009 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
2010 Remove unnecessary forward static decls.
2011
20122005-12-27 Akim Demaille <akim@epita.fr>
2013
2014 * src/reader.c (grammar_current_rule_check): Also check that $$
2015 is used.
2016 Take the rule to check as argument, hence rename as...
2017 (grammar_rule_check): this.
2018 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
2019 Rename as...
2020 (grammar_rule_begin, grammar_rule_end): these, for consistency.
2021 (grammar_midrule_action, grammar_symbol_append): Now static.
2022 * tests/torture.at (input): Don't rely on the default action
2023 being always performed.
2024 * tests/calc.at: "Set" $$ even when the action is "cut" with
2025 YYERROR or other.
2026 * tests/actions.at (Exotic Dollars): Instead of using unused
2027 values, check that the warning is issued.
2028
20292005-12-22 Paul Eggert <eggert@cs.ucla.edu>
2030
2031 * NEWS: Improve wording for unused-value warnings.
2032
20332005-12-22 Akim Demaille <akim@epita.fr>
2034
2035 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
2036 (b4_yysymprint_generate): Rename as...
2037 (b4_yy_symbol_print_generate): this.
2038 Generate yy_symbol_print instead of yysymprint.
2039 Generate also yy_symbol_value_print, and use it.
2040
20412005-12-22 Akim Demaille <akim@epita.fr>
2042
2043 * NEWS: Warn about unused values.
2044 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
2045 a `used' member.
2046 (symbol_list_n_get, symbol_list_n_used_set): New.
2047 (symbol_list_n_type_name_get): Use symbol_list_n_get.
2048 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
2049 * src/reader.c (grammar_current_rule_check): Check that values are
2050 used.
2051 * src/symtab.c (symbol_print): Accept 0.
2052 * tests/existing.at: Remove the type information.
2053 Empty the actions.
2054 Remove useless actions (beware of mid-rule actions: perl -000
2055 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
2056 * tests/actions.at (Exotic Dollars): Use unused values.
2057 * tests/calc.at: Likewise.
2058 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2059 Likewise.
2060
2061 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
2062 rule_useful_p.
2063
20642005-12-21 Paul Eggert <eggert@cs.ucla.edu>
2065
2066 Undo 2005-12-01 tentative license wording change. The wording is
2067 still being reviewed by the lawyers, and we don't want to wait for
2068 them before publishing a test release. For now, revert to the
2069 previous wording.
2070 * NEWS: Undo 2005-12-01 change.
2071 * data/glr.c: Revert to previous license wording.
2072 * data/glr.cc: Likewise.
2073 * data/lalr1.cc: Likewise.
2074 * data/location.cc: Likewise.
2075 * data/yacc.c: Likewise.
2076
2077 * NEWS: Reword %destructor vs YYABORT etc.
2078 * data/glr.c: Use American spacing, for consistency.
2079 * data/glr.cc: Likewise.
2080 * data/lalr1.cc: Likewise.
2081 * data/yacc.c: Likewise.
2082 * data/yacc.c: Reformat comments slightly.
2083 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
2084 for consistency. Fix some spelling errors and reword recently-included
2085 text slightly.
2086 * tests/cxx-type.at: Cast results of malloc, for C++.
2087
20882005-12-21 Joel E. Denny <address@hidden>
2089
2090 * tests/cxx-type.at: Construct a tree, count the parents of shared
2091 nodes, and free each node once and only once. Previously, the memory
2092 for semantic values was leaked instead.
2093
20942005-12-21 Joel E. Denny <address@hidden>
2095
2096 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
2097 (yylval, yylloc): If pure, #define to yystackp->yyval and
2098 yystackp->yyloc similar to yychar and yynerrs.
2099 (yyparse): If pure, remove local yylval and yylloc. Add local
2100 yystackp to accommodate pure definitions of yylval and yylloc.
2101 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
2102 yylvalp and yyllocp to &yylval and &yylloc.
2103 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
2104 namespace. Previously, nerrs and char were missing, but lval and lloc
2105 weren't necessary.
2106 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
2107 yylvalp and yyllocp parameters since, if pure, these are now always
2108 accessible through yystackp. If not pure, they are still accessible
2109 globally.
2110 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
2111 `if (YYID (N))' to pacify lint.
2112
21132005-12-21 Akim Demaille <akim@epita.fr>
2114
2115 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
2116 destroy the RHS symbols of a rule.
2117 * data/yacc.c (yylen): Initialize to 0.
2118 Keep its value to the number of items to possibly shift.
2119 In particular, a regular successful parse that ends on YYFINAL by
2120 a (internal) YYACCEPT must not have yylen != 0.
2121 (yyerrorlab, yyreturn): Pop the RHS.
2122 Reorder a bit to emphasize the `shifting' bits of code.
2123 (YYPOPSTACK): Now accept a number of items to pop.
2124 * data/lalr1.cc: Likewise.
2125 * data/glr.c: Formatting changes.
2126 Use goto instead of fall through.
2127 * doc/bison.texinfo (Destructor Decl): Complete.
2128
21292005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2130
2131 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
2132 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
2133 * djgpp/config.bat: Replace every occurence of the file name
2134 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
2135 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
2136 * djgpp/config.sed: Replace every occurence of the file name
2137 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
2138 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
2139 * djgpp/djunpack.bat: DJGPP specific file.
2140 * djgpp/fnchange.lst: DJGPP specific file.
2141 * djgpp/README.in: Add new information about how to unpack the bison
2142 source on MSDOS and other systems which have 8.3 file name restrictions
2143 using djunpack.bat and fnchange.lst.
2144
21452005-12-12 Paul Eggert <eggert@cs.ucla.edu>
2146
2147 * bootstrap (build_cvs_prefix): Remove; unused.
2148 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
2149 when getting gnulib.
2150
21512005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
2152
2153 * data/glr.c: Reorder typedef declarations for structs to match order
2154 of struct declarations.
2155 Rename yystack everywhere to yystackp except in yyparse where it's not
2156 a pointer.
2157 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
2158 consistency.
2159 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
2160 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
2161 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
2162 lint.
2163
21642005-12-09 Paul Eggert <eggert@cs.ucla.edu>
2165
2166 * tests/sets.at (Accept): Fix typos in regular expression used to
2167 sed out the final state number.
2168
2169 Work around portability problem on Solaris 10: flex-generated
2170 files include <stdio.h> before <config.h>, which messes up
2171 because the latter defines __EXTENSIONS__. Address the problem
2172 by creating two new little files that include <config.h> first,
2173 then include the flex-generated files. Rewrite everyone else
2174 to include <config.h> first, as well.
2175 * lib/timevar.c: Always include "config.h".
2176 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
2177 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
2178 (EXTRA_bison_SOURCES): New macro.
2179 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
2180 * src/system.h: Don't include config.h.
2181 * src/LR0.c: Include <config.h> first.
2182 * src/assoc.c: Likewise.
2183 * src/closure.c: Likewise.
2184 * src/complain.c: Likewise.
2185 * src/conflicts.c: Likewise.
2186 * src/derives.c: Likewise.
2187 * src/files.c: Likewise.
2188 * src/getargs.c: Likewise.
2189 * src/gram.c: Likewise.
2190 * src/lalr.c: Likewise.
2191 * src/location.c: Likewise.
2192 * src/main.c: Likewise.
2193 * src/muscle_tab.c: Likewise.
2194 * src/nullable.c: Likewise.
2195 * src/output.c: Likewise.
2196 * src/parse-gram.y: Likewise.
2197 * src/print.c: Likewise.
2198 * src/print_graph.c: Likewise.
2199 * src/reader.c: Likewise.
2200 * src/reduce.c: Likewise.
2201 * src/relation.c: Likewise.
2202 * src/state.c: Likewise.
2203 * src/symlist.c: Likewise.
2204 * src/symtab.c: Likewise.
2205 * src/tables.c: Likewise.
2206 * src/uniqstr.c: Likewise.
2207 * src/vcg.c: Likewise.
2208
2209 * src/parse-gram.y: Fix minor problems uncovered by lint.
2210 (current_lhs, current_lhs_location): Now static.
2211 (current_assoc): Remove unused variable.
2212
2213 Cleanups so that Bison-generated parsers have less lint.
2214 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
2215 Prepend /*ARGSUSED*/, for lint's sake.
2216 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
2217 definition if 'lint' is defined.
2218 (YYID): New macro (or function, if lint).
2219 All uses of /*CONSTCOND*/0 replaced by YYID(0).
2220 * data/yacc.c: Likewise.
2221 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
2222 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
2223 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
2224 is C++ only.
2225 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
2226 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
2227 Use YYID(0) rather than 0, for lint.
2228 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
2229 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
2230
22312005-12-07 Paul Eggert <eggert@cs.ucla.edu>
2232
2233 * tests/glr-regression.at
2234 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
2235 Close memory leak reported by twlevo.
2236
22372005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
2238
2239 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
2240 all stacks.
2241 (yyparse): Iterate another stack in order to call user destructors.
2242 * tests/glr-regression.at (No users destructors if stack 0 deleted):
2243 New test case.
2244 (Duplicated user destructor for lookahead): This test now is expected
2245 to succeed.
2246
22472005-12-01 Paul Eggert <eggert@cs.ucla.edu>
2248
2249 * NEWS: Document the following change.
2250 * data/yacc.c: Say "parser skeleton" rather than "file", since
2251 it's no longer just a file.
2252 * data/glr.c: Grant a special exception for C GLR parsers, that
2253 reads like the already-existing exception for C LALR(1) parsers.
2254 * data/glr.cc: Likewise.
2255 * data/lalr1.cc: Likewise.
2256 * data/location.cc: Likewise.
2257 * data/yacc.c: Reword the "written by" statement to clarify that
2258 it was the parser skeleton, not the entire output file.
2259 * data/glr.c: Written by Paul Hilfinger.
2260 * data/glr.cc: Written by Akim Demaille.
2261 * data/lalr1.cc: Likewise.
2262
22632005-11-18 Paul Eggert <eggert@cs.ucla.edu>
2264
2265 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
2266 Fix typos in previous change that broke 'make check'.
2267 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
2268 supported in C.
2269 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
2270 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
2271 We can revert this once things settle down.
2272
2273 * src/conflicts.c (conflicts_print): Don't print file name twice
2274 when %expect fails because there were no conflicts.
2275 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
2276 change.
2277 * tests/conflicts.at (%expect not enough, %expect too much):
2278 (%expect with reduce conflicts): Adjust to new behavior.
2279
22802005-11-18 Akim Demaille <akim@epita.fr>
2281
2282 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
2283 errors.
2284 * NEWS: Document this.
2285 * doc/bison.texinfo (Expect Decl): Likewise.
2286
22872005-11-16 Akim Demaille <akim@epita.fr>
2288
2289 Generalize the display of semantic values and locations in traces.
2290 * data/glr.c (yy_reduce_print): Fix indices (again).
2291 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
2292 literal integers.
2293 * data/lalr1.cc (yyreduce_print): Rename as...
2294 (yy_reduce_print): this.
2295 Display values and locations.
2296 * data/yacc.c (yy_reduce_print): Likewise.
2297 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
2298 (yysymprint): Move higher to be visible from yy_reduce_print).
2299 (yyparse): Adjust.
2300 * tests/calc.at: Adjust the expected length of the traces.
2301
23022005-11-14 Akim Demaille <akim@epita.fr>
2303
2304 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
2305 from 1 to N, while values and location start at 0.
2306 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
2307
23082005-11-14 Akim Demaille <akim@epita.fr>
2309
2310 * data/glr.c (yy_reduce_print): Fix the $ number.
2311
23122005-11-14 Akim Demaille <akim@epita.fr>
2313
2314 "Use" parse parameters.
2315 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
2316 * data/glr.c, data/glr.cc: Use them.
2317 * data/glr.c (YYUSE): Have a C++ definition that supports
2318 non-pointer types.
2319
23202005-11-14 Akim Demaille <akim@epita.fr>
2321
2322 * data/glr.c (yyexpandGLRStack): Declare only if defined.
2323
23242005-11-14 Akim Demaille <akim@epita.fr>
2325
2326 * data/glr.cc: New.
2327 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
2328
23292005-11-12 Akim Demaille <akim@epita.fr>
2330
2331 Let position and location be PODs.
2332 * data/location.cc (position::initialize, location::initialize): New.
2333 (position::position, location::location): Define only if
2334 b4_location_constructors is defined.
2335 * data/lalr1.cc (b4_location_constructors): Define it for backward
2336 compatibility.
2337 * doc/bison.texinfo (Initial Action Decl): Use initialize.
2338
23392005-11-12 Akim Demaille <akim@epita.fr>
2340
2341 * data/lalr1.cc: Move the body of the ctor and dtor into the
2342 parser file (instead of the header).
2343 Wrap the implementations in a "namespace yy".
2344
23452005-11-12 Akim Demaille <akim@epita.fr>
2346
2347 Have glr.c include its header file when created.
2348 * data/glr.c (b4_shared_declarations): New.
2349 Output them verbatim in the parser if !%defines, otherwise
2350 output then in the header file, and include it instead.
2351
23522005-11-11 Akim Demaille <akim@epita.fr>
2353
2354 * data/glr.c: Comment changes.
2355
23562005-11-11 Akim Demaille <akim@epita.fr>
2357
2358 When yydebug, report semantic and location values for reductions.
2359 * data/glr.c (yy_reduce_print): Report the semantic values and the
2360 locations.
2361 (YY_REDUCE_PRINT): Adjust.
2362 (yyglrReduce): Use them.
2363 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
2364 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
2365 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
2366 traces.
2367
23682005-11-10 Akim Demaille <akim@epita.fr>
2369
2370 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
2371 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
2372 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
2373
23742005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
2375
2376 * m4/cxx.m4, examples/Makefile.am: Don't build
2377 examples/calc++ if no C++ compiler is available. (trivial change)
2378
23792005-11-09 Akim Demaille <akim@epita.fr>
2380
2381 * src/scan-skel.l: Use a couple of asserts.
2382
23832005-11-03 Akim Demaille <akim@epita.fr>
2384
2385 In some (weird) cases, the final state number is incorrect.
2386 Reported by Alexandre Duret-Lutz.
2387 * src/LR0.c (state_list_append): Remove the computation of
2388 final_state.
2389 (save_reductions): Do it here.
2390 (get_state): Alpha conversion.
2391 (generate_states): Use a for loop.
2392 * src/gram.h (item_number_is_rule_number)
2393 (item_number_is_symbol_number): New.
2394 * src/state.c: Use assert.
2395 * src/system.h: Include assert.h.
2396 * tests/sets.at (Accept): New.
2397
23982005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2399
2400 * data/glr.c (yyfill): Adjust comment.
2401 (yyresolveAction): Initialize default location properly
2402 for empty right-hand sides.
2403 (yydoAction): Ditto.
2404 Add comment explaining apparently dead code.
2405 * tests/glr-regression.at
2406 (Incorrectly initialized location for empty right-hand side in GLR):
2407 New test.
2408
24092005-10-30 Paul Eggert <eggert@cs.ucla.edu>
2410
2411 * bootstrap (cleanup_gnulib): New function. Use it to clean up
2412 gnulib when interrupted. This fixes some race conditions and
2413 works around some portability problems (one noted by Paul
2414 Hilfinger).
2415
24162005-10-22 Akim <akim@epita.fr>
2417
2418 * Makefile.cfg: Adjust to config -> build-aux.
2419 Reported by twledo.
2420
24212005-10-21 Akim Demaille <akim@epita.fr>
2422
2423 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
2424 the %parse-params.
2425 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
2426 * data/yacc.c (b4_Pure_if): Rename as...
2427 (b4_yacc_pure_if): this.
2428 (YY_SYMBOL_PRINT, yyparse): Adjust.
2429 * doc/bison.texinfo: Formatting changes.
2430
24312005-10-21 Akim Demaille <akim@epita.fr>
2432
2433 Finish the transition config -> build-aux.
2434 * configure.ac, Makefile.am: Use build-aux.
2435 * config/prev-version, config/announce-gen, config/Makefile.am:
2436 Move to...
2437 * build-aux/prev-version, build-aux/announce-gen,
2438 * build-aux/Makefile.am: here.
2439
24402005-10-14 Akim Demaille <akim@epita.fr>
2441
2442 * examples/calc++/test: Use set -x only when VERBOSE.
2443
24442005-10-13 Paul Eggert <eggert@cs.ucla.edu>
2445
2446 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
2447 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
2448
24492005-10-13 Akim Demaille <akim@epita.fr>
2450
2451 * src/scan-skel.l: Output the base name parts of the parser and
2452 header file names.
2453 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
2454 additional checks.
2455 Use this to exercise C++ outputs in subdirs.
2456 Reported by Oleg Smolsky.
2457
24582005-10-12 Paul Eggert <eggert@cs.ucla.edu>
2459
2460 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
2461 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
2462 Problem reported by John P. Hartmann.
2463 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
2464 already defined it.
2465
24662005-10-12 Akim Demaille <akim@epita.fr>
2467
2468 * src/parse-gram.y (version_check): Exit 63 to please missing
2469 (stands for "version mismatch).
2470 * tests/input.at, doc/bison.texinfo: Adjust.
2471
24722005-10-10 Paul Eggert <eggert@cs.ucla.edu>
2473
2474 Work around portability problems with Visual Age C compiler
2475 (xlc and xlC_r) reported by John P. Hartmann.
2476 * data/location.cc (initial_column, initial_line): Remove.
2477 All uses replaced by 0 and 1.
2478 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
2479 that xlc complains about.
2480 * src/scan-skel.l (skel_wrap): Likewise.
2481 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
2482 as __STDC__.
2483 * data/yacc.c (YYMODERN_C): New macro, which also looks at
2484 __STDC_VERSION__. Use it everywhere instead of looking at
2485 __STDC__ and __cplusplus.
2486
24872005-10-10 Akim Demaille <akim@epita.fr>
2488
2489 * examples/calc++/test: Be quiet unless VERBOSE.
2490
24912005-10-05 Paul Eggert <eggert@cs.ucla.edu>
2492
2493 * data/c.m4 (yydestruct, yysymprint):
2494 Use YYUSE instead of casting to void.
2495 * data/glr.c (YYUSE): New macro.
2496 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
2497 Use it instead of rolling our own.
2498 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
2499 (YYCHK1):
2500 Use /*CONSTCOND*/ to suppress lint warnings.
2501 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
2502 (YY_STACK_PRINT): Use 'false' not '0'.
2503 (YYUSE): New macro.
2504 (yysymprint_, yydestruct_): Use it instead of rolling our own.
2505 * data/yacc.c (YYUSE): New macro.
2506 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
2507 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
2508 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
2509
2510
2511 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
2512 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
2513
25142005-10-04 Paul Eggert <eggert@cs.ucla.edu>
2515
2516 Undo the parts of the unlocked-I/O change that substituted
2517 putc or puts for printf. This might hurt performance a bit,
2518 but some people prefer the printf style.
2519 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
2520 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
2521 All uses replaced by YYFPRINTF and YYDPRINTF.
2522 * data/yacc.c: Likewise.
2523 * lib/bitset.c (bitset_print): Likewise.
2524 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
2525 putc and puts.
2526 * lib/lbitset.c (debug_lbitset): Likewise.
2527 * src/closure.c (print_firsts, print_fderives): Likewise.
2528 * src/gram.c (grammar_dump): Likewise.
2529 * src/lalr.c (look_ahead_tokens_print): Likewise.
2530 * src/output.c (escaped_output): Likewise.
2531 (user_actions_output): Break apart two printfs.
2532 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
2533 * src/reduce.c (reduce_print): Likewise.
2534 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2535 * src/system.h: Include unlocked-io.h rathe than stdio.h.
2536
2537 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
2538 Use assignments rather than casts-to-void to suppress
2539 unused-variable warnings. This pacifies 'lint'.
2540 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
2541 unused-variable warnings.
2542
25432005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2544
2545 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
2546
25472005-10-02 Paul Eggert <eggert@cs.ucla.edu>
2548
2549 Use unlocked I/O for a minor performance improvement on hosts like
2550 GNU/Linux and Solaris that support unlocked I/O. The basic idea
2551 is to use the gnlib unlocked-io module, and to prefer putc and
2552 puts to printf when either will work (since the latter doesn't
2553 come in an unlocked flavor).
2554 * bootstrap (gnulib_modules): Add unlocked-io.
2555 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
2556 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
2557 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
2558 and similarly for puts and putc and printf.
2559 * data/yacc.c: Likewise.
2560 * lib/bitset.c (bitset_print): Likewise.
2561 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
2562 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
2563 to printf.
2564 * lib/lbitset.c (debug_lbitset): Likewise.
2565 * src/closure.c (print_firsts, print_fderives): Likewise.
2566 * src/gram.c (grammar_dump): Likewise.
2567 * src/lalr.c (look_ahead_tokens_print): Likewise.
2568 * src/output.c (escaped_output): Likewise.
2569 (user_actions_output): Coalesce two printfs.
2570 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
2571 * src/reduce.c (reduce_print): Likewise.
2572 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2573 * src/system.h: Include unlocked-io.h rather than stdio.h.
2574
2575 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
2576 this confuses xgettext.
2577
25782005-10-02 Akim Demaille <akim@epita.fr>
2579
2580 * bootstrap (gnulib_modules): Add strverscmp.
2581 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
2582 * m4/.cvsignore: Add strverscmp.m4.
2583 * src/parse-gram.y (%require): New token, new rule.
2584 (version_check): New.
2585 * src/scan-gram.l (%require): Adjust.
2586 * tests/input.at (AT_REQUIRE): New.
2587 Use it.
2588 * doc/bison.texinfo (Require Decl): New.
2589 (Calc++ Parser): Use %require.
2590
25912005-10-02 Akim Demaille <akim@epita.fr>
2592
2593 * data/location.cc: New.
2594
25952005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
2596 Akim Demaille <akim@epita.fr>
2597
2598 Make sure -odir/foo.cc creates dir/location.hh etc.
2599 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
2600 (spec_file_prefix, spec_verbose_file, spec_graph_file)
2601 (spec_defines_file): Now const.
2602 (dir_prefix): New.
2603 (short_base_name): Remove.
2604 * src/files.c: Adjust.
2605 (dirname.h): Include.
2606 (base_name): Don't prototype it.
2607 (finput): Remove, duplicates gram_in.
2608 (full_base_name, short_base_name): Replace by...
2609 (all_but_ext, all_but_tab_ext): these.
2610 (compute_base_names): Rename as...
2611 (compute_file_name_parts): this.
2612 Update to compute the new variables, including dir_prefix.
2613 Adjust dependencies.
2614 * src/output.c (prepare): Output them.
2615 * src/reader.c: Adjust to use gram_in, not finput.
2616 * src/scan-skel.l (@dir_prefix@): New.
2617
26182005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2619
2620 * lib/subpipe.c: New function end_of_output_subpipe() added
2621 to allow support for non-posix systems. This is a no-op function
2622 for posix systems.
2623
2624 * lib/subpipe.h: New function end_of_output_subpipe() added
2625 to allow support for non-posix systems. This is a no-op function
2626 for posix systems.
2627
2628 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
2629 handle the lack of pipe/fork functionality on non-posix systems.
2630
2631 * djgpp/Makefile.maint: DJGPP specific file.
2632
2633 * djgpp/README.in: DJGPP specific file.
2634
2635 * djgpp/config.bat: DJGPP specific configuration file.
2636
2637 * djgpp/config.sed: DJGPP specific configuration file.
2638
2639 * djgpp/config.site: DJGPP specific configuration file.
2640
2641 * djgpp/config_h.sed: DJGPP specific configuration file.
2642
2643 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
2644
2645 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
2646
26472005-10-02 Akim Demaille <akim@epita.fr>
2648
2649 * data/location.cc: New, extract from...
2650 * data/lalr1.cc: here.
2651 (location.hh): Include it after the user prologue, in case the
2652 filename type is defined by the user.
2653 Forward declation location and position before the pre-prologue.
2654 (yyresult_): Rename as...
2655 (yyresult): this, it's a local variable, not an attribute.
2656 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
2657
26582005-10-01 Akim Demaille <akim@epita.fr>
2659
2660 * examples/extexi: Restore the #line generation.
2661
26622005-09-30 Akim Demaille <akim@epita.fr>,
2663 Alexandre Duret-Lutz <adl@gnu.org>
2664
2665 Move the token type and YYSTYPE in the parser class.
2666 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
2667 (parser::token): New, from the moved free definition of tokens.
2668 (parser::semantic_value): Now a full definition instead of an
2669 indirection to YYSTYPE.
2670 (b4_post_prologue): No longer included in the header file, but
2671 in the implementation file.
2672 * doc/bison.texi (C+ Language Interface): Update.
2673 * src/parse-gram.y: Support unary %define.
2674 * tests/actions.at: Define global_tokens_and_yystype for backward
2675 compatibility until we update the tests.
2676 * tests/calc.at: Idem.
2677 (first_line, first_column, last_line, last_column): Define for lalr1.cc
2678 to simplify the code.
2679
26802005-09-29 Paul Eggert <eggert@cs.ucla.edu>
2681
2682 Port to SunOS 4.1.4, which lacks strtoul and strerror.
2683 Ah, the good old days! Problem reported by Peter Klein.
2684 * bootstrap (gnulib_modules): Add strerror, strtoul.
2685 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
2686 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
2687
26882005-09-29 Akim Demaille <akim@epita.fr>
2689
2690 * data/c.m4 (b4_error_verbose_if): New.
2691 * data/lalr1.cc: Use it.
2692 (YYERROR_VERBOSE_IF): Remove.
2693 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
2694 parser members, replaced by...
2695 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
2696 local variables.
2697 (yysyntax_error_): Takes the state number as argument.
2698 (yyreduce_print_): Use the argument yyrule, not the former
2699 attribute yyn_.
2700
27012005-09-26 Paul Eggert <eggert@cs.ucla.edu>
2702
2703 * bootstrap (gnulib_modules): Add verify.
2704 * lib/.cvsignore: Add verify.h.
2705 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
2706 * src/system.h (verify): Remove.
2707 Include verify.h instead.
2708 * src/tables.c (tables_generate): Use new API for 'verify'.
2709
27102005-09-21 Paul Eggert <eggert@cs.ucla.edu>
2711
2712 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
2713 local variables whose names begin with 'yy'.
2714 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
2715 Trivial changes from Joel E. Denny.
2716
2717 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
2718 it itself.
2719 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
2720 don't use alloca any more.
2721
2722 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
2723 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
2724 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
2725 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
2726 to match yacc.c, to test more hosts.
2727
27282005-09-20 Paul Eggert <eggert@cs.ucla.edu>
2729
2730 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
2731 doesn't affect behavior.
2732 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
2733 Solaris, AIX, MSC.
2734 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
2735 This works a bit better with glibc, if user code has already included
2736 stdlib.h.
2737 * doc/bison.texinfo (Bison Parser): Document that users can't
2738 arbitrarily use malloc and free for other purposes. Document
2739 that <alloca.h> and <malloc.h> might be included.
2740 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
2741 user must declare alloca.
2742
2743 * HACKING (release): Forwarn the Translation Project about
2744 stable releses.
2745
27462005-09-20 Akim Demaille <akim@epita.fr>
2747
2748 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
2749
27502005-09-19 Paul Eggert <eggert@cs.ucla.edu>
2751
2752 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
2753 (YYSTACK_ALLOC_MAXIMUM): Use it.
2754 (yysyntax_error): New function.
2755 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
2756 multiple syntax errors are reported, and alloca is being used.
2757 Instead, reallocate buffers twice as big each time, so that
2758 we waste at most half the allocated memory. Start with a small
2759 (128-byte) buffer that will suffice in most cases anyway.
2760 Use yysyntax_error to do most of the work.
2761
2762 * doc/bison.texinfo (Error Reporting, Table of Symbols):
2763 yynerrs is the number of errors reported, not the number of
2764 errors encountered.
2765
2766 * tests/glr-regression.at (Duplicated user destructor for lookahead):
2767 Mark it as expected to fail.
2768 Cast result of malloc; problem reported by twlevo@xs4all.nl.
2769 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
2770 Don't start user-code symbols with "yy", to avoid name space problems.
2771
27722005-09-19 Akim Demaille <akim@epita.fr>
2773
2774 Remove the traits, failed experiment.
2775 It never proved useful, and anyway because of the current
2776 definition, it was not possible to have several specialization of
2777 this traits, making it useless.
2778 * data/lalr1.cc (yy:traits): Remove.
2779 Inline its definitions in the parser class.
2780
27812005-09-19 Akim Demaille <akim@epita.fr>
2782
2783 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
2784 least Mac OSX with a /usr/local install of gettext.
2785
27862005-09-19 Akim Demaille <akim@epita.fr>
2787
2788 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
2789 and yytoken for similarity with the other skeletons.
2790
27912005-09-19 Akim Demaille <akim@epita.fr>
2792
2793 * NEWS, configure.ac: update version number to 2.1a.
2794
27952005-09-16 Paul Eggert <eggert@cs.ucla.edu>
2796
2797 * NEWS: Version 2.1.
2798
2799 * NEWS: Remove notice of yytname change, since it was never in an
2800 official release.
2801 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
2802 diagnostic.
2803 * src/output.c (prepare): Likewise.
2804 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
2805 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
2806 is not defined. This is an awful hack, but it's enough for now.
2807 All callers changed.
2808 * tests/glr-regression-at (make_value): Args are const pointers now,
2809 to avoid GCC warning.
2810 (Duplicated user destructor for lookahead): New test. Currently
2811 skipped. It fails on my host but I'm not sure it'll always fail.
2812
28132005-09-16 Akim Demaille <akim@epita.fr>
2814
2815 * src/symtab.h (struct symbol): Declare the printer and destructor
2816 as const, to avoid accidental calls to free.
2817 (symbol_destructor_set, symbol_printer_set): Adjust.
2818 * src/symtab.c: Adjust.
2819
28202005-09-16 Akim Demaille <akim@epita.fr>
2821
2822 * data/c.m4 (b4_token_enums): New.
2823 (b4_token_defines): Rename as...
2824 (b4_token_enums_defines): this.
2825 (b4_token_defines): New, output only the #defines.
2826 * data/yacc.c, data/glr.c: Adjust.
2827 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
2828 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
2829 as default values.
2830
28312005-09-16 Akim Demaille <akim@epita.fr>
2832
2833 * data/lalr1.cc (yylex_): Remove, inline its code.
2834 (yyreport_syntax_error_): Remove, replaced by...
2835 (yysyntax_error_): this which returns a string and leaves to the
2836 caller the call to the users' error function.
2837 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
2838 Move from members of the parser object...
2839 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
2840 to local variables of the parse function.
2841
28422005-09-16 Akim Demaille <akim@epita.fr>
2843
2844 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
2845 since it's in Bison's name space.
2846
28472005-09-15 Paul Eggert <eggert@cs.ucla.edu>
2848
2849 * data/glr.c (yyresolveValue): Add default case to pacify
2850 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
2851
2852 * NEWS: Document when yyparse started to return 2.
2853 * doc/bison.texinfo (Parser Function): Document when yyparse
2854 returns 2.
2855
2856 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
2857 (b4_filename_type): Renamed back from b4_file_name_type. All uses
2858 changed.
2859 (class position): file_name -> filename (reverting). All uses changed.
2860
28612005-09-14 Paul Eggert <eggert@cs.ucla.edu>
2862
2863 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
2864 do anything if $@ exists. This reverts part of the 2005-07-07
2865 patch.
2866
28672005-09-11 Paul Eggert <eggert@cs.ucla.edu>
2868
2869 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
2870 contains obsolete information and isn't worth distributing as a
2871 separate file anyway.
2872 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
2873 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
2874 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
2875 (yyparse): Abort if user code uses longjmp to throw an unexpected
2876 value.
2877
28782005-09-09 Paul Eggert <eggert@cs.ucla.edu>
2879
2880 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
2881 Suggested by twlevo@xs4all.nl.
2882
2883 * data/glr.c (YYCHK1): Do not assume YYE is in range.
2884 This avoids a diagnostic from gcc -Wswitch-enum.
2885 Problem reported by twlevo@xs4all.nl.
2886
2887 * doc/bison.texinfo: Don't use "filename", as per GNU coding
2888 standards. Use "file name" or "file" or "name", depending on
2889 the context.
2890 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
2891 not to hack/foo.tab.c.
2892 (Calc++ Top Level): 2nd arg of main is not const.
2893 * data/glr.c: b4_filename -> b4_file_name.
2894 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
2895 All uses changed.
2896 (class position): filename -> file_name. All uses changed.
2897 * data/yacc.c: b4_filename -> b4_file_name.
2898 * lib/bitset.h: filename -> file_name in local vars.
2899 * lib/bitset_stats.c: Likewise.
2900 * src/files.c: Likewise.
2901 * src/scan-skel.l ("@output ".*\n): Likewise.
2902 * src/files.c (file_name_split): Renamed from filename_split.
2903 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
2904
29052005-09-08 Paul Eggert <eggert@cs.ucla.edu>
2906
2907 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
2908 to accommodate latest gnulib.
2909
2910 * tests/glr-regression.at (Duplicate representation of merged trees):
2911 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
2912
2913 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
2914 needed.
2915
29162005-08-26 Paul Eggert <eggert@cs.ucla.edu>
2917
2918 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
2919 All uses changed. Invoke user destructor after an error during a
2920 split parse (trivial change from Joel E. Denny).
2921
2922 * tests/glr-regression.at
2923 (User destructor after an error during a split parse): New test case.
2924 Problem reported by Joel E. Denny in:
2925 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
2926
29272005-08-25 Paul Eggert <eggert@cs.ucla.edu>
2928
2929 * README-cvs: Give URLs for recommended tools.
2930 Mention Gzip version problem, and bootstrapping issues.
2931 Remove troubleshooting section, as it's somewhat obsolete.
2932
2933 * bootstrap (no_cache): New var, to accommodate different wget
2934 variants. Use it instead of '-C off'. Problem reported by
2935 twlevo@xs4all.nl.
2936
2937 * data/glr.c (yydestroyStackItem): New function.
2938 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
2939 debugging information. Problem reported by Joel E. Denny.
2940
29412005-08-25 Akim Demaille <akim@epita.fr>
2942
2943 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
2944
29452005-08-24 Paul Eggert <eggert@cs.ucla.edu>
2946
2947 * data/glr.c (yyrecoverSyntaxError, yyreturn):
2948 Don't invoke destructor on unresolved entries.
2949 * tests/glr-regression.at
2950 (User destructor for unresolved GLR semantic value): New test case.
2951 Problem reported by Joel E. Denny in:
2952 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
2953
29542005-08-21 Paul Eggert <eggert@cs.ucla.edu>
2955
2956 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
2957 Add strnlen.c.
2958 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
2959 lib-prefix.m4, po.m4.
2960
2961 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
2962 in yydestruct diagnostic, since it might not be an error.
2963 Problem reported by Joel Denny near end of
2964 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
2965 * data/lalr1.cc (yyerturn): Likewise.
2966 * data/yacc.c (yyreturn): Likewise.
2967 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
2968
2969 * src/files.c: Remove obsolete FIXME comment.
2970
2971 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
2972 with the other templates, and to fix bogus run-on messages such
2973 as the one reported at the end of
2974 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
2975 All callers changed to avoid the newline.
2976 (yyprocessOneStack): Output two lines rather than one, to accommodate
2977 the above change. This changes the debug output format slightly.
2978
2979 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
2980 reported by Joel E. Denny in
2981 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
2982 (trivial change).
2983 * tests/glr-regression.at (Duplicate representation of merged trees):
2984 New test, from Joel E. Denny in:
2985 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
2986 * THANKS: Add Joel E. Denny.
2987
2988 * configure.ac (AC_INIT): Bump to 2.0c.
2989
29902005-07-24 Paul Eggert <eggert@cs.ucla.edu>
2991
2992 * NEWS: Version 2.0b.
2993
2994 * Makefile.am (SUBDIRS): Put examples before tests, so that
2995 "make check" doesn't finish with "All 1 tests passed".
2996
2997 * tests/regression.at (Token definitions): Don't rely on
2998 AT_PARSER_CHECK for data that contains backslashes. It currently
2999 uses 'echo', and 'echo' isn't portable if its argument contains
3000 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
3001 that the byte '\0xff' is not printable in the C locale; it is,
3002 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
3003 not printable, so use '\0x81' to test.
3004
3005 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
3006 version of GCC, since the macro is used with non-GCC compilers.
3007
3008 Fix core dump reported by Pablo De Napoli in
3009 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
3010 * tests/regression.at (Invalid inputs with {}): New test.
3011 * src/parse-gram.y (token_name): Translate type before using
3012 it as an index.
3013
3014 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
3015 the user's name space. All uses changed to __attribute__
3016 ((__unused__)).
3017 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
3018 Add __attribute__ ((__noreturn__)).
3019
3020 * etc/clcommit: Remove. We weren't using it, and it failed
3021 "make maintainer-distcheck".
3022 * Makefile.maint: Merge from coreutils.
3023 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
3024 (syntax-check-rules): Change list of rules as described below.
3025 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
3026 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
3027 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
3028 (sc_trailing_space): New rules.
3029 (sc_xalloc_h_in_src): Remove.
3030 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
3031 (sc_space_tab, sc_error_exit_success, sc_changelog):
3032 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
3033 (makefile-check, po-check, author_mark_check):
3034 (makefile_path_separator_check, copyright-check):
3035 Use grep -n, to make it easier to find violations.
3036 Use CVS_LIST and CVS_LIST_EXCEPT.
3037 (header_regexp, h_re): Remove.
3038 (dd_c): New macro.
3039 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
3040 (my-distcheck): Use more-modern GCC flags.
3041 (signatures, %.asc): Remove.
3042 (rel-files, announcement): Remove signatures.
3043 Restore old updating code, even though we don't use it, so
3044 that we're the same as coreutils.
3045 (alpha, beta, major): Depend on news-date-check.
3046 Make the upload commands.
3047
3048 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
3049 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
3050 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
3051 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
3052 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
3053 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
3054 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
3055 * tests/sets.at: Likewise.
3056
3057 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
3058 we comment out the Autoconf version number.
3059 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
3060 it's error-prone and "make maintainer-distcheck" rejects it.
3061
3062 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
3063 Indent calls to "error" to pacify "make maintainer-distcheck",
3064 when the calls are not intended to be translated.
3065 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
3066
3067 * src/Makefile.am (DEFS): Use +=, to pacify
3068 "make maintainer-distcheck".
3069 (bison_SOURCES): Add scan-skel.h.
3070 (sc_tight_scope): New rule, from coreutils.
3071
3072 * src/files.c (src_extension, header_extension):
3073 Now static, not extern.
3074 * src/getargs.c (short_options): Likewise.
3075 * src/muscle_tab.c (muscle_table): Likewise.
3076 * src/parse-gram.y (current_class, current_type, current_prec):
3077 Likewise.
3078 * src/reader.c (grammar_end, previous_rule_end): Likewise.
3079 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
3080 * src/main.c (main): Cast bindtextdomain and textdomain calls to
3081 void, to avoid warning when NLS is disabled.
3082 * src/output.c: Include scan-skel.h.
3083 (scan_skel): Remove decl, since scan-skel.h does this.
3084 (output_skeleton):
3085 Indent calls to "error" to pacify "make maintainer-distcheck".
3086 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
3087 * src/reader.h (gram_end, gram_lineno): New decls to pacify
3088 "make maintainer-distcheck".
3089 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
3090 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
3091 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
3092 (skel_lex_destroy, scan_skel): Move these decls to...
3093 * src/scan-skel.h: New file.
3094 * src/uniqstr.c (uniqstr_assert):
3095 Indent calls to "error" to pacify "make maintainer-distcheck".
3096
3097 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
3098 not @VAR@.
3099
3100 * tests/torture.at: Revamp to avoid misuse of atoi that
3101 "make maintainer-distcheck" complained about.
3102
3103 * examples/extexi (message): Don't print a message more than once,
3104 and omit line-number decoration that makes Emacs compile think
3105 that informative messages are worth worrying about.
3106
31072005-07-22 Paul Eggert <eggert@cs.ucla.edu>
3108
3109 * configure.ac: Update version number.
3110
3111 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
3112 accidentally.
3113 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
3114 autogenerated by the maintainer.
3115 * examples/calc++/.cvsignore: Add *.yy.
3116
3117 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
3118 * lib/bitset_stats.c (bitset_stats_init): Likewise.
3119 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3120
3121 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
3122
3123 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
3124 from maintainer-distcheck about casting the argument of 'free'.
3125
3126 * NEWS: Mention recent yytname changes.
3127 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
3128
3129 * bootstrap: For translations that have not yet been upgraded to
3130 the new runtime-po domain, prime the pump by extracting the
3131 relevant strings from the obsolete translations. This code can be
3132 removed once the bison-runtime domain has been translated by each
3133 team.
3134
3135 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
3136 now that token names are already quoted.
3137
3138 Fix problem reported by Anthony Heading.
3139 * data/glr.c (YYTOKEN_TABLE): New macro.
3140 (yytname): Define if YYTOKEN_TABLE.
3141 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
3142 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
3143 (YYERROR_VERBOSE): Define the same way the other skeletons do.
3144 * src/output.c (prepare_symbols): Output token_table_flag.
3145
31462005-07-21 Paul Eggert <eggert@cs.ucla.edu>
3147
3148 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
3149 again if the first call fails.
3150
3151 * data/glr.c (yytnamerr): New function.
3152 (yyreportSyntaxError): Use it to dequote most string literals.
3153 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
3154 with other skeletons. All uses changed.
3155 (yytnameerr_): New function.
3156 (yyreport_syntax_error): Use it to dequote most string literals.
3157 * data/yacc.c (yytnamerr): New function.
3158 (yyerrlab): Use it to decode most string literals.
3159 * doc/bison.texinfo (Decl Summary, Calling Convention):
3160 Clarify quoting convention of yytname.
3161 * src/output.c (prepare_symbols): Quote all names. This undoes
3162 the 2005-04-17 change, which is now accomplished (mostly) via
3163 changes in the parsers as described above.
3164 * tests/regression.at (Token definitions, Web2c Actions):
3165 Undo most 2005-04-17 change here, too.
3166
31672005-07-20 Paul Eggert <eggert@cs.ucla.edu>
3168
3169 Fix more problems reported by twlevo@xs4all.nl.
3170 * tests/cxx-type.at: Don't pipe output of ./types through sed to
3171 remove trailing spaces. This loses the exit status of ./types,
3172 and isn't needed since ./types shouldn't be emitting trailing
3173 spaces.
3174 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
3175 as the stack isn't valid in that case.
3176
3177 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3178 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3179 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3180 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
3181 is used.
3182 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
3183 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
3184 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
3185 Likewise.
3186
3187 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
3188 overly-picky compilers that reject 'char *foo = "bar";'.
3189
3190 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
3191 to FILE * parameter, not to stderr. This fixes a typo introduced
3192 in the 2005-07-12 change.
3193
3194 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
3195 warnings from GCC 4.
3196
3197 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
3198 (yyglrShiftDefer, yysplitStack):
3199 Remove unused parameters b4_pure_formals. All uses changed.
3200 (yyglrShift): Remove unused parameters b4_user_formals.
3201 All uses changed.
3202 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
3203
32042005-07-18 Paul Eggert <eggert@cs.ucla.edu>
3205
3206 Destructor cleanups and regularization among the three skeletons.
3207 * NEWS: Document the behavior changes.
3208 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
3209 stack before failing, as the cleanup code will do it for us now.
3210 * data/lalr1.cc (yyerrlab): Likewise.
3211 * data/glr.c (yyparse): Pop everything off the stack before
3212 freeing it, so that destructors get called properly.
3213 * data/lalr1.cc (yyreturn): Likewise.
3214 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
3215 This is more consistent.
3216 * doc/bison.texinfo (Destructor Decl): Mention more reasons
3217 why destructors might be called. 1.875 -> 2.1.
3218 (Destructor Decl, Decl Summary, Table of Symbols):
3219 Some English-language cleanups for %destructor.
3220 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
3221 Add output line for destructor of start symbol.
3222 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
3223 because of that same extra output line.
3224
3225 * NEWS: Document minor wording changes in diagnostics of
3226 Bison-generated parsers.
3227 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
3228 Remove unused formals. All uses changed.
3229 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
3230 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
3231 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
3232 Rename yyoverflowab to yyexhaustedlab.
3233 When memory exhaustion occurs during syntax-error reporting,
3234 report it separately rather than in a single diagnostic; this
3235 eases translation.
3236 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
3237 (Memory Exhausted): Renamed from Parser Stack Overflow.
3238 Revamp wording slightly to prefer "memory exhaustion".
3239 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
3240
3241 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
3242
3243 Add i18n support to the GLR skeleton. Partially fix the C++
3244 skeleton; a C++ expert needs to finish this. Remove debugging
3245 msgids; there's little point to having them translated, since they
3246 can be understood only by someone who can read the
3247 (English-language) source code.
3248
3249 Generate runtime-po/bison-runtime.pot automatically, so that we
3250 don't have to worry about garbage getting in that file. We'll
3251 make sure after the next official release that old msgids don't
3252 get lost. See
3253 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
3254
3255 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
3256 Now auto-generated.
3257 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
3258 Fix typos in explanations of the runtime file.
3259 * bootstrap: Change gettext keyword from YYI18N to YY_.
3260 Use standard Makefile.in.in in runtime-po, since we'll arrange
3261 for backward-compatible bison-runtime.po files in a different way.
3262 * data/glr.c (YY_): New macro, from yacc.c.
3263 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
3264 Translate messages intended for users.
3265 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
3266 the wording in the other skeletons. We don't know that the memory
3267 is virtual.
3268 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
3269 Use same method that yacc.c uses.
3270 Don't translate debugging messages.
3271 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
3272 it doesn't work (yet), and requires C++ expertise to fix.
3273 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
3274 Move defn to a more logical place, to be consistent with other
3275 skeletons.
3276 Don't translate debugging messages.
3277 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
3278 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
3279 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
3280 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
3281
3282 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
3283 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
3284 void, not int.
3285 * tests/glr-regression.at (Badly Collapsed GLR States):
3286 Likewise.
3287 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3288 yylex should return 0 at EOF rather than aborting.
3289
3290 Improve tests for stack overflow in GLR parser.
3291 Problem reported by twlevo@xs4all.nl.
3292 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
3293 All uses removed.
3294 (yyStackOverflow): Just longjmp, but with value 2 so that caller
3295 can handle the problem.
3296 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
3297 (yyparse): New local variable yyresult to record the result.
3298 Use result of setjmp to set it, rather than storing itinto
3299 struct.
3300 (yyDone): Remove label.
3301 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
3302 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
3303 if YYABORT is used).
3304 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
3305 yyparse status; put status > 1 into diagnostic.
3306 Check that status==2 works.
3307 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
3308 Use exit status 3 for failure to open (which shouldn't happen).
3309
33102005-07-17 Paul Eggert <eggert@cs.ucla.edu>
3311
3312 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
3313 1 on syntax error; just let yyparse do its thing.
3314 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
3315 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
3316 (Exploding the Stack Size with Alloca):
3317 (Exploding the Stack Size with Malloc):
3318 Expect exit status 2, not 1, since the parser is supposed to blow
3319 its stack. Problem reported by twlevo@xs4all.nl.
3320
3321 * data/glr.c (yyparse): Don't assume that the initial calls
3322 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
3323 Print a stack-overflow message and fail instead.
3324 Initialize the line-number information before creating the stack,
3325 so that the stack-overflow message can report line zero safely.
3326
33272005-07-14 Paul Eggert <eggert@cs.ucla.edu>
3328
3329 Fix problems reported by twlevo@xs4all.nl.
3330 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
3331 (yyuserMerge): Provide a default case if b4_mergers is empty.
3332 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
3333 * tests/glr-regression.at
3334 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
3335 Add casts to pacify C++ compilers.
3336 * tests/glr-regression.at (Improper merging of GLR delayed action
3337 sets): Declare yylex before using it.
3338 * tests/Makefile.am (maintainer-check-g++): Fix a stray
3339 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
3340 test for valgrind; valgrind is independent of g++.
3341 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
3342 for compatibility with POSIX 1003.1-2001 (if running coreutils).
3343 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
3344 Use a destructor, so that we can expand the stack. Change
3345 YYSTYPE to char * so that we can free it. Cast result of malloc.
3346
33472005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3348
3349 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
3350 a valgrind failure. Problem reported by twlevo@xs4all.nl.
3351
33522005-07-13 Paul Eggert <eggert@cs.ucla.edu>
3353
3354 * PACKAGING: New file, suggested by Bruno Haible and taken from
3355 similar wording in gettext's PACKAGING file.
3356 * NEWS: Mention PACKAGING.
3357 * Makefile.am (EXTRA_DIST): Add PACKAGING.
3358
33592005-07-12 Paul Eggert <eggert@cs.ucla.edu>
3360
3361 * NEWS: Document recent i18n improvements.
3362 * bootstrap: Get runtime translations into runtime-po.
3363 Create runtime-po files automatically, if possible.
3364 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
3365 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
3366 does not infringe on the user's name space.
3367 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
3368 * doc/bison.texinfo (Internationalization): Revamp the English
3369 and Texinfo syntax a bit, to try to make it clearer.
3370 (Bison Options, Option Cross Key): Mention --print-localedir.
3371 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
3372 YYENABLE_NLS. Quote a bit more.
3373 * runtime-po/.cvsignore: New file.
3374 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
3375 * runtime-po/Rules-quot: Remove; now created by bootstrap.
3376 * runtime-po/quot.sed: Likewise.
3377 * runtime-po/boldquot.sed: Likewise.
3378 * runtime-po/en@quot.header: Likewise.
3379 * runtime-po/en@boldquot.header: Likewise.
3380 * runtime-po/insert-header.sin: Likewise.
3381 * runtime-po/remove-potcdate.sin: Likewise.
3382 * runtime-po/Makevars: Likewise.
3383 * runtime-po/LINGUAS: Likewise.
3384 * runtime-po/de.po: Likewise; we will rely on the translation project
3385 to maintain this, so "bootstrap" should get it.
3386 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
3387 its value.
3388 * src/main.c (main): Bind the bison-runtime domain, too.
3389
33902005-07-12 Bruno Haible <bruno@clisp.org>
3391
3392 * data/yacc.c: Include <libintl.h> when NLS is enabled.
3393 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
3394 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
3395 * runtime-po: New directory.
3396 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
3397 $(DOMAIN).pot-update rule, so that old messages are never dropped.
3398 * runtime-po/Rules-quot: New file, copied from po/.
3399 * runtime-po/quot.sed: Likewise.
3400 * runtime-po/boldquot.sed: Likewise.
3401 * runtime-po/en@quot.header: Likewise.
3402 * runtime-po/en@boldquot.header: Likewise.
3403 * runtime-po/insert-header.sin: Likewise.
3404 * runtime-po/remove-potcdate.sin: Likewise.
3405 * runtime-po/Makevars: New file.
3406 * runtime-po/POTFILES.in: New file.
3407 * runtime-po/LINGUAS: New file.
3408 * runtime-po/bison-runtime.pot: New file.
3409 * runtime-po/de.po: New file.
3410 * m4/bison.m4: New file.
3411 * Makefile.am (SUBDIRS): Add runtime-po.
3412 (aclocaldir, aclocal_DATA): New variables.
3413 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
3414 Define aclocaldir.
3415 * src/getargs.c (usage): Document --print-localedir option.
3416 (PRINT_LOCALEDIR_OPTION): New enum item.
3417 (long_options): Add --print-localedir option.
3418 (getargs): Handle --print-localedir option.
3419 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
3420 (Internationalization): New section.
3421
34222005-07-12 Akim Demaille <akim@epita.fr>
3423
3424 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
3425 for consistency with the rest of the code.
3426 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
3427 Add separators.
3428
34292005-07-12 Akim Demaille <akim@epita.fr>
3430
3431 * src/parse-gram.y: Use %printer instead of YYPRINT.
3432
34332005-07-12 Akim Demaille <akim@epita.fr>
3434
3435 * src/symtab.h, src/symtab.c (symbol_print): New.
3436 * src/symlist.h, src/symlist.c (symbol_list_print): New.
3437 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
3438
34392005-07-12 Akim Demaille <akim@epita.fr>
3440
3441 * data/glr.c (b4_syncline): Fix (swap) the definitions of
3442 b4_at_dollar and b4_dollar_dollar.
3443
34442005-07-11 Paul Eggert <eggert@cs.ucla.edu>
3445
3446 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
3447 and Pennello's paper.
3448
34492005-07-09 Paul Eggert <eggert@cs.ucla.edu>
3450
3451 * data/yacc.c (yyparse): Undo previous patch. Instead,
3452 set yylsp[0] and yyvsp[0] only if the initial action
3453 sets yylloc and yylval, respectively.
3454
3455 * data/yacc.c (yyparse): In the initial action, set
3456 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
3457 This avoids the use of undefined variables if the initial
3458 action does not set yylloc and/or yylval.
3459
34602005-07-07 Paul Eggert <eggert@cs.ucla.edu>
3461
3462 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
3463 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
3464 Remove from CVS. These files are automatically generated.
3465 * examples/extexi: Clarify that this file is now part of Bison,
3466 not GNU M4, and that it works with any POSIX-compatible Awk.
3467 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
3468 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
3469 so that we also get calc++-parser.yy. Geneate it.
3470 Use $(AWK), not gawk, since any conforming Awk will do.
3471 Put comment before action, since older 'make' can't handle comment
3472 in action.
3473 $(BUILT_SOURCES): List all built sources, not just some of them.
3474 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
3475 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
3476 $($(calc_sources_generated)): Remove unnecessary test for existence
3477 of target. (This had a shell syntax error anyway; a stray "x".)
3478 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
3479 calc++-parser.yy.
3480 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
3481
3482 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
3483 implied by the other modules.
3484
34852005-07-06 Akim Demaille <akim@epita.fr>
3486
3487 Bind examples/calc++ to the package.
3488 * examples/calc++/Makefile: Remove, replaced by...
3489 * examples/calc++/Makefile.am: ... this new file.
3490 * examples/calc++/test: Remove input.
3491 * examples/calc++/compile: Remove.
3492 * examples/Makefile.am: New.
3493 * configure.ac, Makefile.am: Adjust.
3494 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
3495
34962005-07-05 Paul Eggert <eggert@cs.ucla.edu>
3497
3498 * data/glr.c (yyFail): Drastically simplify; since the format argument
3499 never had any % directives, we can simply pass it to yyerror.
3500 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
3501 be modified later, as that is the usual style in glr.c.
3502 Problems reported by Paul Hilfinger.
3503
3504 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
3505 and size overflow errors.
3506 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
3507 in case the user prolog sets feature-test macros like _GNU_SOURCE.
3508 (YYSIZEMAX): New macro.
3509 (yystpcpy): New function, taken from yacc.c.
3510 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
3511 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
3512 so that we don't have to maintain their signatures.
3513 (yyFail): Check for buffer overflow, by using vsnprintf rather
3514 than vsprintf. Allocate a bigger buffer if possible.
3515 Report an error if buffer allocation fails.
3516 (yyStackOverflow): New function.
3517 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
3518 the initialization was successful. It might fail if storage was
3519 exhausted.
3520 (yyexpandGLRStack): Add more checks for storage allocation failure.
3521 Use yyStackOverflow to report failures.
3522 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
3523 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
3524 Don't assume stack number fits in int.
3525 (yysplitStack): Check for storage allocation failure.
3526 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
3527 can print diagnostics on storage allocation failure. All callers
3528 changed.
3529 (yyresolveValue): Use yybool for boolean.
3530 (yyreportSyntaxError): Check for size-calculation overflow.
3531 This code is taken from yacc.c.
3532 (yyparse): Check for storage allocation errors when allocating
3533 the initial stack.
3534
35352005-07-05 Akim Demaille <akim@epita.fr>
3536
3537 Extract calc++ from the documentation.
3538 * doc/bison.texinfo (Calc++): Add the extraction marks.
3539 * examples/extexi: New, from the aborted GNU Programming 2E.
3540 Separate the different paragraph of a file with empty lines.
3541 * examples/Makefile: Use it to extract the whole calc++ example.
3542
35432005-06-24 Akim Demaille <akim@epita.fr>
3544
3545 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
3546 class typedefs.
3547
35482005-06-22 Akim Demaille <akim@epita.fr>
3549
3550 * doc/bison.texinfo (C++ Language Interface): First stab.
3551 (C++ Parsers): Remove.
3552
35532005-06-22 Akim Demaille <akim@epita.fr>
3554
3555 * data/lalr1.cc (yylex_): Honor %lex-param.
3556
35572005-06-22 Akim Demaille <akim@epita.fr>
3558
3559 Start a set of simple examples.
3560 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
3561 * examples/calc++/calc++-driver.hh,
3562 * examples/calc++/calc++-parser.yy,
3563 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
3564 * examples/calc++/compile, examples/calc++/test: New.
3565
35662005-06-09 Paul Eggert <eggert@cs.ucla.edu>
3567
3568 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
3569 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
3570 which stems from the 2005-05-27 patch.
3571
35722005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3573
3574 * data/glr.c: Modify treatment of unused parameters to permit use
3575 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
3576
35772005-05-30 Paul Eggert <eggert@cs.ucla.edu>
3578
3579 Fix infringement on user name space reported by Janos Zoltan Szabo.
3580 * data/yacc.c (yyparse): strlen -> yystrlen.
3581
35822005-05-30 Akim Demaille <akim@epita.fr>
3583
3584 * data/lalr1.cc (_): New.
3585 Translate the various messages.
3586
35872005-05-27 Paul Eggert <eggert@cs.ucla.edu>
3588
3589 Fix infringement on user name space reported by Bruno Haible.
3590 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
3591 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
3592 the user's name space.
3593 (alloca): Include <stdlib.h> to get it, if it's not built in.
3594 (YYMALLOC, YYFREE): Define only if needed.
3595 (malloc, free): Declare, but only if needed, as this infringes on
3596 the user name space.
3597
35982005-05-25 Paul Eggert <eggert@cs.ucla.edu>
3599
3600 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
3601 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
3602 with %d format.
3603 * lib/ebitset.c (min, max): Undef before defining.
3604 * lib/vbitset.c (min, max): Likewise.
3605 * lib/subpipe.c (create_subpipe): Save local variables in case
3606 vfork clobbers them.
3607
36082005-05-24 Bruno Haible <bruno@clisp.org>
3609
3610 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
3611 error message syntax used by gcc-4.0.
3612
36132005-05-23 Paul Eggert <eggert@cs.ucla.edu>
3614
3615 * README: Mention m4 1.4.3. Remove obsolete advice about
3616 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
3617
3618 * bootstrap: Remove workaround for problem I encountered with
3619 gettext 0.14.1; it seems to be fixed now.
3620
36212005-05-22 Paul Eggert <eggert@cs.ucla.edu>
3622
3623 * NEWS: Version 2.0a.
3624
3625 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
3626 the previous change.
3627
3628 Various maintainer cleanups.
3629 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
3630 conftest*, for benefit of CVS commands run at the same time as
3631 "configure". Add build-aux, since "bootstrap" now creates it and
3632 its subfiles.
3633 * Makefile.cfg (move_if_change): Remove.
3634 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
3635 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
3636 (po_repo, do-po-update, po-update, wget_files, get-targets):
3637 (config.guess-url_prefix, config.sub-url_prefix):
3638 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
3639 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
3640 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
3641 Remove.
3642 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
3643 this is now the recommended name.
3644 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
3645 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
3646 ylwrap. These files now go into build-aux.
3647 * config/move-if-change: Remove.
3648 * config/prev-version.txt: Bump from 1.75 to 2.0.
3649
3650 * bootstrap: Add stdio-safer, unistd-safer modules.
3651 Remove m4/glibc2.m4 (introduced by latest gnulib, but
3652 we don't need it).
3653 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
3654 fopen-safer.c, stdio-safer.h, unistd-safer.h.
3655 * lib/subpipe.c: Include "unistd-safer.h".
3656 (create_subpipe): Make sure all the newly-created
3657 file descriptors are > 2, so that diagnostics don't
3658 get sent down them (which might cause Bison to hang, in theory).
3659 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
3660 * src/files.c (xfopen): Use fopen_safer, not fopen.
3661
3662 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
3663 yesterday's yacc.c fix.
3664
36652005-05-21 Paul Eggert <eggert@cs.ucla.edu>
3666
3667 * data/glr.c, data/lalr1.cc: Update copyright date.
3668
3669 Fix a destructor bug reported by Wolfgang Spraul in
3670 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
3671 * data/yacc.c (yyabortlab): Don't call destructor, and
3672 don't set yychar to EMPTY.
3673 (yyoverflowlab): Don't call destructor.
3674 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
3675 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
3676 since we no longer output the message "discarding lookahead token
3677 end of input ()".
3678
36792005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3680
3681 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
3682 fix a small glitch in debugging output.
3683 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
3684 after YY_SYMBOL_PRINT where needed.
3685
3686 (struct yyGLRState): Add some comments.
3687 (struct yySemanticOption): Add some comments.
3688 (union yyGLRStackItem): Add comment.
3689
3690 (yymergeOptionSets): Correct this to properly perform the union,
3691 avoiding infinite reported by Michael Rosien.
3692 Update comment.
3693
3694 * tests/glr-regression.at: Add test for GLR merging error reported
3695 by M. Rosien.
3696
36972005-05-13 Paul Eggert <eggert@cs.ucla.edu>
3698
3699 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
3700 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
3701 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
3702 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
3703 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
3704 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
3705 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
3706 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
3707 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
3708 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
3709 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
3710 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
3711 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
3712 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
3713 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
3714 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
3715 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
3716 src/derives.h, src/files.c, src/files.h, src/getargs.c,
3717 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
3718 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
3719 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
3720 src/output.h, src/parse-gram.c, src/parse-gram.h,
3721 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
3722 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
3723 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
3724 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
3725 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
3726 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
3727 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
3728 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
3729 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
3730 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
3731 tests/reduce.at, tests/regression.at, tests/sets.at,
3732 tests/synclines.at, tests/testsuite.at, tests/torture.at:
3733 Update FSF postal mail address.
3734
37352005-05-11 Paul Eggert <eggert@cs.ucla.edu>
3736
3737 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
3738 Problem reported by Ralf Menzel.
3739
37402005-05-01 Paul Eggert <eggert@cs.ucla.edu>
3741
3742 * tests/actions.at: Test that stack overflow invokes destructors.
3743 From Marcus Holland-Moritz.
3744 * data/yacc.c (yyerrlab): Move the code that destroys the stack
3745 from here....
3746 (yyreturn): to here. That way, destructors are called properly
3747 even if the stack overflows, or the user calls YYACCEPT or
3748 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
3749 (yyoverflowlab): Destroy the lookahead.
3750
37512005-04-24 Paul Eggert <eggert@cs.ucla.edu>
3752
3753 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
3754
37552005-04-17 Paul Eggert <eggert@cs.ucla.edu>
3756
3757 * NEWS: Bison-generated C parsers no longer quote literal strings
3758 associated with tokens.
3759 * src/output.c (prepare_symbols): Don't escape strings,
3760 since users don't want to see C escapes.
3761 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
3762 in diagnostics.
3763 * tests/input.at (Torturing the Scanner): Likewise.
3764 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
3765
37662005-04-16 Paul Eggert <eggert@cs.ucla.edu>
3767
3768 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
3769 the data size is known to be too small and we can't increase it.
3770 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
3771
37722005-04-15 Paul Eggert <eggert@cs.ucla.edu>
3773
3774 * src/parse-gram.y: Include quotearg.h.
3775 (string_as_id): Quote $1 before using it as a key, since the
3776 lexer no longer quotes it for us.
3777 (string_content): Don't strip quotes, since lexer no longer
3778 quotes it for us.
3779 * src/scan-gram.l: Include quotearg.h.
3780 ("\""): Omit quote.
3781 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
3782 a key, since the rest of the lexer doesn't quote it.
3783 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
3784 * tests/regression.at (Token definitions): Check for backslashes
3785 in token strings.
3786
3787 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
3788 (YYSIZE_T): Define to unsigned long int when using an older compiler.
3789 (yyparse): Revamp code to generate long syntax error message, to
3790 make it easier to translate, and to avoid problems with arithmetic
3791 overflow. Change "virtual memory" to "memory" in diagnostic, since
3792 we don't know whether the memory is virtual.
3793
37942005-04-13 Paul Eggert <eggert@cs.ucla.edu>
3795
3796 * NEWS: Bison-generated C parsers now use the _ macro to
3797 translate strings.
3798 * data/yacc.c (_) [!defined _]: New macro.
3799 All English strings wrapped inside this macro.
3800 * doc/bison.texinfo (Bison Parser): Document _.
3801 * po/POTFILES.in: Include src/parse-gram.c, since it now
3802 includes translateable strings that parse-gram.y doesn't.
3803
38042005-04-12 Paul Eggert <eggert@cs.ucla.edu>
3805
3806 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
3807 reverting the 2004-10-11 change to this function.
3808 (symbol_check_alias_consistency): Don't call symbol_type_set
3809 if the type name is already correct.
3810 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
3811
38122005-03-25 Paul Eggert <eggert@cs.ucla.edu>
3813
3814 * tests/regression.at (Token definitions): Don't use a token named
3815 c, as that generates a "#define c ..." that runs afoul of buggy
3816 stdlib.h that uses the identifier c as a member of struct
3817 drand48_data. Problem reported by Horst Wente.
3818
38192005-03-21 Paul Eggert <eggert@cs.ucla.edu>
3820
3821 * bootstrap: Change translation URL from
3822 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
3823 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
3824 redirection glitches. Problem reported by twlevo@xs4all.nl.
3825
38262005-03-20 Paul Eggert <eggert@cs.ucla.edu>
3827
3828 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
3829 after operands; POSIX says this isn't portable for the c99 command.
3830
38312005-03-18 Paul Eggert <eggert@cs.ucla.edu>
3832
3833 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
3834 immediately if a data overrun has occurred; this may help us track
3835 down what may be a spurious failure on MacOS.
3836
38372005-03-17 Paul Eggert <eggert@cs.ucla.edu>
3838
3839 Respond to problems reported by twlevo@xs4all.nl.
3840
3841 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
3842
3843 * src/vcg.h: Comment fix.
3844 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
3845 (G_CMAX): Change to -1 instead of INT_MAX.
3846
3847 * data/yacc.c (yyparse): Omit spaces before #line.
3848
38492005-03-15 Paul Eggert <eggert@cs.ucla.edu>
3850
3851 * src/tables.c (state_number_to_vector_number): Put it inside an
3852 "#if 0", since it's not currently used. Problem reported by
3853 Roland McGrath.
3854
38552005-03-06 Paul Eggert <eggert@cs.ucla.edu>
3856
3857 * src/output.c (escaped_output): Renamed from
3858 escaped_file_name_output, since we now use it for symbol tags as
3859 well. All uses changed.
3860 (symbol_destructors_output, symbol_printers_output):
3861 Escape symbol tags too.
3862 Problem reported by Matyas Forstner in
3863 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
3864
3865 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
3866 not needed.
3867 * src/output.c (user_actions_output, token_definitions_output,
3868 symbol_destructors_output, symbol_printers_output): Likewise.
3869 * src/reader.c (prologue_augment): Likewise.
3870 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
3871
3872 * src/vcg.c (output_edge): Don't quote linestyle arg.
3873 Problem reported by twlevo@xs4all.nl.
3874
38752005-02-28 Paul Eggert <eggert@cs.ucla.edu>
3876
3877 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
3878 example, reported by Derek M Jones. Also, make the example even
3879 more outrageous, to better illustrate how bad the problem is.
3880
38812005-02-24 Paul Eggert <eggert@cs.ucla.edu>
3882
3883 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
3884 putsym. Typo reported by Sebastian Piping.
3885
38862005-02-23 Paul Eggert <eggert@cs.ucla.edu>
3887
3888 * doc/bison.texinfo (Language and Grammar): some -> same
3889 (Epilogue): int he -> in the
3890 Typos reported by Sebastian Piping via Justin Pence.
3891
38922005-02-07 Paul Eggert <eggert@cs.ucla.edu>
3893
3894 * tests/glr-regression.at (Improper handling of embedded actions
3895 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
3896 embedded actions and $-N in GLR parsers", work around an Autoconf bug
3897 with dollar signs in test names.
3898 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
3899 for a similar reason.
3900
39012005-01-28 Paul Eggert <eggert@cs.ucla.edu>
3902
3903 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
3904 wants to redefine G_VIEW.
3905
39062005-01-27 Paul Eggert <eggert@cs.ucla.edu>
3907
3908 * src/vcg.c (get_view_str): Remove case for normal_view.
3909 Problem reported by twlevo@xs4all.nl.
3910
39112005-01-24 Paul Eggert <eggert@cs.ucla.edu>
3912
3913 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
3914 Problem reported by twlevo@xs4all.nl.
3915
3916 * doc/bison.texinfo: Change @dircategory from "GNU programming
3917 tools" to "Software development". Requested by Richard Stallman
3918 via Karl Berry.
3919
39202005-01-23 Paul Eggert <eggert@cs.ucla.edu>
3921
3922 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
3923 Problem reported by twlevo@xs4all.nl.
3924
39252005-01-21 Paul Eggert <eggert@cs.ucla.edu>
3926
3927 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
3928 keyword; it's not needed with modern compilers, and it doesn't
3929 affect correctness with older compilers. Suggested by
3930 twlevo@xs4all.nl.
3931
39322005-01-17 Paul Eggert <eggert@cs.ucla.edu>
3933
3934 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
3935 gcc -Wswitch-default.
3936 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
3937 * data/yacc.c (yyparse): Likewise.
3938
39392005-01-12 Paul Eggert <eggert@cs.ucla.edu>
3940
3941 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
3942 already. Let config.h define any nonstandard values.
3943
39442005-01-10 Paul Eggert <eggert@cs.ucla.edu>
3945
3946 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
3947 for the benefit of slower hosts. Problem reported by
3948 Nelson H. F. Beebe.
3949
39502005-01-07 Paul Eggert <eggert@cs.ucla.edu>
3951
3952 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
3953 being defined and not used.
3954 * data/lalr1.cc (yyparse): Likewise.
3955 Use "if (false)" rather than "if (0)".
3956
39572005-01-05 Paul Eggert <eggert@cs.ucla.edu>
3958
3959 * TODO: Mention that we should allow NUL bytes in tokens.
3960
39612005-01-02 Paul Eggert <eggert@cs.ucla.edu>
3962
3963 * src/scan-skel.l (<<EOF>>): Don't close standard output.
3964 Problem reported by Hans Aberg.
3965
39662005-01-01 Paul Eggert <eggert@cs.ucla.edu>
3967
3968 * src/getargs.c (version): Happy new year; update overall
3969 program copyright date from 2004 to 2005.
3970
3971 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
3972 Problem reported by Hans Aberg.
3973 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
3974 (Output file names.): Add a test for the case when standard output
3975 is closed.
3976
39772004-12-26 Paul Eggert <eggert@cs.ucla.edu>
3978
3979 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
3980 to fix an oversight in the Bison 2.0 manual.
3981
39822004-12-25 Paul Eggert <eggert@cs.ucla.edu>
3983
3984 * NEWS: Version 2.0. Reformat the existing news items since
3985 1.875, so that related items are grouped together.
3986 * configure.ac (AC_INIT): Bump version to 2.0.
3987 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
3988
3989 * tests/torture.at (Exploding the Stack Size with Alloca): Set
3990 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
3991 otherwise, we're not testing alloca. Unfortunately there's no
3992 simple way to consult HAVE_ALLOCA here.
3993
3994 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
3995 for yymsg, too.
3996
3997 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
3998 hand. This avoids a warning about comparing int to size_t when
3999 GCC warnings are enabled.
4000
40012004-12-22 Paul Eggert <eggert@cs.ucla.edu>
4002
4003 * NEWS: Bison-generated parsers no longer default to using the
4004 alloca function (when available) to extend the parser stack, due
4005 to widespread problems in unchecked stack-overflow detection.
4006 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
4007 responsibility to set it to a positive value. This lets the user
4008 specify a value that is not a preprocessor constant.
4009 * data/yacc.c (YYMAXDEPTH): Likewise.
4010 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
4011 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
4012 to be a compile-time constant. However, explain the constraints on it.
4013 Also, explain the constraints on YYINITDEPTH.
4014 (Table of Symbols): Explain that alloca is no longer the default.
4015 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
4016 to 1.
4017
4018 * doc/bison.texinfo (Location Default Action): Mention that n must
4019 be zero when k is zero. Suggested by Frank Heckenbach.
4020
40212004-12-22 Akim Demaille <akim@epita.fr>
4022
4023 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
4024 (parser::state_type, parser::semantic_type, parser::location_type):
4025 Private, not public.
4026 (parser::parse): Return ints, not bool.
4027 Returning a bool introduces a problem: 0 corresponds to false, and
4028 it seems weird to return false on success. Returning true changes
4029 the conventions for yyparse.
4030 Alternatively we could return void and send an exception.
4031 There is no clear consensus (yet?).
4032 (state_stack, semantic_stack, location_stack): Rename as...
4033 (state_stack_type, semantic_stack_type, location_stack_type): these.
4034 Private, not public.
4035 * tests/c++.at: New.
4036 * tests/testsuite.at, tests/Makefile.am: Adjust.
4037
40382004-12-21 Akim Demaille <akim@epita.fr>
4039
4040 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
4041
40422004-12-21 Akim Demaille <akim@epita.fr>
4043
4044 Don't impose std::string for filenames.
4045
4046 * data/lalr1.cc (b4_filename_type): New.
4047 (position::filename): Use it.
4048 (parser.hh): Move the inclusion of stack.hh and location.hh below
4049 the user code, so that needed headers for the filename type can be
4050 included first.
4051 Forward declare them before the user code.
4052 * tests/Makefile.am (check-local, installcheck-local): Pass
4053 TESTSUITEFLAGS to the TESTSUITE.
4054
40552004-12-20 Akim Demaille <akim@epita.fr>
4056
4057 Use more STL like names: my_class instead of MyClass.
4058
4059 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
4060 (SemanticStack, SemanticType, StateStack, StateType)
4061 (TokenNumberType, Stack, Slice, Traits, Parser::location)
4062 (Parser::value): Rename as...
4063 (location_stack, location_type, rhs_number_type, semantic_stack)
4064 (semantic_type, state_stack, state_type, token_number_type, stack)
4065 (slice, traits, parser::yylloc, parser::yylval): these.
4066
4067 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
4068
40692004-12-19 Paul Eggert <eggert@cs.ucla.edu>
4070
4071 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
4072 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4073
40742004-12-17 Paul Eggert <eggert@cs.ucla.edu>
4075
4076 Remove uses of 'short int' and 'unsigned short int'. This raises
4077 some arbitrary limits. It uses more memory but nowadays that's
4078 not much of an issue.
4079
4080 This change does not affect the generated parsers; that's a different
4081 task, as some users will want to conserve memory there.
4082
4083 Ideally we should use size_t to represent all object counts, and
4084 something like ptrdiff_t to represent signed differences of object
4085 counts; but that will require more code-cleanup than I have the
4086 time to do right now.
4087
4088 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
4089 Use size_t, not int or short int, to count objects.
4090 * src/closure.c (nritemset, closure): Likewise.
4091 * src/closure.h (nritemset, closure): Likewise.
4092 * src/nullable.c (nullable_compute): Likewise.
4093 * src/print.c (print_core): Likewise.
4094 * src/print_graph.c (print_core): Likewise.
4095 * src/state.c (state_compare, state_hash): Likewise.
4096 * src/state.h (struct state): Likewise.
4097 * src/tables.c (default_goto, goto_actions): Likewise.
4098
4099 * src/gram.h (rule_number, rule): Use int, not short int.
4100 * src/output.c (prepare_rules): Likewise.
4101 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
4102 errs, reductions): Likewise.
4103 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
4104 Likewise.
4105 * src/tables.c (vector_number, tally, action_number,
4106 ACTION_NUMBER_MINIMUM): Likewise.
4107 * src/output.c (muscle_insert_short_int_table): Remove.
4108
41092004-12-17 Akim Demaille <akim@epita.fr>
4110
4111 * data/lalr1.cc: Extensive Doxygenation.
4112 (error_): Rename as...
4113 (error): this, since it is visible to the user.
4114 Adjust callers.
4115 (Parser::message): Now an automatic variable from...
4116 (Parser::yyreport_syntax_error_): here.
4117 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
4118 Parser::error.
4119 * tests/input.at: Escape $.
4120
41212004-12-16 Paul Eggert <eggert@cs.ucla.edu>
4122
4123 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
4124 Parenthesize rhs to avoid obscure problems with mistakes like
4125 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
4126 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
4127 b4_rhs_location): Likewise.
4128 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
4129 b4_rhs_location): Likewise.
4130
41312004-12-16 Akim Demaille <akim@epita.fr>
4132
4133 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
4134 yacc.c: be sure to stay within yycheck_.
4135 * tests/actions.at: Re-enable C++ tests.
4136
41372004-12-16 Akim Demaille <akim@epita.fr>
4138
4139 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
4140 real.
4141
41422004-12-16 Akim Demaille <akim@epita.fr>
4143
4144 Use #define to handle the %name-prefix.
4145
4146 * data/glr.c, data/yacc.c: Comment changes.
4147 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
4148 so that one can refer to yylex in the parser file, and have it
4149 renamed, as is the case with other skeletons.
4150
41512004-12-16 Akim Demaille <akim@epita.fr>
4152
4153 Move lalr1.cc internals into yy*.
4154
4155 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
4156 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
4157 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
4158 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
4159 (empty_, final_, terror_, errcode_, ntokens_)
4160 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
4161 (looka_, ilooka_, error_range_, nerrs_):
4162 Rename as...
4163 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
4164 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
4165 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
4166 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
4167 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
4168 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
4169 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
4170 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
4171 these.
4172
41732004-12-15 Paul Eggert <eggert@cs.ucla.edu>
4174
4175 Fix some problems reported by twlevo at xs4all.
4176 * src/symtab.c (symbol_new): Report an error if the input grammar
4177 contains too many symbols. This is better than calling abort() later.
4178 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
4179 (struct node, struct graph):
4180 Rename member expand to stretch. All uses changed.
4181 (struct graph): Remove member layoutalgorithm. All uses removed.
4182 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
4183 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
4184 All uses changed.
4185 (N_STRETCH): Rename from N_EXPAND. All uses changed.
4186
41872004-12-15 Akim Demaille <akim@epita.fr>
4188
4189 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
4190 Add more Doxygen comments.
4191 (symprint_, stack_print_, reduce_print_, destruct_, pop)
4192 (report_syntax_error_, translate_): Rename as...
4193 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
4194 (yypop_, yyreport_syntax_error_, yytranslate_): this.
4195
41962004-12-15 Akim Demaille <akim@epita.fr>
4197
4198 * data/lalr1.cc (lex_): Rename as...
4199 (yylex_): this.
4200 Move the trace here.
4201 Take the %name-prefix into account.
4202 Reported by Alexandre Duret-Lutz.
4203
42042004-12-15 Akim Demaille <akim@epita.fr>
4205
4206 Simplify the C++ parser constructor.
4207
4208 * data/lalr1.cc (debug_): Rename as...
4209 (yydebug_): so that the parser's internals are always in the yy*
4210 pseudo namespace.
4211 Adjust uses.
4212 (b4_parse_param_decl): Remove the leading comma as it is now only
4213 called as unique argument list.
4214 (Parser::Parser): Remove the constructor accepting a location and
4215 an initial debugging level.
4216 Remove from the other ctor the argument for the debugging level.
4217 (debug_level_type, debug_level, set_debug_level): New.
4218
4219 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
4220 constructor calls.
4221
42222004-12-15 Akim Demaille <akim@epita.fr>
4223
4224 Remove b4_root related material: failure experiment
4225 (which goal was to allow to derive from a class).
4226
4227 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
4228 definitions and uses.
4229
42302004-12-14 Paul Eggert <eggert@cs.ucla.edu>
4231
4232 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
4233 not 2, since it's not portable to subtract 1 from the start of an
4234 array. The new item 0 is never set or used. All uses changed.
4235
4236 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
4237 the default definition of YYLLOC_DEFAULT. Problem reported
4238 by Frank Heckenbach.
4239
42402004-12-12 Paul Eggert <eggert@cs.ucla.edu>
4241
4242 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
4243 the normal case and one for the error case. Just use the
4244 first one uniformly. Problem reported by Frank Heckenbach.
4245 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
4246 use exactly the same macro in both places.
4247 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
4248 so that the normal-case YYRHSLOC works for the error case too.
4249 All uses changed.
4250 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
4251 (YYLLOC_DEFAULT): Use the same macro as glr.c.
4252 * doc/bison.texinfo (Location Default Action): Don't claim that
4253 we have an array of locations. Use the same macro for both glr
4254 and lalr parsers. Mention YYRHSLOC. Mention what happens when
4255 the index is 0.
4256
42572004-12-10 Paul Eggert <eggert@cs.ucla.edu>
4258
4259 * HACKING: Update email addresses to send announcements to.
4260
4261 * configure.ac (AC_INIT): Bump version to 1.875f.
4262
42632004-12-10 Paul Eggert <eggert@cs.ucla.edu>
4264
4265 * NEWS: Version 1.875e.
4266 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
4267
4268 * src/scan-skel.l: Include "complain.h", for "fatal".
4269
4270 * src/relation.h (relation_print, relation_digraph):
4271 Relation sizes are of type relation_node, not size_t (this is
4272 merely a doc fix, since the two types are equivalent).
4273 (relation_transpose): Relation sizes are of type relation_node,
4274 not int.
4275 * src/relation.c: Likewise.
4276 (top, infinity): Now of type relation_node, not int.
4277 (traverse, relation_transpose): Use relation_node, not int.
4278
4279 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
4280 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
4281 (yyparse): Remove unused local introduced in 2004-10-25 patch.
4282
4283 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
4284 specifying whether the test should be skipped. Use it tp
4285 specify that the [%defines %skeleton "lalr1.cc"] tests currently
4286 fail on some hosts, and should be skipped.
4287
42882004-12-08 Paul Eggert <eggert@cs.ucla.edu>
4289
4290 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
4291 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
4292 unless otherwise specified below.
4293
4294 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
4295 to allocate kernel_base, kernel_items, kernel_size, since
4296 they needn't be initialized to 0.
4297 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
4298 * src/closure.c (new_closure): Likewise, for itemset.
4299 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
4300 * src/lalr.c (set_goto_map): Likewise, for temp_map.
4301 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
4302 (build_relations): Likewise for edge, states1, includes.
4303 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
4304 * src/reader.c (packgram): Likewise, for ritem, rules.
4305 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
4306 * src/relation.c (relation_digraph): Likewise for VERTICES.
4307 (relation_transpose): Likewise for new_R, end_R.
4308 * src/symtab.c (symbols_token_translations_init): Likewise for
4309 token_translations.
4310 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
4311 (token_actions): Likewise for yydefact, actrow, conflrow,
4312 conflict_list.
4313 (save_column): Likewise for froms[symno], tos[symno].
4314 (goto_actions): Likewise for state_count.
4315 (pack_table): Likewise for base, pos, check.
4316 (tables_generate): Likewise for width.
4317
4318 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
4319 for initial core. Just have a separate core, so we needn't worry
4320 about whether kernel_size and kernel_base are initialized.
4321
4322 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
4323 kernel_size, kernel_items): Remove unnecessary initialization.
4324 * src/conflicts.c (conflicts): Likewise.
4325 * src/derives.c (derives): Likewise.
4326 * src/muscle_tablc (muscle_insert): Likewise.
4327 * src/relation.c (relation_digraph): Likewise.
4328 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
4329 conflrow, conflict_table, conflict_list, table, check):
4330 Likewise.
4331
4332 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
4333 This is because all callers pass unsigned int.
4334 * src/closure.h (new_closure): Likewise.
4335
4336 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
4337 (build_relations): Initialize includes[i] in all cases.
4338 * src/reader.c (packgram): Always initialize rules[ruleno].prec
4339 and rules[ruleno].precsym. Initialize members in order.
4340 * src/relation.c (relation_transpose): Always initialize new_R[i]
4341 and end_R[i].
4342 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
4343
4344 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
4345 conflict_list[0] was always 0, but now it isn't initialized.
4346
4347 * src/table.c (table_grow): When conflict_table grew, the grown
4348 area wasn't cleared. Fix this.
4349
4350 * lib/.cvsignore: Add strdup.c, strdup.h.
4351 * m4/.cvsignore: Add strdup.m4.
4352
43532004-12-07 Paul Eggert <eggert@cs.ucla.edu>
4354
4355 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
4356 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
4357 GOTO_NUMBER_MAXIMUM, since we occasionally compute
4358 ngotos + 1 without checking for overflow.
4359 (build_relations): Use END_NODE, not -1, to denote end of edges.
4360 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
4361 build_relations): Use goto_number, not int, for goto numbers.
4362 * src/tables.c (save_column, default_goto): Likewise.
4363
43642004-11-23 Akim Demaille <akim@epita.fr>
4365
4366 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
4367 of #defining from yystype.
4368 Don't typedef yystype, C++ does not need it.
4369 This lets it possible to forward declare it as union.
4370
43712004-11-23 Paul Eggert <eggert@cs.ucla.edu>
4372
4373 * bootstrap (gnulib_modules): Add extensions.
4374 Problem reported by Jim Meyering.
4375
43762004-11-22 Paul Eggert <eggert@cs.ucla.edu>
4377
4378 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
4379 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
4380 src/system.h, src/tables.c: XFREE -> free, to accommodate
4381 recent change to gnulib xalloc.h.
4382 Problem reported by Jim Meyering.
4383
43842004-11-17 Akim Demaille <akim@epita.fr>
4385
4386 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
4387
43882004-11-17 Akim Demaille <akim@epita.fr>,
4389 Alexandre Duret-Lutz <adl@gnu.org>
4390
4391 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
4392 changes.
4393 (YYCDEBUG): Adjust.
4394 Use it instead of cdebug_.
4395 (Parser::debug_stream, Parser::set_debug_stream): New.
4396 (Parser::symprint_): Define cdebug_ for temporary backward
4397 compatibility.
4398 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
4399 debug_stream ().
4400
44012004-11-17 Akim Demaille <akim@epita.fr>
4402
4403 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
4404 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
4405 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
4406 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
4407
44082004-10-27 Paul Eggert <eggert@cs.ucla.edu>
4409
4410 * data/glr.c (yyloc_default): Remove; not used.
4411 Problem reported by Frank Heckenbach.
4412
44132004-10-25 Akim Demaille <akim@epita.fr>
4414
4415 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
4416 Introduce another definition to address simple location arrays.
4417 (yyGLRStack): New member: yyerror_range.
4418 (yyrecoverSyntaxError, yyparse): Update it.
4419 (yyrecoverSyntaxError): Use it when shifting the error token to
4420 have an accurate range, equivalent to the one computed by both
4421 yacc.c and lalr1.cc.
4422 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
4423 that column numbers start at column 0, as per GNU Coding
4424 Standards, the others tests, and the doc.
4425 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
4426 Adjust to the above change (first column is 0).
4427 And adjust the location of the "<error>", now covering the whole
4428 line.
4429
44302004-10-22 Akim Demaille <akim@epita.fr>
4431 and Paul Eggert <eggert@cs.ucla.edu>
4432
4433 Remove some arbitrary limits on goto numbers and relations.
4434 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
4435 initial values, since they're never used.
4436 (set_goto_map): ngotos is now unsigned, so test for overflow
4437 by seeing whether it wraps around to zero.
4438 * src/lalr.h (goto_number): Now size_t, not short int.
4439 (GOTO_NUMBER_MAXIMUM): Remove.
4440 * src/relation.c (relation_print, traverse, relation_transpose):
4441 Check for END_NODE rather than looking at sign.
4442 * src/relation.h (END_NODE): New macro.
4443 (relation_node): Now size_t, not short int.
4444
44452004-10-22 Paul Eggert <eggert@cs.ucla.edu>
4446
4447 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
4448 keyword, not an identifier. Problem reported by Baron Schwartz in
4449 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
4450
44512004-10-11 Akim Demaille <akim@epita.fr>
4452
4453 * src/symtab.c (symbol_check_alias_consistency): Also check
4454 type names, destructors, and printers.
4455 Reported by Alexandre Duret-Lutz.
4456 Recode the handling of associativity and precedence in terms
4457 of symbol_precedence_set.
4458 Accept no redeclaration at all, not even equal to the previous
4459 value.
4460 (redeclaration): New.
4461 Use it to factor redeclaration complaints.
4462 (symbol_make_alias): Don't set the type of the alias, let
4463 symbol_check_alias_consistency do it as for other features.
4464 * src/symtab.h (symbol): Add new member prec_location, and
4465 type_location.
4466 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
4467 * tests/input.at (Incompatible Aliases): New.
4468
44692004-10-09 Paul Eggert <eggert@cs.ucla.edu>
4470
4471 .cvsignore fixes to accommodate gnulib changes,
4472 and the practice of naming build directories "_build".
4473 * .cvsignore: Add "_*". Sort.
4474 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
4475 * m4/.cvsignore: Add "*_gl.m4".
4476
44772004-10-06 Akim Demaille <akim@epita.fr>
4478
4479 * src/parse-gram.y (add_param): Fix the truncation of trailing
4480 spaces.
4481
44822004-10-05 Akim Demaille <akim@epita.fr>
4483
4484 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
4485 whether the reducion was empty or not. This leaves room to
4486 improve the use of YYLLOC_DEFAULT in such a case.
4487 lalr1.cc is still experimental, so changing this is acceptable.
4488 And finally, there are probably not many users who changed the
4489 handling of locations in GLR, so changing is admissible too.
4490
4491 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
4492 empty reduction, set @$ to an empty location ending the previously
4493 stacked symbol.
4494 Adjust uses to make sure the code is triggered on empty
4495 reductions.
4496 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
4497 expected output: empty reductions have empty locations.
4498
44992004-09-29 Akim Demaille <akim@epita.fr>
4500
4501 * data/lalr1.cc: Move towards a more standard C++ coding style
4502 for templates: Class < T > -> Class<T>.
4503
45042004-09-29 Akim Demaille <akim@epita.fr>
4505
4506 * data/lalr1.cc: Reinstall the former ctor, for sake of
4507 compatibility, but warn it will be removed.
4508 Move towards a more standard C++ coding style (i.e., type *var ->
4509 type* var).
4510
45112004-09-27 Paul Eggert <eggert@cs.ucla.edu>
4512
4513 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
4514 since it's less likely to work if NULs are involved in the future.
4515
45162004-09-27 Akim Demaille <akim@epita.fr>
4517
4518 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
4519
45202004-09-27 Akim Demaille <akim@epita.fr>
4521
4522 * data/lalr1.cc (b4_parse_param_decl_1): New.
4523 (b4_parse_param_decl): Use it to have different names between attribute
4524 and argument names.
4525 (b4_cc_constructor_call): Likewise.
4526
45272004-09-24 Akim Demaille <akim@epita.fr>
4528
4529 * src/parse-gram.y (add_param): Strip the leading and trailing
4530 blanks from a formal argument declaration.
4531 (YY_LOCATION_PRINT): New.
4532
45332004-09-24 Akim Demaille <akim@epita.fr>
4534
4535 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
4536 after the location.
4537
45382004-09-24 Akim Demaille <akim@epita.fr>
4539
4540 * doc/bison.texinfo (Table of Symbols): Sort.
4541
45422004-09-21 Akim Demaille <akim@epita.fr>
4543
4544 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
4545 the useless parentheses.
4546 Suggested by Paul Eggert.
4547
45482004-09-20 Akim Demaille <akim@epita.fr>
4549
4550 Let the initial-action act on the look-ahead, and use it for the
4551 "initial push" (corresponding to an hypothetical beginning-of-file).
4552 And let lalr1.cc honor %initial-action.
4553
4554 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
4555 example.
4556 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
4557 (Parser::Parser): Remove the ctor that used to initialize it.
4558 (Parser::parse): Like in the other skeletons, issue the "starting
4559 parse" message before any action.
4560 Honor %initial-action.
4561 Initialize the stacks with the lookahead.
4562 * data/yacc.c: Let $$ and @$ in %initial-action designate the
4563 look-ahead.
4564 Push them in the stacks.
4565 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
4566
45672004-09-20 Akim Demaille <akim@epita.fr>
4568
4569 * doc/bison.texinfo (Initial Action Decl): New.
4570
45712004-09-20 Akim Demaille <akim@epita.fr>
4572
4573 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
4574 clearer criterion to define it.
4575 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
4576 When reducing on an empty RHS, use the latest stacked location as
4577 location.
4578 yylloc is not always available.
4579 * data/glr.c: Likewise.
4580 Also, honor initial-actions.
4581
45822004-09-20 Akim Demaille <akim@epita.fr>
4583
4584 * data/yacc.c (YY_LOCATION_PRINT): New.
4585 Define when we know YYLTYPE's structure, i.e., when the default
4586 YYLLOC_DEFAULT is used.
4587 * data/c.m4 (b4_yysymprint_generate): Use it.
4588 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
4589 value of the result.
4590 (error_start_): Replace with...
4591 (error_range_): this location array.
4592 This allows to replace code relying on the implementation of
4593 locations by portable code.
4594 * data/yacc.c (yylerrsp): Replace with...
4595 (yyerror_range): this.
4596 Every time a token is popped, update yyerror_range[0], to have an
4597 accurate location for the error token.
4598 * data/glr.c (YY_LOCATION_PRINT): New.
4599 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
4600 deference a pointer.
4601 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
4602 report the location in %printers.
4603
4604 * src/scan-skel.l: Instead of abort, report error messages to ease
4605 understanding skeleton scanning failures.
4606
46072004-09-16 Akim Demaille <akim@epita.fr>
4608
4609 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
4610 (iterator, const_iterator): these, to be more in the C++ spirit.
4611 Also, return reverse iterators so that when displaying the stack
4612 we display its bottom first.
4613 (Parser::stack_print_, Parser::reduce_print_): Match the messages
4614 from yacc.c.
4615 We should probably use vector here though.
4616
46172004-09-16 Akim Demaille <akim@epita.fr>
4618
4619 Have more complete shift traces.
4620
4621 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
4622 to report Shifts instead of ad hoc YYDPRINTF invocations,
4623 including for the error token.
4624 * data/lalr1.cc (symprint_): Output the location.
4625 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
4626 output the location within the %printer.
4627 Activate GLR tests, at least to make sure they compile properly.
4628 They still don't pass though.
4629 * tests/calc.at: Adjust expect verbose output, since now "Entering
4630 state..." is on a different line than the "Shifting" message.
4631
46322004-09-08 Akim Demaille <akim@epita.fr>
4633
4634 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
4635 Bison directive from the Bison file to the invocation of this
4636 macro, so that these directives are passed to
4637 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
4638 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
4639 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
4640 the extra Bison directives instead of the whole series.
4641 Change the grammar so that there are recoverable errors, and
4642 unrecoverable errors. Now we can have the parser give up before
4643 consuming the whole input. As a result we now can observe that
4644 the lookahead is freed when needed.
4645 Change the parser source to parse argv[1] instead of a hard coded
4646 string.
4647 Simplify yylex, and give a value and location to EOF.
4648 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
4649 passed directives already coded in the file.
4650 Add some tests to check the location of "error".
4651 For some tests, the C++ parser is correct, and not yacc.c.
4652 For other tests, they provide different, but unsatisfying, values,
4653 so keep the C++ value so that at least one parser is "correct"
4654 according to the test suite.
4655 (Actions after errors): Remove, this is subsumed by the
4656 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
4657
46582004-09-06 Akim Demaille <akim@epita.fr>
4659
4660 * data/lalr1.cc: Adjust the indentation of the labels.
4661 (Parser::pop): New.
4662 Use it.
4663
46642004-09-06 Akim Demaille <akim@epita.fr>
4665
4666 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
4667 argument, an informative message.
4668 Call YY_SYMBOL_PRINT.
4669 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
4670 * data/lalr1.cc (destruct_): Likewise.
4671 In addition, no longer depend on b4_yysymprint_generate and
4672 b4_yydestruct_generate to generate these functions, do it "by
4673 hand".
4674
46752004-09-03 Akim Demaille <akim@epita.fr>
4676
4677 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
4678 invoked, yydestruct the lookahead.
4679 * tests/calc.at (Calculator $1): Update the expected lengths of
4680 traces: there is an added line for the discarded lookahead.
4681 * doc/bison.texinfo (Destructor Decl): Some rewording.
4682 Define "discarded" symbols.
4683
46842004-09-02 Akim Demaille <akim@epita.fr>
4685
4686 * data/lalr1.cc (translate_, destruct_): No reason to be static.
4687
46882004-09-02 Akim Demaille <akim@epita.fr>
4689
4690 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
4691 (YYDSYMPRINTF): Rename as...
4692 (YY_SYMBOL_PRINT): this.
4693 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
4694 two.
4695 Use it instead of direct symprint_ calls.
4696 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
4697 one.
4698
46992004-09-02 Akim Demaille <akim@epita.fr>
4700
4701 * data/lalr1.cc (b4_yysymprint_generate): New.
4702 (symprint_): New member function, defined when YYDEBUG.
4703 Use it consistently instead of token/nterm debugging output by
4704 hand.
4705 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
4706 %printer calls to use cdebug_ when using lalr1.cc.
4707
47082004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
4709
4710 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
4711 with #ifdef YYDEBUG.
4712
47132004-08-26 Akim Demaille <akim@epita.fr>
4714
4715 * doc/bison.texinfo (Implementing Loops): Rename as...
4716 (Implementing Gotos/Loops): this.
4717
47182004-08-13 Paul Eggert <eggert@cs.ucla.edu>
4719
4720 Adjust to latest gnulib.
4721 * bootstrap (gnulib_modules): Add xalloc-die.
4722 Set LC_ALL=C so that file names sort consistently.
4723 Prefer the gnulib copies of gettext.m4, glibc21.m4,
4724 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
4725 uintmax_t.m4, ulonglong.m4.
4726 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
4727 po.m4 since we are now using _gl.m4 instead.
4728
47292004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
4730
4731 * src/scan-action.l: Remove. Scanning of semantic actions is
4732 handled in scan-gram.l.
4733
47342004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
4735
4736 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
4737
4738 * src/location.h (struct): The file member is a uniqstr.
4739 (equal_boundaries): Use UNIQSTR_EQ for comparison.
4740
47412004-07-22 Paul Eggert <eggert@cs.ucla.edu>
4742
4743 Fix bug with non-%union parsers that have printers or destructors,
4744 which led to a Bison core dump. Reported by Peter Fales in
4745 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
4746
4747 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
4748 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
4749 not to our own type.
4750 * src/output.c (symbol_destructors_output, symbol_printers_output):
4751 Don't assume %union.
4752 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
4753 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
4754 UNION-FLAG. All callers changed.
4755 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
4756 Use type char, not unsigned int, when declaring an array of char;
4757 this lets us remove a cast.
4758 (Printers and Destructors): Add non-%union test cases.
4759
47602004-06-21 Paul Eggert <eggert@cs.ucla.edu>
4761
4762 * doc/bison.texinfo: Minor editorial changes, mostly to the new
4763 GLR writeups. E.g., avoid frenchspacing and the future tense,
4764 change "lookahead" to "look-ahead", and change "wrt" to "with
4765 respect to".
4766
47672004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
4768
4769 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
4770 New sections, split off from the GLR Parsers section. Put the new
4771 Simple GLR Parser near the start of the GLR section, for clarity.
4772 Rewrite connective text.
4773
47742004-06-21 Frank Heckenbach <frank@g-n-u.de>
4775
4776 * doc/bison.texinfo (Simple GLR Parsers): New section.
4777
47782004-06-21 Paul Eggert <eggert@cs.ucla.edu>
4779
4780 * NEWS, TODO, doc/bison.texinfo:
4781 Use "look-ahead" instead of "lookahead", to be consistent.
4782 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
4783 while we're fixing "look-ahead".
4784 * src/conflicts.c (shift_set): Renamed from shiftset.
4785 (look_ahead_set): Renamed from lookaheadset.
4786 * src/print.c: Likewise.
4787 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
4788 name for "lookahead".
4789 (report_types, usage): Likewise.
4790 * src/getargs.h (report_look_ahead_tokens): Renamed from
4791 report_lookaheads.
4792 * src/lalr.c (compute_look_ahead_tokens): Renamed from
4793 compute_lookaheads.
4794 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
4795 (look_ahead_tokens_print): Renamed from lookaheads_print.
4796 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
4797 state_rule_lookaheads_print.
4798 * src/state.h: Likewise.
4799 (reductions.look_ahead_tokens): Renamed from lookaheads.
4800 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
4801 AT_DATA_LOOKAHEADS_GRAMMAR.
4802
48032004-06-03 Paul Eggert <eggert@cs.ucla.edu>
4804
4805 * README: Update location of patched M4 distribution.
4806
48072004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
4808
4809 Don't assume the C++ compiler takes the same arguments as the C compiler
4810 (trivial change).
4811 * configure.ac (O0CXXFLAGS): New var.
4812 * tests/atlocal.in (CXXFLAGS): Use it.
4813
48142004-05-29 Paul Eggert <eggert@cs.ucla.edu>
4815
4816 Fix some "make check" problems with C++ reported by
4817 Albert Chin-A-Young for Tru64 C++ in this thread:
4818 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
4819
4820 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
4821 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
4822 Output to a .cc file for C++, not to a .c file.
4823 * tests/calc.at (AT_CHECK_CALC): Likewise.
4824 * tests/regression.at (AT_CHECK_DANCER): Likewise.
4825 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
4826
48272004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
4828
4829 * tests/calc.at, tests/actions.at: Workaround for SGI
4830 C++ compiler. (trivial change)
4831
48322004-05-27 Paul Eggert <eggert@cs.ucla.edu>
4833
4834 Spent a few hours checking out which prerequisite versions the
4835 current sources actually require. I went all the way back to
4836 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
4837 a seemingly endless set of combinations of versions more recent
4838 than that. The bottom line is that the current sources require
4839 fairly recent versions of the build tools, and it'll be some work
4840 to change this.
4841 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
4842 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
4843 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
4844 Add comments explaining why those particular versions are
4845 currently needed.
4846
4847 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
4848 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
4849 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
4850
4851 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
4852 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
4853
48542004-05-26 Paul Eggert <eggert@cs.ucla.edu>
4855
4856 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
4857 0.11.5. Suggested by Bruno Haible.
4858 * bootstrap: Remove gettext version checking.
4859
4860 * doc/bison.texinfo (Decl Summary): Also mention that %union
4861 can depend on prerequisite types. Problem reported by Tim
4862 Van Holder.
4863
48642004-05-25 Paul Eggert <eggert@cs.ucla.edu>
4865
4866 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
4867 * README-alpha: Don't tell people not to package this.
4868
4869 * bootstrap: Don't assume $(...) works; use `...` instead.
4870 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
4871 gettext better.
4872
4873 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
4874 put into the -d output file, and mention what to do if YYSTYPE is
4875 defined as a macro.
4876
48772004-05-24 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 Undo change made earlier today: it caused autopoint to not bring
4880 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
4881 autopoint's.
4882
4883 * bootstrap: Check that gettext version matches what's in
4884 configure.ac. Warn users to ignore robots.txt ERROR 404.
4885 * bootstrap: Undo today's earlier change (logged below).
4886 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
4887
4888 The gettext version checking is causing more trouble than it's
4889 curing; remove it. Problem reported by Paul Hilfinger.
4890
4891 * bootstrap: Issue a warning that one can expect a message
4892 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
4893 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
4894
48952004-05-23 Paul Eggert <eggert@cs.ucla.edu>
4896
4897 Ensure that the C++ compiler used for testing actually works on a
4898 simple test program; if not, skip the C++-related tests. Problem
4899 reported by Vin Shelton in:
4900 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
4901
4902 * m4/cxx.m4: New file.
4903 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
4904 * tests/atlocal.in (BISON_CXX_WORKS): Add.
4905 * tests/local.at (AT_COMPILE_CXX): Use it.
4906
49072004-05-21 Paul Eggert <eggert@cs.ucla.edu>
4908
4909 * data/glr.c (yylloc): Output this macro even if locations are not
4910 being generated, as the GLR parser needs it even in that case.
4911 Problem reported by Troy A. Johnson
4912 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
4913
4914 * configure.ac (AC_INIT): Update to 1.875e.
4915
49162004-05-21 Paul Eggert <eggert@cs.ucla.edu>
4917
4918 * NEWS: Version 1.875d.
4919 * configure.ac (AC_INIT): Likewise.
4920 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
4921
4922 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
4923 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
4924 lalr1.cc runs afoul of the first, and the last two are no longer
4925 supported by GCC 3.4.0.
4926 * README: Mention GNU m4 1.4 or later; mention m4 patches.
4927 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
4928
49292004-05-06 Paul Eggert <eggert@cs.ucla.edu>
4930
4931 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
4932 unsigned int, for compatibility with latest gnulib hash module.
4933 * src/state.c (state_hash, state_hasher): Likewise.
4934 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
4935 * src/uniqstr.c (hash_uniqstr): Likewise.
4936
49372004-05-03 Paul Eggert <eggert@cs.ucla.edu>
4938
4939 * NEWS: Unescaped newlines are no longer allowed in char & strings.
4940
4941 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
4942 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
4943 character and string literals.
4944 (unexpected_end): New function.
4945 (unexpected_eof): Use it.
4946 (unexpected_newline): New function.
4947 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
4948 actions.
4949
4950 * NEWS: Document %expect-rr.
4951
4952 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
4953 Fix typo by replacing $1 with $option.
4954 Remove more 'intl'-related files.
4955 Don't DEFUN AM_INTL_SUBDIR twice.
4956
4957 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
4958 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
4959 strtoul.c.
4960 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
4961 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
4962 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
4963 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
4964 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
4965 * src/.cvsignore: Add *.output.
4966
4967 * src/parse-gram.y: Put copyright notice inside %{ %} so it
4968 gets copied to the output file.
4969
49702004-04-28 Paul Eggert <eggert@twinsun.com>
4971
4972 Get files from the gnulib and po repositories, instead of relying
4973 on them being in our CVS. Upgrade to latest versions of gnulib
4974 and Automake.
4975
4976 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
4977 * bootstrap: Bootstrap from gnulib and po repositories.
4978 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
4979 * README-cvs: Document these changes. Remove version numbers from
4980 mentions of build tools, since they change so often. Mention Flex.
4981
4982 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
4983 (gl_USE_SYSTEM_EXTENSIONS): Add.
4984 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
4985 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
4986 does this for us.
4987 (AC_ISC_POSIX): Remove; we no longer support this
4988 ancient OS, as it gets in the way of latest Autoconf & gnulib.
4989 (AC_HEADER_STDC): Remove: we now assume C89 or better.
4990 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
4991 Do not check for C89 headers, except for locale.h which is used
4992 by the Yacc library and must port to K&R hosts.
4993 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
4994 Do not check for C89 functions, except for setlocale which is
4995 used by the Yacc library.
4996 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
4997 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
4998 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
4999 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
5000 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
5001 AM_GNU_GETTEXT): Remove; now done by:
5002 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
5003 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
5004 for us.
5005
5006 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
5007 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
5008 Define to empty, as gnulib.mk will do the rest for us.
5009 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
5010 for us.
5011 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
5012 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
5013
5014 * src/files.c: Include gnulib's xstrndup.h.
5015
5016 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
5017 (REALLOC): Use xnrealloc, for likewise.
5018 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
5019 (strnlen, memrchr): Remove decls; functions no longer used.
5020 Include <stpcpy.h>.
5021
5022 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
5023 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
5024 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
5025 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
5026 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
5027 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
5028 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
5029 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
5030 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
5031 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
5032 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
5033 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5034 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
5035 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
5036 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
5037 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
5038 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
5039 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
5040 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
5041 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
5042 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
5043 Remove, as these files are now generated automatically
5044 by bootstrap or automake.
5045
5046 * po/ChangeLog: Remove: all but one entry was a duplicate
5047 of this file, and I moved that 2000-11-02 entry here.
5048
5049 * config/.cvsignore: Add Makefile, depcomp, install-sh.
5050 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
5051 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
5052 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
5053 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
5054 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
5055 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
5056 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
5057 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
5058 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
5059 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
5060 xstrndup.h.
5061 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
5062 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
5063 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
5064 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
5065 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
5066 * src/.cvsignore: Remove *_.c.
5067
5068
5069 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
5070 support it. (The latest stable gzip doesn't.)
5071
50722004-04-27 Paul Eggert <eggert@twinsun.com>
5073
5074 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
5075 case, as stos_ is now used by destructors due to the 2004-02-09
5076 change.
5077
5078 Remove more K&R C support.
5079 * lib/libiberty.y (PARAMS): Remove. All uses removed.
5080 * lib/subpipe.c (errno): Remove decl.
5081 Include <stdlib.h> unconditionally.
5082 (EXIT_FAILURE): Remove macro.
5083 * src/complain.c (vfprintf, strerror): Remove.
5084 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
5085 unconditionally.
5086 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
5087 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
5088 (strchr, strspn, memchr): Remove decls.
5089 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
5090 unconditionally. Do not declare perror.
5091 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
5092 unconditionally.
5093
5094 * src/complain.c (_): Remove useless defn, as system.h defines this.
5095
5096 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
5097 with latest obstack.h.
5098 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
5099 to procedure types, as obstack.h now does that for us.
5100 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
5101
5102 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
5103 so that this include file can stand alone.
5104 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
5105 does this now. Include subpipe.h first after config.h, to
5106 test whether it can stand alone.
5107
5108 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
5109 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
5110 unused declaration.
5111
5112 * tests/synclines.at (%union synch line): Put a dummy member in
5113 the union, because empty unions aren't allowed in C. Caught
5114 by GCC 3.4.0.
5115
51162004-04-13 Jim Meyering <jim@meyering.net>
5117
5118 * src/conflicts.c (conflicts_print): Correct format string typo:
5119 use `%%' to produce literal `%'. (trivial change)
5120
51212004-03-30 Paul Eggert <eggert@twinsun.com>
5122
5123 * src/getargs.c (version): Update copyright year to 2004.
5124
5125 * data/c.m4 (b4_int_type): Use 'short int' rather than
5126 'short', and similarly for 'long', 'unsigned', etc.
5127 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
5128 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
5129 yy_yypstack, yydumpstack): Likewise.
5130 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
5131 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
5132 Likewise.
5133 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
5134 yy_stack_print, yyparse): Likewise.
5135 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
5136 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
5137 * lib/bitset.c (bitset_print): Likewise.
5138 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
5139 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
5140 * lib/bitsetv.c (bitsetv_dump): Likewise.
5141 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
5142 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
5143 Likewise.
5144 * src/LR0.c (allocate_itemsets): Likewise.
5145 * src/gram.h (rule_number, rule): Likewise.
5146 * src/lalr.h (goto_number): Likewise.
5147 * src/nullable.c (nullable_compute): Likewise.
5148 * src/output.c (prepare_rules): Likewise.
5149 * src/relation.c (relation_print, relation_digraph): Likewise.
5150 * src/relation.h (relation_node): Likewise.
5151 * src/state.h (state_number, transitions, errs, reductions,
5152 struct state): Likewise.
5153 * src/symtab.h (symbol_number, struct symbol): Likewise.
5154 * src/tables.c (vector_number, tally, action_number,
5155 default_goto, goto_actions): Likewise.
5156 * tests/existing.at (GNU Cim Grammar): Likewise.
5157 * tests/regression.at (Web2c Actions): Likewise.
5158
5159 * src/output.c (muscle_insert_short_int_table): Renamed from
5160 muscle_insert_short_table. All uses changed.
5161
51622004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5163
5164 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
5165 (declaration): Replace expected_conflicts with expected_sr_conflicts.
5166 Add %expect-rr rule.
5167
5168 * src/scan-gram.l: Recognize %expect-rr.
5169
5170 * src/conflicts.h (expected_sr_conflicts): Rename from
5171 expected_conflicts.
5172 (expected_rr_conflicts): Declare.
5173
5174 * src/conflicts.c (expected_sr_conflicts): Rename from
5175 expected_conflicts.
5176 (expected_rr_conflicts): Define.
5177 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
5178 for GLR parsers.
5179 Use expected_sr_conflicts in place of expected_conflicts.
5180 Warn if expected_rr_conflicts used in non-GLR parser.
5181
5182 * doc/bison.texinfo: Add documentation for %expect-rr.
5183
51842004-03-08 Paul Eggert <eggert@gnu.org>
5185
5186 Add support for hex token numbers. Suggested by Odd Arild Olsen in
5187 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
5188
5189 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
5190 in lalr1.cc.
5191 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
5192 * src/scan-gram.l (scan_integer): New function.
5193 ({int}): Use it.
5194 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
5195 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
5196 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
5197 Say "long int", not "long", for uniformity with GNU style.
5198
51992004-02-25 Paul Eggert <eggert@twinsun.com>
5200
5201 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
5202 compilers. This fixes a problem with Intel's C++ compiler being
5203 chatty, reported by Guido Trentalancia in
5204 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
5205
52062004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
5207
5208 Support %destructor and merge error locations in lalr1.cc.
5209
5210 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
5211 (Parser::stos_): Define unconditionally.
5212 (Parser::destruct_): New method. Generate its body with
5213 b4_yydestruct_generate.
5214 (Parser::error_start_): New attribute.
5215 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
5216 token which are discarded.
5217 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
5218 error_start_ when erroneous token are discarded.
5219 (Parser::parse) <yyerrlab1>: Compute the location of the error
5220 token so that it covers all the discarded tokens.
5221 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
5222 it can be called with `%skeleton "lalr1.cc"', and do that.
5223
52242004-02-02 Paul Eggert <eggert@twinsun.com>
5225
5226 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
5227 $(top_srcdir)/lib and ../lib. This fixes a bug reported
5228 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
5229 There's no need to mention top_builddir since Automake does that
5230 for us.
5231 (INCLUDES): Remove, as Automake says it's obsolescent.
5232 Contents migrated into AM_CPPFLAGS as described above.
5233 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
5234
52352004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
5236
5237 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
5238 (yyreportSyntaxError): Handle case where lookahead token is
5239 YYEMPTY.
5240
52412004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5242
5243 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
5244 resulting parsers are compilable with C++.
5245
52462003-12-23 Paul Eggert <eggert@twinsun.com>
5247
5248 * config/depcomp, config/install-sh: Sync with Automake 1.8.
5249 * src/output.c (output_skeleton): Rename local var.
5250 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
5251 Bison tokens, as this runs afoul of the 2003-10-07 change that
5252 disallowed NUL bytes in character constants or string literals.
5253
5254 * tests/local.at: Require Autoconf 2.59's Autotest.
5255 * tests/testsuite.at: Don't include local.at, since we now assume
5256 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
5257 including it.
5258 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
5259 multiple inclusion warnings.
5260
52612003-12-02 Akim Demaille <akim@epita.fr>
5262
5263 * doc/bison.texinfo (How Can I Reset the Parser): More about start
5264 conditions.
5265 From Bruno Haible.
5266
52672003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
5268
5269 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
5270
52712003-10-07 Paul Eggert <eggert@twinsun.com>
5272
5273 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
5274 if testsuite doesn't exist.
5275
5276 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
5277 literals, unfortunately.
5278 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
5279 Complain about NUL bytes in character constants or string literals.
5280
52812003-10-05 Paul Eggert <eggert@twinsun.com>
5282
5283 * NEWS: Don't document %no-default-prec, as it's still
5284 too experimental.
5285 * doc/bison.texinfo: Document %no-default-prec only if
5286 the defaultprec flag is set. Normally it's not.
5287
52882003-10-04 Paul Eggert <eggert@twinsun.com>
5289
5290 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
5291 non-modifiable lvalue, instead of a modifiable one.
5292 * doc/bison.texinfo (Actions): Document that $$ can
5293 be assigned to. Do not claim that $$ and $N are
5294 array element references: user code should not rely on this.
5295
52962003-10-01 Paul Eggert <eggert@twinsun.com>
5297
5298 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
5299 (grammar_declaration): Use it.
5300 * src/scan-gram.l: New token %no-default-prec.
5301 * tests/conflicts.at: Revamp tests to use %no-default-prec.
5302 * NEWS, doc/bison.texinfo: Document the above.
5303
53042003-10-01 Akim Demaille <akim@epita.fr>
5305
5306 VCG no longer supports long_straight_phase.
5307
5308 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
5309 * src/print_graph.c (print_graph): Adjust.
5310
53112003-09-30 Frank Heckenbach <frank@g-n-u.de>
5312 and Paul Eggert <eggert@twinsun.com>
5313
5314 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
5315 Table of Symbols): Document %default-prec.
5316 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
5317 (grammar_declaration): Set default_prec on %default-prec.
5318 * src/scan-gram.l (%default-prec): New token.
5319 * src/reader.h (default_prec): New flag.
5320 * src/reader.c: Likewise.
5321 (packgram): Handle it.
5322 * tests/conflicts.at (%default-prec without %prec,
5323 %default-prec with %prec, %default-prec 1): New tests.
5324
53252003-09-30 Paul Eggert <eggert@twinsun.com>
5326
5327 * tests/testsuite.at: Include local.at, not input.at, fixing
5328 a typo in the 2003-08-25 patch.
5329
53302003-08-27 Akim Demaille <akim@epita.fr>
5331
5332 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
5333 GCC warnings.
5334
53352003-08-26 Akim Demaille <akim@epita.fr>
5336
5337 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
5338 "<\#" to avoid magic from Gnus when posting parts of this script.
5339
53402003-08-26 Akim Demaille <akim@epita.fr>
5341
5342 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
5343 (Parser::parse): here.
5344 Adjust: nerrs and errstatus is now replaced by...
5345 (Parser::nerrs_, Parser::errstatus_): New.
5346
53472003-08-25 Akim Demaille <akim@epita.fr>
5348
5349 * config/announce-gen, Makefile.cfg: New.
5350 * Makefile.am: Adjust.
5351 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
5352 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
5353
53542003-08-25 Akim Demaille <akim@epita.fr>
5355
5356 When reducing initial empty rules, Bison parser read an initial
5357 location that is not defined. This results in garbage, and that
5358 affects Bison's own parser. Therefore we need (i) to extend Bison
5359 to support a means to initialize this location, and (ii) to use
5360 this CVS Bison to fix CVS Bison's parser.
5361
5362 * src/reader.h, reader.c (epilogue_augment): Remove, replace
5363 with...
5364 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
5365 * src/parse-gram.y: Adjust.
5366 (%initial-action): New.
5367 (%error-verbose): Since we require CVS Bison, there is no reason
5368 not to use it.
5369 * src/scan-gram.l: Adjust.
5370 * src/Makefile.am (YACC): New, to make sure we use our own parser.
5371 * data/yacc.c (yyparse): Use b4_initial_action.
5372
53732003-08-25 Akim Demaille <akim@epita.fr>
5374
5375 * doc/bison.texinfo: Don't promote stdout for error messages.
5376
53772003-08-25 Akim Demaille <akim@epita.fr>
5378
5379 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
5380 From Alexandre Duret-Lutz.
5381
53822003-08-25 Akim Demaille <akim@epita.fr>
5383
5384 Version 1.875c.
5385
53862003-08-25 Akim Demaille <akim@epita.fr>
5387
5388 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
5389 Use them.
5390
53912003-08-25 Akim Demaille <akim@epita.fr>
5392
5393 * data/lalr1.cc (Parser::reduce_print_): New.
5394 Use it.
5395
53962003-08-25 Akim Demaille <akim@epita.fr>
5397
5398 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
5399 error recovery loops. This patch is based on
5400 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
5401 Also, augment the similarity between lalr1.cc and yacc.c.
5402 Note: the locations of error recovery rules are not correct yet.
5403
5404 * data/lalr1.cc: Comment changes to augment the similarity between
5405 lalr1.cc and yacc.c.
5406 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
5407 (yyerrlab1): Remove, but where it used to be (now the bottom part of
5408 yyerrlab), when hitting EOF, pop the whole stack here instead of
5409 merely falling thru the default error handling mechanism.
5410 (yyerrorlab): New label, with the old contents of YYERROR,
5411 plus the following change: pop the stack of rhs corresponding
5412 to the production that invoked YYERROR. That is how Yacc
5413 behaves (required by POSIX).
5414 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
5415 fail.
5416
54172003-08-25 Akim Demaille <akim@epita.fr>
5418
5419 Tune local.at so that people can "autom4te -l autotest calc.at -o
5420 calc" for instance, to extract a sub test suite.
5421
5422 * tests/testsuite.at: Move the initialization, Autotest version
5423 requirement, and AT_TESTED invocation into...
5424 * tests/local.at: here.
5425 * tests/testsuite.at: Include it for compatibility with Autoconf
5426 2.57.
5427 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
5428 be ignore.
5429
54302003-08-04 Paul Eggert <eggert@twinsun.com>
5431
5432 Rework code slightly to avoid gcc -Wtraditional warnings.
5433 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
5434 The returned value is now stored in *YY0. All callers changed.
5435 * src/output.c (merge_output): Adjust to the above change.
5436
54372003-07-26 Paul Eggert <eggert@twinsun.com>
5438
5439 * data/glr.c (YYASSERT): New macro.
5440 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
5441 yyresolveStates, yyprocessOneStack):
5442 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
5443 Derived from a suggestion by Frank Heckenbach.
5444
54452003-07-25 Paul Eggert <eggert@twinsun.com>
5446
5447 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
5448 for portability to K&R C (after ansi2knr, presumably). See
5449 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5450 by Frank Heckenbach, though I have omitted the structure-initialization
5451 part of his glr-knr.diff patch since I recall that the Portable
5452 C Compiler didn't require that change.
5453
5454 Let the user specify how to allocate and free memory.
5455 Derived from a suggestion by Frank Heckenbach in
5456 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
5457 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
5458 All uses of free, malloc, realloc changed to use these macros,
5459 and unnecessary casts removed.
5460 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
5461
54622003-07-06 Matthias Mann <MatthiasMann@gmx.de>
5463
5464 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
5465 use s.empty() rather than s == "" to test for empty string; see
5466 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
5467 (trivial change)
5468
54692003-06-25 Akim Demaille <akim@epita.fr>
5470
5471 * config/depcomp, config/install-sh: Update from masters.
5472
54732003-06-20 Paul Eggert <eggert@twinsun.com>
5474
5475 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
5476 and return properly parenthesized result.
5477 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
5478 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
5479 Remove unnecessary parentheses from uses.
5480 * doc/bison.texinfo (Location Default Action): Describe the
5481 conventions for parentheses.
5482
54832003-06-19 Paul Eggert <eggert@twinsun.com>
5484
5485 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
5486 yyreportTree): Do not assume that size_t is the same width as int,
5487 when printing sizes. Print sizes using an unsigned format.
5488 Problem reported by Frank Heckenbach in
5489 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
5490
5491 Port to Forte Developer 7 C compiler.
5492 * data/glr.c (struct YYLTYPE): If locations are not being used,
5493 declare a single dummy member, as empty structs do not conform
5494 to the C standard.
5495 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
5496 the Forte Developer 7 C compiler complains that end-of-loop
5497 code is not reached.
5498
54992003-06-17 Paul Eggert <eggert@twinsun.com>
5500
5501 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
5502 avoid warnings from picky compilers about redefinition of PARAMS.
5503
55042003-06-17 Paul Eggert <eggert@twinsun.com>
5505
5506 Version 1.875b.
5507
5508 * NEWS: Document 1.875b.
5509
5510 * lib/bbitset.h: Do not include config.h; that's the includer's job.
5511 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
5512 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
5513 Don't use 'index' in comments, as it's a builtin fn on some hosts.
5514 * lib/bitset_stats.c: Include gettext.h unconditionally, as
5515 per recent gettext manual's suggestion.
5516 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
5517 Use prototypes, not old-style definitions.
5518 * lib/lbitset.c (lbitset_unused_clear): Likewise.
5519 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
5520 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
5521 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
5522 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
5523 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
5524 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
5525 vbitset_or_and_cmp, vbitset_copy): Likewise.
5526
5527 * lib/libiberty.h: Do not include config.h; that's the includer's job.
5528 Do not include <stdlib.h>.
5529 (PARAMS): Define unconditionally for C89.
5530 (ATTRIBUTE_NORETURN): Remove.
5531 (ATTRIBUTE_UNUSED): Define unconditionally.
5532
5533 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
5534 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
5535 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
5536 * lib/vbitset.c, lib/vbitset.h: New files.
5537 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
5538 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
5539 from libbitset.
5540
5541 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
5542 `How Can I Reset @code{yyparse}', since texinfo does not allow
5543 arbitrary @ in node names.
5544
5545 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
5546 shouldn't be needed according to the gettext 0.12.1 documentation
5547 but which seem to be needed anyway: codeset.m4 glibc21.m4
5548 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
5549 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
5550 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
5551
5552 * lib/.cvsignore: Add stdbool.h.
5553 * m4/.cvsignore: Add nls.m4, po.m4.
5554
5555 Upgrade to CVS gnulib.
5556 * stdbool_.h: File renamed from stdbool.h.in.
5557 * configure.ac (AM_STDBOOL_H): Invoke this instead of
5558 AC_HEADER_STDBOOL.
5559 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
5560 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
5561 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
5562 (MOSTLYCLEANFILES): New var.
5563 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
5564 (stdbool.h): New rule.
5565 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
5566 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
5567 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
5568 m4/quote.m4: Upgrade to today's gnulib.
5569
5570 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
5571 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
5572 the tests right now.
5573 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
5574 yyerror are declared before use; C99 requires this.
5575
55762003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5577
5578 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
5579 first.
5580 (yyrecoverSyntaxError): Correct the logic for setting and testing
5581 yyerrState.
5582 Correct comment on handling EOF.
5583 Allow states with only a default reduction, rather than failing
5584 (I can't quite reconstruct why these were not allowed before).
5585
5586 Fixes to avoid problem that $-N rules in GLR parsers can cause
5587 buffer overruns, corrupting state.
5588
5589 * src/output.c (prepare_rules): Output max_left_semantic_context
5590 definition.
5591 * src/reader.h (max_left_semantic_context): New variable declaration.
5592 * src/scan-gram.l (max_left_semantic_context): Define.
5593 (handle_action_dollar): Update max_left_semantic_context.
5594 * data/glr.c (YYMAXLEFT): New definition.
5595 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
5596 (yyresolveAction): Ditto.
5597
5598 Fixes to problems with location handling in GLR parsers reported by
5599 Frank Heckenbach (2003/06/05).
5600
5601 * data/glr.c (YYLTYPE): Make trivial if locations not used.
5602 (YYRHSLOC): Add parentheses, and define only if locations used.
5603 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
5604 locations not used.
5605 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
5606 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
5607
5608 * tests/cxx-type.at: Exercise location information; update tests
5609 to differentiate output with and without locations.
5610 Remove forward declarations of yylex and yyerror---caused errors
5611 because default YYLTYPE not yet defined.
5612 Change semantic actions to compute strings, rather than printing
5613 them directly (to test proper passing of semantics values). Change
5614 output to prefix notation and update test data and expected results.
5615 (yylex): Track locations.
5616 (stmtMerge): Return value rather than printing, and include arguments
5617 in value.
5618
56192003-06-03 Paul Eggert <eggert@twinsun.com>
5620
5621 Avoid warnings generated by GCC 2.95.4 when Bison is
5622 configured with --enable-gcc-warnings.
5623 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
5624 yy::]b4_parser_class_name[::translate_,
5625 yy::Stack::operator[] (unsigned),
5626 yy::Stack::operator[] (unsigned) const,
5627 yy::Slice::operator[] (unsigned),
5628 yy::Slice::operator[] (unsigned) const):
5629 Rename local vars to avoid warnings.
5630 * tests/glr-regression.at (Improper handling of embedded actions
5631 and $-N in GLR parsers): Remove unused local variable from yylex.
5632 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
5633 (void) as arg when not pure, since we now assume C89 when building
5634 Bison. Pacify GCC by using parameter.
5635
56362003-06-02 Paul Eggert <eggert@twinsun.com>
5637
5638 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
5639 yy::Location::lines, yy::Location::columns): Rename arguments
5640 to avoid shadowing; this removes a warning generated by GCC 3.3.
5641
56422003-06-01 Paul Eggert <eggert@twinsun.com>
5643
5644 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
5645 to g++, as GCC 3.3 complains if you do it.
5646 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
5647 everything that WARNING_CFLAGS has, except omit warnings
5648 not suitable for C++.
5649 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
5650 * tests/atlocal.in (CXXFLAGS): New var.
5651 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
5652
5653 Fix a GLR parser bug I reported in February; see
5654 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
5655 The problem was that GLR parsers did not conform to the C standard,
5656 because actions like { $1 = $2 + $3; } expanded to expressions
5657 that invoked YYFILL in separate subexpressions, and YYFILL assigned
5658 to a local variable. The C standard says that expressions
5659 like (var = f ()) + (var = f ()) have undefined behavior.
5660 Another problem was that GCC sometimes issues warnings that
5661 yyfill and its parameters are unused.
5662
5663 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
5664 as possibly unused.
5665 (yyfill): New function.
5666 (YYFILL): Use it.
5667 (yyuserAction): Change type of yynormal to bool, so that it matches
5668 the new yyfill signature. Mark it as possibly unused.
5669
5670
5671 Follow up on a bug I reported in February, where a Bison-generated
5672 parser can loop. Provide a test case and a fix for yacc.c. I
5673 don't have a fix for lalr1.cc or for glr.c, unfortunately.
5674 The original bug report is in:
5675 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
5676
5677 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
5678 macro's size was becoming unwieldy.
5679 (yyerrlab): Do not discard an empty lookahead symbol, as this
5680 might destroy garbage.
5681 (yyerrorlab): New label, with the old contents of YYERROR,
5682 plus the following change: pop the stack of rhs corresponding
5683 to the production that invoked YYERROR. That is how Yacc
5684 behaves, and POSIX requires this behavior.
5685 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
5686 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
5687 Define 'alarm' to do nothing if unistd.h is not available.
5688 Add a new rule "exp: '-' error;" to test the above change to
5689 data/yacc.c. Use 'alarm' to abort any test taking longer than
5690 10 seconds, as it's probably looping.
5691 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
5692 Also, the new yacc.c generates two fewer diagnostics for an
5693 existing test.
5694
56952003-05-24 Paul Eggert <eggert@twinsun.com>
5696
5697 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
5698 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
5699 This fixes a problem reported by John Bowman when the Compaq/HP
5700 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
5701 -ansi -Wall -gall).
5702 * data/yacc.c (union yyalloc): Likewise.
5703 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
5704
5705 Switch from 'int' to 'bool' where that makes sense.
5706
5707 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
5708 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
5709 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
5710 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
5711 Return or accept bool, not int. All callers changed.
5712 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
5713 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
5714 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
5715 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
5716 bitset_or_and_cmp_): Likewise.
5717 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
5718 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
5719 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
5720 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
5721 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
5722 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
5723 bitset_stats_or_and_cmp): Likewise.
5724 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
5725 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
5726 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
5727 ebitset_xor_cmp): Likewise.
5728 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
5729 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
5730 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
5731 lbitset_xor_cmp): Likewise.
5732 * lib/bbitset.h: Include <stdbool.h>.
5733 (struct bitset_vtable): The following members now return bool, not
5734 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
5735 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
5736 or_and_cmp).
5737 * src/conflicts.c (count_rr_conflicts): Likewise.
5738 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
5739 All uses changed.
5740 * lib/ebitset.c (ebitset_obstack_init): Likewise.
5741 * lib/lbitset.c (lbitset_obstack_init): Likewise.
5742 * src/getargs.c (debug_flag, defines_flag, locations_flag,
5743 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
5744 graph_flag): Likewise.
5745 * src/getargs.h (debug_flag, defines_flag, locations_flag,
5746 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
5747 graph_flag): Likewise.
5748 * src/output.c (error_verbose): Likewise.
5749 * src/output.h (error_verbose): Likewise.
5750 * src/reader.c (start_flag, typed): Likewise.
5751 * src/reader.h (typed): Likewise.
5752 * src/getargs.c (LOCATIONS_OPTION): New constant.
5753 (long_options, getargs): Use it.
5754 * src/lalr.c (build_relations): Use bool, not int.
5755 * src/nullable.c (nullable_compute): Likewise.
5756 * src/print.c (print_reductions): Likewise.
5757 * src/tables.c (action_row, pack_vector): Likewise.
5758 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
5759 * src/output.c (prepare): Use it.
5760 * src/output.c (token_definitions_output,
5761 symbol_destructors_output, symbol_destructors_output): Use string,
5762 not boolean integer, to keep track of whether to output separator.
5763 * src/print_graph.c (print_core): Likewise.
5764 * src/state.c (state_rule_lookaheads_print): Likewise.
5765
5766 * config/install-sh: Sync from automake 1.7.5.
5767
57682003-05-14 Paul Eggert <eggert@twinsun.com>
5769
5770 * src/parse-gram.y (rules_or_grammar_declaration): Require a
5771 semicolon after a grammar declaration, in the interest of possible
5772 future changes to the Bison input language.
5773 Do not allow a stray semicolon at the start of the grammar.
5774 (rhses.1): Allow one or more semicolons after any rule, including
5775 just before "|" as required by POSIX.
5776 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
5777 grammar.
5778
57792003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
5780
5781 %parse-param support for lalr1.cc.
5782
5783 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
5784 b4_cc_constructor_calls, b4_cc_constructor_call,
5785 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
5786 definitions.
5787 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
5788 parse-param arguments.
5789 (yy::b4_parser_class_name): Declare instance variables to
5790 hold parse-param arguments.
5791 * tests/calc.at: s/value/semantic_value/ because value clashes
5792 with a member of yy::b4_parser_class_name. Adjust C++ code
5793 to handle %parse-param. Enable %parse-param test in C++.
5794
57952003-05-12 Paul Eggert <eggert@twinsun.com>
5796
5797 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
5798 English a bit. Fix fclose typo. Change "const char" to "char
5799 const", and use ANSI C rather than K&R for "main". Suggest
5800 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
5801 and suggest yy_switch_to_buffer.
5802
58032003-05-05 Paul Eggert <eggert@twinsun.com>
5804
5805 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
5806 C89. This avoids a diagnostic on compilers that define __STDC__
5807 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
5808 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
5809
58102003-05-03 Paul Eggert <eggert@twinsun.com>
5811
5812 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
5813 Do not overrun array bounds.
5814 This should fix a bug reported today by Olatunji Oluwabukunmi in
5815 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
5816
58172003-04-29 Akim Demaille <akim@epita.fr>
5818
5819 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
5820 * src/getargs.c, src/getargs.h: here, as bool, not int.
5821 (nondeterministic_parser): New.
5822 * src/parse-gram.y, src/scan-gram.l: Support
5823 %nondeterministic-parser.
5824 * src/output.c (prepare): Use nondeterministic_parser instead
5825 of glr_parser where appropriate.
5826 * src/tables.c (conflict_row, action_row, save_row)
5827 (token_actions, token_actions, pack_vector): Ditto.
5828
58292003-04-29 Akim Demaille <akim@epita.fr>
5830
5831 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
5832
58332003-04-29 Akim Demaille <akim@epita.fr>
5834
5835 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
5836 with %pure-parser and %locations to exercise the patch from Yakov
5837 Markovitch below.
5838
58392003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
5840
5841 * data/yacc.c: (b4_lex_param): Corrected for the case where
5842 %lex-param is provided and %pure-parser isn't.
5843
58442003-04-27 Paul Eggert <eggert@twinsun.com>
5845
5846 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
5847 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
5848 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
5849 if it is not defined.
5850 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
5851
58522003-04-26 Paul Eggert <eggert@twinsun.com>
5853
5854 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
5855 Declare to be of type suitable for the ninf value itself, not of
5856 type suitable for the corresponding table, since the latter might
5857 be unsigned but the ninf value might be negative. This fixes a
5858 bug reported by Alexandre Duret-Lutz in
5859 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
5860
5861 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
5862 invokes it. We shouldn't invoke it twice because it will attempt
5863 to put error.o in the archive twice. This fixes a glitch reported
5864 by Martin Mokrejs in
5865 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
5866
58672003-04-21 Paul Eggert <eggert@twinsun.com>
5868
5869 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
5870 to gnulib.
5871
58722003-04-21 Yakov Markovitch <Markovitch@iso.ru>
5873
5874 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
5875 Fix obvious typo that results in uncompilable GLR parsers
5876 when both %pure-parser and %locations are used. (trivial change)
5877
58782003-04-17 Paul Eggert <eggert@twinsun.com>
5879
5880 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
5881 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
5882 Do not insert the expected token via unput, as this runs afoul
5883 of a POSIX-compatibility bug in flex 2.5.31.
5884 All uses changed to BEGIN the parent state,
5885 since we no longer insert the expected token via unput.
5886 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
5887 that is no longer emitted after the above change.
5888
5889 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
5890 the first one. This change is from Paul Hilfinger, and it fixes
5891 regression reported by Werner Lemberg in
5892 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5893
5894 (resolve_sr_conflict): Don't invoke state_errs_set
5895 unless one or more tokens have been explicitly made errors.
5896 Otherwise, the above change causes Bison to abort.
5897
5898 * tests/existing.at (GNU pic Grammar): New test case, taken from
5899 Lemberg's email.
5900
59012003-03-31 Akim Demaille <akim@epita.fr>
5902
5903 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
5904
59052003-03-31 Akim Demaille <akim@epita.fr>
5906
5907 * src/output.c (prepare_symbols): Avoid trailing spaces in the
5908 output.
5909
59102003-03-31 Akim Demaille <akim@epita.fr>
5911
5912 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
5913 From Paul Hilfinger.
5914
59152003-03-29 Akim Demaille <akim@epita.fr>
5916
5917 * m4/error.m4: Do not put under dynamic conditions some code which
5918 expansion is under static control.
5919
59202003-03-29 Akim Demaille <akim@epita.fr>
5921
5922 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
5923
59242003-03-29 Akim Demaille <akim@epita.fr>
5925
5926 * doc/bison.texinfo (Strings are Destroyed): New.
5927
59282003-03-13 Paul Eggert <eggert@twinsun.com>
5929
5930 * .cvsignore: Add configure.lineno.
5931 * src/.cvsignore: Add yacc.
5932 * tests/.cvsignore: Add testsuite.log.
5933 * doc/fdl.texi: Sync with latest FSF version.
5934
59352003-03-12 Paul Eggert <eggert@twinsun.com>
5936
5937 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
5938 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
5939 cursor, instead of leaving it undefined. This fixes a bug
5940 reported by Tim Van Holder in
5941 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
5942 * tests/input.at (Torturing the Scanner): Test the scanner on
5943 an empty input file, which was Tim Van Holder's test case.
5944
5945 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
5946 <sys/resource.h> can be included, include sys/time.h and
5947 sys/times.h first, if available. This works around the SunOS
5948 4.1.4 porting bug reported by Bruce Becker in
5949 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
5950
5951 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
5952 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
5953 AC_HEADER_SYS_WAIT.
5954
5955 Merge changes from gnulib. This was prompted because the CVS
5956 snapshot didn't build on Solaris 7 due to strnlen problems.
5957
5958 These changes need to be merged back into gnulib:
5959 * lib/hash.c: Include <stdbool.h> unconditionally.
5960 * m4/onceonly.m4 (m4_quote): New macro.
5961 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
5962 Quote AC_FOREACH variable-expansions properly.
5963 The 2003-01-03 obstack.h change also needs merging.
5964 {end of changes requiring merging}
5965
5966 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
5967 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
5968 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
5969 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
5970 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
5971 New files, imported from gnulib.
5972 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
5973 above.
5974
5975 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
5976 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
5977 gnulib sources.
5978
5979 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
5980 Add.
5981 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
5982 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
5983 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
5984 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
5985 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
5986 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
5987 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
5988 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
5989 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
5990 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
5991 (jm_PREREQ_ARGMATCH): Remove.
5992 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
5993 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
5994
5995 * src/system.h: Include <stdbool.h> unconditionally.
5996
5997 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
5998 assuming at least C89 in the bitset code for some time now.
5999
60002003-03-03 Akim Demaille <akim@epita.fr>
6001
6002 * ro.po: New.
6003
60042003-03-02 Akim Demaille <akim@epita.fr>
6005
6006 * doc/bison.texinfo (Table of Symbols): Reactivate the
6007 documentation for %lex-param, and %parse-param.
6008
60092003-03-02 Akim Demaille <akim@epita.fr>
6010
6011 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
6012 generate verbose error messages.
6013 Use the number of tokens as an upper bound in yytname, as it
6014 cannot be a non terminal.
6015
60162003-03-02 Akim Demaille <akim@epita.fr>
6017
6018 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
6019 message.
6020
60212003-03-02 Akim Demaille <akim@epita.fr>
6022
6023 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
6024 Use them to exercise yycheck overrun.
6025 Based on Andrew Suffield's grammar.
6026
60272003-03-02 Akim Demaille <akim@epita.fr>
6028
6029 Create tests/local.at for Bison generic testing macros.
6030
6031 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
6032 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
6033 This new file.
6034 * tests/calc.at (AT_CHECK_CALC): Adjust.
6035 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
6036 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
6037 * tests/local.at: here.
6038 (AT_COMPILE_CXX): Tags the tests using it as c++.
6039 Ignore the test if CXX is not functional.
6040
60412003-03-01 Paul Eggert <eggert@twinsun.com>
6042
6043 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
6044 not loc->end, since loc->end might contain garbage and this leads
6045 to undefined behavior on some platforms.
6046 (id_loc, token_start): Use (IF_LINTed) initial values that do not
6047 depend on *loc, so that the reader doesn't give the the false
6048 impression that *loc is initialized.
6049 (<INITIAL>"%%"): Do not bother setting code_start, since its value
6050 does not survive the return.
6051
60522003-03-01 Akim Demaille <akim@epita.fr>
6053
6054 * src/scan-gram.l (code_start): Always initialize it when entering
6055 into yylex, as SC_EPILOGUE is activated *before* the corresponding
6056 yylex invocation. An alternative would be making it static, but
6057 then it starts with the second %%'s beginning, instead of its end.
6058
60592003-02-28 Paul Eggert <eggert@twinsun.com>
6060
6061 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
6062 around a UnixWare 7.1.1 porting bug reported by John Hughes in
6063 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
6064
60652003-02-26 Paul Eggert <eggert@twinsun.com>
6066
6067 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
6068 Remove Sequent/Pyramid discussion (nobody uses them any more).
6069 Merge VMS and MS-DOS discussion; these ports may well be dead
6070 but let's keep mentioning them for now. Put <> around email
6071 addresses. Add copyright notice.
6072
60732003-02-24 Paul Eggert <eggert@twinsun.com>
6074
6075 * data/glr.c (yy_reduce_print): yylineno -> yylno,
6076 to avoid collision with flex use of yylineno.
6077 Problem reported by Bruce Lilly in
6078 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
6079 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6080 * data/yacc.c (yy_reduce_print): Likewise.
6081
6082 * config/depcomp: Sync with Automake 1.7.3.
6083
60842003-02-21 Akim Demaille <akim@epita.fr>
6085
6086 * data/lalr1.cc: Use temporary variables instead of casts to
6087 change integer types.
6088 Suggested by Paul Eggert.
6089
60902003-02-21 Akim Demaille <akim@epita.fr>
6091
6092 * doc/bison.texinfo: Use "location" consistently to refer to @n,
6093 to avoid confusions with lalr1.cc's notion of Position.
6094 Suggested by Paul Eggert.
6095
60962003-02-20 Akim Demaille <akim@epita.fr>
6097
6098 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
6099 before initial_columns.
6100 (location.hh): Use consistent variable names when defining the
6101 operator<<.
6102 Use "last" so that we subtract from Positions, not from unsigned.
6103
61042003-02-20 Akim Demaille <akim@epita.fr>
6105
6106 * data/lalr1.cc (position.hh): New subfile, including the extended
6107 and Doxygen'ed documentation of class Position.
6108 (location.hh): Use it.
6109 Document a` la Doxygen.
6110 With the help of Benoit Perrot.
6111
61122003-02-20 Akim Demaille <akim@epita.fr>
6113
6114 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
6115 AT_YACC_IF.
6116 Redefine AT_YYERROR_SEES_LOC_IF using it.
6117 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
6118 not defined.
6119 Don't use the location in yy::Parser::error_ and
6120 yy::Parser::print_ when not %locations.
6121 Activate more lalr1.cc tests.
6122
61232003-02-19 Akim Demaille <akim@epita.fr>
6124
6125 * data/lalr1.cc: When displaying a line number, be sure to make it
6126 an int.
6127
61282003-02-19 Akim Demaille <akim@epita.fr>
6129
6130 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
6131 Remove, useless.
6132 (YYABORT, YYACCEPT, YYERROR): New.
6133 * tests/calc.at: Renable the lalr1.cc test.
6134
61352003-02-19 Akim Demaille <akim@epita.fr>
6136
6137 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
6138 error recovery, mixing with/without pops and discarding of the
6139 lookahead.
6140 Exercise YYERROR.
6141 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
6142
61432003-02-17 Paul Eggert <eggert@twinsun.com>
6144
6145 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
6146 * tests/testsuite.at (AT_COMPILE): Use them.
6147 This fixes the testsuite problem reported by Robert Lentz in
6148 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
6149
61502003-02-12 Paul Eggert <eggert@twinsun.com>
6151
6152 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
6153 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
6154 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
6155 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
6156 Check for malloc failure, for consistency with yacc.c.
6157 (yytname_size): Remove, for consistency with yacc.c.
6158
6159 The bug still remains in data/lalr1.cc, as I didn't have time
6160 to fix it there.
6161
61622003-02-06 Akim Demaille <akim@epita.fr>
6163
6164 * configure.ac (GXX): Rename as...
6165 (CXX): this, to keep the original Autoconf semantics.
6166 Require 2.57.
6167 * data/lalr1.cc: Fix b4_copyright invocations.
6168 If YYDEBUG is not defined, don't depend upon name_ being defined.
6169 (location.hh): Include string and iostream.
6170 (Position::filename): New member.
6171 (Position::Position ()): New.
6172 (operator<< (Position)): New.
6173 (operator- (Position, int)): New.
6174 (Location::first, Location::last): Rename as...
6175 (Location::begin, Location::end): these, to mock the conventional
6176 iterator names.
6177 (operator<< (Location)): New.
6178 * tests/atlocal.in (CXX): New.
6179 * tests/testsuite.at (AT_COMPILE_CXX): New.
6180 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
6181 locations in a more synthetic way.
6182 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
6183 lalr1.cc is used.
6184 Adjust the C locations to match those from Emacs: first column is
6185 column 0.
6186 Change all the expected results.
6187 Conform to the GCS: simplify the locations when applicable.
6188 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
6189 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
6190 these CPP macros with the m4 macros new defined by...
6191 (AT_CHECK_PUSHDEFS): this, i.e.:
6192 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
6193 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
6194 New macros.
6195 (AT_CHECK_POPDEFS): Undefine them.
6196 (AT_CHECK_CALC_LALR1_CC): New.
6197 Use it for the first lalr1.cc test.
6198
61992003-02-04 Akim Demaille <akim@epita.fr>
6200
6201 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
6202 Location as is defined.
6203
62042003-02-04 Akim Demaille <akim@epita.fr>
6205
6206 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
6207 name_ being defined.
6208
62092003-02-03 Paul Eggert <eggert@twinsun.com>
6210
6211 * src/gram.h (start_symbol): Remove unused decl.
6212
6213 Use more-consistent naming conventions for local vars.
6214
6215 * src/derives.c (derives_compute): Change type of local var from
6216 int to rule_number.
6217 * src/gram.c (grammar_rules_partial_print): Likewise.
6218 * src/print.c (print_core): Likewise.
6219 * src/reduce.c (reduce_grammar_tables): Likewise.
6220
6221 * src/gram.c (grammar_dump): Change name of item_number *
6222 local var from r to rp.
6223 * src/nullable.c (nullable_compute): Likewise.
6224
6225 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
6226
6227 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
6228 for symbol or symbol_number var.
6229 * src/reader.c (grammar_start_symbol_set): Likewise.
6230 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
6231 Likewise.
6232 * src/state.c (transitions_to): Likewise.
6233 * src/state.h: Likewise.
6234 * src/tables.c (symbol_number_to_vector_number): Likewise.
6235
6236 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
6237 char * var.
6238
6239 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
6240 var.
6241
6242 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
6243 var.
6244
6245 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
6246 Use str, not s, for char * var. Use ch, not c, for character var.
6247 Use size for size var.
6248
6249 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
6250 char * var.
6251 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
6252 uniqstr var.
6253 * src/uniqstr.h: Likewise.
6254
6255 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
6256 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
6257 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
6258 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
6259 param to have same name as that of enum, so that we don't use
6260 "s" to stand for a non-state.
6261
62622003-02-02 Akim Demaille <akim@epita.fr>
6263
6264 * src/scan-skel.l: Scan more than one inert character per yylex
6265 invocation.
6266
62672003-02-01 Paul Eggert <eggert@twinsun.com>
6268
6269 Version 1.875a.
6270
6271 * po/LINGUAS: Add ms.
6272
62732003-01-30 Akim Demaille <akim@epita.fr>
6274
6275 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
6276
62772003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6278
6279 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
6280 of $1.
6281
6282 Changes in response to error report by S. Eken: GLR mode does not
6283 handle negative $ indices or $ indices in embedded rules correctly.
6284 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
6285
6286 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
6287 (b4_rhs_location): Ditto.
6288 (yyfill): New function to copy from stack tree into array
6289 incrementally.
6290 (yyuserAction): Modify to allow incremental move of semantic values
6291 to rhs array when in GLR mode.
6292 Define YYFILL to use in user-defined actions to fill semantic array
6293 as needed.
6294 Remove dummy use of yystack, as there is now a guaranteed use.
6295 (yydoAction): Modify to allow incremental move of semantic values
6296 to rhs array when in GLR mode.
6297 (yyresolveAction): Ditto.
6298 (yyglrShiftDefer): Update comment.
6299 (yyresolveStates): Use X == NULL for pointers, not !X.
6300 (yyglrReduce): Ditto.
6301 (yydoAction): Ditto
6302
6303 * tests/glr-regr1.at: Rename to ...
6304 * tests/glr-regression.at: Add new regression test for the problems
6305 described above (adapted from S. Eken).
6306 Update copyright notice.
6307 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
6308 * tests/Makefile.am: Ditto.
6309
63102003-01-28 Paul Eggert <eggert@twinsun.com>
6311
6312 * data/lalr1.cc: Do not use @output_header_name@ unless
6313 b4_defines_flag is set. This fixes two bugs reported by
6314 Tim Van Holder in
6315 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
6316 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6317
63182003-01-21 Paul Eggert <eggert@twinsun.com>
6319
6320 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
6321 we don't need to worry about yyerrlab1 being reported as an
6322 "unused label" by non-GCC C compilers. The downside is that if
6323 locations are used then a couple of statements are duplicated each
6324 time YYERROR is invoked, but the upside is that the warnings
6325 should vanish.
6326 (yyerrlab1): Move code to YERROR.
6327 (yyerrlab2): Remove. Change uses back to yyerrlab1.
6328 This reverts some of the 2002-12-27 change.
6329
63302003-01-17 Paul Eggert <eggert@twinsun.com>
6331
6332 * src/output.c (symbol_printers_output): Fix typo that led
6333 to core dump. Problem reported by Antonio Rus in
6334 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
6335
63362003-01-13 Akim Demaille <akim@epita.fr>,
6337 Quoc Peyrot <chojin@lrde.epita.fr>,
6338 Robert Anisko <anisko_r@lrde.epita.fr>
6339
6340 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
6341 when the stacks contain one element, as the loop would otherwise
6342 free the last state, and then use the top state (the one we just
6343 popped). This means that the initial elements will not be freed
6344 explicitly, as is the case in yacc.c; it is not a problem, as
6345 these elements have fake values.
6346
63472003-01-11 Paul Eggert <eggert@twinsun.com>
6348
6349 * NEWS: %expect-violations are now just warnings, reverting
6350 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
6351 bootstrapping problem reported by Matthias Klose; see
6352 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
6353 * src/conflicts.c (conflicts_print): Likewise.
6354 * tests/conflicts.at (%expect not enough, %expect too much,
6355 %expect with reduce conflicts): Likewise.
6356 * doc/bison.texinfo (Expect Decl): Document this. Also mention
6357 that the warning is enabled if the number of conflicts changes
6358 (not necessarily increases).
6359
6360 * src/getargs.c (version): Update copyright year.
6361
63622003-01-09 Akim Demaille <akim@epita.fr>
6363
6364 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
6365
63662003-01-08 Paul Eggert <eggert@twinsun.com>
6367
6368 * Makefile.maint (WGETFLAGS):
6369 New macro, containing "-C off" to disable proxy caches.
6370 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
6371 (rel-check): Use $(WGET) instead of wget.
6372
63732003-01-06 Paul Eggert <eggert@twinsun.com>
6374
6375 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
6376 the GLR paper of Scott, Johnstone and Hussain.
6377
63782003-01-04 Paul Eggert <eggert@twinsun.com>
6379
6380 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
6381 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
6382 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
6383 (EXTRA_LIBRARIES): New var, for liby.a.
6384 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
6385 (EXTRA_SCRIPTS): New var, for yacc.
6386
6387 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
6388 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
6389 Problem reported by Nelson H. F. Beebe.
6390
63912003-01-03 Paul Eggert <eggert@twinsun.com>
6392
6393 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
6394 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
6395 when compiling Bison 1.875's `bitset bset = obstack_alloc
6396 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
6397
6398 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
6399 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
6400 grow to a huge size with typical invocation.
6401
6402 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
6403 Use the pattern recommended by Autoconf 2.57, except also protect
6404 against double-definition.
6405 * src/system.h: Likewise.
6406 Portability issues reported by Nelson H. F. Beebe.
6407
6408 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
6409 All uses changed. Provide a definition in both C and C++.
6410 (yytrue, yyfalse): Define even if defined (__cplusplus).
6411
6412 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
6413 Reported by Nelson H. F. Beebe.
6414
6415 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
6416
64172003-01-02 Paul Eggert <eggert@twinsun.com>
6418
6419 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
6420 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
6421 Bug reported by Nelson H. F. Beebe.
6422
64232003-01-01 Paul Eggert <eggert@twinsun.com>
6424
6425 * Version 1.875.
6426
64272002-12-30 Paul Eggert <eggert@twinsun.com>
6428
6429 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
6430 Moved here from...
6431 (<INITIAL>","): Here. This causes stray "," to be treated
6432 more uniformly.
6433
6434 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
6435 last brace in braced code when not in Yacc mode, for compatibility
6436 with Bison 1.35. This resurrects the 2001-12-15 patch to
6437 src/reader.c.
6438
6439 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
6440 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
6441
64422002-12-28 Paul Eggert <eggert@twinsun.com>
6443
6444 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
6445 that of SYM's type. This fixes Debian bug 168069, reported by
6446 Thomas Olsson.
6447
64482002-12-28 Paul Eggert <eggert@twinsun.com>
6449
6450 Version 1.75f.
6451
6452 Switch back to the Yacc style of conflict reports, undoing some
6453 of the 2002-07-30 change.
6454 * doc/bison.texinfo (Understanding): Use Yacc style for
6455 conflict reports. Also, use new way of locating rules.
6456 * src/conflicts.c (conflict_report):
6457 Renamed from conflict_report_yacc, removing the old
6458 'conflict_report'. Translate the entire conflict report at once,
6459 so that we don't assume that "," has the same interpretation in
6460 all languages.
6461 (conflicts_output): Use Yacc-style conflict report for each state,
6462 instead of our more-complicated style.
6463 (conflicts_print): Use Yacc-style conflict report, except print
6464 the input file name when not emulating Yacc.
6465 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
6466 Conflicted Reduction, %expect not enough, %expect too much,
6467 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
6468 * tests/existing.at (GNU Cim Grammar): Likewise.
6469 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
6470
6471 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
6472 fatal): Don't invoke fflush; it's not needed and it might even be
6473 harmful for stdout, as stdout might not be open.
6474 * src/reduce.c (reduce_print): Likewise.
6475
64762002-12-27 Paul Eggert <eggert@twinsun.com>
6477
6478 Fix a bug where error locations were not being recorded correctly.
6479 This problem was originally reported by Paul Hilfinger in
6480 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
6481
6482 * data/yacc.c (yyparse): New local var yylerrsp, to record the
6483 top of the location stack's error locations.
6484 (yyerrlab): Set it. When discarding a token, push its location
6485 onto yylerrsp so that we don't lose track of the error's end.
6486 (yyerrlab1): Now is only the target of YYERROR, so that we can
6487 properly record the location of the action that failed. For GCC
6488 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
6489 GCC warning about yyerrlab1 being unused if YYERROR is unused.
6490 (yyerrlab2): New label, which yyerrlab now falls through to.
6491 Compute the error's location by applying YYLLOC_DEFAULT to
6492 the locations of all the symbols that went into the error.
6493 * doc/bison.texinfo (Location Default Action): Mention that
6494 YYLLOC_DEFAULT is also invoked for syntax errors.
6495 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6496 Error locations include the locations of all the tokens that were
6497 discarded, not just the last token.
6498
64992002-12-26 Paul Eggert <eggert@twinsun.com>
6500
6501 * src/files.c: Include quote.h.
6502 (compute_output_file_names): Warn if we detect conflicting
6503 outputs to the same file. This should catch the misunderstanding
6504 exemplified by Debian Bug 165349, reported by Bruce Stephens..
6505
6506 * src/conflicts.c (conflicts_print): If the user specifies
6507 "%expect N", report an error if there are any reduce/reduce
6508 conflicts. This is what the manual says should happen.
6509 This fixes Debian bug 130890, reported by Anthony DeRobertis.
6510 * tests/conflicts.at (%expect with reduce conflicts): New test.
6511
6512 Don't use m4_include on relative file names, as it doesn't work as
6513 desired if there happens to be a file with that name under ".".
6514
6515 * m4sugar/version.m4: Remove; it was included but it wasn't used.
6516 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
6517 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
6518 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
6519 * src/output.c (output_skeleton): Use full path names when
6520 specifying a file to include; don't rely on include path, as
6521 it's unreliable when the working file contains a file with
6522 that name.
6523
65242002-12-25 Paul Eggert <eggert@twinsun.com>
6525
6526 Remove obsolete references to bison.simple and bison.hairy.
6527 Problem mentioned by Aubin Mahe in
6528 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
6529 * data/glr.c: Comment fix.
6530 * doc/bison.1: Remove references. Also, mention "yacc".
6531
6532 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
6533 with -g option.
6534
6535 * src/parse-gram.y (declaration): Use enum "report_states" rather
6536 than its numeric value 1.
6537
6538 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
6539 opening a new one. This fixes Debian bug 165349, reported by
6540 Bruce Stephens.
6541
65422002-12-24 Paul Eggert <eggert@twinsun.com>
6543
6544 Version 1.75e.
6545
6546 * Makefile.maint (cvs-update): Don't assume that the shell
6547 supports $(...), as Solaris sh doesn't.
6548
6549 * src/parse-gram.y (lloc_default): Remove test for empty
6550 nonterminals at the end, since it didn't change the result.
6551
65522002-12-24 Paul Eggert <eggert@twinsun.com>
6553
6554 If the user does not define YYSTYPE as a macro, Bison now declares it
6555 using typedef instead of defining it as a macro. POSIX requires this.
6556 For consistency, YYLTYPE is also declared instead of defined.
6557
6558 %union directives can now have a tag before the `{', e.g., the
6559 directive `%union foo {...}' now generates the C code
6560 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
6561 The default union tag is `YYSTYPE', for compatibility with Solaris 9
6562 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
6563 instead of `yyltype'.
6564
6565 `yystype' and `yyltype' are now obsolescent macros instead of being
6566 typedefs or tags; they are no longer documented and will be
6567 withdrawn in a future release.
6568
6569 * data/glr.c (b4_location_type): Remove.
6570 (YYSTYPE): Renamed from yystype.
6571 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
6572 (struct YYLTYPE): Renamed from struct yyltype.
6573 (YYLTYPE): Renamed from yyltype.
6574 (yyltype, yystype): New (and obsolescent) macros,
6575 for backward compatibility.
6576 * data/yacc.c: Likewise.
6577
6578 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
6579 does not specify a union tag. This is for compatibility with
6580 Solaris 9 yacc.
6581
6582 * src/parse-gram.y (add_param): 2nd arg is now char * not char
6583 const *, since it is now modified by stripping surrounding { }.
6584 (current_braced_code): Remove.
6585 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
6586 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
6587 trailing " {...}". Now of type <chars>.
6588 (grammar_declaration): Adjust to bundled tokens.
6589 (code_content): Remove; stripping is now done by add_param.
6590 (print_token_value): Print contents of bundled tokens.
6591 (token_name): New function.
6592
6593 * src/reader.h (braced_code, current_braced_code): Remove.
6594 (token_name): New decl.
6595
6596 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
6597 token_type, not braced_code code_kind. All uses changed.
6598 (SC_PRE_CODE): New state, for scanning after a keyword that
6599 has (or usually has) an immediately-following braced code.
6600 (token_type): New local var, to keep track of which token type
6601 to return when scanning braced code.
6602 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
6603 <INITIAL>"%parse-param", <INITIAL>"%printer",
6604 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
6605 instead of returning a token type immediately.
6606 (<INITIAL>"{"): Set token type.
6607 (<SC_BRACED_CODE>"}"): Use it.
6608 (handle_action_dollar, handle_action_at): Now returns bool
6609 indicating success. Fail if ! current_rule; this prevents a core dump.
6610 (handle_symbol_code_dollar, handle_symbol_code_at):
6611 Remove; merge body into caller.
6612 (handle_dollar, handle_at): Complain in invalid contexts.
6613
6614 * NEWS, doc/bison.texinfo: Document the above.
6615 * NEWS: Fix years and program names in copyright notice.
6616
66172002-12-17 Paul Eggert <eggert@twinsun.com>
6618
6619 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
6620 Reporting, Table of Symbols): Omit mentions of %lex-param and
6621 %parse-param from the documentation for now.
6622
66232002-12-15 Paul Eggert <eggert@twinsun.com>
6624
6625 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
6626 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
6627 lookahead symbol, and which sets yychar in parser actions) and it
6628 disagreed with the Bison documentation. Bug
6629 reported by Andrew Walrond.
6630
6631 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
6632 as the caller now does that.
6633 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
6634 (YYEMPTY): Parenthesize right hand side, since others use it.
6635 (yyparse): Don't assume that our generated code is the only code
6636 that sets yychar.
6637
66382002-12-13 Paul Eggert <eggert@twinsun.com>
6639
6640 Version 1.75d.
6641
6642 POSIX requires a "yacc" command.
6643 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
6644 (MOSTLYCLEANFILES): Add yacc.
6645 (yacc): New rule.
6646 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
6647 as an alias for bison y.
6648
6649 * po/LINGUAS: Add da.
6650
6651 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
6652 problem with latest <getopt.h>.
6653 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
6654
6655 * doc/fdl.texi: Upgrade to 1.2.
6656 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
6657 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
6658 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
6659 gnulib.
6660 * config/install-sh: Sync with autotools.
6661
6662 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
6663 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
6664 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
6665 locations are requested.
6666 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
6667 locations are requested.
6668
66692002-12-12 Paul Eggert <eggert@twinsun.com>
6670
6671 Remove unportable casts and storage allocation tricks.
6672 While we're at it, remove almost all casts, since they
6673 usually aren't needed and are a sign of trouble.
6674
6675 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
6676
6677 * src/derives.c (derives_compute): Do not subtract NTOKENS from
6678 the pointer DSET returned by malloc; this isn't portable.
6679 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
6680 Similarly for DERIVES.
6681 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
6682 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
6683 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
6684
6685 * src/derives.c (derives_compute): Do not bother invoking
6686 int_of_rule_number, since rule numbers are integers.
6687
6688 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
6689 rather than XMALLOC (char, N).
6690
6691 * src/files.c (filename_split): Rewrite to avoid cast.
6692
6693 * src/gram.h (symbol_number_as_item_number,
6694 item_number_as_symbol_number, rule_number_as_item_number,
6695 item_number_as_rule_number):
6696 Now inline functions rather than macros, to avoid casts.
6697 * src/state.h (state_number_as_int): Likewise.
6698 * src/tables.c (state_number_to_vector_number,
6699 symbol_number_to_vector_number): Likewise.
6700
6701 * src/gram.h (int_of_rule_number): Remove; no longer used.
6702
6703 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
6704 since the resulting storage is always stored into.
6705
6706 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
6707 where it's needed.
6708
6709 * src/muscle_tab.c (muscle_m4_output):
6710 Now inline. Return bool, not int.
6711 * src/state.c (state_compare): Likewise.
6712 * src/symtab.c (symbol_check_defined,
6713 symbol_check_alias_consistency, symbol_pack, symbol_translation,
6714 hash_compare_symbol, hash_symbol):
6715 Likewise.
6716 * src/uniqstr.c (uniqstr_print): Likewise.
6717 * src/muscle_tab.c (muscle_m4_output_processor):
6718 New function, to avoid casts.
6719 * src/state.c (state_comparator, stage_hasher): Likewise.
6720 * src/symtab.c (symbol_check_defined_processor,
6721 symbol_check_alias_consistency_processor, symbol_pack_processor,
6722 symbol_translation_processor, hash_symbol_comparator,
6723 hash_symbol_hasher): Likewise.
6724 * src/uniqstr.c (uniqstr_print_processor): Likewise.
6725 * src/muscle_tab.c (muscles_m4_output):
6726 Use new functions instead of casting old functions unportably.
6727 * src/state.c (state_hash_new): Likewise.
6728 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
6729 symbols_token_translations_init):
6730 Likewise.
6731 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
6732
6733 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
6734 var instead of casting to long, to avoid casts.
6735 (prepare_states): Use MALLOC rather than alloca, so that we don't
6736 have to worry about alloca.
6737 * src/state.c (state_hash_lookup): Likewise.
6738
6739 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
6740 local var instead of casting to unsigned char, to avoid casts.
6741
6742 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
6743 STATE_ALLOC): Remove.
6744 (transitions_new, errs_new, reductions_new, state_new): Use malloc
6745 rather than calloc, and use offsetof to avoid allocating slightly
6746 too much storage.
6747 (state_new): Initialize all members.
6748
6749 * src/state.c (state_hash): Use unsigned accumulator, not signed.
6750
6751 * src/symtab.c (symbol_free): Remove; unused.
6752 (symbol_get): Remove cast in lhs of assignment.
6753 (symbols_do): Now static. Accept generic arguments, not
6754 hashing-related ones.
6755
6756 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
6757 (symbol_processor): Remove.
6758 (symbols_do): Remove decl; now static.
6759
6760 * src/system.h (alloca): Remove; decl no longer needed.
6761 (<stddef.h>): Include, for offsetof.
6762 (<inttypes.>, <stdint.h>): Include if available.
6763 (uintptr_t): New type, if system lacks it.
6764 (CALLOC, MALLOC, REALLOC): New macros.
6765 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
6766 new macros.
6767
6768 * src/tables.c (table_size): Now int, to pacify GCC.
6769 (table_grow, table_ninf_remap): Use signed table size.
6770 (save_row): Don't bother initializing locals when not needed.
6771 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
6772 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
6773
6774 * src/vcg.h: Correct misspellings.
6775
6776 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
6777
6778
6779 * src/getargs.c (getargs): Don't assume EOF == -1.
6780
67812002-12-09 Paul Eggert <eggert@twinsun.com>
6782
6783 Change identifier spellings to avoid collisions with names
6784 that are reserved by POSIX.
6785
6786 Don't use names ending in _t, since POSIX reserves them.
6787 For consistency, remove _e and _s endings -- they're weren't
6788 needed to remove ambiguity. All uses changed.
6789 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
6790 turn was just renamed from struniq_t.
6791 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
6792 which in turn was just renamed from struniq_processor_t.
6793 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
6794 in turn was renamed from hash_compare_struniq_t.
6795 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
6796 (state_list): Renamed from state_list_t.
6797 * src/assoc.h (assoc): Renamed from assoc_t.
6798 * src/conflicts.c (enum conflict_resolution): Renamed from
6799 enum conflict_resolution_e.
6800 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
6801 (rule_list): Renamed from rule_list_t.
6802 * src/getargs.h (enum trace): Renamed from enum trace_e.
6803 (enum report): Renamed from enum report_e.
6804 * src/gram.h (item_number): Renamed from item_number_t.
6805 (rule_number): Renamed from rule_number_t.
6806 (struct rule_s): Remove the "rule_s" part; not used.
6807 (rule): Renamed from rule_t.
6808 (rule_filter): Renamed from rule_filter_t.
6809 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
6810 (goto_list): Renamed from goto_list_t.
6811 * src/lalr.h (goto_number): Renamed from goto_number_t.
6812 * src/location.h (location): Renamed from location_t.
6813 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
6814 and moved here from:
6815 * src/muscle_tab.h (muscle_entry_t): here.
6816 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
6817 (rule_list): Renamed from rule_list_t.
6818 * src/print_graph.c (static_graph): Renamed from graph.
6819 * src/reader.h (braced_code): Renamed from braced_code_t.
6820 Remove brace_code_e tag.
6821 * src/relation.h (relation_node): Renamed from relation_node_t.
6822 (relation_nodes): Renamed from relation_nodes_t.
6823 (relation): Renamed from relation_t.
6824 * src/state.h (state_number): Renamed from state_number_t.
6825 (struct state): Renamed from struct state_s.
6826 (state): Renamed from state_t.
6827 (transitions): Renamed from transitions_t. Unused (and
6828 misspelled) transtion_s tag removed.
6829 (errs): Renamed from errs_t. Unused errs_s tag removed.
6830 (reductions): Renamed from reductions_t. Unused tag
6831 reductions_s removed.
6832 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
6833 (struct symbol_list): Renamed from struct symbol_list_s.
6834 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
6835 (struct symbol): Renamed from struct symbol_s.
6836 (symbol): Renamed from symbol_t.
6837 * src/tables.c (vector_number): Renamed from vector_number_t.
6838 (action_number): Renamed from action_t.
6839 * src/tables.h (base_number): Renamed from base_t.
6840 * src/vcg.h (enum color): Renamed from enum color_e.
6841 (enum textmode): Renamed from enum textmode_e.
6842 (enum shape): Renamed from enum shape_e.
6843 (struct colorentry): Renamed from struct colorentry_s.
6844 (struct classname): Renamed from struct classname_s.
6845 (struct infoname): Renamed from struct infoname_s.
6846 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
6847 (enum decision): Renamed from enum decision_e.
6848 (enum orientation): Renamed from enum orientation_e.
6849 (enum alignment): Renamed from enum alignment_e.
6850 (enum arrow_mode): Renamed from enum arrow_mode_e.
6851 (enum crossing_type): Renamed from enum crossing_type_e.
6852 (enum view): Renamed from enum view_e.
6853 (struct node): Renamed from struct node_s.
6854 (node): Renamed from node_t.
6855 (enum linestyle): Renamed from enum linestyle_e.
6856 (enum arrowstyle): Renamed from enum arrowstyle_e.
6857 (struct edge): Renamed from struct edge.
6858 (edge): Renamed from edge_t.
6859 (struct graph): Renamed from struct graph_s.
6860 (graph): Renamed from graph_t.
6861 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
6862 Rename value_t -> value.
6863 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
6864 value_t_as_yystype -> value_as_yystype.
6865
6866 Don't include <errno.h> in the mainstream code, since it
6867 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
6868 * lib/get-errno.c, lib/get-errno.h: New files.
6869 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
6870 get-errno.c.
6871 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
6872 * src/output.c (output_skeleton): Likewise.
6873 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
6874 instead of errno.
6875 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
6876 Likewise.
6877 (handle_action_dollar, handle_action_at): Likewise.
6878 * src/system.h: Do not include <errno.h>.
6879 (TAB_EXT): Renamed from EXT_TAB.
6880 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
6881
6882 Avoid str[a-z]*, since <string.h> reserves that name space.
6883 Change all instances of "struniq" in names to "uniqstr", and
6884 likewise for "STRUNIQ" and "UNIQSTR".
6885 * src/uniqstr.c: Renamed from src/struniq.c.
6886 * src/uniqstr.h: Renamed from src/struniq.h.
6887 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
6888 * src/files.c (strsuffix): Remove; unused.
6889 (concat2): Renamed from stringappend. Now static.
6890 * src/files.h (strsuffix, stringappend): Remove; unused.
6891 * src/parse-gram.y (<chars>): Renamed from <string>.
6892 (<uniqstr>): Renamed from <struniq>.
6893 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
6894 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
6895 (struct graph_s.expand): Renamed from struct graph_s.stretch.
6896 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
6897 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
6898 (N_EXPAND): Renamed from N_STRETCH.
6899
6900 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
6901 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
6902 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
6903 Remove; unused.
6904 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
6905 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
6906 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
6907 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
6908 (BASE_MAXIMUM): Renamed from BASE_MAX.
6909 (BASE_MINIMUM): Renamed from BASE_MIN.
6910 (ACTION_MAX): Remove; unused.
6911 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
6912 Unnecessary casts removed from above defines.
6913
6914
6915 Fix misspelling in names.
6916 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
6917 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
6918 G_NODE_ALIGNEMENT.
6919
6920
6921 * lib/timevar.c (timevar_report): Renamed from time_report,
6922 for consistency with other names.
6923 * lib/timevar.h (timevar_report): New decl.
6924 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
6925
6926
6927 Sort include-file uses.
6928
6929 Reorder all include files under src to be in the order "system.h".
6930 then the ../lib include files in angle brackets (alphabetized),
6931 then the . include files in double-quotes (alphabetized). Fix
6932 dependency breakages encountered in this process, as follows:
6933 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
6934 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
6935 * src/state.h: Include "symtab.h".
6936
69372002-12-08 Paul Eggert <eggert@twinsun.com>
6938
6939 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
6940 since this causes problems when __file__ contains character
6941 sequences like "@" that are treated specially by src/scan-skel.l.
6942 Instead, just use the file's basename. This fixes the bug
6943 reported by Martin Mokrejs in
6944 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
6945
69462002-12-06 Paul Eggert <eggert@twinsun.com>
6947
6948 Add support for rules that do not have trailing semicolons, as
6949 POSIX requires. Improve the quality of locations in Bison
6950 diagnostics.
6951
6952 * src/location.c: Include <quotearg.h>.
6953 (empty_location): Now const.
6954 (location_print): New function. Follow the recommendation of the
6955 GNU Coding Standards for locations that span file boundaries.
6956 * src/location.h: Do not include <quotearg.h>; no longer needed.
6957 (boundary): New type.
6958 (location_t): Use it. This allows locations to span file boundaries.
6959 All member uses changed: file -> start.file or end.file (as needed),
6960 first_line -> start.line, first_column -> start.column,
6961 last_line -> end.line, last_column -> end.column.
6962 (equal_boundaries): New function.
6963 (LOCATION_RESET, LOCATION_STEP): Remove.
6964 (LOCATION_PRINT): Remove. All callers changed to use location_print.
6965 (empty_location): Now const.
6966 (location_print): New decl.
6967 * src/parse-gram.y (lloc_default): New function, which handles
6968 empty locations more accurately.
6969 (YYLLOC_DEFAULT): Use it.
6970 (%token COLON): Remove.
6971 (%token ID_COLON): New token.
6972 (rules): Use it.
6973 (declarations, rules): Remove trailing semicolon.
6974 (declaration, rules_or_grammar_declaration):
6975 Allow empty (";") declaration.
6976 (symbol_def): Remove empty actions; no longer needed.
6977 (rules_or_grammar_declaration): Remove trailing semicolon.
6978 (semi_colon.opt): Remove.
6979 * src/reader.h: Include location.h.
6980 (scanner_cursor): New decl.
6981 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
6982 rolling our own.
6983 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
6984 of *loc.
6985 (STEP): Remove. No longer needed, now that adjust_location does
6986 the work. All uses removed.
6987 (scanner_cursor): New var.
6988 (adjust_location): Renamed from extend_location. It now sets
6989 *loc and adjusts the scanner cursor. All uses changed.
6990 Don't bother testing for CR.
6991 (handle_syncline): Remove location arg; now updates scanner cursor.
6992 All callers changed.
6993 (unexpected_end_of_file): Now accepts start boundary of token or
6994 comment, not location. All callers changed. Update scanner cursor,
6995 not the location.
6996 (SC_AFTER_IDENTIFIER): New state.
6997 (context_state): Renamed from c_context. All uses changed.
6998 (id_loc, code_start, token_start): New local vars.
6999 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
7000 processing of Yacc white space and equivalents here.
7001 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
7002 instead of returning ID immediately, since we need to search for
7003 a subsequent colon.
7004 (<INITIAL>"'", "\""): Save token_start.
7005 (<INITIAL>"%{", "{", "%%"): Save code_start.
7006 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
7007 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
7008 BEGIN context_state at end, not INITIAL.
7009 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
7010 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
7011 Return correct token start.
7012 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
7013 the start of a character, string or multiline comment is found.
7014 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
7015 Reduction): Adjust reported locations to match the more-precise
7016 results now expected.
7017 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
7018 * tests/reduce.at (Useless Rules, Reduced Automaton,
7019 Underivable Rules): Likewise.
7020 * tests/regression.at (Invalid inputs): No longer `expecting ";"
7021 or "|"' now that so many other tokens are allowed by the new grammar.
7022
7023 * src/complain.h (current_file): Remove duplicate decl;
7024 current_file is now owned by files.h.
7025 * src/complain.c, src/scan-gram.l: Include files.h.
7026
70272002-12-06 Paul Eggert <eggert@twinsun.com>
7028
7029 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
7030 promotes to int; it might be unsigned int.
7031 * data/yacc.c (yy_reduce_print): Likewise.
7032
7033 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
7034 be #defined in the prologue, not in the Bison declarations.
7035 This fixes Debian Bug 102878, reported by Shaul Karl.
7036
70372002-12-02 Paul Eggert <eggert@twinsun.com>
7038
7039 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
7040 * lib/strtoul.c: New file, from gnulib.
7041 This fixes a porting bug reported by Peter Klein in
7042 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
7043
70442002-11-30 Paul Eggert <eggert@twinsun.com>
7045
7046 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
7047 and put only a forward declaration in the prologue. This is for
7048 consistency with the other scanner helper functions.
7049
7050 Type clashes now generate warnings, not errors, since it
7051 appears that POSIX may allow some grammars with type clashes.
7052 * src/reader.c (grammar_current_rule_check): Warn about
7053 type clashes instead of complaining.
7054 * tests/input.at (Type Clashes): Expect warnings, not complaints.
7055
7056 Add Yacc library, since POSIX requires it.
7057 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
7058 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
7059 * lib/main.c, lib/yyerror.c: New files.
7060
7061 gram_error can be static; it need not be extern.
7062 * src/reader.h (gram_error): Remove decl.
7063 * src/parse-gram.y (gram_error): Now static. Add static decl.
7064 (print_token_value): Omit parameter names from forward decl,
7065 for consistency.
7066
70672002-11-29 Paul Eggert <eggert@twinsun.com>
7068
7069 * doc/bison.texinfo: Emphasize that yylex and yyerror must
7070 be declared before being used. E.g., one should typically
7071 declare them in the prologue. Use GNU coding style in examples.
7072 Put "const" consistently after the type it modifies. Mention
7073 that C99 supports "inline". Mention that yyerror traditionally
7074 returns "int".
7075
7076 %parse-param and %lex-param now take just one argument, the
7077 declaration; the argument name is deduced from the declaration.
7078
7079 * doc/bison.texinfo (Parser Function, Pure Calling, Error
7080 Reporting, Table of Symbols): Document this.
7081 * src/parse-gram.y (add_param): New function.
7082 (COMMA): Remove.
7083 (declaration): Implement new rule for %parse-param and %lex-param.
7084 * src/scan-gram.l: "," now elicits a warning, rather than being
7085 a token; this is more compatible with byacc.
7086 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
7087
70882002-11-27 Paul Eggert <eggert@twinsun.com>
7089
7090 Rename identifiers to avoid real and potential collisions.
7091
7092 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
7093 to avoid collision with lex macro described by Bruce Lilly in
7094 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
7095 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7096 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
7097 * src/parse-gram.y (print_token_value): Renamed from yyprint.
7098 All uses changed.
7099 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
7100 The name "yycontrol" violates the name space rules, and this stuff
7101 wasn't being used anyway.
7102 (input): Remove action; this stuff wasn't being used.
7103 (gram_error): Rename local variable yylloc -> loc.
7104 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
7105 (YY_DECL): Don't use "yy" at start of local variables.
7106 All uses changed, e.g., yylloc -> loc.
7107 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
7108 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
7109 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
7110 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
7111
7112 * src/parse-gram.y (gram_error): loc is now const *.
7113 * src/reader.h (gram_error): Likewise.
7114
71152002-11-24 Paul Eggert <eggert@twinsun.com>
7116
7117 Version 1.75c.
7118
7119 * tests/actions.at (Actions after errors): Use an output format
7120 more similar to that of the Printers and Destructors test.
7121 Test the position of the ';' token too.
7122 (Printers and Destructors): Likewise.
7123 (Printers and Destructors: %glr-parser): Remove for now, to avoid
7124 unnecessarily alarming people when the test fails.
7125
7126 * data/yacc.c (yyerrlab1): Move this label down, so that the
7127 parser does not discard the lookahead token if the user code
7128 invokes YYERROR. This change is required for POSIX conformance.
7129
7130 * lib/error.c: Sync with gnulib.
7131
71322002-11-22 Paul Eggert <eggert@twinsun.com>
7133
7134 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
7135 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
7136 * lib/xmalloc.c: Likewise.
7137
71382002-11-20 Paul Eggert <eggert@twinsun.com>
7139
7140 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
7141
71422002-11-20 Paul Eggert <eggert@twinsun.com>
7143
7144 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
7145 should use `if (! x) abort ();' rather than `assert (x);', and
7146 anyway it's one less thing to worry about configuring.
7147
7148 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
7149 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
7150 and replace all instances of assert with abort.
7151 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
7152 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
7153
7154 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
7155 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
7156 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
7157 hash_find_entry, hash_rehash, hash_insert): Likewise.
7158 * src/conflicts.c (resolve_sr_conflict): Likewise.
7159 * src/lalr.c (set_goto_map, map_goto): Likewise.
7160 * src/nullable.c (nullable_compute): Likewise.
7161 * src/output.c (prepare_rules, token_definitions_output): Likewise.
7162 * src/reader.c (packgram, reader): Likewise.
7163 * src/state.c (state_new, state_free, state_transitions_set,
7164 state_reduction_find): Likewise.
7165 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
7166 symbol_pack): Likewise.
7167 * src/tables.c (conflict_row, pack_vector): Likewise.
7168 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
7169 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
7170 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
7171 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
7172
7173 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
7174 (ARGMATCH_CONSTRAINT): New macro.
7175 (ARGMATCH_ASSERT): Use it.
7176
7177 * src/system.h (verify): New macro.
7178 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
7179 rather than assert.
7180 * src/tables.c (tables_generate): Likewise.
7181
7182 * src/struniq.c (struniq_assert): Now returns void, and aborts
7183 if the assertion is false.
7184 (struniq_assert_p): Remove.
7185 * src/struniq.h: Likewise.
7186
71872002-11-18 Paul Eggert <eggert@twinsun.com>
7188
7189 * data/glr.c (yygetLRActions): Replace `yyindex' with
7190 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
7191 This fixes the regression with Sun ONE Studio 7 cc that I reported in
7192 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
7193
71942002-11-18 Akim Demaille <akim@epita.fr>
7195
7196 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
7197 space.
7198 From Tim Van Holder.
7199
72002002-11-17 Paul Eggert <eggert@twinsun.com>
7201
7202 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
7203 to "SyntaxError" for consistency with my 2002-11-15 change.
7204
7205 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
7206 not define to {}, since this breaks the common use of `YYDPRINTF
7207 ((...));' if a single statement is desired (e.g. before `else').
7208 Work around GCC warnings by surrounding corresponding calls with
7209 {} if needed.
7210 (yyhasResolvedValue): Remove unused function.
7211 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
7212 loop body.
7213 (yyreportSyntaxError): Renamed from yyreportParseError.
7214 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
7215 All uses changed.
7216 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
7217 extern when possible. Remove unused initializations.
7218
72192002-11-16 Akim Demaille <akim@epita.fr>
7220
7221 Augment the similarity between GLR and LALR traces.
7222
7223 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
7224 (YY_REDUCE_PRINT): New.
7225 (yyparse): Use them.
7226 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
7227 YYDPRINT here.
7228 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
7229 state reached after the reduction/recovery, since...
7230 (yyparse, yyprocessOneStack): Report the state we are entering in.
7231
72322002-11-16 Akim Demaille <akim@epita.fr>
7233
7234 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
7235 Add support for --trace=skeleton.
7236 * src/scan-skel.l: %option debug.
7237 Scan strings of non-@ or \n instead of character by character.
7238 (scan_skel): Handle trace_skeleton.
7239 (QPUTS): New.
7240 (@output_parser_name@, @output_header_name@): ``Restore'' their
7241 support (used to be M4 macros).
7242 * data/yacc.c: Quote larger chunks, a la glr.c.
7243 * data/lalr1.cc: Likewise.
7244 The header guards are no longer available, so use some other
7245 string than `YYLSP_NEEDED'.
7246
72472002-11-16 Akim Demaille <akim@epita.fr>
7248
7249 Make the ``Printers and Destructors'' test more verbose, taking
7250 `yacc.c''s behavior as (possibly wrong) reference.
7251
7252 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
7253 instead of fprint on stdout.
7254 Set and report the last_line of the symbols.
7255 Consistently display values and locations.
7256
72572002-11-16 Paul Eggert <eggert@twinsun.com>
7258
7259 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
7260
72612002-11-15 Paul Eggert <eggert@twinsun.com>
7262
7263 * tests/actions.at (Actions after errors): New test case.
7264
7265 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
7266 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
7267 tests/action.at, tests/calc.at, tests/conflicts.at,
7268 tests/cxx-type.at, tests/regression.at:
7269 "parse error" -> "syntax error" for POSIX compatibility.
7270 "parsing stack overflow..." -> "parser stack overflow" so
7271 that code matches Bison documentation.
7272
72732002-11-15 Akim Demaille <akim@epita.fr>
7274
7275 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
7276 take two BRACED_CODE, not two string_content.
7277 Free the scanner's obstack when we are done.
7278 (code_content): New.
7279 * tests/calc.at: Adjust.
7280 * doc/bison.texinfo: Adjust.
7281 Also, make sure to include the `,' for these declarations.
7282
72832002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
7284
7285 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
7286 definition; avoids potential autoreconf problems.
7287
72882002-11-15 Akim Demaille <akim@epita.fr>
7289
7290 Always check the value returned by yyparse.
7291
7292 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
7293 returned by yyparse.
7294 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
7295 Adjust calls.
7296 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
7297 returned by yyparse.
7298
72992002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7300
7301 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
7302 on input.at test.
7303
73042002-11-14 Paul Eggert <eggert@twinsun.com>
7305
7306 * src/output.c (output_skeleton): Call xfopen instead of
7307 duplicating xfopen's body.
7308
7309 Fix bugs reported by Nelson H. F. Beebe in
7310 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
7311
7312 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
7313 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
7314 Group compiler. Instead, use "$CC -E bar.c". Include the .h
7315 file twice in the grammar, as an extra check.
7316
7317 * tests/input.at (Torturing the Scanner): Surround the
7318 backslash-newline tests with "#if 0", to make it less likely that
7319 we'll run into compiler bugs. Bring back solitary \ inside
7320 comment, but add a closing comment to work around HP C bug. Don't
7321 test backslash-newline in C character constant.
7322
73232002-11-14 Akim Demaille <akim@epita.fr>
7324
7325 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
7326 status of the compiler.
7327 Calling `exit 1' is no longer needed.
7328 Reported by Nelson H. F. Beebe.
7329
73302002-11-14 Akim Demaille <akim@epita.fr>
7331
7332 * tests/atlocal.in (CPPFLAGS): We have config.h.
7333 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
7334 New.
7335 * tests/actions.at, tests/calc.at, tests/conflicts.at,
7336 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
7337 * tests/regression.at, tests/torture.at: Use them for all the
7338 grammars that are to be compiled.
7339 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
7340 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
7341 * doc/bison.texinfo (GLR Parsers): Document `inline'.
7342
73432002-11-14 Akim Demaille <akim@epita.fr>
7344
7345 * doc/bison.texinfo: Various formatting changes (alignments in
7346 samples, additional @group/@end group, GCS in samples.
7347 Use @deffn instead of simple @table to define the directives,
7348 macros, variables etc.
7349
73502002-11-13 Paul Eggert <eggert@twinsun.com>
7351
7352 Fix some bugs reported by Albert Chin-A-Young in
7353 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
7354
7355 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
7356 -o c"; the HP C compiler chatters during compilation.
7357 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
7358 * tests/headers.at (export YYLTYPE): Likewise.
7359
7360 * tests/input.at (Torturing the Scanner): Remove lines containing
7361 solitary backslashes, as they tickle a bug in the HP C compiler.
7362
7363 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
7364 comments, since they're not portable. Use GNU coding style.
7365
73662002-11-13 Akim Demaille <akim@epita.fr>
7367
7368 * data/yacc.c: Leave bigger chunks of quoted text.
7369 (YYDSYMPRINTF): New.
7370 Use it to report symbol activities.
7371 * data/glr.c (YYDSYMPRINTF): New.
7372 Use it.
7373
73742002-11-12 Paul Eggert <eggert@twinsun.com>
7375
7376 Version 1.75b.
7377
7378 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
7379 (yyglrReduce): Return yyok, not 0.
7380 This should avoid the enumerated-type warnings reported
7381 by Nelson H. F. Beebe in
7382 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
7383
7384 * lib/bbitset.h (BITSET_INLINE): Remove.
7385 * lib/bitset.h [! BITSET_INLINE]: Remove.
7386 (bitset_set, bitset_reset, bitset_test): Rename local vars
7387 to avoid shadowing warnings by GCC.
7388
7389 * data/glr.c (inline): Remove #define. It's the user's
7390 responsibility to #define it away, just like 'const'.
7391 This fixes one of the bugs reported by Nelson H. F. Beebe in
7392 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
7393
7394 * Makefile.maint (po-check): Scan .l and .y files instead of the
7395 .c and the .h files that they generate. This fixes the bug
7396 reported by Tim Van Holder in:
7397 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
7398 Look for N_ as well as for _. Try to avoid matching #define for
7399 N_ and _.
7400 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
7401 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
7402 * src/scan-gram.l: Revamp regular expressions so that " and '
7403 do not confuse xgettext.
7404
7405 * src/struniq.h (struniq_new): Do not declare the return type
7406 to be 'const'; this violates the C standard.
7407 * src/struniq.c (struniq_new): Likewise.
7408
74092002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
7410
7411 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
7412 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
7413 linker.
7414
74152002-11-12 Akim Demaille <akim@epita.fr>
7416
7417 * Makefile.maint: Sync with Autoconf:
7418 (local_updates): New.
7419
74202002-11-12 Akim Demaille <akim@epita.fr>
7421
7422 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
7423
74242002-11-12 Akim Demaille <akim@epita.fr>
7425
7426 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
7427 locations.
7428
74292002-11-12 Akim Demaille <akim@epita.fr>
7430
7431 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
7432 not yyvalue.
7433
74342002-11-12 Akim Demaille <akim@epita.fr>
7435
7436 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
7437 Use it to test the GLR parser.
7438
74392002-11-12 Akim Demaille <akim@epita.fr>
7440
7441 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
7442 defines it.
7443 * data/glr.c (yystos): New.
7444 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
7445 (YYDSYMPRINT): New.
7446 (yyval): Don't define it, it is handled via M4.
7447 (yyrecoverParseError): Free verbosely the discarded symbols.
7448 * data/yacc.c (yysymprint): Remove, rather...
7449 (b4_yysymprint_generate): invoke.
7450 * data/c.m4 (b4_yysymprint_generate): New.
7451 Accept pointers as arguments, as opposed to the version from
7452 yacc.c.
7453 (b4_yydestruct_generate): Likewise.
7454 * tests/cations.at (Printers and Destructors): Use Bison directives
7455 instead of CPP macros.
7456 Don't rely on internal details.
7457
74582002-11-12 Akim Demaille <akim@epita.fr>
7459
7460 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
7461 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
7462 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
7463 it against YYEMPTY and so forth), work on yytoken (i.e., set
7464 it to YYEMPTY etc.).
7465 (yydestruct): Replace with a b4_yydestruct_generate invocation.
7466 (b4_symbol_actions): Remove.
7467 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
7468 for 0, end-of-input.
7469
74702002-11-12 Akim Demaille <akim@epita.fr>
7471
7472 * doc/bison.texinfo (Destructor Decl): New.
7473
74742002-11-12 Akim Demaille <akim@epita.fr>
7475
7476 * src/tables.c (tables_generate): Use free for pointers that
7477 cannot be NULL, not XFREE.
7478 (pack_vector): Use assert, not fatal, for bound violations.
7479 * src/state.c (state_new): Likewise.
7480 * src/reader.c (reader): Likewise.
7481 * src/lalr.c (set_goto_map): Likewise.
7482 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
7483 the file name.
7484
74852002-11-12 Akim Demaille <akim@epita.fr>
7486
7487 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
7488 Restore.
7489 * src/scan-gram.l (last_string): Is global to the file, not to
7490 yylex.
7491 * src/parse-gram.y (input): Don't append the epilogue here,
7492 (epilogue.opt): do it here, and free the scanner's obstack.
7493 * src/reader.c (epilogue_set): Rename as...
7494 (epilogue_augment): this.
7495 * data/c.m4 (b4_epilogue): Defaults to empty.
7496
74972002-11-12 Akim Demaille <akim@epita.fr>
7498
7499 * src/getargs.c (long_options): Remove duplicates.
7500 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
7501 Remove.
7502 * doc/bison.rnh: Remove.
7503 * doc/bison.texinfo (VMS Invocation): Remove.
7504
75052002-11-12 Akim Demaille <akim@epita.fr>
7506
7507 * src/struniq.h, src/struniq.c (struniq_t): Is const.
7508 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
7509
7510 Use struniq for symbols.
7511
7512 * src/symtab.h (symbol_t): The tag member is a struniq.
7513 (symbol_type_set): Adjust.
7514 * src/symtab.c (symbol_new): Takes a struniq.
7515 (symbol_free): Don't free the tag member.
7516 (hash_compare_symbol_t, hash_symbol_t): Rename as...
7517 (hash_compare_symbol, hash_symbol): these.
7518 Use the fact that tags as struniqs.
7519 (symbol_get): Use struniq_new.
7520 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
7521 Returns a strniq.
7522 * src/reader.h (merger_list, grammar_currentmerge_set): The name
7523 and type members are struniqs.
7524 * src/reader.c (get_merge_function)
7525 (grammar_current_rule_merge_set): Adjust.
7526 (TYPE, current_type): Are struniq.
7527
7528 Use struniq for file names.
7529
7530 * src/files.h, src/files.c (infile): Split into...
7531 (grammar_file, current_file): these.
7532 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
7533 * src/reduce.c (reduce_print): Likewise.
7534 * src/getargs.c (getargs): Likewise.
7535 * src/complain.h, src/complain.c: Likewise.
7536 * src/main.c (main): Call struniqs_new early enough to use it for
7537 file names.
7538 Don't free the input file name.
7539
75402002-11-12 Akim Demaille <akim@epita.fr>
7541
7542 * src/symtab.c (symbol_free): Remove dead deactivated code:
7543 type_name are properly removed.
7544 Don't use XFREE to free items that cannot be NULL.
7545 * src/struniq.h, src/struniq.c: New.
7546 * src/main.c (main): Initialize/free struniqs.
7547 * src/parse-gram.y (%union): Add astruniq member.
7548 (yyprint): Adjust.
7549 * src/scan-gram.l (<{tag}>): Return a struniq.
7550 Free the obstack bit that used to store it.
7551 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
7552
75532002-11-11 Paul Eggert <eggert@twinsun.com>
7554
7555 Revamp to fix many (but not all) of the C- and M4-related quoting
7556 problems. Among other things, this fixes the Bison bug reported
7557 by Jan Hubicka when processing the Bash grammar; see:
7558 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7559
7560 Use new @ escapes consistently. Represent brackets with @{ and @}
7561 rather than @<:@ and @:>@, since this works a bit better with dumb
7562 editors like vi. Represent @ with @@, since @ is now consistently
7563 an escape. Use @oline@ and @ofile@ rather than __oline__ and
7564 __ofile__, to avoid unexpected expansions. Similarly, use @output
7565 rather than #output.
7566
7567 * data/c.m4 (b4_copyright): Omit file name from comment, since
7568 the file name could contain "*/".
7569 (b4_synclines_flag): Don't quote the 2nd argument; it should already
7570 be quoted. All uses changed.
7571
7572 * data/glr.c: Use new @ escapes consistently.
7573 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
7574 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
7575 Remove, since they couldn't handle arbitrary characters in file
7576 names.
7577 * data/lalr1.cc: Likewise.
7578 * data/yacc.c: Likewise.
7579
7580 * src/files.c (output_infix): Remove; all uses removed.
7581 * src/files.h: Likewise.
7582
7583 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
7584 mishandled funny characters in file names, and anyway it isn't
7585 needed any more.
7586 * data/yacc.c: Likewise.
7587 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
7588
7589 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
7590 * data/yacc.c: Likewise.
7591
7592 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
7593 strings now.
7594 (muscle_init): Quote filename as a C string.
7595 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
7596 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
7597 * src/output.c (escaped_file_name_output): New function.
7598 (prepare_symbols): Quote tokens for M4.
7599 (prepare): Don't insert output_infix, output_prefix,
7600 output_parser_name, output_header_name; this is now down by scan-skel.
7601 Insert skeleton as a C string.
7602
7603 * src/output.c (user_actions_output, symbol_destructors_output,
7604 symbol_printers_output): Quote filenames for C and M4.
7605 * src/reader.c (prologue_augment, epilogue_set): Likewise.
7606
7607 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
7608 escapes other than \\ and \'; this simplifies the code.
7609 (<SC_STRING>): Likewise, for \\ and \".
7610 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
7611 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
7612 Use new escapes @{ and @} for [ and ].
7613
7614 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
7615 them with auto vars.
7616 Switch to new escape scheme, where @ is the escape character uniformly.
7617 Abort if a stray escape character is found. Avoid unbounded input
7618 buffer when parsing non-escaped text.
7619
7620 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
7621 __oline__, #output, $@, and @{ do not have unintended meanings.
7622
76232002-11-09 Paul Eggert <eggert@twinsun.com>
7624
7625 Fix the test failure due to GCC warnings described in
7626 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
7627 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
7628 evaluate to 0 if it's impossible for NINF to be in the respective
7629 table.
7630 (yygetLRActions, yyrecoverParseError): Use them.
7631
7632 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
7633 counted in the token inserted at end of file. Now takes
7634 location_t *, not location_t, so that the location can be
7635 adjusted. All uses changed.
7636
7637 * tests/regression.at (Invalid inputs): Adjust wording in
7638 diagnostic to match the new behavior.
7639
7640 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
7641 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
7642 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
7643 abort ();'. This reduces the runtime of the "Many lookaheads"
7644 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
7645 GCC 3.2.
7646
76472002-11-07 Paul Eggert <eggert@twinsun.com>
7648
7649 * src/parse-gram.y (CHARACTER): Remove unused token.
7650 All uses removed.
7651
7652 * src/scan-gram.l: Remove stack option. We no longer use the
7653 stack, since the stack was never deeper than 1; instead, use the
7654 new auto var c_context to record the stacked value.
7655
7656 Remove nounput option. At an unexpected end of file, we now unput
7657 the minimal input necessary to end cleanly; this simplifies the
7658 code.
7659
7660 Avoid unbounded token sizes where this is easy.
7661
7662 (unexpected_end_of_file): New function.
7663 Use it to systematize the error message on unexpected EOF.
7664 (last-string): Now auto, not static.
7665 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
7666 (scanner_last_string_free): Remove; not used.
7667 (percent_percent_count): Move decl to just before use.
7668 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
7669 not the (never otherwised-used) CHARACTER.
7670
76712002-11-07 Akim Demaille <akim@epita.fr>
7672
7673 Let yyerror always receive the msg as last argument, so that
7674 yyerror can be variadic.
7675
7676 * data/yacc.c (b4_yyerror_args): New.
7677 Use it when calling yyerror.
7678 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
7679 Use it when calling yyerror.
7680 * doc/bison.texinfo (Error Reporting): Adjust.
7681 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
7682 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
7683
76842002-11-06 Akim Demaille <akim@epita.fr>
7685
7686 #line should have quoted strings.
7687 Ideally, this should be done by m4_quotearg.
7688
7689 * src/scan-skel.l: Include quotearg.h.
7690 Quote __ofile__.
7691 * src/output.c (symbol_printers_output)
7692 (symbol_destructors_output): Quote the file name.
7693
76942002-11-06 Akim Demaille <akim@epita.fr>
7695
7696 * tests/regression.at (Invalid inputs): Adjust to the recent
7697 messages.
7698
76992002-11-06 Akim Demaille <akim@epita.fr>
7700
7701 Restore --no-lines.
7702 Reported by Jim Kent.
7703
7704 * data/c.m4 (b4_syncline): New.
7705 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
7706 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
7707 * src/output.c (user_actions_output): Likewise.
7708 (prepare): Define 'b4_synclines_flag'.
7709 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
7710
77112002-11-06 Akim Demaille <akim@epita.fr>
7712
7713 * src/main.c (main): Free `infile'.
7714 * src/scan-gram.l (handle_syncline): New.
7715 Recognize `#line'.
7716 * src/output.c (user_actions_output, symbol_destructors_output)
7717 (symbol_printers_output): Use the location's file name, not
7718 infile.
7719 * src/reader.c (prologue_augment, epilogue_set): Likewise.
7720
77212002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7722
7723 * src/tables.c (matching_state): Don't allow states to match if
7724 either has GLR conflict entries.
7725
77262002-11-05 Paul Eggert <eggert@twinsun.com>
7727
7728 * src/scan-gram.l: Use more accurate diagnostics, e.g.
7729 "integer out of range" rather than "invalid value".
7730 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
7731 accordingly.
7732
7733 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
7734 Also, remove one static variable in the scanner.
7735
7736 * src/scan-gram.l (braces_level): Now auto, not static.
7737 Initialize to zero if the compiler is being picky.
7738 (INITIAL): Clear braces_level instead of incrementing it.
7739 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
7740 as POSIX 1003.1-2001 requires.
7741 * src/system.h (IF_LINT): New macro, taken from coreutils.
7742 * configure.ac: Define "lint" if --enable-gcc-warnings.
7743
77442002-11-05 Akim Demaille <akim@epita.fr>
7745
7746 * src/scan-gram.l: When it starts with `%', complain about the
7747 whole directive, not just that `invalid character: %'.
7748
77492002-11-04 Akim Demaille <akim@epita.fr>
7750
7751 * Makefile.maint: Update from Autoconf.
7752 (update, cvs-update, po-update, do-po-update): New.
7753
77542002-11-04 Akim Demaille <akim@epita.fr>
7755
7756 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
7757 and yyerror.
7758 Have yyerror `use' its arguments.
7759 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
7760 returns true when location & yacc & pure & parse-param.
7761 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
7762
77632002-11-04 Akim Demaille <akim@epita.fr>
7764
7765 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
7766 clashes.
7767 * src/scan-gram.l: Use [\'] instead of ['] to pacify
7768 font-lock-mode.
7769 Use complain_at.
7770 Use quote, not quote_n since LOCATION_PRINT no longer uses the
7771 slot 0.
7772
77732002-11-03 Paul Eggert <eggert@twinsun.com>
7774
7775 * src/reader.c (get_merge_function, grammar_current_rule_check):
7776 Use consistent diagnostics for reporting type name clashes.
7777 Quote the types with <>, for consistency with Yacc.
7778 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
7779
77802002-11-03 Akim Demaille <akim@epita.fr>
7781
7782 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
7783 New.
7784 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
7785 (b4_parse_param): Remove.
7786 Use b4_identification.
7787 Propagate b4_pure_args where needed to pass them to yyerror.
7788 * data/glr.m4 (b4_parse_param): Remove.
7789 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
7790 (b4_lpure_formals): New.
7791 Use b4_identification.
7792 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
7793 b4_user_formals and b4_user_args.
7794 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
7795 (yyreportAmbiguity): When using a pure parser, also need
7796 the location, and the parse-params.
7797 Adjust callers.
7798 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
7799 When using a pure parser, also need the parse-params.
7800 Adjust callers.
7801 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
7802 (%pure-parser + %parse-param) LALR and GLR parsers.
7803 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
7804 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
7805 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
7806 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
7807 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
7808 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
7809 * doc/bison.texinfo: Untabify the whole file.
7810 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
7811 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
7812 (Error Reporting): Adjust to these new directives.
7813 Document %error-verbose, deprecate YYERROR_VERBOSE.
7814
78152002-11-03 Akim Demaille <akim@epita.fr>
7816
7817 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
7818 AT_CHECK_CALC_GLR invocations to use % directives, instead of
7819 command line options.
7820 * tests/cxx-type.at: Formatting changes.
7821
78222002-11-03 Paul Eggert <eggert@twinsun.com>
7823
7824 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
7825 to count columns correctly, and to check for invalid inputs.
7826
7827 Use mbsnwidth to count columns correctly. Account for tabs, too.
7828 Include mbswidth.h.
7829 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
7830 (extend_location): New function.
7831 (YY_LINES): Remove.
7832
7833 Handle CRLF in C code rather than in Lex code.
7834 (YY_INPUT): New macro.
7835 (no_cr_read): New function.
7836
7837 Scan UCNs, even though we don't fully handle them yet.
7838 (convert_ucn_to_byte): New function.
7839
7840 Handle backslash-newline correctly in C code.
7841 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
7842 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
7843 all uses changed.
7844 (tag, splice): New EREs. Do not allow NUL or newline in tags.
7845 Use {splice} wherever C allows backslash-newline.
7846 YY_STEP after space, newline, vertical-tab.
7847 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
7848
7849 (letter, id): Don't assume ASCII; e.g., spell out a-z.
7850
7851 ({int}, handle_action_dollar, handle_action_at): Check for integer
7852 overflow.
7853
7854 (YY_STEP): Omit trailing semicolon, so that it's more like C.
7855
7856 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
7857 as well as \000. Check for UCHAR_MAX, not 255.
7858 Allow \x with an arbitrary positive number of digits, as in C.
7859 Check for overflow here.
7860 Allow \? and UCNs, for compatibility with C.
7861
7862 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
7863 with quote slot used by complain_at.
7864
7865 * tests/input.at: Add tests for backslash-newline, m4 quotes
7866 in symbols, long literals, and funny escapes in strings.
7867
7868 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
7869 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
7870 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
7871 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
7872 * m4/mbswidth.m4: New file, from GNU coreutils.
7873
7874 * doc/bison.texinfo (Grammar Outline): Document // comments.
7875 (Symbols): Document that trigraphs have no special meaning in Bison,
7876 nor is backslash-newline allowed.
7877 (Actions): Document that trigraphs have no special meaning.
7878
7879 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
7880 no longer used.
7881
78822002-11-02 Paul Eggert <eggert@twinsun.com>
7883
7884 * src/reader.c: Don't include quote.h; not needed.
7885 (get_merge_function): Reword warning to be consistent with
7886 type clash diagnostic in grammar_current_rule_check.
7887
7888 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
7889 bug in trigraph handling.
7890
7891 * src/output.c (prepare_symbols): When printing token names,
7892 escape "[" as "@<:@" and likewise for "]".
7893
7894 * src/system.h (errno): Remove declaration, as we are now
7895 assuming C89 or better, and C89 guarantees errno.
7896
78972002-10-30 Paul Eggert <eggert@twinsun.com>
7898
7899 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
7900 Check for close failures.
7901 * src/files.h (xfclose): Return void, not int, since it always
7902 returned zero.
7903 * src/files.c (xfclose): Likewise. Report I/O error if ferror
7904 indicates one.
7905 * src/output.c (output_skeleton): Use xfclose rather than fclose
7906 and ferror. xfclose now checks ferror.
7907
7908 * data/glr.c (YYLEFTMOST_STATE): Remove.
7909 (yyreportTree): Use a stack-based leftmost state. This avoids
7910 our continuing battles with bogus warnings about initializers.
7911
79122002-10-30 Akim Demaille <akim@epita.fr>
7913
7914 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
7915 #if.
7916
79172002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
7918
7919 * tests/glr-regr1.at: New test for reported regressions.
7920 * tests/testsuite.at: Add glr-regr1.at test.
7921 * tests/Makefile.am: Add glr-regr1.at test.
7922
79232002-10-24 Paul Eggert <eggert@twinsun.com>
7924
7925 Version 1.75a.
7926
7927 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
7928 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
7929 we use malloc. Don't assume 'A' through 'Z' are contiguous.
7930 Don't assume strdup exists; POSIX says its an XSI extension.
7931 Check for buffer overflow on input.
7932
79332002-10-24 Akim Demaille <akim@epita.fr>
7934
7935 * src/output.c (output_skeleton): Don't disable M4sugar comments
7936 too soon: it results in comments being expanded.
7937 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
7938 first output.
7939
79402002-10-24 Akim Demaille <akim@epita.fr>
7941
7942 * data/yacc.c (m4_int_type): New.
7943 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
7944 char' as only yacc.c wants K&R portability.
7945 * data/glr.c (yysigned_char): Remove.
7946 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
7947 Reported by Quoc Peyrot.
7948
79492002-10-23 Paul Eggert <eggert@twinsun.com>
7950
7951 * src/main.c (main): With --trace=time, report times even if a
7952 non-fatal error occurs. Formerly, the times were reported in some
7953 such cases but not in others.
7954 * src/reader.c (reader): Just return if a complaint has been issued,
7955 instead of exiting, so that 'main' can report times.
7956
79572002-10-22 Akim Demaille <akim@epita.fr>
7958
7959 * src/system.h: Include sys/types.
7960 Reported by Bert Deknuydt.
7961
79622002-10-23 Paul Eggert <eggert@twinsun.com>
7963
7964 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
7965 Suggested by Art Haas.
7966
79672002-10-22 Paul Eggert <eggert@twinsun.com>
7968
7969 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
7970 decl; not needed any more.
7971 * src/main.c (main): Use return to exit, undoing yesterday's change.
7972 The last OS that we could find where this wouldn't work is
7973 SunOS 3.5, and that's too old to worry about now.
7974
7975 * data/glr.c (struct yyltype): Define members even when not
7976 doing locations. This is more consistent with yacc.c, and it
7977 works around the following bug reports:
7978 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
7979 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
7980
7981 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
7982 @acronym consistently. Standardize on "Yacc" instead of "YACC",
7983 "Algol" instead of "ALGOL". Give a bit more history about BNF.
7984
79852002-10-22 Akim Demaille <akim@epita.fr>
7986
7987 * data/README: New.
7988
79892002-10-21 Paul Eggert <eggert@twinsun.com>
7990
7991 Be consistent about 'bool'; the old code used an enum in one
7992 module and an int in another, and this violates the C standard.
7993 * m4/stdbool.m4: New file, from coreutils 4.5.3.
7994 * configure.ac (AC_HEADER_STDBOOL): Add.
7995 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
7996 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
7997 * src/symtab.c (hash_compare_symbol_t): Likewise.
7998 * src/system.h (bool, false, true): Use a definition consistent
7999 with ../lib/hash.c. All uses changed.
8000
8001 * src/complain.c (warning_issued): Renamed from warn_message_count,
8002 so that we needn't worry about integer overflow (!).
8003 Now of type bool. All uses changed.
8004 (complaint_issued): Renamed from complain_message_count; likewise.
8005
8006 * src/main.c (main): Use exit to exit with failure.
8007
8008 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
8009 rather than 1 and 0.
8010 * src/main.c (main): Likewise.
8011 * src/getargs.c (getargs): Likewise.
8012 * src/reader.c (reader): Likewise.
8013
8014 * src/getarg.c (getargs): Remove duplicate code for
8015 "Try `bison --help'".
8016
8017 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
8018 What was that "2" for?
8019
8020 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
8021 * src/getargs.c (usage): Likewise.
8022
8023 * src/getargs.c (getargs): When there are too few operands, report
8024 the last one. When there are too many, report the first extra
8025 one. This is how diffutils does it.
8026
80272002-10-20 Paul Eggert <eggert@twinsun.com>
8028
8029 Remove K&R vestiges.
8030 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
8031 * src/complain.c (VA_START): Remove. Assume prototypes.
8032 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
8033 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
8034 fatal): Assume prototypes.
8035 * src/complain.h: Assume prototypes.
8036 * src/system.h (PARAMS): Remove.
8037 Include <limits.h> unconditionally, since it's guaranteeed even
8038 for a freestanding C89 compiler.
8039 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
8040 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8041
80422002-10-20 Akim Demaille <akim@epita.fr>
8043
8044 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
8045 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
8046 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
8047 (yyresolveStates, yyresolveAction, yyresolveStack)
8048 (yyprocessOneStack): Use them.
8049 (yy_reduce_print): New.
8050 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
8051
80522002-10-20 Akim Demaille <akim@epita.fr>
8053
8054 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
8055 arguments and output `void'.
8056 (b4_c_function): Rename as...
8057 (b4_c_function_def): this.
8058 (b4_c_function_decl, b4_c_ansi_function_def)
8059 (b4_c_ansi_function_decl): New.
8060 Change the interpretation of the arguments: before `int, foo', now
8061 `int foo, foo'.
8062 * data/yacc.c (yyparse): Prototype and define thanks to these.
8063 Adjust b4_c_function_def uses.
8064 * data/glr.c (yyparse): Likewise, but ANSI only.
8065
80662002-10-20 Akim Demaille <akim@epita.fr>
8067
8068 * src/output.c (prepare): Move the definition of `tokens_number',
8069 `nterms_number', `undef_token_number', `user_token_number_max'
8070 to...
8071 (prepare_tokens): Here.
8072 (prepare_tokens): Rename as...
8073 (prepare_symbols): this.
8074 (prepare): Move the definition of `rules_number' to...
8075 (prepare_rules): here.
8076 (prepare): Move the definition of `last', `final_state_number',
8077 `states_number' to...
8078 (prepare_states): here.
8079 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
8080
80812002-10-20 Akim Demaille <akim@epita.fr>
8082
8083 * src/tables.h, src/tables.c, src/output.c: Comment changes.
8084
80852002-10-20 Akim Demaille <akim@epita.fr>
8086
8087 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
8088 * data/c.m4: here.
8089
80902002-10-20 Akim Demaille <akim@epita.fr>
8091
8092 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
8093 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
8094 `pair'.
8095 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
8096 `name' to...
8097 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
8098 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
8099 These.
8100
81012002-10-19 Paul Eggert <eggert@twinsun.com>
8102
8103 Do not create a temporary file, as that involves security and
8104 cleanup headaches. Instead, use a pair of pipes.
8105 Derived from a suggestion by Florian Krohm.
8106 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
8107 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
8108 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
8109 (BISON_PREREQ_SUBPIPE): Add.
8110 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
8111 Add subpipe.h, subpipe.c.
8112 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
8113 * po/POTFILES.in: Add lib/subpipe.c.
8114 * src/output.c: Include "subpipe.h".
8115 (m4_invoke): Remove decl.
8116 (scan_skel): New decl.
8117 (output_skeleton): Use pipe rather than temporary file for m4 input.
8118 Check that m4sugar.m4 is readable, to avoid deadlock.
8119 Check for pipe I/O error.
8120 * src/scan-skel.l (readpipe): Remove decl.
8121 (scan_skel): New function, to be used in place of m4_invoke.
8122 Read from stream rather than file.
8123
8124 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
8125 float, as this generates a warning on Solaris 8 + GCC 3.2 with
8126 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
8127 this generates a more-accurate value anyway.
8128
8129 * lib/timevar.c (timervar_accumulate): Rename locals to
8130 avoid confusion with similarly-named more-global.
8131 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
8132
8133 * src/output.c (prepare): Use xstrdup to convert char const *
8134 to char *, to avoid GCC warning.
8135
81362002-10-19 Akim Demaille <akim@epita.fr>
8137
8138 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
8139 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
8140 Use them to have `calc.y' ready for %pure-parser.
8141 * data/yacc.c (YYLEX): Pass a yylex return type to
8142 b4_c_function_call.
8143
81442002-10-19 Akim Demaille <akim@epita.fr>
8145
8146 Prototype support of %lex-param and %parse-param.
8147
8148 * src/parse-gram.y: Add the definition of the %lex-param and
8149 %parse-param tokens, plus their rules.
8150 Drop the `_' version of %glr-parser.
8151 Add the "," token.
8152 * src/scan-gram.l (INITIAL): Scan them.
8153 * src/muscle_tab.c: Comment changes.
8154 (muscle_insert, muscle_find): Rename `pair' as `probe'.
8155 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
8156 (muscle_entry_s): The `value' member is no longer const.
8157 Adjust all dependencies.
8158 * src/muscle_tab.c (muscle_init): Adjust: use
8159 MUSCLE_INSERT_STRING.
8160 Initialize the obstack earlier.
8161 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
8162 (muscle_pair_list_grow): New.
8163 * data/c.m4 (b4_c_function_call, b4_c_args): New.
8164 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
8165 * tests/calc.at: Use %locations, not --locations.
8166 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
8167
81682002-10-19 Akim Demaille <akim@epita.fr>
8169
8170 * src/getargs.c (usage): Take status as argument and exit
8171 accordingly.
8172 Report the traditional `Try ... --help' message when status != 0.
8173 (usage, version): Don't take a FILE * as arg, it is pointless.
8174 (getargs): When there is an incorrect number of arguments, make it
8175 an error, and report it GNUlically thanks to `usage ()'.
8176
81772002-10-18 Paul Eggert <eggert@twinsun.com>
8178
8179 * data/glr.c (yyreportParseError): Don't assume that sprintf
8180 yields the length of the printed string, as this is not true
8181 on SunOS 4.1.4. Reported by Peter Klein.
8182
8183 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
8184 * tests/conflicts.at (%nonassoc and eof): Likewise.
8185 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
8186
81872002-10-17 Akim Demaille <akim@epita.fr>
8188
8189 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
8190 * src/getargs.c (trace_types, trace_args): Adjust.
8191 * src/reader.c (grammar_current_rule_prec_set)
8192 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
8193 Standardize error messages.
8194 And s/@prec/%prec/!
8195 (reader): Use trace_flag to enable scanner/parser debugging,
8196 instead of an adhoc scheme.
8197 * src/scan-gram.l: Remove trailing debugging code.
8198
81992002-10-16 Paul Eggert <eggert@twinsun.com>
8200
8201 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
8202 MUSCLE_TAB_H.
8203
8204 * NEWS: Officially drop support for building Bison with K&R C,
8205 since it didn't work anyway and it's not worth worrying about.
8206 * Makefile.maint (wget_files): Remove ansi2knr.c.
8207 (ansi2knr.c-url_prefix): Remove.
8208 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
8209 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8210 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8211
82122002-10-15 Paul Eggert <eggert@twinsun.com>
8213
8214 Stop using the "enum_" trick for K&R-style function definitions;
8215 it confused me, and I was the author! Instead, assume that people
8216 who want to use K&R C compilers (when using these modules in GCC,
8217 perhaps?) will run ansi2knr.
8218
8219 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
8220 All uses of "enum_" changed to "enum ".
8221 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
8222 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
8223
8224 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
8225 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
8226 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
8227 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
8228 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
8229 abitset_not, abitset_ones, abitset_or, abitset_or_and,
8230 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
8231 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
8232 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
8233 Use function prototypes; this removes the need for declaring
8234 static functions simply to provide their prototypes.
8235 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
8236 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
8237 bitset_count_, bitset_create, bitset_dump, bitset_first,
8238 bitset_free, bitset_init, bitset_last, bitset_next,
8239 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
8240 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
8241 bitset_print, bitset_release_memory, bitset_toggle_,
8242 bitset_type_choose, bitset_type_get, bitset_type_name_get,
8243 debug_bitset): Likewise.
8244 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
8245 * lib/bitset_stats.c (bitset_log_histogram_print,
8246 bitset_percent_histogram_print, bitset_stats_and,
8247 bitset_stats_and_cmp, bitset_stats_and_or,
8248 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
8249 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
8250 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
8251 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
8252 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
8253 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
8254 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
8255 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
8256 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
8257 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
8258 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
8259 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
8260 bitset_stats_zero): Likewise.
8261 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
8262 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
8263 bitsetv_dump, debug_bitsetv): Likewise.
8264 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
8265 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
8266 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
8267 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
8268 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
8269 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
8270 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
8271 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
8272 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
8273 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
8274 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
8275 Likewise.
8276 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
8277 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
8278 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
8279 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
8280 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
8281 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
8282 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
8283 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
8284 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
8285 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
8286 lbitset_xor_cmp, lbitset_zero): Likewise.
8287
82882002-10-14 Akim Demaille <akim@epita.fr>
8289
8290 Version 1.75.
8291
82922002-10-14 Akim Demaille <akim@epita.fr>
8293
8294 * tests/Makefile.am (maintainer-check-posix): New.
8295
82962002-10-14 Akim Demaille <akim@epita.fr>
8297
8298 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
8299 member.
8300
83012002-10-14 Akim Demaille <akim@epita.fr>
8302
8303 * src/tables.c (table_ninf_remap): base -> tab.
8304 Reported by Matt Rosing.
8305
83062002-10-14 Paul Eggert <eggert@twinsun.com>
8307
8308 * tests/action.at, tests/calc.at, tests/conflicts.at,
8309 tests/cxx-type.at, tests/headers.at, tests/input.at,
8310 tests/regression.at, tests/synclines.at, tests/torture.at:
8311 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
8312 so that the tests still work even if POSIXLY_CORRECT is set.
8313 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
8314
8315 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
8316 for portability to K&R hosts. Fix typo: signed char is guaranteed
8317 only to 127, not to 128.
8318 * data/glr.c (yysigned_char): New type.
8319 * data/yacc.c (yysigned_char): Likewise.
8320 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
8321
83222002-10-13 Paul Eggert <eggert@twinsun.com>
8323
8324 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
8325 true due to limited range of data type" warning from GCC.
8326
8327 * data/c.m4 (b4_token_defines): Protect against double-inclusion
8328 by wrapping enum yytokentype's definition inside #ifndef
8329 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
8330
83312002-10-13 Akim Demaille <akim@epita.fr>
8332
8333 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
8334 Un yy- yyrhs to avoid the name clash with the global YYRHS.
8335
83362002-10-13 Akim Demaille <akim@epita.fr>
8337
8338 * Makefile.maint: Update from Autoconf 2.54.
8339 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
8340
83412002-10-13 Akim Demaille <akim@epita.fr>
8342
8343 * src/print.c (print_state): Separate the list of solved conflicts
8344 from the other items.
8345 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
8346
83472002-10-13 Akim Demaille <akim@epita.fr>
8348
8349 Let nondeterministic skeletons be usable with deterministic
8350 tables.
8351
8352 With the patch, GAWK compiled by GCC without -O2 passes its test
8353 suite using a GLR parser driven by LALR tables. It fails with -O2
8354 because `struct stat' gives two different answers on my machine:
8355 88 (definition of an auto var) and later 96 (memset on this var).
8356 Hence the stack is badly corrumpted. The headers inclusion is to
8357 blame: if I move the awk.h inclusion before GLR's system header
8358 inclusion, the two struct stat have the same size.
8359
8360 * src/tables.c (pack_table): Always create conflict_table.
8361 (token_actions): Always create conflict_list.
8362 * data/glr.c (YYFLAG): Remove, unused.
8363
83642002-10-13 Akim Demaille <akim@epita.fr>
8365
8366 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
8367 (O0FLAGS): New.
8368 (VALGRIND, GXX): New.
8369 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
8370 * tests/bison.in: Run $PREBISON a pre-command.
8371 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
8372 (maintainer-check-g++): New.
8373 * Makefile.am (maintainer-check): New.
8374
83752002-10-13 Akim Demaille <akim@epita.fr>
8376
8377 * data/glr.c: Formatting changes.
8378 Tweak some trace messages to match yacc.c's.
8379
83802002-10-13 Akim Demaille <akim@epita.fr>
8381
8382 GLR parsers sometimes raise parse errors instead of performing the
8383 default reduction.
8384 Reported by Charles-Henry de Boysson.
8385
8386 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
8387 check the length of the traces when %glr.
8388 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
8389 GLR's traces.
8390 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
8391 Test GLR parsers.
8392 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
8393 (yyltype): Remove the yy prefix from the member names.
8394 (yytable): Complete its comment.
8395 (yygetLRActions): Map error action number from YYTABLE from
8396 YYTABLE_NINF to 0.
8397 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
8398 (which was a bug: it should have been YYTABEL_NINF, and yet it was
8399 not satisfying as we could compare an YYACTION computed from
8400 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
8401 only value for error actions.
8402 (yyreportParseError): In verbose parse error messages, don't issue
8403 `error' in the list of expected tokens.
8404 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
8405 next action to perform to match glr.c's decoding.
8406 (yytable): Complete its comment.
8407
84082002-10-13 Paul Eggert <eggert@twinsun.com>
8409
8410 Fix problem reported by Henrik Grubbstroem in
8411 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
8412 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
8413 because the Bison parser reads the second action before reducing
8414 the first one.
8415 * src/scan-gram.l (rule_length): New static var.
8416 Use it to keep track of the rule length in the scanner, since
8417 we can't expect the parser to be in lock-step sync with the scanner.
8418 (handle_action_dollar, handle_action_at): Use this var.
8419 * tests/actions.at (Exotic Dollars): Test for the problem.
8420
84212002-10-12 Paul Eggert <eggert@twinsun.com>
8422
8423 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
8424 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
8425 Include <sys/time.h> when checking for clock_t and struct tms.
8426 Use same include order as source.
8427 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
8428 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
8429
8430 * lib/timevar.c: Update copyright date and clarify comments.
8431 (get_time) [IN_GCC]: Keep the GCC version for reference.
8432
8433 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
8434 GCC version as of today, then merge Bison's changes.
8435 Change "GCC" to "Bison" in copyright notice. timevar.def's
8436 author is Akim, so change that too.
8437
8438 * src/reader.c (grammar_current_rule_check):
8439 Don't worry about the default action if $$ is untyped.
8440 Prevents bogus warnings reported by Jim Gifford in
8441 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
8442
8443 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
8444 * data/glr.c, data/lalr1.cc, data/yacc.c:
8445 Output token definitions before the first part of user declarations.
8446 Fixes compatibility problem reported by Jim Gifford for kbd in
8447 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
8448
84492002-10-11 Paul Eggert <eggert@twinsun.com>
8450
8451 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
8452 (yyparse): here. This undoes some of the 2002-07-25 change.
8453 Compatibility problem reported by Ralf S. Engelschall with
8454 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
8455
84562002-10-11 Akim Demaille <akim@epita.fr>
8457
8458 * tests/regression.at Characters Escapes): New.
8459 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
8460 characters.
8461 Reported by Jan Nieuwenhuizen.
8462
84632002-10-11 Akim Demaille <akim@epita.fr>
8464
8465 * po/id.po: New.
8466
84672002-10-10 Paul Eggert <eggert@twinsun.com>
8468
8469 Portability fixes for bitsets; this also avoids several GCC
8470 warnings.
8471
8472 * lib/abitset.c: Include <stddef.h>, for offsetof.
8473 * lib/lbitset.c: Likewise.
8474
8475 * lib/abitset.c (abitset_bytes): Return a size that is aligned
8476 properly for vectors of objects. Do not assume that adding a
8477 header size to a multiple of a word size yields a value that is
8478 properly aligned for the whole union.
8479 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8480
8481 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
8482 unique names for structures.
8483 * lib/ebitset.c (ebitset_bytes): Likewise.
8484 * lib/lbitset.c (lbitset_bytes): Likewise.
8485
8486 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
8487 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
8488 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
8489 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
8490 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
8491 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
8492 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
8493 to improve the type-checking that GCC can do.
8494 * lib/bitset.c (bitset_op4_cmp): Likewise.
8495 * lib/bitset_stats.c (bitset_stats_count,
8496 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
8497 bitset_stats_copy, bitset_stats_disjoint_p,
8498 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
8499 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
8500 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
8501 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
8502 bitset_stats_and_or_cmp, bitset_stats_andn_or,
8503 bitset_stats_andn_or_cmp, bitset_stats_or_and,
8504 bitset_stats_or_and_cmp): Likewise.
8505 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
8506 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
8507 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
8508 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
8509
8510 * lib/abitset.h: Include bitset.h, not bbitset.h.
8511 * lib/ebitset.h: Likewise.
8512 * lib/lbitset.h: Likewise.
8513
8514 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
8515 All instances of parameters of type enum bitset_opts are now of
8516 type enum_bitset_opts, to conform to the C Standard, and similarly
8517 for enum_bitset_type.
8518 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
8519 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
8520
8521 Do not use "struct bitset_struct" to mean different things in
8522 different modules. Not only is this confusing, it violates
8523 the C Standard, which requires that structure types in different
8524 modules must be compatible if one is to be passed to the other.
8525 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
8526 All instances of "struct bitset_struct *" replaced with "bitset".
8527 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
8528 (union bitset_union, struct abitset_struct, struct ebitset_struct,
8529 struct lbitset_struct, struct bitset_stats_struct): New types.
8530 All uses of struct bitset_struct changed to union bitset_union,
8531 etc.
8532 * lib/abitset.c (struct abitset_struct, abitset,
8533 struct bitset_struct): Remove.
8534 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
8535 struct bitset_struct): Remove.
8536 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
8537 bitset_struct): Remove.
8538 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
8539 Likewise.
8540
8541 Do not call a function of type T using a call that assumes the
8542 function is of a different type U. Standard C requires that a
8543 function must be called with a type that is compatible with its
8544 definition.
8545 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
8546 New decls.
8547 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
8548 New functions.
8549 * lib/ebitset.c (PFV): Remove.
8550 * lib/lbitset.c (PFV): Likewise.
8551 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
8552 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
8553 decls.
8554 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
8555 (ebitset_vtable): Use them.
8556 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
8557 lbitset_xor): New functions.
8558 (lbitset_vtable): Use them.
8559
8560 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
8561 Declare.
8562
8563 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
8564 GCC warning.
8565 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
8566 Use offsetof, for simplicity.
8567
85682002-10-06 Paul Eggert <eggert@twinsun.com>
8569
8570 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
8571 the same width as int. This reapplies a hunk of the 2002-08-12 patch
8572 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
8573 which was inadvertently undone by the 2002-09-30 patch.
8574 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
8575 the same width as int.
8576
85772002-10-04 Paul Eggert <eggert@twinsun.com>
8578
8579 Version 1.50.
8580
8581 * configure.ac (AC_INIT), NEWS: Increment version number.
8582
8583 * doc/bison.texinfo: Minor spelling, grammar, and white space
8584 fixes.
8585 (Symbols): Mention that any negative value returned from yylex
8586 signifies end-of-input. Warn about negative chars. Mention
8587 the portable Standard C character set.
8588
8589 The GNU coding standard says CFLAGS and YFLAGS are reserved
8590 for the installer to set.
8591 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
8592 * src/Makefile.am (AM_CFLAGS): Likewise.
8593 (AM_YFLAGS): Renamed from YFLAGS.
8594
8595 Fix some MAX and MIN problems.
8596 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
8597 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
8598 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
8599 * src/reader.c (reader): Use it.
8600
8601 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
8602 POSIX 1003.1-2001 has removed fgrep.
8603
86042002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
8605
8606 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
8607 interpreted as signed.
8608 * lib/ebitset.c (ebitset_list): Fix bug.
8609
86102002-10-01 Paul Eggert <eggert@twinsun.com>
8611
8612 More fixes for 64-bit hosts and large bitsets.
8613
8614 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
8615 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
8616 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
8617 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
8618 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
8619 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
8620 bitset_count_): Likewise.
8621 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
8622 bitset_first, bitset_last): Likewise.
8623 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
8624 bitset_stats_list_reverse, bitset_stats_size,
8625 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
8626 Likewise.
8627 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8628 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
8629 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
8630 bitsetv_reflexive_transitive_closure): Likewise.
8631 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
8632 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
8633 Likewise.
8634 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
8635 Likewise.
8636
8637 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
8638 Use size_t, not unsigned int, to count bytes.
8639 * lib/abitset.h (abitset_bytes): Likewise.
8640 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
8641 Likewise.
8642 * lib/bitset.h (bitset_bytes): Likewise.
8643 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
8644 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
8645 * lib/bitsetv.c (bitsetv_alloc): Likewise.
8646 * lib/ebitset.c (ebitset_bytes): Likewise.
8647 * lib/ebitset.h (ebitset_bytes): Likewise.
8648 * lib/lbitset.c (lbitset_bytes): Likewise.
8649 * lib/lbitset.h (lbitset_bytes): Likewise.
8650
8651 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
8652 abitset_subset_p, abitset_disjoint_p, abitset_and,
8653 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
8654 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
8655 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
8656 abitset_or_and, abitset_or_and_cmp):
8657 Use bitset_windex instead of unsigned int.
8658 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
8659 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
8660 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
8661 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
8662 Likewise.
8663 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
8664
8665 * lib/bitset.c (bitset_print):
8666 Use proper printf formats for widths of integer types.
8667 * lib/bitset_stats.c (bitset_percent_histogram_print,
8668 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
8669 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8670 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
8671 * lib/lbitset.c (lbitset_bytes): Likewise.
8672
8673 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
8674 BITSET_SIZE_MAX): New macros.
8675 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
8676 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
8677 to BITSET_WINDEX_MAX.
8678
8679 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
8680 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
8681 since we now return the bitset_bindex type (not int).
8682
8683 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
8684 when computing sizes.
8685 * lib/ebitset.c (ebitset_elts_grow): Likewise.
8686
8687 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
8688 and avoid cast to unsigned.
8689
86902002-09-30 Akim Demaille <akim@epita.fr>
8691
8692 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8693 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
8694 Updates from Michael Hayes.
8695
86962002-09-30 Art Haas <ahaas@neosoft.com>
8697
8698 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
8699 invocations.
8700 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
8701 defined.
8702
87032002-09-27 Akim Demaille <akim@epita.fr>
8704
8705 Version 1.49c.
8706
87072002-09-27 Akim Demaille <akim@epita.fr>
8708
8709 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
8710 (Because of AC_LIBSOURCE).
8711
87122002-09-27 Akim Demaille <akim@epita.fr>
8713
8714 Playing with Autoscan.
8715
8716 * configure.ac: Remove the old LIBOBJ tweaks.
8717 (AC_REPLACE_FUNCS): Add strrchr and strtol.
8718 * lib/strrchr.c: New.
8719 * lib/strtol.c: New, from the Coreutils 4.5.1.
8720
87212002-09-27 Akim Demaille <akim@epita.fr>
8722
8723 Playing with Autoscan.
8724
8725 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
8726 * lib/Makefile.am (libbison_a_SOURCES): No longer include
8727 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
8728 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
8729 Coreutils 4.5.1.
8730
87312002-09-24 Akim Demaille <akim@epita.fr>
8732
8733 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
8734 (Frequently Asked Questions, Parser Stack Overflow): New.
8735
87362002-09-13 Akim Demaille <akim@epita.fr>
8737
8738 Playing with autoscan.
8739
8740 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
8741 * src/files.c (skeleton_find): Remove, unused.
8742 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
8743 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
8744
87452002-09-13 Akim Demaille <akim@epita.fr>
8746
8747 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
8748 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
8749
87502002-09-13 Akim Demaille <akim@epita.fr>
8751
8752 * configure.ac: Require 2.54.
8753 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
8754 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
8755 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
8756 Remove, provided by Autoconf macros.
8757
87582002-09-12 Akim Demaille <akim@epita.fr>
8759
8760 * m4/prereq.m4: Update, from Coreutils 4.5.1.
8761
87622002-09-12 Akim Demaille <akim@epita.fr>
8763
8764 * m4/prereq.m4: Update, from Fileutils 4.1.5.
8765 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
8766 Reported by Martin Mokrejs.
8767
87682002-09-10 Akim Demaille <akim@epita.fr>
8769
8770 * src/parse-gram.y: Associate a human readable string to each
8771 token type.
8772 * tests/regression.at (Invalid inputs): Adjust.
8773
87742002-09-10 Gary V. Vaughan <gary@gnu.org>
8775
8776 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
8777 with an Autoconf-2.5x style configure.ac.
8778
87792002-09-06 Paul Eggert <eggert@twinsun.com>
8780
8781 * doc/bison.texinfo (Conditions): Make explicit that the GPL
8782 exception applies only to yacc.c. This is a modification of a
8783 patch originally suggested by Akim Demaille.
8784
87852002-09-06 Akim Demaille <akim@epita.fr>
8786
8787 * data/c.m4 (b4_copyright): Move the GPL exception comment from
8788 here to...
8789 * data/yacc.c: here.
8790
8791 * data/lalr1.cc (struct yyltype): Don't define it, since we use
8792 LocationType.
8793 (b4_ltype): Default to yy::Location from location.hh.
8794
87952002-09-04 Jim Meyering <jim@meyering.net>
8796
8797 * data/yacc.c: Guard the declaration of yytoknum also with
8798 `#ifdef YYPRINT', so it is declared only when used.
8799
88002002-09-04 Akim Demaille <akim@epita.fr>
8801
8802 * configure.in: Rename as...
8803 * configure.ac: this.
8804 Bump to 1.49c.
8805
88062002-09-04 Akim Demaille <akim@epita.fr>
8807
8808 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
8809 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
8810 translate maintainer only messages.
8811
88122002-08-12 Paul Eggert <eggert@twinsun.com>
8813
8814 Version 1.49b.
8815
8816 * Makefile.am (SUBDIRS): Remove intl.
8817 (DISTCLEANFILES): Remove.
8818 * NEWS: Mention that GNU M4 is now required. Clarify what is
8819 meant by "larger grammars". Mention the pt_BR translation.
8820 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
8821 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
8822 Bump version from 0.11.2 to 0.11.5.
8823 (BISON_PREREQ_STAGE): Remove.
8824 (AM_GNU_GETTEXT): Use external gettext.
8825 (AC_OUTPUT): Remove intl/Makefile.
8826
8827 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
8828
8829 * data/glr.c: Include string.h, for strlen.
8830 (yyreportParseError): Use size_t for yysize.
8831 (yy_yypstack): No longer nested inside yypstates, as nested
8832 functions are not portable. Do not assume size_t is the
8833 same width as int.
8834 (yypstates): Do not assume that ptrdiff_t is the same width
8835 as int, and similarly for yyposn and YYINDEX.
8836
8837 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
8838
8839 * lib/Makefile.am (INCLUDES): Do not include from the intl
8840 directory, which has been removed.
8841 * src/Makefile.am (INCLUDES): Likewise.
8842
8843 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
8844 (bitsets_sources, additional_bitsets_sources, timevars_sources):
8845 New vars.
8846
8847 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
8848 * tests/Makefile.am (EXTRA_DIST): Likewise.
8849
8850 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
8851 Do not assume that bitset_windex is the same width as unsigned.
8852
8853 * lib/abitset.c (abitset_unused_clear): Do not assume that
8854 bitset_word is the same width as int.
8855 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
8856 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
8857 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
8858 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
8859 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
8860
8861 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
8862 portability to one's complement hosts!).
8863 * lib/ebitset.c (ebitset_op1): Likewise.
8864 * lib/lbitset.c (lbitset_op1): Likewise.
8865
8866 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
8867 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8868 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
8869 Sync with fileutils.
8870 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
8871 lib/gettext.h: Sync with diffutils.
8872
8873 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
8874 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
8875
8876 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
8877 PROTOTYPES to check for prototypes, and "defined __STDC__" to
8878 check for void *.
8879
8880 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
8881 size_t; the old version tried to do this but casted improperly.
8882 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
8883 (bitset_test): Now returns int, not unsigned long.
8884
8885 * lib/bitset_stats.c: Include "gettext.h".
8886 (_): New macro.
8887 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
8888 name locals "index", as it generates unnecessary warnings on some
8889 hosts that have an "index" function.
8890
8891 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
8892 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
8893 they need translation.
8894 * src/LR0.c (state_list_append, new_itemsets, get_state,
8895 append_states, generate_states): Likewise.
8896 * src/assoc.c (assoc_to_string): Likewise.
8897 * src/closure.c (print_closure, set_firsts, closure): Likewise.
8898 * src/gram.c (grammar_dump): Likewise.
8899 * src/injections.c (injections_compute): Likewise.
8900 * src/lalr.c (lookaheads_print): Likewise.
8901 * src/relation.c (relation_transpose): Likewise.
8902 * src/scan-gram.l: Likewise.
8903 * src/tables.c (table_grow, pack_vector): Likewise.
8904
8905 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
8906 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
8907 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
8908 * m4/mbstate_t.m4: Sync with fileutils.
8909 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
8910
8911 * po/LINGUAS: Add pt_BR.
8912 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
8913 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
8914 lib/timevar.c.
8915 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
8916 manual recommends.
8917 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
8918
8919 * src/complain.c (strerror_r): Remove decl; not needed.
8920 (strerror): Use same pattern as ../lib/error.c.
8921
8922 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
8923
8924 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
8925
8926 * src/main.c (main): Cast result of bindtextdomain and textdomain
8927 to void, to avoid a GCC warning when --disable-nls is in effect.
8928
8929 * src/scan-gram.l: Use strings rather than escapes when possible,
8930 to minimize the number of warnings from xgettext.
8931 (handle_action_dollar, handle_action_at): Don't use isdigit,
8932 as it mishandles negative chars and it may not work as expected
8933 outside the C locale.
8934
8935 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
8936 this is a GCC extension and is not portable to other compilers.
8937
8938 * src/system.h (alloca): Use same pattern as ../lib/error.c.
8939 Do not include <ctype.h>; no longer needed.
8940 Do not include <malloc.h>; no longer needed (and generates
8941 warnings on OpenBSD 3.0).
8942
8943 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
8944 it's not portable.
8945
8946 * tests/regression.at: Do not use 'cc -c input.c -o input';
8947 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
8948
8949 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
8950 exit status as failure, not just exit status 1. Sun C exits
8951 with status 2 sometimes.
8952
8953 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
8954 Use it for the two large tests.
8955
89562002-08-02 Akim Demaille <akim@epita.fr>
8957
8958 * src/conflicts.c (conflicts_output): Don't output rules never
8959 reduced here, since anyway that computation doesn't work.
8960 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
8961 (rule_useless_p, rule_never_reduced_p): New.
8962 (grammar_rules_partial_print): Use a filter instead of a range.
8963 Display the title only if needed.
8964 (grammar_rules_print): Adjust.
8965 (grammar_rules_never_reduced_report): New.
8966 * src/tables.c (action_row): Move the computation of rules never
8967 reduced to...
8968 (token_actions): here.
8969 * src/main.c (main): Make the parser before making the report, so
8970 that rules never reduced are computed.
8971 Call grammar_rules_never_reduced_report.
8972 * src/print.c (print_results): Report rules never reduced.
8973 * tests/conflicts.at, tests/reduce.at: Adjust.
8974
89752002-08-01 Akim Demaille <akim@epita.fr>
8976
8977 Instead of attaching lookaheads and duplicating the rules being
8978 reduced by a state, attach the lookaheads to the reductions.
8979
8980 * src/state.h (state_t): Remove the `lookaheads',
8981 `lookaheads_rule' member.
8982 (reductions_t): Add a `lookaheads' member.
8983 Use a regular array for the `rules'.
8984 * src/state.c (reductions_new): Initialize the lookaheads member
8985 to 0.
8986 (state_rule_lookaheads_print): Adjust.
8987 * src/state.h, src/state.c (state_reductions_find): New.
8988 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
8989 (count_rr_conflicts): Adjust.
8990 * src/lalr.c (LArule): Remove.
8991 (add_lookback_edge): Adjust.
8992 (state_lookaheads_count): New.
8993 (states_lookaheads_initialize): Merge into...
8994 (initialize_LA): this.
8995 (lalr_free): Adjust.
8996 * src/main.c (main): Don't free nullable and derives too early: it
8997 is used by --verbose.
8998 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
8999
90002002-08-01 Akim Demaille <akim@epita.fr>
9001
9002 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
9003 `rule_number_t**'.
9004 (set_derives, free_derives): Rename as...
9005 (derives_compute, derives_free): this.
9006 Adjust all dependencies.
9007 * src/nullable.c (set_nullable, free_nullable): Rename as...
9008 (nullable_compute, nullable_free): these.
9009 (rule_list_t): Store rule_t *, not rule_number_t.
9010 * src/state.c (state_rule_lookaheads_print): Directly compare rule
9011 pointers, instead of their numbers.
9012 * src/main.c (main): Call nullable_free, and derives_free earlier,
9013 as they were lo longer used.
9014
90152002-08-01 Akim Demaille <akim@epita.fr>
9016
9017 * lib/timevar.c (get_time): Include children time.
9018 * src/lalr.h (LA, LArule): Don't export them: used with the
9019 state_t.
9020 * src/lalr.c (LA, LArule): Static.
9021 * src/lalr.h, src/lalr.c (lalr_free): New.
9022 * src/main.c (main): Call it.
9023 * src/tables.c (pack_vector): Check whether loc is >= to the
9024 table_size, not >.
9025 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
9026 (tables_generate): do it, since that's also it which allocates
9027 them.
9028 Don't free LA and LArule, main does.
9029
90302002-07-31 Akim Demaille <akim@epita.fr>
9031
9032 Separate parser tables computation and output.
9033
9034 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
9035 (conflict_list, conflict_list_cnt, table, check, table_ninf)
9036 (yydefgoto, yydefact, high): Move to...
9037 * src/tables.h, src/tables.c: here.
9038 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9039 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9040 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
9041 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
9042 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
9043 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
9044 (action_row, save_row, token_actions, save_column, default_goto)
9045 (goto_actions, sort_actions, matching_state, pack_vector)
9046 (table_ninf_remap, pack_table, prepare_actions): Move to...
9047 * src/tables.c: here.
9048 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
9049 * src/output.c (token_actions, output_base, output_conflicts)
9050 (output_check): Merge into...
9051 (prepare_actions): this.
9052 (actions_output): Rename as...
9053 (user_actions_output): this.
9054 * src/main.c (main): Call tables_generate and tables_free.
9055
90562002-07-31 Akim Demaille <akim@epita.fr>
9057
9058 Steal GCC's --time-report support.
9059
9060 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
9061 stolen/adjusted from GCC.
9062 * m4/stage.m4: Remove time related checks.
9063 * m4/timevar.m4: New.
9064 * configure.in: Adjust.
9065 * src/system.h: Adjust to using timevar.h.
9066 * src/getargs.h, src/getargs.c: Support trace_time for
9067 --trace=time.
9068 * src/main.c (stage): Remove.
9069 (main): Replace `stage' invocations with timevar calls.
9070 * src/output.c: Insert pertinent timevar calls.
9071
90722002-07-31 Akim Demaille <akim@epita.fr>
9073
9074 Let --trace have arguments.
9075
9076 * src/getargs.h (enum trace_e): New.
9077 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
9078 (long_options, short_options): --trace/-T takes an optional
9079 argument.
9080 Change all the uses of trace_flag to reflect the new flags.
9081 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
9082
9083 Strengthen `stage' portability.
9084
9085 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
9086 * configure.in: Use it.
9087 Don't check for malloc.h and sys/times.h.
9088 * src/system.h: Include them when appropriate.
9089 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
9090 times and struct tms are available.
9091
90922002-07-30 Akim Demaille <akim@epita.fr>
9093
9094 In verbose parse error message, don't report `error' as an
9095 expected token.
9096 * tests/actions.at (Printers and Destructors): Adjust.
9097 * tests/calc.at (Calculator $1): Adjust.
9098 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
9099 error message, do not report the parser accepts the error token in
9100 that state.
9101
91022002-07-30 Akim Demaille <akim@epita.fr>
9103
9104 Normalize conflict related messages.
9105
9106 * src/complain.h, src/complain.c (warn, complain): New.
9107 * src/conflicts.c (conflicts_print): Use them.
9108 (conflict_report_yacc): New, extracted from...
9109 (conflicts_print): here.
9110 * tests/conflicts.at, tests/existing.at: Adjust.
9111
91122002-07-30 Akim Demaille <akim@epita.fr>
9113
9114 Report rules which are never reduced by the parser: those hidden
9115 by conflicts.
9116
9117 * src/LR0.c (save_reductions): Don't make the final state too
9118 different: save its reduction (accept) instead of having a state
9119 without any action (no shift or goto, no reduce).
9120 Note: the final state is now a ``regular'' state, i.e., the
9121 parsers now contain `reduce 0' as default reduction.
9122 Nevertheless, since they decide to `accept' when yystate =
9123 final_state, they still will not reduce rule 0.
9124 * src/print.c (print_actions, print_reduction): Adjust.
9125 * src/output.c (action_row): Track reduced rules.
9126 (token_actions): Report rules never reduced.
9127 * tests/conflicts.at, tests/regression.at: Adjust.
9128
91292002-07-30 Akim Demaille <akim@epita.fr>
9130
9131 `stage' was accidently included in a previous patch.
9132 Initiate its autoconfiscation.
9133
9134 * configure.in: Look for malloc.h and sys/times.h.
9135 * src/main.c (stage): Adjust.
9136 Report only when trace_flag.
9137
91382002-07-29 Akim Demaille <akim@epita.fr>
9139
9140 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
9141 state_number_t.
9142 (errs_t): symbol_t*, not symbol_number_t.
9143 (reductions_t): rule_t*, not rule_number_t.
9144 (FOR_EACH_SHIFT): New.
9145 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
9146 * src/print.c, src/print_graph.c: Adjust.
9147
91482002-07-29 Akim Demaille <akim@epita.fr>
9149
9150 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
9151
9152 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
9153 (endtoken, accept): these.
9154 * src/reader.c (reader): Set endtoken's default tag to "$end".
9155 Set undeftoken's tag to "$undefined" instead of "$undefined.".
9156 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
9157 Adjust.
9158
91592002-07-29 Akim Demaille <akim@epita.fr>
9160
9161 * src/reduce.c (reduce_grammar): When the language is empty,
9162 complain about the start symbol, not the axiom.
9163 Use its location.
9164 * tests/reduce.at (Empty Language): New.
9165
91662002-07-26 Akim Demaille <akim@epita.fr>
9167
9168 * src/reader.h, src/reader.c (gram_error): ... can't get
9169 yycontrol without making too strong assumptions on the parser
9170 itself.
9171 * src/output.c (prepare_tokens): Use the real 0th value of
9172 token_translations instead of `0'.
9173 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
9174 visible here.
9175 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
9176 for the time being: %locations ought to provide it to yyerror.
9177
91782002-07-25 Akim Demaille <akim@epita.fr>
9179
9180 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
9181 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
9182 * tests/regression.at (Web2c Actions): Adjust.
9183
91842002-07-25 Akim Demaille <akim@epita.fr>
9185
9186 Stop storing rules from 1 to nrules + 1.
9187
9188 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
9189 * src/nullable.c, src/output.c, src/print.c, src/reader.c
9190 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
9191 Iterate from 0 to nrules.
9192 Use rule_number_as_item_number and item_number_as_rule_number.
9193 Adjust to `derive' now containing possibly 0.
9194 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
9195 Handle the `- 1' part in rule numbers from/to item numbers.
9196 * src/conflicts.c (log_resolution): Fix the message which reversed
9197 shift and reduce.
9198 * src/output.c (action_row): Initialize default_rule to -1.
9199 (token_actions): Adjust.
9200 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
9201 expected output.
9202 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
9203
92042002-07-25 Akim Demaille <akim@epita.fr>
9205
9206 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
9207 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
9208 (b4_c_knr_arg_decl): New.
9209 * data/yacc.c: Use it to define yysymprint, yydestruct, and
9210 yyreport_parse_error.
9211
92122002-07-25 Akim Demaille <akim@epita.fr>
9213
9214 * data/yacc.c (yyreport_parse_error): New, extracted from...
9215 (yyparse): here.
9216 (yydestruct, yysymprint): Move above yyparse.
9217 Be K&R compliant.
9218
92192002-07-25 Akim Demaille <akim@epita.fr>
9220
9221 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
9222 replace...
9223 (b4_sint_type, b4_uint_type): these.
9224 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
9225 * tests/regression.at (Web2c Actions): Adjust.
9226
92272002-07-25 Akim Demaille <akim@epita.fr>
9228
9229 * src/gram.h (TIEM_NUMBER_MAX): New.
9230 (item_number_of_rule_number, rule_number_of_item_number): Rename
9231 as...
9232 (rule_number_as_item_number, item_number_as_rule_number): these.
9233 Adjust dependencies.
9234 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
9235 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
9236 (symbol_number_to_vector_number): New.
9237 (order): Of vector_number_t* type.
9238 (base_t, BASE_MAX, BASE_MIN): New.
9239 (froms, tos, width, pos, check): Of base_t type.
9240 (action_number_t, ACTION_MIN, ACTION_MAX): New.
9241 (actrow): Of action_number_t type.
9242 (conflrow): Of unsigned int type.
9243 (table_ninf, base_ninf): New.
9244 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
9245 (muscle_insert_int_table, muscle_insert_base_table)
9246 (muscle_insert_rule_number_table): New.
9247 (prepare_tokens): Output `toknum' as int_table.
9248 (action_row): Returns a rule_number_t.
9249 Use ACTION_MIN, not SHRT_MIN.
9250 (token_actions): yydefact is rule_number_t*.
9251 (table_ninf_remap): New.
9252 (pack_table): Use it for `base' and `table'.
9253 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
9254 replaced with...
9255 (YYPACT_NINF, YYTABLE_NINF): these.
9256 (yypact, yytable): Compute their types instead of hard-coded
9257 `short'.
9258 * tests/regression.at (Web2c Actions): Adjust.
9259
92602002-07-19 Akim Demaille <akim@epita.fr>
9261
9262 * src/scan-gram.l (id): Can start with an underscore.
9263
92642002-07-16 Akim Demaille <akim@epita.fr>
9265
9266 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
9267 Adjust all former `associativity' dependencies.
9268 * src/symtab.c (symbol_new): Default associativity is `undef', not
9269 `right'.
9270 (symbol_check_alias_consistence): Adjust.
9271
92722002-07-09 Akim Demaille <akim@epita.fr>
9273
9274 * doc/bison.texinfo: Properly set the ``header'' part.
9275 Use @dircategory ``GNU programming tools'' as per Texinfo's
9276 documentation.
9277 Use @copying.
9278
92792002-07-09 Akim Demaille <akim@epita.fr>
9280
9281 * lib/quotearg.h: Protect against multiple inclusions.
9282 * src/location.h (location_t): Add a `file' member.
9283 (LOCATION_RESET, LOCATION_PRINT): Adjust.
9284 * src/complain.c (warn_at, complain_at, fatal_at): Drop
9285 `error_one_per_line' support.
9286
92872002-07-09 Akim Demaille <akim@epita.fr>
9288
9289 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
9290 * src/reader.c (lineno): Remove.
9291 Adjust all dependencies.
9292 (get_merge_function): Take a location and use complain_at.
9293 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
9294 * tests/regression.at (Invalid inputs, Mixing %token styles):
9295 Adjust.
9296
92972002-07-09 Akim Demaille <akim@epita.fr>
9298
9299 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
9300 recovery rule, and forbid extensions when --yacc.
9301 (gram_error): Use complain_at.
9302 * src/reader.c (reader): Exit if there were parse errors.
9303
93042002-07-09 Akim Demaille <akim@epita.fr>
9305
9306 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
9307 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
9308 Reported by R Blake <blakers@mac.com>.
9309
93102002-07-09 Akim Demaille <akim@epita.fr>
9311
9312 * data/yacc.c: Output the copyright notive in the header.
9313
93142002-07-03 Akim Demaille <akim@epita.fr>
9315
9316 * src/output.c (froms, tos): Are state_number_t.
9317 (save_column): sp, sp1, and sp2 are state_number_t.
9318 (prepare): Rename `final' as `final_state_number', `nnts' as
9319 `nterms_number', `nrules' as `rules_number', `nstates' as
9320 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
9321 unused.
9322 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
9323 * data/lalr1.cc (nsym_): Remove, unused.
9324
93252002-07-03 Akim Demaille <akim@epita.fr>
9326
9327 * src/lalr.h, src/lalr.c (goto_number_t): New.
9328 * src/lalr.c (goto_list_t): New.
9329 Propagate them.
9330 * src/nullable.c (rule_list_t): New.
9331 Propagate.
9332 * src/types.h: Remove.
9333
93342002-07-03 Akim Demaille <akim@epita.fr>
9335
9336 * src/closure.c (print_fderives): Use rule_rhs_print.
9337 * src/derives.c (print_derives): Use rule_rhs_print.
9338 (rule_list_t): New, replaces `shorts'.
9339 (set_derives): Add comments.
9340 * tests/sets.at (Nullable, Firsts): Adjust.
9341
93422002-07-03 Akim Demaille <akim@epita.fr>
9343
9344 * src/output.c (prepare_actions): Free `tally' and `width'.
9345 (prepare_actions): Allocate and free `order'.
9346 * src/symtab.c (symbols_free): Free `symbols'.
9347 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
9348 * src/output.c (m4_invoke): Move to...
9349 * src/scan-skel.l: here.
9350 (<<EOF>>): Close yyout, and free its name.
9351
93522002-07-03 Akim Demaille <akim@epita.fr>
9353
9354 Fix some memory leaks, and fix a bug: state 0 was examined twice.
9355
9356 * src/LR0.c (new_state): Merge into...
9357 (state_list_append): this.
9358 (new_states): Merge into...
9359 (generate_states): here.
9360 (set_states): Don't ensure a proper `errs' state member here, do it...
9361 * src/conflicts.c (conflicts_solve): here.
9362 * src/state.h, src/state.c: Comment changes.
9363 (state_t): Rename member `shifts' as `transitions'.
9364 Adjust all dependencies.
9365 (errs_new): For consistency, also take the values as argument.
9366 (errs_dup): Remove.
9367 (state_errs_set): New.
9368 (state_reductions_set, state_transitions_set): Assert that no
9369 previous value was assigned.
9370 (state_free): New.
9371 (states_free): Use it.
9372 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
9373 temporary storage: use `errs' and `nerrs' as elsewhere.
9374 (set_conflicts): Allocate and free this `errs'.
9375
93762002-07-02 Akim Demaille <akim@epita.fr>
9377
9378 * lib/libiberty.h: New.
9379 * lib: Update the bitset implementation from upstream.
9380 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
9381 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
9382 * src/main.c: Adjust bitset stats calls.
9383
93842002-07-01 Paul Eggert <eggert@twinsun.com>
9385
9386 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
9387 char, so that negative chars don't collide with $.
9388
93892002-06-30 Akim Demaille <akim@epita.fr>
9390
9391 Have the GLR tests be `warning' checked, and fix the warnings.
9392
9393 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
9394 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
9395 (yyremoveDeletes): `yyi' and `yyj' are size_t.
9396 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
9397 (yyaddDeferredAction): static.
9398 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
9399 (yyreportParseError): yyprefix is const.
9400 yytokenp is used only when verbose.
9401 (yy__GNUC__): Replace with __GNUC__.
9402 (yypdumpstack): yyi is size_t.
9403 (yypreference): Un-yy local variables and arguments, to avoid
9404 clashes with `yyr1'. Anyway, we are not in the user name space.
9405 (yytname_size): be an int, as is compared with ints.
9406 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
9407 Use them.
9408 * tests/cxx-gram.at: Use quotation to protect $1.
9409 Use AT_COMPILE to enable warnings hunts.
9410 Prototype yylex and yyerror.
9411 `Use' argc.
9412 Include `string.h', not `strings.h'.
9413 Produce and prototype stmtMerge only when used.
9414 yylex takes a location.
9415
94162002-06-30 Akim Demaille <akim@epita.fr>
9417
9418 We spend a lot of time in quotearg, in particular when --verbose.
9419
9420 * src/symtab.c (symbol_get): Store a quoted version of the key.
9421 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
9422 Adjust all callers.
9423
94242002-06-30 Akim Demaille <akim@epita.fr>
9425
9426 * src/state.h (reductions_t): Rename member `nreds' as num.
9427 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
9428 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
9429
94302002-06-30 Akim Demaille <akim@epita.fr>
9431
9432 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
9433 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
9434 (shifts_to): Rename as...
9435 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
9436 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
9437 (TRANSITION_IS_DISABLED, transitions_to): these.
9438
94392002-06-30 Akim Demaille <akim@epita.fr>
9440
9441 * src/print.c (print_shifts, print_gotos): Merge into...
9442 (print_transitions): this.
9443 (print_transitions, print_errs, print_reductions): Align the
9444 lookaheads columns.
9445 (print_core, print_transitions, print_errs, print_state,
9446 print_grammar): Output empty lines separator before, not after.
9447 (state_default_rule_compute): Rename as...
9448 (state_default_rule): this.
9449 * tests/conflicts.at (Defaulted Conflicted Reduction),
9450 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
9451 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
9452
94532002-06-30 Akim Demaille <akim@epita.fr>
9454
9455 Display items as we display rules.
9456
9457 * src/gram.h, src/gram.c (rule_lhs_print): New.
9458 * src/gram.c (grammar_rules_partial_print): Use it.
9459 * src/print.c (print_core): Likewise.
9460 * tests/conflicts.at (Defaulted Conflicted Reduction),
9461 (Unresolved SR Conflicts): Adjust.
9462 (Unresolved SR Conflicts): Adjust and rename as...
9463 (Resolved SR Conflicts): this, as was meant.
9464 * tests/regression.at (Web2c Report): Adjust.
9465
94662002-06-30 Akim Demaille <akim@epita.fr>
9467
9468 * src/print.c (state_default_rule_compute): New, extracted from...
9469 (print_reductions): here.
9470 Pessimize, but clarify the code.
9471 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
9472
94732002-06-30 Akim Demaille <akim@epita.fr>
9474
9475 * src/output.c (action_row): Let default_rule be always a rule
9476 number.
9477
94782002-06-30 Akim Demaille <akim@epita.fr>
9479
9480 * src/closure.c (print_firsts, print_fderives, closure):
9481 Use BITSET_EXECUTE.
9482 * src/lalr.c (lookaheads_print): Likewise.
9483 * src/state.c (state_rule_lookaheads_print): Likewise.
9484 * src/print_graph.c (print_core): Likewise.
9485 * src/print.c (print_reductions): Likewise.
9486 * src/output.c (action_row): Likewise.
9487 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
9488
94892002-06-30 Akim Demaille <akim@epita.fr>
9490
9491 * src/print_graph.c: Use report_flag.
9492
94932002-06-30 Akim Demaille <akim@epita.fr>
9494
9495 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
9496 to...
9497 * src/relation.h, src/relation.c (traverse, relation_digraph)
9498 (relation_print, relation_transpose): New.
9499
95002002-06-30 Akim Demaille <akim@epita.fr>
9501
9502 * src/state.h, src/state.c (shifts_to): New.
9503 * src/lalr.c (build_relations): Use it.
9504
95052002-06-30 Akim Demaille <akim@epita.fr>
9506
9507 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
9508 (item_number_of_rule_number, rule_number_of_item_number): New.
9509 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
9510 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
9511 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
9512 Propagate their use.
9513 Much remains to be done, in particular wrt `shorts' from types.h.
9514
95152002-06-30 Akim Demaille <akim@epita.fr>
9516
9517 * src/symtab.c (symbol_new): Initialize the `printer' member.
9518
95192002-06-30 Akim Demaille <akim@epita.fr>
9520
9521 * src/LR0.c (save_reductions): Remove, replaced by...
9522 * src/state.h, src/state.c (state_reductions_set): New.
9523 (reductions, errs): Rename as...
9524 (reductions_t, errs_t): these.
9525 Adjust all dependencies.
9526
95272002-06-30 Akim Demaille <akim@epita.fr>
9528
9529 * src/LR0.c (state_list_t, state_list_append): New.
9530 (first_state, last_state): Now symbol_list_t.
9531 (this_state): Remove.
9532 (new_itemsets, append_states, save_reductions): Take a state_t as
9533 argument.
9534 (set_states, generate_states): Adjust.
9535 (save_shifts): Remove, replaced by...
9536 * src/state.h, src/state.c (state_shifts_set): New.
9537 (shifts): Rename as...
9538 (shifts_t): this.
9539 Adjust all dependencies.
9540 * src/state.h (state_t): Remove the `next' member.
9541
95422002-06-30 Akim Demaille <akim@epita.fr>
9543
9544 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
9545 escaped in slot 0.
9546
95472002-06-30 Akim Demaille <akim@epita.fr>
9548
9549 Use hash.h for the state hash table.
9550
9551 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
9552 (allocate_storage): Use state_hash_new.
9553 (free_storage): Use state_hash_free.
9554 (new_state, get_state): Adjust.
9555 * src/lalr.h, src/lalr.c (states): Move to...
9556 * src/states.h (state_t): Remove the `link' member, no longer
9557 used.
9558 * src/states.h, src/states.c: here.
9559 (state_hash_new, state_hash_free, state_hash_lookup)
9560 (state_hash_insert, states_free): New.
9561 * src/states.c (state_table, state_compare, state_hash): New.
9562 * src/output.c (output_actions): Do not free states now, since we
9563 still need to know the final_state number in `prepare', called
9564 afterwards. Do it...
9565 * src/main.c (main): here: call states_free after `output'.
9566
95672002-06-30 Akim Demaille <akim@epita.fr>
9568
9569 * src/state.h, src/state.c (state_new): New, extracted from...
9570 * src/LR0.c (new_state): here.
9571 * src/state.h (STATE_ALLOC): Move to...
9572 * src/state.c: here.
9573 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
9574 * src/state.h, src/state.c: here.
9575
95762002-06-30 Akim Demaille <akim@epita.fr>
9577
9578 * src/reader.c (gensym): Rename as...
9579 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
9580 (getsym): Rename as...
9581 (symbol_get): this.
9582
95832002-06-30 Akim Demaille <akim@epita.fr>
9584
9585 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
9586 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
9587 * src/output.c, src/print.c, src/print_graph.c: Propagate.
9588 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
9589
95902002-06-30 Akim Demaille <akim@epita.fr>
9591
9592 Make the test suite pass with warnings checked.
9593
9594 * tests/actions.at (Printers and Destructors): Improve.
9595 Avoid unsigned vs. signed issues.
9596 * tests/calc.at: Don't exercise the scanner here, do it...
9597 * tests/input.at (Torturing the Scanner): here.
9598
95992002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9600
9601 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
9602 reorganize first lines parallel to yacc.c.
9603
96042002-06-28 Akim Demaille <akim@epita.fr>
9605
9606 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
9607 (b4_token_enum, b4_token_defines): New, factored from...
9608 * data/lalr1.cc, data/yacc.c, glr.c: here.
9609
96102002-06-28 Akim Demaille <akim@epita.fr>
9611
9612 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
9613 unused variables.
9614 * src/output.c (merger_output): static.
9615
96162002-06-28 Akim Demaille <akim@epita.fr>
9617
9618 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
9619 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
9620 pacify GCC.
9621 * src/output.c (save_row): Initialize all the variables to pacify GCC.
9622
96232002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9624
9625 Accumulated changelog for new GLR parsing features.
9626
9627 * src/conflicts.c (count_total_conflicts): Change name to
9628 conflicts_total_count.
9629 * src/conflicts.h: Ditto.
9630 * src/output.c (token_actions): Use the new name.
9631 (output_conflicts): Change conflp => conflict_list_heads, and
9632 confl => conflict_list for better readability.
9633 * data/glr.c: Use the new names.
9634 * NEWS: Add self to GLR announcement.
9635
9636 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
9637
9638 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
9639 Akim Demaille.
9640
9641 * data/bison.glr: Change name to glr.c
9642 * data/glr.c: Renamed from bison.glr.
9643 * data/Makefile.am: Add glr.c
9644
9645 * src/getargs.c:
9646
9647 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
9648 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
9649
9650 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9651
9652 * data/bison.glr: Be sure to restore the
9653 current #line when returning to the skeleton contents after having
9654 exposed the input file's #line.
9655
9656 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9657
9658 * data/bison.glr: Bring up to date with changes to bison.simple.
9659
9660 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9661
9662 * data/bison.glr: Correct definitions that use b4_prefix.
9663 Various reformatting.
9664 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
9665 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
9666 yytokenp argument; now part of stack.
9667 (yychar): Define to behave as documented.
9668 (yyclearin): Ditto.
9669
9670 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9671
9672 * src/reader.h: Add declaration for free_merger_functions.
9673
9674 * src/reader.c (merge_functions): New variable.
9675 (get_merge_function): New function.
9676 (free_merger_functions): New function.
9677 (readgram): Check for %prec that is not followed by a symbol.
9678 Handle %dprec and %merge declarations.
9679 (packgram): Initialize dprec and merger fields in rules array.
9680
9681 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
9682 conflict_list_cnt, conflict_list_free): New variables.
9683 (table_grow): Also grow conflict_table.
9684 (prepare_rules): Output dprec and merger tables.
9685 (conflict_row): New function.
9686 (action_row): Output conflict lists for GLR parser. Don't use
9687 default reduction in conflicted states for GLR parser so that there
9688 are spaces for the conflict lists.
9689 (save_row): Also save conflict information.
9690 (token_actions): Allocate conflict list.
9691 (merger_output): New function.
9692 (pack_vector): Pack conflict table, too.
9693 (output_conflicts): New function to output yyconflp and yyconfl.
9694 (output_check): Allocate conflict_tos.
9695 (output_actions): Output conflict tables, also.
9696 (output_skeleton): Output b4_mergers definition.
9697 (prepare): Output b4_max_rhs_length definition.
9698 Use 'bison.glr' as default skeleton for GLR parsers.
9699
9700 * src/gram.c (glr_parser): New flag.
9701 (grammar_free): Call free_merger_functions.
9702
9703 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
9704 all pairs of conflicting reductions, rather than just all tokens
9705 causing conflicts. Needed to size conflict tables.
9706 (conflicts_output): Modify call to count_rr_conflicts for new
9707 interface.
9708 (conflicts_print): Ditto.
9709 (count_total_conflicts): New function.
9710
9711 * src/reader.h (merger_list): New type.
9712 (merge_functions): New variable.
9713
9714 * src/lex.h (tok_dprec, tok_merge): New token types.
9715
9716 * src/gram.h (rule_s): Add dprec and merger fields.
9717 (glr_parser): New flag.
9718
9719 * src/conflicts.h (count_total_conflicts): New function.
9720
9721 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
9722
9723 * doc/bison.texinfo (Generalized LR Parsing): New section.
9724 (GLR Parsers): New section.
9725 (Language and Grammar): Mention GLR parsing.
9726 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
9727 Correct typo ("tge" -> "the").
9728
9729 * data/bison.glr: New skeleton for GLR parsing.
9730
9731 * tests/cxx-gram.at: New tests for GLR parsing.
9732
9733 * tests/testsuite.at: Include cxx-gram.at.
9734
9735 * tests/Makefile.am: Add cxx-gram.at.
9736
9737 * src/parse-gram.y:
9738
9739 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
9740
9741 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
9742
97432002-06-27 Akim Demaille <akim@epita.fr>
9744
9745 * src/options.h, src/options.c: Remove.
9746 * src/getargs.c (short_options, long_options): New.
9747
97482002-06-27 Akim Demaille <akim@epita.fr>
9749
9750 * data/bison.simple, data/bison.c++: Rename as...
9751 * data/yacc.c, data/lalr1.cc: these.
9752 * doc/bison.texinfo (Environment Variables): Remove.
9753
97542002-06-25 Raja R Harinath <harinath@cs.umn.edu>
9755
9756 * src/getargs.c (report_argmatch): Initialize strtok().
9757
97582002-06-20 Akim Demaille <akim@epita.fr>
9759
9760 * data/bison.simple (b4_symbol_actions): New, replaces...
9761 (b4_symbol_destructor, b4_symbol_printer): these.
9762 (yysymprint): Be sure to call YYPRINT only for tokens, and using
9763 user token numbers.
9764
97652002-06-20 Akim Demaille <akim@epita.fr>
9766
9767 * data/bison.simple (yydestructor): Rename as...
9768 (yydestruct): this.
9769
97702002-06-20 Akim Demaille <akim@epita.fr>
9771
9772 * src/symtab.h, src/symtab.c (symbol_type_set)
9773 (symbol_destructor_set, symbol_precedence_set): The location is
9774 the last argument.
9775 Adjust all callers.
9776
97772002-06-20 Akim Demaille <akim@epita.fr>
9778
9779 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
9780 internals.
9781 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
9782 Takes a location.
9783 * src/symtab.h, src/symtab.c (symbol_class_set)
9784 (symbol_user_token_number_set): Likewise.
9785 Adjust all callers.
9786 Promote complain_at.
9787 * tests/input.at (Type Clashes): Adjust.
9788
97892002-06-20 Akim Demaille <akim@epita.fr>
9790
9791 * data/bison.simple (YYLEX): Fix the declaration when
9792 %pure-parser.
9793
97942002-06-20 Akim Demaille <akim@epita.fr>
9795
9796 * data/bison.simple (yysymprint): Don't print the token number,
9797 just its name.
9798 * tests/actions.at (Destructors): Rename as...
9799 (Printers and Destructors): this.
9800 Also exercise %printer.
9801
98022002-06-20 Akim Demaille <akim@epita.fr>
9803
9804 * data/bison.simple (YYDSYMPRINT): New.
9805 Use it to remove many of the #if YYDEBUG/if (yydebug).
9806
98072002-06-20 Akim Demaille <akim@epita.fr>
9808
9809 * src/symtab.h, src/symtab.c (symbol_t): printer and
9810 printer_location are new members.
9811 (symbol_printer_set): New.
9812 * src/parse-gram.y (PERCENT_PRINTER): New token.
9813 Handle its associated rule.
9814 * src/scan-gram.l: Adjust.
9815 (handle_destructor_at, handle_destructor_dollar): Rename as...
9816 (handle_symbol_code_at, handle_symbol_code_dollar): these.
9817 * src/output.c (symbol_printers_output): New.
9818 (output_skeleton): Call it.
9819 * data/bison.simple (yysymprint): New. Cannot be named yyprint
9820 since there are already many grammar files with a user `yyprint'.
9821 Replace the calls to YYPRINT to calls to yysymprint.
9822 * tests/calc.at: Adjust.
9823 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
9824 taking advantage of parser very internal details (stack size!).
9825
98262002-06-20 Akim Demaille <akim@epita.fr>
9827
9828 * src/scan-gram.l: Complete the scanner with the missing patterns
9829 to pacify Flex.
9830 Use `quote' and `symbol_tag_get' where appropriate.
9831
98322002-06-19 Akim Demaille <akim@epita.fr>
9833
9834 * tests/actions.at (Destructors): Augment to test locations.
9835 * data/bison.simple (yydestructor): Pass it the current location
9836 if locations are enabled.
9837 Prototype only when __STDC__ or C++.
9838 Change the argument names to move into the yy name space: there is
9839 user code here.
9840
98412002-06-19 Akim Demaille <akim@epita.fr>
9842
9843 * data/bison.simple (b4_pure_if): New.
9844 Use it instead of #ifdef YYPURE.
9845
98462002-06-19 Akim Demaille <akim@epita.fr>
9847
9848 * data/bison.simple (b4_location_if): New.
9849 Use it instead of #ifdef YYLSP_NEEDED.
9850
98512002-06-19 Akim Demaille <akim@epita.fr>
9852
9853 Prepare @$ in %destructor, but currently don't bind it in the
9854 skeleton, as %location use is not cleaned up yet.
9855
9856 * src/scan-gram.l (handle_dollar, handle_destructor_at)
9857 (handle_action_at): New.
9858 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
9859 a braced_code_t and a location as additional arguments.
9860 (handle_destructor_dollar): Instead of requiring `b4_eval', just
9861 unquote one when outputting `b4_dollar_dollar'.
9862 Adjust callers.
9863 * data/bison.simple (b4_eval): Remove.
9864 (b4_symbol_destructor): Adjust.
9865 * tests/input.at (Invalid @n): Adjust.
9866
98672002-06-19 Zack Weinberg <zack@codesourcery.com>
9868
9869 * doc/bison.texinfo: Document ability to have multiple
9870 prologue sections.
9871
98722002-06-18 Akim Demaille <akim@epita.fr>
9873
9874 * src/files.c (compute_base_names): When computing the output file
9875 names from the input file name, strip the directory part.
9876
98772002-06-18 Akim Demaille <akim@epita.fr>
9878
9879 * data/bison.simple.new: Comment changes.
9880 Reported by Andreas Schwab.
9881
98822002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
9883
9884 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
9885 there are no `label `yyoverflowlab' defined but not used' warnings
9886 when yyoverflow is defined.
9887
98882002-06-18 Akim Demaille <akim@epita.fr>
9889
9890 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
9891 new member.
9892 (symbol_destructor_set): Adjust.
9893 * src/output.c (symbol_destructors_output): Output the destructor
9894 locations.
9895 Output the symbol name.
9896 * data/bison.simple (b4_symbol_destructor): Adjust.
9897
98982002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
9899 and Akim Demaille <akim@epita.fr>
9900
9901 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
9902 what's left on the stack when the error recovery hits EOF.
9903 * tests/actions.at (Destructors): Complete to exercise this case.
9904
99052002-06-17 Akim Demaille <akim@epita.fr>
9906
9907 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
9908 arguments is really empty, not only equal to `[]'.
9909 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
9910 member.
9911 (symbol_destructor_set): New.
9912 * src/output.c (symbol_destructors_output): New.
9913 * src/reader.h (brace_code_t, current_braced_code): New.
9914 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
9915 (handle_dollar): Rename as...
9916 (handle_action_dollar): this.
9917 (handle_destructor_dollar): New.
9918 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
9919 (grammar_declaration): Use it.
9920 * data/bison.simple (yystos): Is always defined.
9921 (yydestructor): New.
9922 * tests/actions.at (Destructors): New.
9923 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
9924
99252002-06-17 Akim Demaille <akim@epita.fr>
9926
9927 * src/symlist.h, src/symlist.c (symbol_list_length): New.
9928 * src/scan-gram.l (handle_dollar, handle_at): Compute the
9929 rule_length only when needed.
9930 * src/output.c (actions_output, token_definitions_output): Output
9931 the full M4 block.
9932 * src/symtab.c: Don't access directly to the symbol tag, use
9933 symbol_tag_get.
9934 * src/parse-gram.y: Use symbol_list_free.
9935
99362002-06-17 Akim Demaille <akim@epita.fr>
9937
9938 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
9939 (symbol_list_prepend, get_type_name): Move to...
9940 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
9941 (symbol_list_prepend, symbol_list_n_type_name_get): here.
9942 Adjust all callers.
9943 (symbol_list_free): New.
9944 * src/scan-gram.l (handle_dollar): Takes a location.
9945 * tests/input.at (Invalid $n): Adjust.
9946
99472002-06-17 Akim Demaille <akim@epita.fr>
9948
9949 * src/reader.h, src/reader.c (symbol_list_new): Export it.
9950 (symbol_list_prepend): New.
9951 * src/parse-gram.y (%union): `list' is a new member.
9952 (symbols.1): New, replaces...
9953 (terms_to_prec.1, nterms_to_type.1): these.
9954 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
9955 Take a location as additional argument.
9956 Adjust all callers.
9957
99582002-06-15 Akim Demaille <akim@epita.fr>
9959
9960 * src/parse-gram.y: Move %token in the declaration section so that
9961 we don't depend upon CVS Bison.
9962
99632002-06-15 Akim Demaille <akim@epita.fr>
9964
9965 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
9966 * src/print.c (print_core): Use it.
9967
99682002-06-15 Akim Demaille <akim@epita.fr>
9969
9970 * src/conflicts.c (log_resolution): Accept the rule involved in
9971 the sr conflicts instead of the lookahead number that points to
9972 that rule.
9973 (flush_reduce): Accept the current lookahead vector as argument,
9974 instead of the index in LA.
9975 (resolve_sr_conflict): Accept the current number of lookahead
9976 bitset to consider for the STATE, instead of the index in LA.
9977 (set_conflicts): Adjust.
9978 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
9979
99802002-06-15 Akim Demaille <akim@epita.fr>
9981
9982 * src/state.h (state_t): Replace the `lookaheadsp' member, a
9983 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
9984 Adjust all dependencies.
9985 * src/lalr.c (initialize_lookaheads): Split into...
9986 (states_lookaheads_count, states_lookaheads_initialize): these.
9987 (lalr): Adjust.
9988
99892002-06-15 Akim Demaille <akim@epita.fr>
9990
9991 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
9992 out of...
9993 (grammar_rules_print): here.
9994 * src/reduce.c (reduce_output): Use it.
9995 * tests/reduce.at (Useless Rules, Reduced Automaton)
9996 (Underivable Rules): Adjust.
9997
99982002-06-15 Akim Demaille <akim@epita.fr>
9999
10000 Copy BYacc's nice way to report the grammar.
10001
10002 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
10003 New.
10004 Don't print the rules' location, it is confusing and useless.
10005 (rule_print): Use grammar_rhs_print.
10006 * src/print.c (print_grammar): Use grammar_rules_print.
10007
100082002-06-15 Akim Demaille <akim@epita.fr>
10009
10010 Complete and rationalize `useless thing' warnings.
10011
10012 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
10013 (symbol_tag_print): New.
10014 Use them everywhere in place of accessing directly the tag member.
10015 * src/gram.h, src/gram.c (rule_print): New.
10016 Use it where a rule used to be printed `by hand'.
10017 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
10018 (reduce_grammar_tables): Report the useless rules.
10019 (reduce_print): Useless things are a warning, not an error.
10020 Report it as such.
10021 * tests/reduce.at (Useless Nonterminals, Useless Rules):
10022 (Reduced Automaton, Underivable Rules): Adjust.
10023 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
10024 * tests/conflicts.at (Unresolved SR Conflicts)
10025 (Solved SR Conflicts): Adjust.
10026
100272002-06-15 Akim Demaille <akim@epita.fr>
10028
10029 Let symbols have a location.
10030
10031 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
10032 (getsym): Adjust.
10033 Adjust all callers.
10034 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
10035 Use location_t, not int.
10036 * src/symtab.c (symbol_check_defined): Take advantage of the
10037 location.
10038 * tests/regression.at (Invalid inputs): Adjust.
10039
100402002-06-15 Akim Demaille <akim@epita.fr>
10041
10042 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
10043 (input): Don't try to initialize yylloc here, do it in the
10044 scanner.
10045 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
10046 * src/gram.h (rule_t): Change line and action_line into location
10047 and action_location, of location_t type.
10048 Adjust all dependencies.
10049 * src/location.h, src/location.c (empty_location): New.
10050 * src/reader.h, src/reader.c (grammar_start_symbol_set)
10051 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
10052 (grammar_current_rule_symbol_append)
10053 (grammar_current_rule_action_append): Expect a location as argument.
10054 * src/reader.c (grammar_midrule_action): Adjust to attach an
10055 action's location as dummy symbol location.
10056 * src/symtab.h, src/symtab.c (startsymbol_location): New.
10057 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
10058 the line numbers.
10059
100602002-06-14 Akim Demaille <akim@epita.fr>
10061
10062 Grammar declarations may be found in the grammar section.
10063
10064 * src/parse-gram.y (rules_or_grammar_declaration): New.
10065 (declarations): Each declaration may end with a semicolon, not
10066 just...
10067 (grammar_declaration): `"%union"'.
10068 (grammar): Branch to rules_or_grammar_declaration.
10069
100702002-06-14 Akim Demaille <akim@epita.fr>
10071
10072 * src/main.c (main): Invoke scanner_free.
10073
100742002-06-14 Akim Demaille <akim@epita.fr>
10075
10076 * src/output.c (m4_invoke): Extracted from...
10077 (output_skeleton): here.
10078 Free tempfile.
10079
100802002-06-14 Akim Demaille <akim@epita.fr>
10081
10082 * src/parse-gram.y (directives, directive, gram)
10083 (grammar_directives, precedence_directives, precedence_directive):
10084 Rename as...
10085 (declarations, declaration, grammar, grammar_declaration)
10086 (precedence_declaration, precedence_declarator): these.
10087 (symbol_declaration): New.
10088
100892002-06-14 Akim Demaille <akim@epita.fr>
10090
10091 * src/files.c (action_obstack): Remove, unused.
10092 (output_obstack): Remove it, and all its dependencies, as it is no
10093 longer needed.
10094 * src/reader.c (epilogue_set): Build the epilogue in the
10095 muscle_obstack.
10096 * src/output.h, src/output.c (muscle_obstack): Move to...
10097 * src/muscle_tab.h, src/muscle_tab.h: here.
10098 (muscle_init): Initialize muscle_obstack.
10099 (muscle_free): New.
10100 * src/main.c (main): Call it.
10101
101022002-06-14 Akim Demaille <akim@epita.fr>
10103
10104 * src/location.h: New, extracted from...
10105 * src/reader.h: here.
10106 * src/Makefile.am (noinst_HEADERS): Merge into
10107 (bison_SOURCES): this.
10108 Add location.h.
10109 * src/parse-gram.y: Use location_t instead of Bison's.
10110 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
10111 Use location_t instead of ints.
10112
101132002-06-14 Akim Demaille <akim@epita.fr>
10114
10115 * data/bison.simple, data/bison.c++: Be sure to restore the
10116 current #line when returning to the skeleton contents after having
10117 exposed the input file's #line.
10118
101192002-06-12 Akim Demaille <akim@epita.fr>
10120
10121 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
10122 eager.
10123 * tests/actions.at (Exotic Dollars): New.
10124
101252002-06-12 Akim Demaille <akim@epita.fr>
10126
10127 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
10128 ['"/] too eagerly.
10129 * tests/input.at (Torturing the Scanner): New.
10130
101312002-06-11 Akim Demaille <akim@epita.fr>
10132
10133 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
10134 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
10135 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
10136 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
10137 * src/reader.c (reader): Use it.
10138
101392002-06-11 Akim Demaille <akim@epita.fr>
10140
10141 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
10142 Adjust all callers.
10143 (scanner_last_string_free): New.
10144
101452002-06-11 Akim Demaille <akim@epita.fr>
10146
10147 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
10148 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
10149 (last_string, YY_OBS_FREE): New.
10150 Use them when returning an ID.
10151
101522002-06-11 Akim Demaille <akim@epita.fr>
10153
10154 Have Bison grammars parsed by a Bison grammar.
10155
10156 * src/reader.c, src/reader.h (prologue_augment): New.
10157 * src/reader.c (copy_definition): Remove.
10158
10159 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
10160 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
10161 (grammar_current_rule_prec_set, grammar_current_rule_check)
10162 (grammar_current_rule_symbol_append)
10163 (grammar_current_rule_action_append): Export.
10164 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
10165 (symbol_list_action_append): Remove.
10166 Hook the routines from reader.
10167 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
10168 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
10169
10170 * src/reader.c (read_declarations): Remove, unused.
10171
10172 * src/parse-gram.y: Handle the epilogue.
10173 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
10174 (grammar_start_symbol_set): this.
10175 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
10176 * src/reader.c (readgram): Remove, unused.
10177 (reader): Adjust to insert eoftoken and axiom where appropriate.
10178
10179 * src/reader.c (copy_dollar): Replace with...
10180 * src/scan-gram.h (handle_dollar): this.
10181 * src/parse-gram.y: Remove `%thong'.
10182
10183 * src/reader.c (copy_at): Replace with...
10184 * src/scan-gram.h (handle_at): this.
10185
10186 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
10187 New.
10188
10189 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
10190 time being.
10191
10192 * src/reader.h, src/reader.c (grammar_rule_end): New.
10193
10194 * src/parse.y (current_type, current_class): New.
10195 Implement `%nterm', `%token' support.
10196 Merge `%term' into `%token'.
10197 (string_as_id): New.
10198 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
10199 type name.
10200
10201 * src/parse-gram.y: Be sure to handle properly the beginning of
10202 rules.
10203
10204 * src/parse-gram.y: Handle %type.
10205 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
10206
10207 * src/parse-gram.y: More directives support.
10208 * src/options.c: No longer handle source directives.
10209
10210 * src/parse-gram.y: Fix %output.
10211
10212 * src/parse-gram.y: Handle %union.
10213 Use the prologue locations.
10214 * src/reader.c (parse_union_decl): Remove.
10215
10216 * src/reader.h, src/reader.c (epilogue_set): New.
10217 * src/parse-gram.y: Use it.
10218
10219 * data/bison.simple, data/bison.c++: b4_stype is now either not
10220 defined, then default to int, or to the contents of %union,
10221 without `union' itself.
10222 Adjust.
10223 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
10224
10225 * src/output.c (actions_output): Don't output braces, as they are
10226 already handled by the scanner.
10227
10228 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
10229 characters to themselves.
10230
10231 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
10232 that the epilogue has a proper #line.
10233
10234 * src/parse-gram.y: Handle precedence/associativity.
10235
10236 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
10237 a terminal.
10238 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
10239 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
10240 at all to define terminals that cannot be emitted.
10241
10242 * src/scan-gram.l: Escape M4 characters.
10243
10244 * src/scan-gram.l: Working properly with escapes in user
10245 strings/characters.
10246
10247 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
10248 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
10249 grammar.
10250 Use more modest sizes, as for the time being the parser does not
10251 release memory, and therefore the process swallows a huge amount
10252 of memory.
10253
10254 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
10255 stricter %token grammar.
10256
10257 * src/symtab.h (associativity): Add `undef_assoc'.
10258 (symbol_precedence_set): Do nothing when passed an undef_assoc.
10259 * src/symtab.c (symbol_check_alias_consistence): Adjust.
10260
10261 * tests/regression.at (Invalid %directive): Remove, as it is now
10262 meaningless.
10263 (Invalid inputs): Adjust to the new error messages.
10264 (Token definitions): The new grammar doesn't allow too many
10265 eccentricities.
10266
10267 * src/lex.h, src/lex.c: Remove.
10268 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
10269 (copy_character, copy_string2, copy_string, copy_identifier)
10270 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
10271 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
10272 (parse_action): Remove.
10273 * po/POTFILES.in: Adjust.
10274
102752002-06-11 Akim Demaille <akim@epita.fr>
10276
10277 * src/reader.c (parse_action): Don't store directly into the
10278 rule's action member: return the action as a string.
10279 Don't require `rule_length' as an argument: compute it.
10280 (grammar_current_rule_symbol_append)
10281 (grammar_current_rule_action_append): New, eved out from
10282 (readgram): here.
10283 Remove `action_flag', `rulelength', unused now.
10284
102852002-06-11 Akim Demaille <akim@epita.fr>
10286
10287 * src/reader.c (grammar_current_rule_prec_set).
10288 (grammar_current_rule_check): New, eved out from...
10289 (readgram): here.
10290 Remove `xaction', `first_rhs': useless.
10291 * tests/input.at (Type clashes): New.
10292 * tests/existing.at (GNU Cim Grammar): Adjust.
10293
102942002-06-11 Akim Demaille <akim@epita.fr>
10295
10296 * src/reader.c (grammar_midrule_action): New, Eved out from
10297 (readgram): here.
10298
102992002-06-11 Akim Demaille <akim@epita.fr>
10300
10301 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
10302 New.
10303 (readgram): Use them as replacement of inlined code, crule and
10304 crule1.
10305
103062002-06-11 Akim Demaille <akim@epita.fr>
10307
10308 * src/reader.c (grammar_end, grammar_symbol_append): New.
10309 (readgram): Use them.
10310 Make the use of `p' as local as possible.
10311
103122002-06-10 Akim Demaille <akim@epita.fr>
10313
10314 GCJ's parser requires the tokens to be defined before the prologue.
10315
10316 * data/bison.simple: Output the token definition before the user's
10317 prologue.
10318 * tests/regression.at (Braces parsing, Duplicate string)
10319 (Mixing %token styles): Check the output from bison.
10320 (Early token definitions): New.
10321
103222002-06-10 Akim Demaille <akim@epita.fr>
10323
10324 * src/symtab.c (symbol_user_token_number_set): Don't complain when
10325 assigning twice the same user number to a token, so that we can
10326 use it in...
10327 * src/lex.c (lex): here.
10328 Also use `symbol_class_set' instead of hand written code.
10329 * src/reader.c (parse_assoc_decl): Likewise.
10330
103312002-06-10 Akim Demaille <akim@epita.fr>
10332
10333 * src/symtab.c, src/symtab.c (symbol_class_set)
10334 (symbol_user_token_number_set): New.
10335 * src/reader.c (parse_token_decl): Use them.
10336 Use a switch instead of ifs.
10337 Use a single argument.
10338
103392002-06-10 Akim Demaille <akim@epita.fr>
10340
10341 Remove `%thong' support as it is undocumented, unused, duplicates
10342 `%token's job, and creates useless e-mail traffic with people who
10343 want to know what it is, why it is undocumented, unused, and
10344 duplicates `%token's job.
10345
10346 * src/reader.c (parse_thong_decl): Remove.
10347 * src/options.c (option_table): Remove "thong".
10348 * src/lex.h (tok_thong): Remove.
10349
103502002-06-10 Akim Demaille <akim@epita.fr>
10351
10352 * src/symtab.c, src/symtab.c (symbol_type_set)
10353 (symbol_precedence_set): New.
10354 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
10355 (value_components_used): Remove, unused.
10356
103572002-06-09 Akim Demaille <akim@epita.fr>
10358
10359 Move symbols handling code out of the reader.
10360
10361 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
10362 (axiom): Move to...
10363 * src/symtab.h, src/symtab.c: here.
10364
10365 * src/gram.c (start_symbol): Remove: use startsymbol->number.
10366 * src/reader.c (startval): Rename as...
10367 * src/symtab.h, src/symtab.c (startsymbol): this.
10368 * src/reader.c: Adjust.
10369
10370 * src/reader.c (symbol_check_defined, symbol_make_alias)
10371 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
10372 (token_translations_init)
10373 Move to...
10374 * src/symtab.c: here.
10375 * src/reader.c (packsymbols): Move to...
10376 * src/symtab.h, src/symtab.c (symbols_pack): here.
10377 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
10378 argument.
10379
103802002-06-03 Akim Demaille <akim@epita.fr>
10381
10382 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
10383 then statements.
10384
103852002-06-03 Akim Demaille <akim@epita.fr>
10386
10387 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
10388 structs with non literals.
10389 * src/scan-skel.l: never-interactive.
10390 * src/conflicts.c (enum conflict_resolution_e): No trailing
10391 comma.
10392 * src/getargs.c (usage): Split long literal strings.
10393 Reported by Hans Aberg.
10394
103952002-05-28 Akim Demaille <akim@epita.fr>
10396
10397 * data/bison.c++: Use C++ ostreams.
10398 (cdebug_): New member.
10399
104002002-05-28 Akim Demaille <akim@epita.fr>
10401
10402 * src/output.c (output_skeleton): Be sure to allocate enough room
10403 for `/' _and_ for `\0' in full_skeleton.
10404
104052002-05-28 Akim Demaille <akim@epita.fr>
10406
10407 * data/bison.c++: Catch up with bison.simple:
10408 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10409 and Paul Eggert <eggert@twinsun.com>: `error' handing.
10410 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
10411 and popping traces.
10412
104132002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10414
10415 * src/output.c (output_skeleton): Put an explicit path in front of
10416 the skeleton file name, rather than relying on the -I directory,
10417 to partially alleviate effects of having a skeleton file lying around
10418 in the current directory.
10419
104202002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10421
10422 * src/conflicts.c (log_resolution): Correct typo:
10423 obstack_printf should be obstack_fgrow1.
10424
104252002-05-26 Akim Demaille <akim@epita.fr>
10426
10427 * src/state.h (state_t): `solved_conflicts' is a new member.
10428 * src/LR0.c (new_state): Set it to 0.
10429 * src/conflicts.h, src/conflicts.c (print_conflicts)
10430 (free_conflicts, solve_conflicts): Rename as...
10431 (conflicts_print, conflicts_free, conflicts_solve): these.
10432 Adjust callers.
10433 * src/conflicts.c (enum conflict_resolution_e)
10434 (solved_conflicts_obstack): New, used by...
10435 (log_resolution): this.
10436 Adjust to attach the conflict resolution to each state.
10437 Complete the description with the precedence/associativity
10438 information.
10439 (resolve_sr_conflict): Adjust.
10440 * src/print.c (print_state): Output its solved_conflicts.
10441 * tests/conflicts.at (Unresolved SR Conflicts)
10442 (Solved SR Conflicts): Exercise --report=all.
10443
104442002-05-26 Akim Demaille <akim@epita.fr>
10445
10446 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
10447 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
10448 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
10449 (token_number_t, item_number_as_token_number)
10450 (token_number_as_item_number, muscle_insert_token_number_table):
10451 Rename as...
10452 (symbol_number_t, item_number_as_symbol_number)
10453 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
10454 these, since it is more appropriate.
10455
104562002-05-26 Akim Demaille <akim@epita.fr>
10457
10458 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
10459 `Error:' lines.
10460 * data/bison.simple (yystos) [YYDEBUG]: New.
10461 (yyparse) [YYDEBUG]: Display the symbols which are popped during
10462 error recovery.
10463 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
10464
104652002-05-25 Akim Demaille <akim@epita.fr>
10466
10467 * doc/bison.texinfo (Debugging): Split into...
10468 (Tracing): this new section, its former contents, and...
10469 (Understanding): this new section.
10470 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
10471 by...
10472 (report_flag): this.
10473 Adjust all dependencies.
10474 (report_args, report_types, report_argmatch): New.
10475 (usage, getargs): Report/support -r, --report.
10476 * src/options.h
10477 (struct option_table_struct): Rename as..,
10478 (struct option_table_s): this.
10479 Rename the `set_flag' member to `flag' to match with getopt_long's
10480 struct.
10481 * src/options.c (option_table): Split verbose into an entry for
10482 %verbose, and another for --verbose.
10483 Support --report/-r, so remove -r from the obsolete --raw.
10484 * src/print.c: Attach full item sets and lookaheads reports to
10485 report_flag instead of trace_flag.
10486 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
10487
104882002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10489 and Paul Eggert <eggert@twinsun.com>
10490
10491 * data/bison.simple (yyparse): Correct error handling to conform to
10492 POSIX and yacc. Specifically, after syntax error is discovered,
10493 do not reduce further before shifting the error token.
10494 Clean up the code a bit by removing the labels yyerrdefault,
10495 yyerrhandle, yyerrpop.
10496 * NEWS: Document the above.
10497
104982002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10499
10500 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
10501 type; it isn't always big enough, since it doesn't necessarily
10502 include non-terminals.
10503 (yytranslate): Expand definition of yy_token_number_type, so that
10504 the latter can be removed.
10505 (yy_token_number_type): Remove, only one use.
10506 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
10507 don't use TokenNumberType as element type.
10508
10509 * tests/regression.at: Modify expected output to agree with change
10510 to yyr1 and yytranslate.
10511
105122002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
10513
10514 * src/reader.c (parse_action): Use copy_character instead of
10515 obstack_1grow.
10516
105172002-05-13 Akim Demaille <akim@epita.fr>
10518
10519 * tests/regression.at (Token definitions): Prototype yylex and
10520 yyerror.
10521
105222002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10523
10524 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
10525 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
10526 32-bit arithmetic.
10527 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
10528
105292002-05-07 Akim Demaille <akim@epita.fr>
10530
10531 * tests/synclines.at: Be sure to prototype yylex and yyerror to
10532 avoid GCC warnings.
10533
105342002-05-07 Akim Demaille <akim@epita.fr>
10535
10536 Kill GCC warnings.
10537
10538 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
10539 over the RHS of each rule.
10540 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
10541 * src/state.h (state_t): Member `nitems' is unsigned short.
10542 * src/LR0.c (get_state): Adjust.
10543 * src/reader.c (packgram): Likewise.
10544 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
10545 `Type'.
10546 (muscle_insert_int_table): Remove, unused.
10547 (prepare_rules): Remove `max'.
10548
105492002-05-06 Akim Demaille <akim@epita.fr>
10550
10551 * src/closure.c (print_firsts): Display of the symbol tags.
10552 (bitmatrix_print): Move to...
10553 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
10554 here.
10555 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
10556
105572002-05-06 Akim Demaille <akim@epita.fr>
10558
10559 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
10560 hash_do_for_each.
10561
105622002-05-06 Akim Demaille <akim@epita.fr>
10563
10564 * src/LR0.c (new_state, get_state): Instead of using the global
10565 `kernel_size' and `kernel_base', have two new arguments:
10566 `core_size' and `core'.
10567 Adjust callers.
10568
105692002-05-06 Akim Demaille <akim@epita.fr>
10570
10571 * src/reader.c (packgram): No longer end `ritem' with a 0
10572 sentinel: it is not used.
10573
105742002-05-05 Akim Demaille <akim@epita.fr>
10575
10576 New experimental feature: display the lookaheads in the report and
10577 graph.
10578
10579 * src/print (print_core): When --trace-flag, display the rules
10580 lookaheads.
10581 * src/print_graph.c (print_core): Likewise.
10582 Swap the arguments.
10583 Adjust caller.
10584
105852002-05-05 Akim Demaille <akim@epita.fr>
10586
10587 * tests/torture.at (Many lookaheads): New test.
10588
105892002-05-05 Akim Demaille <akim@epita.fr>
10590
10591 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
10592 (GENERATE_MUSCLE_INSERT_TABLE): this.
10593 (output_int_table, output_unsigned_int_table, output_short_table)
10594 (output_token_number_table, output_item_number_table): Replace with...
10595 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
10596 (muscle_insert_short_table, muscle_insert_token_number_table)
10597 (muscle_insert_item_number_table): these.
10598 Adjust all callers.
10599 (prepare_tokens): Don't free `translations', since...
10600 * src/reader.h, src/reader.c (grammar_free): do it.
10601 Move to...
10602 * src/gram.h, src/gram.c (grammar_free): here.
10603 * data/bison.simple, data/bison.c++: b4_token_number_max is now
10604 b4_translate_max.
10605
106062002-05-05 Akim Demaille <akim@epita.fr>
10607
10608 * src/output.c (output_unsigned_int_table): New.
10609 (prepare_rules): `i' is unsigned.
10610 `prhs', `rline', `r2' are unsigned int.
10611 Rename muscle `rhs_number_max' as `rhs_max'.
10612 Output muscles `prhs_max', `rline_max', and `r2_max'.
10613 Free rline and r1.
10614 * data/bison.simple, data/bison.c++: Adjust to use these muscles
10615 to compute types instead of constant types.
10616 * tests/regression.at (Web2c Actions): Adjust.
10617
106182002-05-04 Akim Demaille <akim@epita.fr>
10619
10620 * src/symtab.h (SALIAS, SUNDEF): Rename as...
10621 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
10622 Adjust dependencies.
10623 * src/output.c (token_definitions_output): Be sure not to output a
10624 `#define 'a'' when fed with `%token 'a' "a"'.
10625 * tests/regression.at (Token definitions): New.
10626
106272002-05-03 Paul Eggert <eggert@twinsun.com>
10628
10629 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
10630 for K&R C.
10631
106322002-05-03 gettextize <bug-gnu-gettext@gnu.org>
10633
10634 * Makefile.am (SUBDIRS): Remove intl.
10635 (EXTRA_DIST): Add config/config.rpath.
10636
106372002-05-03 Akim Demaille <akim@epita.fr>
10638
10639 * data/bison.simple (m4_if): Don't output empty enums.
10640 And actually, output valid enum definitions :(.
10641
106422002-05-03 Akim Demaille <akim@epita.fr>
10643
10644 * configure.bat: Remove, completely obsolete.
10645 * Makefile.am (EXTRA_DIST): Adjust.
10646 Don't distribute config.rpath...
10647 * config/Makefile.am (EXTRA_DIST): Do it.
10648
106492002-05-03 Akim Demaille <akim@epita.fr>
10650
10651 * configure.in (GETTEXT_VERSION): New.
10652 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
10653
106542002-05-03 Akim Demaille <akim@epita.fr>
10655
10656 * data/bison.simple (b4_token_enum): New.
10657 (b4_token_defines): Use it to output tokens both as #define and
10658 enums.
10659 Suggested by Paul Eggert.
10660 * src/output.c (token_definitions_output): Don't output spurious
10661 white spaces.
10662
106632002-05-03 Akim Demaille <akim@epita.fr>
10664
10665 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
10666
106672002-05-02 Robert Anisko <robert@lrde.epita.fr>
10668
10669 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
10670 Update the stack class, give a try to deque as the default container.
10671
106722002-05-02 Akim Demaille <akim@epita.fr>
10673
10674 * data/bison.simple (yyparse): Do not implement @$ = @1.
10675 (YYLLOC_DEFAULT): Adjust to do it.
10676 * doc/bison.texinfo (Location Default Action): Fix.
10677
106782002-05-02 Akim Demaille <akim@epita.fr>
10679
10680 * src/reader.c (parse_braces): Merge into...
10681 (parse_action): this.
10682
106832002-05-02 Akim Demaille <akim@epita.fr>
10684
10685 * configure.in (ALL_LINGUAS): Remove.
10686 * po/LINGUAS, hr.po: New.
10687
106882002-05-02 Akim Demaille <akim@epita.fr>
10689
10690 Remove the so called hairy (semantic) parsers.
10691
10692 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
10693 * src/gram.h, src/gram.c (semantic_parser): Remove.
10694 (rule_t): Remove the guard and guard_line members.
10695 * src/lex.h (token_t): remove tok_guard.
10696 * src/options.c (option_table): Remove %guard and %semantic_parser
10697 support.
10698 * src/output.c, src/output.h (guards_output): Remove.
10699 (prepare): Adjust.
10700 (token_definitions_output): Don't output the `T'
10701 tokens (???).
10702 (output_skeleton): Don't output the guards.
10703 * src/files.c, src/files.c (attrsfile): Remove.
10704 * src/reader.c (symbol_list): Remove the guard and guard_line
10705 members.
10706 Adjust dependencies.
10707 (parse_guard): Remove.
10708 * data/bison.hairy: Remove.
10709 * doc/bison.texinfo (Environment Variables): Remove occurrences of
10710 BISON_HAIRY.
10711
107122002-05-02 Akim Demaille <akim@epita.fr>
10713
10714 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
10715 (parse_guard): Rename the formal argument `stack_offset' as
10716 `rule_length', which is more readable.
10717 Adjust callers.
10718 (copy_at, copy_dollar): Instead of outputting the hard coded
10719 values of $$, $n and so forth, output invocation to b4_lhs_value,
10720 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
10721 Note: this patch partially drops `semantic-parser' support: it
10722 always does `rule_length - n', where semantic parsers ought to
10723 always use `-n'.
10724 * data/bison.simple, data/bison.c++ (b4_lhs_value)
10725 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
10726
107272002-05-02 Akim Demaille <akim@epita.fr>
10728
10729 * configure.in (AC_INIT): Bump to 1.49b.
10730 (AM_INIT_AUTOMAKE): Short invocation.
10731
107322002-05-02 Akim Demaille <akim@epita.fr>
10733
10734 Version 1.49a.
10735
107362002-05-01 Akim Demaille <akim@epita.fr>
10737
10738 * src/skeleton.h: Remove.
10739
107402002-05-01 Akim Demaille <akim@epita.fr>
10741
10742 * src/skeleton.h: Fix the #endif.
10743 Reported by Magnus Fromreide.
10744
107452002-04-26 Paul Eggert <eggert@twinsun.com>
10746
10747 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
10748 Define if we define YYSTYPE and YYLTYPE, respectively.
10749 (YYCOPY): Fix [] quoting problem in the non-GCC case.
10750
107512002-04-25 Robert Anisko <robert@lrde.epita.fr>
10752
10753 * src/scan-skel.l: Postprocess quadrigraphs.
10754
10755 * src/reader.c (copy_character): New function, used to output
10756 single characters while replacing `[' and `]' with quadrigraphs, to
10757 avoid troubles with M4 quotes.
10758 (copy_comment): Output characters with copy_character.
10759 (read_additionnal_code): Likewise.
10760 (copy_string2): Likewise.
10761 (copy_definition): Likewise.
10762
10763 * tests/calc.at: Exercise M4 quoting.
10764
107652002-04-25 Akim Demaille <akim@epita.fr>
10766
10767 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
10768 between `!' and the command.
10769 Reported by Paul Eggert.
10770
107712002-04-24 Robert Anisko <robert@lrde.epita.fr>
10772
10773 * tests/calc.at: Exercise prologue splitting.
10774
10775 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
10776 `b4_post_prologue' instead of `b4_prologue'.
10777
10778 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
10779 muscles.
10780 (output): Free pre_prologue_obstack and post_prologue_obstack.
10781 * src/files.h, src/files.c (attrs_obstack): Remove.
10782 (pre_prologue_obstack, post_prologue_obstack): New.
10783 * src/reader.c (copy_definition): Add a parameter to specify the
10784 obstack to fill, instead of using attrs_obstack unconditionally.
10785 (read_declarations): Pass pre_prologue_obstack to copy_definition if
10786 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
10787
107882002-04-23 Paul Eggert <eggert@twinsun.com>
10789
10790 * data/bison.simple: Remove unnecessary commentary and white
10791 space differences from 1_29-branch.
10792 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
10793
10794 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
10795 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
10796 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
10797 constructors or destructors.
10798
10799 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
10800
108012002-04-23 Akim Demaille <akim@epita.fr>
10802
10803 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
10804 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
10805 location with columns.
10806 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
10807 All reported by Paul Eggert.
10808
108092002-04-22 Akim Demaille <akim@epita.fr>
10810
10811 * src/reduce.c (dump_grammar): Move to...
10812 * src/gram.h, src/gram.c (grammar_dump): here.
10813 Be sure to separate long item numbers.
10814 Don't read the members of a rule's prec if its nil.
10815
108162002-04-22 Akim Demaille <akim@epita.fr>
10817
10818 * src/output.c (table_size, table_grow): New.
10819 (MAXTABLE): Remove, replace uses with table_size.
10820 (pack_vector): Instead of dying when the table is too big, grow it.
10821
108222002-04-22 Akim Demaille <akim@epita.fr>
10823
10824 * data/bison.simple (yyr1): Its type is that of a token number.
10825 * data/bison.c++ (r1_): Likewise.
10826 * tests/regression.at (Web2c Actions): Adjust.
10827
108282002-04-22 Akim Demaille <akim@epita.fr>
10829
10830 * src/reader.c (token_translations_init): 256 is now the default
10831 value for the error token, i.e., it will be assigned another
10832 number if the user assigned 256 to one of her tokens.
10833 (reader): Don't force 256 to error.
10834 * doc/bison.texinfo (Symbols): Adjust.
10835 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
10836 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
10837 etc. instead of 10, 20, 30 (which was used to `jump' over error
10838 (256) and undefined (2)).
10839
108402002-04-22 Akim Demaille <akim@epita.fr>
10841
10842 Propagate more token_number_t.
10843
10844 * src/gram.h (token_number_as_item_number)
10845 (item_number_as_token_number): New.
10846 * src/output.c (GENERATE_OUTPUT_TABLE): New.
10847 Use it to create output_item_number_table and
10848 output_token_number_table.
10849 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
10850 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
10851 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
10852 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
10853
108542002-04-22 Akim Demaille <akim@epita.fr>
10855
10856 * src/output.h, src/output.c (get_lines_number): Remove.
10857
108582002-04-19 Akim Demaille <akim@epita.fr>
10859
10860 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
10861 as Lex/Flex'.
10862 (Debugging): More details about enabling the debugging features.
10863 (Table of Symbols): Describe $$, $n, @$, and @n.
10864 Suggested by Tim Josling.
10865
108662002-04-19 Akim Demaille <akim@epita.fr>
10867
10868 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
10869
108702002-04-10 Akim Demaille <akim@epita.fr>
10871
10872 * src/system.h: Rely on HAVE_LIMITS_H.
10873 Suggested by Paul Eggert.
10874
108752002-04-09 Akim Demaille <akim@epita.fr>
10876
10877 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
10878 full stderr, and strip it according to the bison options, instead
10879 of composing the error message from different bits.
10880 This makes it easier to check for several error messages.
10881 Adjust all the invocations.
10882 Add an invocation exercising the error token.
10883 Add an invocation demonstrating a stupid error message.
10884 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
10885 Adjust the tests.
10886 Error message are for stderr, not stdout.
10887
108882002-04-09 Akim Demaille <akim@epita.fr>
10889
10890 * src/gram.h, src/gram.c (error_token_number): Remove, use
10891 errtoken->number.
10892 * src/reader.c (reader): Don't specify the user token number (2)
10893 for $undefined, as it uselessly prevents using it.
10894 * src/gram.h (token_number_t): Move to...
10895 * src/symtab.h: here.
10896 (state_t.number): Is a token_number_t.
10897 * src/print.c, src/reader.c: Use undeftoken->number instead of
10898 hard coded 2.
10899 (Even though this 2 is not the same as above: the number of the
10900 undeftoken remains being 2, it is its user token number which
10901 might not be 2).
10902 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
10903 `user_token_number_max'.
10904 Output `undef_token_number'.
10905 * data/bison.simple, data/bison.c++: Use them.
10906 Be sure to map invalid yylex return values to
10907 `undef_token_number'. This saves us from gratuitous SEGV.
10908
10909 * tests/conflicts.at (Solved SR Conflicts)
10910 (Unresolved SR Conflicts): Adjust.
10911 * tests/regression.at (Web2c Actions): Adjust.
10912
109132002-04-08 Akim Demaille <akim@epita.fr>
10914
10915 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
10916 Adding #line.
10917 Remove the duplicate `typedefs'.
10918 (RhsNumberType): Fix the declaration and various other typos.
10919 Use __ofile__.
10920 * data/bison.simple: Use __ofile__.
10921 * src/scan-skel.l: Handle __ofile__.
10922
109232002-04-08 Akim Demaille <akim@epita.fr>
10924
10925 * src/gram.h (item_number_t): New, the type of item numbers in
10926 RITEM. Note that it must be able to code symbol numbers as
10927 positive number, and the negation of rule numbers as negative
10928 numbers.
10929 Adjust all dependencies (pretty many).
10930 * src/reduce.c (rule): Remove this `short *' pointer: use
10931 item_number_t.
10932 * src/system.h (MINSHORT, MAXSHORT): Remove.
10933 Include `limits.h'.
10934 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
10935 (shortcpy): Remove.
10936 (MAXTABLE): Move to...
10937 * src/output.c (MAXTABLE): here.
10938 (prepare_rules): Use output_int_table to output rhs.
10939 * data/bison.simple, data/bison.c++: Adjust.
10940 * tests/torture.at (Big triangle): Move the limit from 254 to
10941 500.
10942 * tests/regression.at (Web2c Actions): Ajust.
10943
10944 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
10945 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
10946 passes, but produces negative #line number, once fixed, GCC is
10947 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
10948 C), it passes.
10949 * src/state.h (state_h): Code input lines on ints, not shorts.
10950
109512002-04-08 Akim Demaille <akim@epita.fr>
10952
10953 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
10954 and then the grammar.
10955
109562002-04-08 Akim Demaille <akim@epita.fr>
10957
10958 * src/system.h: No longer using strndup.
10959
109602002-04-07 Akim Demaille <akim@epita.fr>
10961
10962 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
10963 * src/output.c (output_table_data): Return the longest number.
10964 (prepare_tokens): Output `token_number_max').
10965 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
10966 New.
10967 Use them to define yy_token_number_type/TokenNumberType.
10968 Use this type for yytranslate.
10969 * tests/torture.at (Big triangle): Push the limit from 124 to
10970 253.
10971 * tests/regression.at (Web2c Actions): Adjust.
10972
109732002-04-07 Akim Demaille <akim@epita.fr>
10974
10975 * tests/torture.at (Big triangle): New.
10976 (GNU AWK Grammar, GNU Cim Grammar): Move to...
10977 * tests/existing.at: here.
10978
109792002-04-07 Akim Demaille <akim@epita.fr>
10980
10981 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
10982 nritems.
10983 Adjust dependencies.
10984
109852002-04-07 Akim Demaille <akim@epita.fr>
10986
10987 * src/reader.c: Normalize increments to prefix form.
10988
109892002-04-07 Akim Demaille <akim@epita.fr>
10990
10991 * src/reader.c, symtab.c: Remove debugging code.
10992
109932002-04-07 Akim Demaille <akim@epita.fr>
10994
10995 Rename all the `bucket's as `symbol_t'.
10996
10997 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
10998 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
10999 * src/symtab.c, src/symtab.h (bucket): Rename as...
11000 (symbol_t): this.
11001 (symbol_list_new, bucket_check_defined, bucket_make_alias)
11002 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
11003 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11004 (buckets_new, buckets_free, buckets_do): Rename as...
11005 (symbol_list_new, symbol_check_defined, symbol_make_alias)
11006 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
11007 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
11008 (symbols_new, symbols_free, symbols_do): these.
11009
110102002-04-07 Akim Demaille <akim@epita.fr>
11011
11012 Use lib/hash for the symbol table.
11013
11014 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
11015 EOF.
11016 * src/lex.c (lex): Set the `number' member of new terminals.
11017 * src/reader.c (bucket_check_defined, bucket_make_alias)
11018 (bucket_check_alias_consistence, bucket_translation): New.
11019 (reader, grammar_free, readgram, token_translations_init)
11020 (packsymbols): Adjust.
11021 (reader): Number the predefined tokens.
11022 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
11023 for predefined tokens.
11024 * src/symtab.h (bucket): Remove all the hash table related
11025 members.
11026 * src/symtab.c (symtab): Replace by...
11027 (bucket_table): this.
11028 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
11029 (buckets_new, buckets_do): New.
11030
110312002-04-07 Akim Demaille <akim@epita.fr>
11032
11033 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
11034 (start_symbol, max_user_token_number, semantic_parser)
11035 (error_token_number): Initialize.
11036 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
11037 Initialize.
11038 (reader): Don't.
11039 (errtoken, eoftoken, undeftoken, axiom): Extern.
11040
110412002-04-07 Akim Demaille <akim@epita.fr>
11042
11043 * src/gram.h (rule_s): prec and precsym are now pointers
11044 to the bucket giving the priority/associativity.
11045 Member `associativity' removed: useless.
11046 * src/reduce.c, src/conflicts.c: Adjust.
11047
110482002-04-07 Akim Demaille <akim@epita.fr>
11049
11050 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
11051 Properly escape the symbols' TAG when outputting them.
11052
110532002-04-07 Akim Demaille <akim@epita.fr>
11054
11055 * src/lalr.h (LA): Is a bitsetv, not bitset*.
11056
110572002-04-07 Akim Demaille <akim@epita.fr>
11058
11059 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
11060 (LArule): this, which is an array to rule_t*.
11061 * src/print.c, src/conflicts.c: Adjust.
11062
110632002-04-07 Akim Demaille <akim@epita.fr>
11064
11065 * src/gram.h (rule_t): Rename `number' as `user_number'.
11066 `number' is a new member.
11067 Adjust dependencies.
11068 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
11069
110702002-04-07 Akim Demaille <akim@epita.fr>
11071
11072 As a result of the previous patch, it is no longer needed
11073 to reorder ritem itself.
11074
11075 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
11076
110772002-04-07 Akim Demaille <akim@epita.fr>
11078
11079 Be sure never to walk through RITEMS, but use only data related to
11080 the rules themselves. RITEMS should be banished.
11081
11082 * src/output.c (output_token_translations): Rename as...
11083 (prepare_tokens): this.
11084 In addition to `translate', prepare the muscles `tname' and
11085 `toknum', which were handled by...
11086 (output_rule_data): this.
11087 Remove, and move the remainder of its outputs into...
11088 (prepare_rules): this new routines, which also merges content from
11089 (output_gram): this.
11090 (prepare_rules): Be sure never to walk through RITEMS.
11091 (output_stos): Rename as...
11092 (prepare_stos): this.
11093 (output): Always invoke prepare_states, after all, just don't use it
11094 in the output if you don't need it.
11095
110962002-04-07 Akim Demaille <akim@epita.fr>
11097
11098 * src/LR0.c (new_state): Display `nstates' as the name of the
11099 newly created state.
11100 Adjust to initialize first_state and last_state if needed.
11101 Be sure to distinguish the initial from the final state.
11102 (new_states): Create the itemset of the initial state, and use
11103 new_state.
11104 * src/closure.c (closure): Now that the initial state has its
11105 items properly set, there is no need for a special case when
11106 creating `ruleset'.
11107
11108 As a result, now the rule 0, reducing to $axiom, is visible in the
11109 outputs. Adjust the test suite.
11110
11111 * tests/conflicts.at (Solved SR Conflicts)
11112 (Unresolved SR Conflicts): Adjust.
11113 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
11114 * tests/conflicts.at (S/R in initial): New.
11115
111162002-04-07 Akim Demaille <akim@epita.fr>
11117
11118 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
11119 the RHS of the rules.
11120 * src/output.c (output_gram): Likewise.
11121
111222002-04-07 Akim Demaille <akim@epita.fr>
11123
11124 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
11125 bucket.
11126 Adjust all dependencies.
11127 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
11128 `number' of the buckets too.
11129 * src/gram.h: Include `symtab.h'.
11130 (associativity): Move to...
11131 * src/symtab.h: here.
11132 No longer include `gram.h'.
11133
111342002-04-07 Akim Demaille <akim@epita.fr>
11135
11136 * src/gram.h, src/gram.c (rules_rhs_length): New.
11137 (ritem_longest_rhs): Use it.
11138 * src/gram.h (rule_t): `number' is a new member.
11139 * src/reader.c (packgram): Set it.
11140 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
11141 the end of `rules', and count them out of `nrules'.
11142 (reduce_output, dump_grammar): Adjust.
11143 * src/print.c (print_grammar): It is no longer needed to check for
11144 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
11145 * tests/reduce.at (Reduced Automaton): New test.
11146
111472002-04-07 Akim Demaille <akim@epita.fr>
11148
11149 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
11150 lacking `+ 1' to nrules, Bison reported as useless a token if it
11151 was used solely to set the precedence of the last rule...
11152
111532002-04-07 Akim Demaille <akim@epita.fr>
11154
11155 * data/bison.c++, data/bison.simple: Don't output the current file
11156 name in #line, to avoid useless diffs between two identical
11157 outputs under different names.
11158
111592002-04-07 Akim Demaille <akim@epita.fr>
11160
11161 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
11162 Normalize loops to using `< nrules + 1', not `<= nrules'.
11163
111642002-04-07 Akim Demaille <akim@epita.fr>
11165
11166 * TODO: Update.
11167
111682002-04-07 Akim Demaille <akim@epita.fr>
11169
11170 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
11171 bucket.value as bucket.number.
11172
111732002-04-07 Akim Demaille <akim@epita.fr>
11174
11175 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
11176 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
11177 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
11178 RHS, instead of being an index in RITEMS.
11179
111802002-04-04 Paul Eggert <eggert@twinsun.com>
11181
11182 * doc/bison.texinfo: Update copyright date.
11183 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
11184 (Symbols): Warn about running Bison in one character set,
11185 but compiling and/or running in an incompatible one.
11186 Warn about character code 256, too.
11187
111882002-04-03 Paul Eggert <eggert@twinsun.com>
11189
11190 * src/bison.data (YYSTACK_ALLOC): Depend on whether
11191 YYERROR_VERBOSE is nonzero, not whether it is defined.
11192
11193 Merge changes from bison-1_29-branch.
11194
111952002-03-20 Paul Eggert <eggert@twinsun.com>
11196
11197 Merge fixes from Debian bison_1.34-1.diff.
11198
11199 * configure.in (AC_PREREQ): 2.53.
11200
112012002-03-20 Akim Demaille <akim@epita.fr>
11202
11203 * src/conflicts.c (log_resolution): Argument `resolution' is const.
11204
112052002-03-19 Paul Eggert <eggert@twinsun.com>
11206
11207 * src/bison.simple (YYCOPY): New macro.
11208 (YYSTACK_RELOCATE): Use it.
11209 Remove Type arg; no longer needed. All callers changed.
11210 (yymemcpy): Remove; no longer needed.
11211
11212 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
11213 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11214
112152002-03-19 Akim Demaille <akim@epita.fr>
11216
11217 Test and fix the #line outputs.
11218
11219 * tests/atlocal.at (GCC): New.
11220 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
11221 (Prologue synch line, %union synch line, Postprologue synch line)
11222 (Action synch line, Epilogue synch line): New tests.
11223 * src/reader.c (parse_union_decl): Define the muscle stype_line.
11224 * data/bison.simple, data/bison.c++: Use it.
11225
112262002-03-19 Akim Demaille <akim@epita.fr>
11227
11228 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
11229 (Solved SR Conflicts, %expect not enough, %expect right)
11230 (%expect too much): Move to...
11231 * tests/conflicts.at: this new file.
11232
112332002-03-19 Akim Demaille <akim@epita.fr>
11234
11235 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
11236 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
11237 that we can move to enums for instance.
11238 * src/output.c (token_definitions_output): Output a list of
11239 `token-name, token-number' instead of the #define.
11240 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
11241
112422002-03-14 Akim Demaille <akim@epita.fr>
11243
11244 Use Gettext 0.11.1.
11245
112462002-03-09 Robert Anisko <robert@lrde.epita.fr>
11247
11248 * data/bison.c++: Make the user able to add members to the generated
11249 parser by subclassing.
11250
112512002-03-05 Robert Anisko <robert@lrde.epita.fr>
11252
11253 * src/reader.c (read_additionnal_code): `c' should be an integer, not
11254 a character.
11255 Reported by Nicolas Tisserand and Nicolas Burrus.
11256
112572002-03-04 Robert Anisko <robert@lrde.epita.fr>
11258
11259 * src/reader.c: Warn about lacking semi-colons, do not complain.
11260
112612002-03-04 Robert Anisko <robert@lrde.epita.fr>
11262
11263 * data/bison.c++: Remove a debug line.
11264
112652002-03-04 Robert Anisko <robert@lrde.epita.fr>
11266
11267 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
11268 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
11269 provide a default implementation.
11270
112712002-03-04 Akim Demaille <akim@epita.fr>
11272
11273 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
11274 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
11275 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
11276 * tests/semantic.at (Parsing Guards): Similarly.
11277 * src/reader.at (readgram): Complain if the last rule is not ended
11278 with a semi-colon.
11279
112802002-03-04 Akim Demaille <akim@epita.fr>
11281
11282 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
11283 * src/closure.c: here.
11284 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
11285 RTC.
11286 * src/warshall.h, src/warshall.c: Remove.
11287 * tests/sets.at (Broken Closure): Adjust.
11288
112892002-03-04 Akim Demaille <akim@epita.fr>
11290
11291 * src/output.c (output_skeleton): tempdir is const.
11292 bytes_read is unused.
11293
112942002-03-04 Akim Demaille <akim@epita.fr>
11295
11296 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
11297 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
11298 Update.
11299 From Michael Hayes.
11300
113012002-03-04 Akim Demaille <akim@epita.fr>
11302
11303 * src/closure.c (closure): `r' is unused.
11304
113052002-03-04 Akim Demaille <akim@epita.fr>
11306
11307 * tests/sets.at (Broken Closure): Add the ending `;'.
11308 * src/reader.at (readgram): Complain if a rule is not ended with a
11309 semi-colon.
11310
113112002-03-04 Akim Demaille <akim@epita.fr>
11312
11313 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
11314 (count_sr_conflicts): Use bitset_count.
11315 * src/reduce.c (inaccessable_symbols): Ditto.
11316 (bits_size): Remove.
11317 * src/warshall.h, src/warshall.c: Convert to bitsetv.
11318
113192002-03-04 Akim Demaille <akim@epita.fr>
11320
11321 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
11322 * src/reduce.c: Remove the `bitset_zero's following the
11323 `bitset_create's, as now it is performed by the latter.
11324
113252002-03-04 Akim Demaille <akim@epita.fr>
11326
11327 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
11328 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
11329 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
11330 latest sources from Michael.
11331
113322002-03-04 Akim Demaille <akim@epita.fr>
11333
11334 * src/output.c (output): Don't free the grammar.
11335 * src/reader.c (grammar_free): New.
11336 * src/main.c (main): Call it and don't free symtab here.
11337
113382002-03-04 Akim Demaille <akim@epita.fr>
11339
11340 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
11341 before returning.
11342 Reported by Benoit Perrot.
11343
113442002-03-04 Akim Demaille <akim@epita.fr>
11345
11346 Use bitset operations when possible, not loops over bits.
11347
11348 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
11349 bitset_or.
11350 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
11351 * src/reduce.c (useless_nonterminals): Formatting changes.
11352 * src/warshall.c (TC): Use bitset_or.
11353
113542002-03-04 Akim Demaille <akim@epita.fr>
11355
11356 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
11357 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
11358 Ditto.
11359
113602002-03-04 Akim Demaille <akim@epita.fr>
11361
11362 * src/lalr.c (F): Now a bitset*.
11363 Adjust all dependencies.
11364
113652002-03-04 Akim Demaille <akim@epita.fr>
11366
11367 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
11368 Adjust all dependencies.
11369
113702002-03-04 Akim Demaille <akim@epita.fr>
11371
11372 * src/L0.c, src/LR0.h (nstates): Be size_t.
11373 Adjust comparisons (signed vs unsigned).
11374 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
11375 bitset*.
11376 Adjust all dependencies.
11377
113782002-03-04 Akim Demaille <akim@epita.fr>
11379
11380 * src/closure.c (firsts): Now, also a bitset.
11381 Adjust all dependencies.
11382 (varsetsize): Remove, now unused.
11383 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
11384
113852002-03-04 Akim Demaille <akim@epita.fr>
11386
11387 * src/print.c: Convert to use bitset.h, not hand coded iterations
11388 over ints.
11389
113902002-03-04 Akim Demaille <akim@epita.fr>
11391
11392 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
11393
113942002-03-04 Akim Demaille <akim@epita.fr>
11395
11396 * src/closure.c (ruleset): Be a bitset.
11397 (rulesetsize): Remove.
11398
113992002-03-04 Akim Demaille <akim@epita.fr>
11400
11401 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
11402 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
11403 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
11404 * src/closure.c (fderives): Be an array of bitsets.
11405
114062002-02-28 Robert Anisko <robert@lrde.epita.fr>
11407
11408 * data/bison.c++: Merge the two generated headers. Insert a copyright
11409 notice in each output file.
11410
114112002-02-28 Akim Demaille <akim@epita.fr>
11412
11413 * data/bison.c++: Copy the prologue of bison.simple to fetch
11414 useful M4 definitions, such as b4_header_guard.
11415
114162002-02-25 Akim Demaille <akim@epita.fr>
11417
11418 * src/getargs.c (version): Give the name of the authors, and use a
11419 translator friendly scheme for the bgr
11420 copyright notice.
11421
114222002-02-25 Akim Demaille <akim@epita.fr>
11423
11424 * src/output.c (header_output): Remove, now handled completely via
11425 M4.
11426
114272002-02-25 Akim Demaille <akim@epita.fr>
11428
11429 * m4/m4.m4: New, from CVS Autoconf.
11430 * configure.in: Invoke it.
11431 * src/output.c (output_skeleton): Use its result instead of the
11432 hard coded name.
11433
114342002-02-25 Akim Demaille <akim@epita.fr>
11435
11436 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
11437 Fileutils 4.1.5.
11438 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
11439 * src/output.c (output_skeleton): Use mkstemp to create a real
11440 temporary file.
11441 Move the filling of `skeleton' and its muscle to...
11442 (prepare): here.
11443 (output): Move the definition of the prologue muscle to...
11444 (prepare): here.
11445 * src/system.h (DEFAULT_TMPDIR): New.
11446
114472002-02-14 Paul Eggert <eggert@twinsun.com>
11448
11449 Remove the support for C++ namespace cleanliness; it was
11450 causing more problems than it was curing, since it didn't work
11451 properly on some nonstandard C++ compilers. This can wait
11452 for a proper C++ parser.
11453
11454 * NEWS: Document this.
11455 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
11456 of C++, as it's treated like C now.
11457 * src/bison.simple (YYSTD): Remove.
11458 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
11459 Treat C++ just like Standard C instead of trying to support
11460 namespace cleanliness.
11461
114622002-02-14 Akim Demaille <akim@epita.fr>
11463
11464 * tests/regression.at (else): Adjust to Andreas' change.
11465
114662002-02-14 Akim Demaille <akim@epita.fr>
11467
11468 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
11469
114702002-02-13 Andreas Schwab <schwab@suse.de>
11471
11472 * src/output.c (output_rule_data): Don't output NULL, it might
11473 not be defined yet.
11474
114752002-02-11 Robert Anisko <robert@lrde.epita.fr>
11476
11477 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
11478 (Copyright notice): Update.
11479
114802002-02-11 Akim Demaille <akim@epita.fr>
11481
11482 * tests/regression.at (%nonassoc and eof): Don't include
11483 nonportable headers.
11484
114852002-02-08 Robert Anisko <robert@lrde.epita.fr>
11486
11487 * data/bison.c++: Correct error recovery. Make the user able to
11488 initialize the starting location.
11489
114902002-02-07 Akim Demaille <akim@epita.fr>
11491
11492 * tests/input.at: New.
11493
114942002-02-07 Robert Anisko <robert@lrde.epita.fr>
11495
11496 * data/bison.c++: Replace some direct m4 expansions by constants. Be
11497 more consistent when naming methods and variables. Put preprocessor
11498 directives around tables only needed for debugging.
11499
115002002-02-07 Robert Anisko <robert@lrde.epita.fr>
11501
11502 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
11503 C++ parsers.
11504 (yy::b4_name::parse): Use print_.
11505
115062002-02-07 Robert Anisko <robert@lrde.epita.fr>
11507
11508 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
11509
115102002-02-07 Robert Anisko <robert@lrde.epita.fr>
11511
11512 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
11513 C++ parsers.
11514 (yy::b4_name::parse): Build verbose error messages, and use error_.
11515
115162002-02-06 Robert Anisko <robert@lrde.epita.fr>
11517
11518 * data/bison.c++: Fix m4 quoting in comments.
11519
115202002-02-06 Robert Anisko <robert@lrde.epita.fr>
11521
11522 * data/bison.c++: Adjust the parser code. Fix some muscles that were
11523 not expanded by m4.
11524
115252002-02-05 Akim Demaille <akim@epita.fr>
11526
11527 * data/bison.c++: Adjust to the M4 back end.
11528 More is certainly needed.
11529
115302002-02-05 Akim Demaille <akim@epita.fr>
11531
11532 Give a try to M4 as a back end.
11533
11534 * lib/readpipe.c: New, from wdiff.
11535 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
11536 BISON_HAIRY.
11537 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
11538 specific values. Now it is m4 that performs the lookup.
11539 * src/parse-skel.y: Remove.
11540 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
11541 * src/output.c (actions_output, guards_output)
11542 (token_definitions_output): No longer keeps track of the output
11543 line number, hence remove the second argument.
11544 (guards_output): Check against the guard member of a rule, not the
11545 action member.
11546 Adjust callers.
11547 (output_skeleton): Don't look for the skeleton location, let m4 do
11548 that.
11549 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
11550 file will be used.
11551 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
11552 (prepare): Given that for the time being changesyntax is not
11553 usable in M4, rename the muscles using `-' to `_'.
11554 Define `defines_flag', `output_parser_name' and `output_header_name'.
11555 * src/output.h (actions_output, guards_output)
11556 (token_definitions_output): Adjust prototypes.
11557 * src/scan-skel.l: Instead of scanning the skeletons, it now
11558 processes the output of m4: `__oline__' and `#output'.
11559 * data/bison.simple: Adjust to be used by M4(sugar).
11560 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
11561 to date.
11562 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
11563 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
11564 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
11565 shamelessly stolen from CVS Autoconf.
11566
115672002-02-05 Akim Demaille <akim@epita.fr>
11568
11569 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
11570 * configure.in: Check for the declarations of free and malloc.
11571 * src/muscle_tab.c: Adjust.
11572
115732002-02-05 Akim Demaille <akim@epita.fr>
11574
11575 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
11576 which have no values.
11577
115782002-02-05 Akim Demaille <akim@epita.fr>
11579
11580 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
11581 * data/: here.
11582
115832002-01-29 Paul Eggert <eggert@twinsun.com>
11584
11585 * src/bison.simple (YYSIZE_T): Do not define merely because
11586 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
11587 On some platforms, <alloca.h> does not declare YYSTD (size_t).
11588
115892002-01-27 Akim Demaille <akim@epita.fr>
11590
11591 Fix `%nonassoc and eof'.
11592
11593 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
11594 which were not properly copied! Replace
11595 memcpy (res->errs, src->errs, src->nerrs);
11596 with
11597 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
11598 !!!
11599 * tests/regression.at (%nonassoc and eof): Adjust to newest
11600 Autotest: `.' is not in the PATH.
11601
116022002-01-27 Akim Demaille <akim@epita.fr>
11603
11604 * tests/sets.at (AT_EXTRACT_SETS): New.
11605 (Nullable): Use it.
11606 (Firsts): New.
11607
116082002-01-26 Akim Demaille <akim@epita.fr>
11609
11610 * tests/actions.at, tests/calc.at, tests/headers.at,
11611 * tests/torture.at: Adjust to the newest Autotest which no longer
11612 forces `.' in the PATH.
11613
116142002-01-25 Akim Demaille <akim@epita.fr>
11615
11616 * tests/regression.at (%nonassoc and eof): New.
11617 Suggested by Robert Anisko.
11618
116192002-01-24 Akim Demaille <akim@epita.fr>
11620
11621 Bison dumps core when trying to complain about broken input files.
11622 Reported by Cris van Pelt.
11623
11624 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
11625 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
11626 into...
11627 (Invalid inputs): Strengthen: exercise parse_percent_token.
11628
116292002-01-24 Robert Anisko <robert.anisko@epita.fr>
11630
11631 * src/Makefile.am: Add bison.c++.
11632 * src/bison.c++: New skeleton.
11633
116342002-01-21 Paolo Bonzini <bonzini@gnu.org>
11635
11636 * po/it.po: New.
11637
116382002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
11639
11640 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
11641
116422002-01-20 Marc Autret <marc@gnu.org>
11643
11644 * src/files.c (compute_output_file_names): Fix
11645
116462002-01-20 Marc Autret <marc@gnu.org>
11647
11648 * tests/output.at: New test.
11649 * src/files.c (compute_base_names): Don't map extensions when
11650 the YACC flag is set, use defaults.
11651 Reported by Evgeny Stambulchik.
11652
116532002-01-20 Marc Autret <marc@gnu.org>
11654
11655 * src/system.h: Need to define __attribute__ away for non-GCC
11656 compilers as well (i.e., the vendor C compiler).
11657 Suggested by Albert Chin-A-Young.
11658
116592002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
11660
11661 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
11662 canonical definition.
11663 * src/system.h: Use the canonical definition for PARAMS (avoids
11664 a conflict with the macro from lib/hash.h).
11665
116662002-01-11 Akim Demaille <akim@epita.fr>
11667
11668 * configure.in: Use AC_FUNC_STRNLEN.
11669 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
11670
116712002-01-09 Akim Demaille <akim@epita.fr>
11672
11673 * src/files.c, src/files.h (output_infix): New.
11674 (tab_extension): Remove.
11675 (compute_base_names): Compute the former, drop the latter.
11676 * src/output.c (prepare): Insert the muscles `output-infix', and
11677 `output-suffix'.
11678 * src/parse-skel.y (string, string.1): New.
11679 (section.header): Use it.
11680 (section.yacc): Remove.
11681 (prefix): Remove too.
11682 * src/scan-skel.l: Adjust.
11683 * src/bison.simple, src/bison.hairy: Adjust.
11684
116852002-01-09 Akim Demaille <akim@epita.fr>
11686
11687 * configure.in (WERROR_CFLAGS): Compute it.
11688 * src/Makefile.am (CFLAGS): Pass it.
11689 * tests/atlocal.in (CFLAGS): Idem.
11690 * src/files.c: Fix a few warnings.
11691 (get_extension_index): Remove, unused.
11692
116932002-01-08 Akim Demaille <akim@epita.fr>
11694
11695 * src/getargs.c (AS_FILE_NAME): New.
11696 (getargs): Use it to convert DOSish file names.
11697 * src/files.c (base_name): Rename as full_base_name to avoid
11698 clashes with `base_name ()'.
11699 (filename_split): New.
11700 (compute_base_names): N-th rewrite, using filename_split.
11701
117022002-01-08 Akim Demaille <akim@epita.fr>
11703
11704 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
11705 New, stolen from the Fileutils 4.1.
11706 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
11707 * configure.in: Check for the presence of memrchr, and of its
11708 prototype.
11709
117102002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
11711
11712 * lib/hash.h (__P): Added definition for this macro.
11713 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
11714 BUILT_SOURCES, to ensure they are generated first.
11715 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
11716 %error-verbose to allow bootstrapping with bison 1.30x.
11717
117182002-01-06 Akim Demaille <akim@epita.fr>
11719
11720 * src/reader.c (parse_braces): Don't fetch the next char, the
11721 convention is to fetch on entry.
11722 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
11723 'switch' without a following semicolon.
11724 * tests/regression.at (braces parsing): New.
11725
117262002-01-06 Akim Demaille <akim@epita.fr>
11727
11728 Bison is dead wrong in its RR conflict reports.
11729
11730 * tests/torture.at (GNU Cim Grammar): New.
11731 * src/conflicts.c (count_rr_conflicts): Fix.
11732
117332002-01-06 Akim Demaille <akim@epita.fr>
11734
11735 Creating package.m4 from configure.ac causes too many problems.
11736
11737 * tests/Makefile.am (package.m4): Create it by hand,
11738 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
11739
117402002-01-06 Akim Demaille <akim@epita.fr>
11741
11742 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
11743 skeleton.h.
11744
117452002-01-04 Paul Eggert <eggert@twinsun.com>
11746
11747 * doc/bison.texinfo (Debugging):
11748 Remove YYSTDERR; it's no longer defined or used.
11749 Also, s/cstdio.h/cstdio/.
11750
117512002-01-03 Akim Demaille <akim@epita.fr>
11752
11753 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
11754
117552002-01-03 Akim Demaille <akim@epita.fr>
11756
11757 * src/parse-skel.y (process_skeleton): Don't bind the parser's
11758 tracing code to --trace, wait for a better --trace option, with
11759 args.
11760
117612002-01-03 Akim Demaille <akim@epita.fr>
11762
11763 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
11764 The ISO C++ standard is extremely clear about it: stderr is
11765 considered a macro, not a regular symbol (see table 94 `Header
11766 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
11767 Therefore std:: does not apply to it. It still does with fprintf.
11768 Also, s/cstdio.h/cstdio/.
11769
117702002-01-03 Akim Demaille <akim@epita.fr>
11771
11772 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
11773 for non system headers.
11774
117752002-01-02 Akim Demaille <akim@epita.fr>
11776
11777 Equip the skeleton chain with location tracking, runtime trace,
11778 pure parser and scanner.
11779
11780 * src/parse-skel.y: Request a pure parser, locations, and prefix
11781 renaming.
11782 (%union): Having several members with the same type does not help
11783 type mismatches, simplify.
11784 (YYPRINT, yyprint): New.
11785 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
11786 (skel_error): this.
11787 Handle locations.
11788 * src/scan-skel.l: Adjust to these changes.
11789 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
11790 (LOCATION_PRINT, skel_control_t): New.
11791
117922001-12-30 Akim Demaille <akim@epita.fr>
11793
11794 * src/parse-skel.y: Get rid of the shift/reduce conflict:
11795 replace `gb' with BLANKS.
11796 * src/scan-skel.l: Adjust.
11797
117982001-12-30 Akim Demaille <akim@epita.fr>
11799
11800 * src/system.h: We don't need nor want bcopy.
11801 Throw away MS-DOS crap: we don't need getpid.
11802 * configure.in: We don't need strndup. It was even causing
11803 problems: because Flex includes the headers *before* us,
11804 _GNU_SOURCE is not defined by config.h, and therefore strndup was
11805 not visible.
11806 * lib/xstrndup.c: New.
11807 * src/scan-skel.l: Use it.
11808 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
11809 * src/parse-skel.y: Use %directives instead of #defines.
11810
118112001-12-30 Akim Demaille <akim@epita.fr>
11812
11813 * src/skeleton.h: New.
11814 * src/output.c (output_parser, output_master_parser): Remove, dead
11815 code.
11816 * src/output.h (get_lines_number, actions_output, guards_output)
11817 (token_definitions_output): Prototype them.
11818 * src/parse-skel.y: Add the license notice.
11819 Include output.h and skeleton.h.
11820 (process_skeleton): Returns void, and takes a single parameter.
11821 * src/scan-skel.l: Add the license notice.
11822 Include skeleton.h.
11823 Don't use %option yylineno: it seems that then Flex imagines
11824 REJECT has been used, and therefore it won't reallocate its
11825 buffers (which makes no other sense to me than a bug). It results
11826 in warnings for `unused: yy_flex_realloc'.
11827
118282001-12-30 Robert Anisko <robert.anisko@epita.fr>
11829
11830 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
11831 (MUSCLE_INSERT_PREFIX): ...to there.
11832 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
11833 (MUSCLE_INSERT_PREFIX): Move from here...
11834
11835 * src/bison.hairy: Add a section directive. Put braces around muscle
11836 names. This parser skeleton is still broken, but Bison should not
11837 choke on a bad muscle 'syntax'.
11838 * src/bison.simple: Add a section directive. Put braces around muscle
11839 names.
11840
11841 * src/files.h (strsuffix, stringappend): Add declarations.
11842 (tab_extension): Add declaration.
11843 (short_base_name): Add declaration.
11844
11845 * src/files.c (strsuffix, stringappend): No longer static. These
11846 functions are used in the skeleton parser.
11847 (tab_extension): New.
11848 (compute_base_names): Use the computations done in this function
11849 to guess if the generated parsers should have '.tab' in their
11850 names.
11851 (short_base_name): No longer static.
11852
11853 * src/output.c (output_skeleton): New.
11854 (output): Disable call to output_master_parser, and give a try to
11855 a new skeleton handling system.
11856 (guards_output, actions_output): No longer static.
11857 (token_definitions_output, get_lines_number): No longer static.
11858
11859 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
11860
11861 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
11862 parse-skel.y.
11863
11864 * src/parse-skel.y: New file.
11865 * src/scan-skel.l: New file.
11866
118672001-12-29 Akim Demaille <akim@epita.fr>
11868
11869 %name-prefix is broken.
11870
11871 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
11872 Adjust all dependencies.
11873 * tests/headers.at (export YYLTYPE): Strengthen this test: use
11874 %name-prefix.
11875
11876 Renaming yylval but not yylloc is not consistent. Now we do.
11877
11878 * src/bison.simple: Prefix yylloc if used.
11879 * doc/bison.texinfo (Decl Summary): Document that.
11880
118812001-12-29 Akim Demaille <akim@epita.fr>
11882
11883 * doc/bison.texinfo: Promote `%long-directive' over
11884 `%long_directive'.
11885 Remove all references to fixed-output-files, yacc is enough.
11886
118872001-12-29 Akim Demaille <akim@epita.fr>
11888
11889 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
11890 user prologue. These are defaults.
11891 * tests/actions.at (Mid-rule actions): Make sure the user can
11892 define YYDEBUG and YYERROR_VERBOSE.
11893
118942001-12-29 Akim Demaille <akim@epita.fr>
11895
11896 * src/output.c (header_output): Don't forget to export YYLTYPE and
11897 yylloc.
11898 * tests/headers.at (export YYLTYPE): New, make sure it does.
11899 * tests/regression.at (%union and --defines, Invalid CPP headers):
11900 Move to...
11901 * tests/headers.at: here.
11902
119032001-12-29 Akim Demaille <akim@epita.fr>
11904
11905 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
11906
119072001-12-29 Akim Demaille <akim@epita.fr>
11908
11909 * tests/actions.at (Mid-rule actions): Output on a single line
11910 instead of several.
11911
119122001-12-29 Akim Demaille <akim@epita.fr>
11913
11914 * doc/bison.texinfo: Formatting changes.
11915
119162001-12-29 Akim Demaille <akim@epita.fr>
11917
11918 Don't store the token defs in a muscle, just be ready to output it
11919 on command. Now possible via `symbols'. Fixes a memory leak.
11920
11921 * src/output.c (token_definitions_output): New.
11922 (output_parser, header_output): Use it.
11923 * src/reader.c (symbols_save): Remove.
11924
119252001-12-29 Akim Demaille <akim@epita.fr>
11926
11927 * src/bison.simple: Do not provide a default for YYSTYPE and
11928 YYLTYPE before the user's prologue. Otherwise it's hardly... a
11929 default.
11930
119312001-12-29 Akim Demaille <akim@epita.fr>
11932
11933 Mid-rule actions are simply... ignored!
11934
11935 * src/reader.c (readgram): Be sure to attach mid-rule actions to
11936 the empty-rule associated to the dummy symbol, not to the host
11937 rule.
11938 * tests/actions.at (Mid-rule actions): New.
11939
119402001-12-29 Akim Demaille <akim@epita.fr>
11941
11942 Memory leak.
11943
11944 * src/reader.c (reader): Free grammar.
11945
119462001-12-29 Akim Demaille <akim@epita.fr>
11947
11948 Memory leak.
11949
11950 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
11951 since it allocates it for each state, although only one is needed.
11952 (allocate_storage): Do it here.
11953
119542001-12-29 Akim Demaille <akim@epita.fr>
11955
11956 * src/options.h, src/options.c (create_long_option_table): Rename
11957 as...
11958 (long_option_table_new): this, with a clearer prototype.
11959 (percent_table): Remove, unused,
11960 * src/getargs.c (getargs): Adjust.
11961
119622001-12-29 Akim Demaille <akim@epita.fr>
11963
11964 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
11965 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
11966 as states.
11967
119682001-12-29 Akim Demaille <akim@epita.fr>
11969
11970 * src/lalr.c (build_relations): Rename `states' as `states1'.
11971 Sorry, I don't understand exactly what it is, no better name...
11972
119732001-12-29 Akim Demaille <akim@epita.fr>
11974
11975 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
11976 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
11977 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
11978 as rules.
11979
119802001-12-29 Akim Demaille <akim@epita.fr>
11981
11982 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
11983 ago.
11984
119852001-12-29 Akim Demaille <akim@epita.fr>
11986
11987 * src/reader.c, src/reader.h (user_toknums): Remove.
11988 Adjust all users to use symbols[i]->user_token_number.
11989
119902001-12-29 Akim Demaille <akim@epita.fr>
11991
11992 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
11993 Adjust all users to use symbols[i]->prec or ->assoc.
11994
119952001-12-29 Akim Demaille <akim@epita.fr>
11996
11997 * src/reader.c, src/reader.h (tags): Remove.
11998 Adjust all users to use symbols[i]->tag.
11999
120002001-12-29 Akim Demaille <akim@epita.fr>
12001
12002 * src/gram.h, src/gram.c (symbols): New, similar to state_table
12003 and rule_table.
12004 * src/reader.c (packsymbols): Fill this table.
12005 Drop sprec.
12006 * src/conflicts.c (resolve_sr_conflict): Adjust.
12007 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
12008 single table.
12009 Use symbols[i]->tag instead of tags[i].
12010
120112001-12-29 Akim Demaille <akim@epita.fr>
12012
12013 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
12014 In addition, put a comment in there, to replace...
12015 * tests/regression.at (%union and C comments): Remove.
12016
120172001-12-29 Akim Demaille <akim@epita.fr>
12018
12019 * tests/regression.at (Web2c Actions): Blindly move the actual
12020 output as expected output. The contents *seem* right to me, but I
12021 can't pretend reading perfectly parser tables... Nonetheless, all
12022 the other tests pass correctly, the table look OK, even though the
12023 presence of `$axiom' is to be noted: AFAICS it is useless (but
12024 harmless).
12025
120262001-12-29 Akim Demaille <akim@epita.fr>
12027
12028 * src/reader.c (readgram): Don't add the rule 0 if there were no
12029 rules read. In other words, add it _after_ having performed
12030 grammar sanity checks.
12031 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
12032
120332001-12-29 Akim Demaille <akim@epita.fr>
12034
12035 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12036 visible, and some states have now a different number.
12037
120382001-12-29 Akim Demaille <akim@epita.fr>
12039
12040 * src/reader.c (readgram): Bind the initial rule's lineno to that
12041 of the first rule.
12042 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
12043 (Solved SR Conflicts): Adjust rule 0's line number.
12044
120452001-12-29 Akim Demaille <akim@epita.fr>
12046
12047 Fix the `GAWK Grammar' failure.
12048
12049 * src/LR0.c (final_state): Initialize to -1 so that we do compute
12050 the reductions of the first state which was mistakenly confused
12051 with the final state because precisely final_state was initialized
12052 to 0.
12053 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
12054 now noticed by Bison.
12055 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
12056 have a reduction on $default.
12057
120582001-12-29 Akim Demaille <akim@epita.fr>
12059
12060 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
12061 rule line numbers.
12062 * src/closure.c (print_closure): Likewise.
12063 * src/derives.c (print_derives): Likewise.
12064 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
12065 now.
12066
120672001-12-29 Akim Demaille <akim@epita.fr>
12068
12069 * src/lalr.c (lookaheads_print): New.
12070 (lalr): Call it when --trace-flag.
12071 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
12072 are dumped.
12073
120742001-12-29 Akim Demaille <akim@epita.fr>
12075
12076 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
12077 when walking through ritem, even via rule->rhs.
12078 * src/reduce.c (dump_grammar, useful_production, reduce_output)
12079 (useful_production, useless_nonterminals): Likewise.
12080 (reduce_grammar_tables): Likewise, plus update nritems.
12081 * src/nullable.c (set_nullable): Likewise.
12082 * src/lalr.c (build_relations): Likewise.
12083 * tests/sets.at (Nullable): Adjust.
12084 Fortunately, now, the $axiom is no longer nullable.
12085
120862001-12-29 Akim Demaille <akim@epita.fr>
12087
12088 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
12089 the 0-sentinel.
12090 * src/gram.c (ritem_longest_rhs): Likewise.
12091 * src/reduce.c (nonterminals_reduce): Likewise.
12092 * src/print_graph.c (print_graph): Likewise.
12093 * src/output.c (output_rule_data): Likewise.
12094 * src/nullable.c (set_nullable): Likewise.
12095
120962001-12-29 Akim Demaille <akim@epita.fr>
12097
12098 * src/output.c: Comment changes.
12099
121002001-12-27 Paul Eggert <eggert@twinsun.com>
12101
12102 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
12103 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
12104 Sparc, as they were causing more porting problems than the
12105 (minor) performance improvement was worth.
12106
12107 Also, catch up with 1.31's YYSTD.
12108
121092001-12-27 Akim Demaille <akim@epita.fr>
12110
12111 * src/output.c (output_gram): Rely on nritems, not the
12112 0-sentinel. See below.
12113 Use -1 as separator, not 0.
12114 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
12115 Rely on -1 as separator in yyrhs, instead of 0.
12116 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
12117 twice `Now at end of input', therefore there are two lines less to
12118 expect.
12119
121202001-12-27 Akim Demaille <akim@epita.fr>
12121
12122 * tests/regression.at (Unresolved SR Conflicts):
12123 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
12124 below.
12125
121262001-12-27 Akim Demaille <akim@epita.fr>
12127
12128 * src/LR0.c (new_state): Recognize the final state by the fact it
12129 is reached by eoftoken.
12130 (insert_start_shifting_state, insert_eof_shifting_state)
12131 (insert_accepting_state, augment_automaton): Remove, since now
12132 these states are automatically computed from the initial state.
12133 (generate_states): Adjust.
12134 * src/print.c: When reporting a rule number to the user, substract
12135 1, so that the axiom rule is rule 0, and the first user rule is 1.
12136 * src/reduce.c: Likewise.
12137 * src/print_graph.c (print_core): For the time being, just as for
12138 the report, depend upon --trace-flags to dump the full set of
12139 items.
12140 * src/reader.c (readgram): Once the grammar read, insert the rule
12141 0: `$axiom: START-SYMBOL $'.
12142 * tests/set.at: Adjust: rule 0 is now displayed, and since the
12143 number of the states has changed (the final state is no longer
12144 necessarily the last), catch up.
12145
121462001-12-27 Akim Demaille <akim@epita.fr>
12147
12148 Try to make the use of the eoftoken valid. Given that its value
12149 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
12150 is used instead of > 0 where appropriate, (ii), depend upon nritems
12151 instead of the 0-sentinel.
12152
12153 * src/gram.h, src/gram.c (nritems): New.
12154 Expected to be duplication of nitems, but for the time being...
12155 * src/reader.c (packgram): Assert nritems and nitems are equal.
12156 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
12157 * src/closure.c (print_closure, print_fderives): Likewise.
12158 * src/gram.c (ritem_print): Likewise.
12159 * src/print.c (print_core, print_grammar): Likewise.
12160 * src/print_graph.c: Likewise.
12161
121622001-12-27 Akim Demaille <akim@epita.fr>
12163
12164 * src/main.c (main): If there are complains after grammar
12165 reductions, then output the report anyway if requested, then die.
12166 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
12167 * src/reader.c (eoftoken): New.
12168 (parse_token_decl): If the token being defined has value `0', it
12169 is the eoftoken.
12170 (packsymbols): No longer hack `tags' to insert `$' by hand.
12171 Be sure to preserve the value of the eoftoken.
12172 (reader): Make sure eoftoken is defined.
12173 Initialize nsyms to 0: now eoftoken is created just like the others.
12174 * src/print.c (print_grammar): Don't special case the eof token.
12175 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
12176 lie anyway, albeit pleasant.
12177 * tests/calc.at: Exercise error messages with eoftoken.
12178 Change the grammar so that empty input is invalid.
12179 Adjust expectations.
12180 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
12181
121822001-12-27 Akim Demaille <akim@epita.fr>
12183
12184 * configure.in: Check the protos of strchr ans strspn.
12185 Replace strchr if needed.
12186 * src/system.h: Provide the protos of strchr, strspn and memchr if
12187 missing.
12188 * lib/strchr.c: New.
12189 * src/reader.c (symbols_save): Use strchr.
12190
121912001-12-27 Akim Demaille <akim@epita.fr>
12192
12193 * src/print.c, src/print_graph.c (escape): New.
12194 Use it to quote the TAGS outputs.
12195 * src/print_graph.c (print_state): Now errors are in red, and
12196 reductions in green.
12197 Prefer high to wide: output the state number on a line of its own.
12198
121992001-12-27 Akim Demaille <akim@epita.fr>
12200
12201 * src/state.h, src/state.c (reductions_new): New.
12202 * src/LR0.c (set_state_table): Let all the states have a
12203 `reductions', even if reduced to 0.
12204 (save_reductions): Adjust.
12205 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
12206 * src/print.c (print_reductions, print_actions): Adjust.
12207 * src/output.c (action_row): Adjust.
12208
122092001-12-27 Akim Demaille <akim@epita.fr>
12210
12211 * src/state.h, src/state.c (errs_new, errs_dup): New.
12212 * src/LR0.c (set_state_table): Let all the states have an errs,
12213 even if reduced to 0.
12214 * src/print.c (print_errs, print_reductions): Adjust.
12215 * src/output.c (output_actions, action_row): Adjust.
12216 * src/conflicts.c (resolve_sr_conflict): Adjust.
12217
122182001-12-27 Akim Demaille <akim@epita.fr>
12219
12220 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
12221
122222001-12-27 Akim Demaille <akim@epita.fr>
12223
12224 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
12225 * src/print.c: here.
12226 (lookaheadset, shiftset): New, used as additional storage by
12227 print_reductions.
12228 (print_results): Adjust.
12229 (print_shifts, print_gotos, print_errs): New, extracted from...
12230 (print_actions): here.
12231 * src/print_graph.c (print_actions): Remove dead code.
12232
122332001-12-27 Akim Demaille <akim@epita.fr>
12234
12235 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
12236 `$n' and `@n'.
12237
122382001-12-27 Akim Demaille <akim@epita.fr>
12239
12240 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
12241 (build_relations): Adjust.
12242
122432001-12-27 Akim Demaille <akim@epita.fr>
12244
12245 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
12246 duplication.
12247
122482001-12-27 Akim Demaille <akim@epita.fr>
12249
12250 * src/reader.c (packgram): Catch nitems overflows.
12251
122522001-12-27 Akim Demaille <akim@epita.fr>
12253
12254 * src/files.c, src/files.h (guard_obstack): Remove.
12255 * src/output.c (output): Adjust.
12256 * src/reader.c (parse_braces): New, factoring...
12257 (copy_action, copy_guard): these two which are renamed as...
12258 (parse_action, parse_guard): these.
12259 As a voluntary consequence, using braces around guards is now
12260 mandatory.
12261
122622001-12-27 Akim Demaille <akim@epita.fr>
12263
12264 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
12265 * src/reader.c (symbol_list): `guard' and `guard_line' are new
12266 members.
12267 (symbol_list_new): Adjust.
12268 (copy_action): action_line is the first line, not the last.
12269 (copy_guard): Just as for actions, store the `action' only, not
12270 the switch/case/break flesh.
12271 Don't parse the user action that might follow the guard, let...
12272 (readgram): do it, i.e., now, there can be an action after a
12273 guard.
12274 In other words the guard is just explicitly optional.
12275 (packgram): Adjust.
12276 * src/output.c (guards_output): New.
12277 (output_parser): Call it when needed.
12278 (output): Also free the guard and attrs obstacks.
12279 * src/files.c, src/files.h (obstack_save): Remove.
12280 (output_files): Remove.
12281 As a result, if one needs the former `.act' file, using an
12282 appropriate skeleton which requires actions and guards is now
12283 required.
12284 * src/main.c (main): Adjust.
12285 * tests/semantic.at: New.
12286 * tests/regression.at: Use `input.y' as input file name.
12287 Avoid 8+3 problems by requiring input.c when the test needs the
12288 parser.
12289
122902001-12-27 Akim Demaille <akim@epita.fr>
12291
12292 * src/reader.c (symbol_list_new): Be sure to initialize all the
12293 fields.
12294
122952001-12-27 Akim Demaille <akim@epita.fr>
12296
12297 All the hacks using a final pseudo state are now useless.
12298
12299 * src/LR0.c (set_state_table): state_table holds exactly nstates.
12300 * src/lalr.c (nLA): New.
12301 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
12302 instead of lookaheadsp from the pseudo state (nstate + 1).
12303
123042001-12-27 Akim Demaille <akim@epita.fr>
12305
12306 * src/output.c (action_row, token_actions): Use a state_t instead
12307 of a integer, and nlookaheads instead of the following state's
12308 lookaheadsp.
12309
123102001-12-27 Akim Demaille <akim@epita.fr>
12311
12312 * src/conflicts.c (log_resolution, flush_shift)
12313 (resolve_sr_conflict, set_conflicts, solve_conflicts)
12314 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
12315 (conflicts_print, print_reductions): Use a state_t instead of an
12316 integer when referring to a state.
12317 As much as possible, depend upon nlookaheads, instead of the
12318 `lookaheadsp' member of the following state (since lookaheads of
12319 successive states are successive, the difference between state n + 1
12320 and n served as the number of lookaheads for state n).
12321 * src/lalr.c (add_lookback_edge): Likewise.
12322 * src/print.c (print_core, print_actions, print_state)
12323 (print_results): Likewise.
12324 * src/print_graph.c (print_core, print_actions, print_state)
12325 (print_graph): Likewise.
12326 * src/conflicts.h: Adjust.
12327
123282001-12-27 Akim Demaille <akim@epita.fr>
12329
12330 * src/bison.hairy: Formatting/comment changes.
12331 ANSIfy.
12332 Remove `register' indications.
12333 Add plenty of `static'.
12334
123352001-12-27 Akim Demaille <akim@epita.fr>
12336
12337 * src/output.c (prepare): Drop the muscle `ntbase' which
12338 duplicates ntokens.
12339 * src/bison.simple: Formatting/comment changes.
12340 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
12341 is an undocumented synonym.
12342
123432001-12-22 Akim Demaille <akim@epita.fr>
12344
12345 * src/output.c (output_table_data): Change the prototype to use
12346 `int' for array ranges: some invocations do pass an int, not a
12347 short.
12348 Reported by Wayne Green.
12349
123502001-12-22 Akim Demaille <akim@epita.fr>
12351
12352 Some actions of web2c.y are improperly triggered.
12353 Reported by Mike Castle.
12354
12355 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
12356 * tests/regression.at (Web2c): Rename as...
12357 (Web2c Report): this.
12358 (Web2c Actions): New.
12359
123602001-12-22 Akim Demaille <akim@epita.fr>
12361
12362 Reductions in web2c.y are improperly reported.
12363 Reported by Mike Castle.
12364
12365 * src/conflicts.c (print_reductions): Fix.
12366 * tests/regression.at (Web2c): New.
12367
123682001-12-18 Akim Demaille <akim@epita.fr>
12369
12370 Some host fail on `assert (!"foo")', which expands to
12371 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
12372 Reported by Nelson Beebee.
12373
12374 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
12375 `#define it_succeeded 0' and `assert (it_succeeded)'.
12376
123772001-12-17 Marc Autret <autret_m@epita.fr>
12378
12379 * src/bison.simple: Don't hard code the skeleton line and filename.
12380 * src/output.c (output_parser): Rename 'line' as 'output_line'.
12381 New line counter 'skeleton_line' (skeleton-line muscle).
12382
123832001-12-17 Paul Eggert <eggert@twinsun.com>
12384
12385 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
12386 YYDEBUG must be defined to a nonzero value.
12387
12388 * src/bison.simple (yytname): Do not assume that the user defines
12389 YYDEBUG to a properly parenthesized expression.
12390
123912001-12-17 Akim Demaille <akim@epita.fr>
12392
12393 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
12394 nlookaheads is a new member.
12395 Adjust all users.
12396 * src/lalr.h (nlookaheads): Remove this orphan declaration.
12397 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
12398 state.
12399
124002001-12-17 Akim Demaille <akim@epita.fr>
12401
12402 * src/files.h, src/files.c (open_files, close_files): Remove.
12403 * src/main.c (main): Don't open/close files, nor invoke lex_free,
12404 let...
12405 * src/reader.c (reader): Do it.
12406
124072001-12-17 Akim Demaille <akim@epita.fr>
12408
12409 * src/conflicts.c (print_reductions): Formatting changes.
12410
124112001-12-17 Akim Demaille <akim@epita.fr>
12412
12413 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
12414 (flush_reduce): New.
12415 (resolve_sr_conflict): Adjust.
12416
124172001-12-17 Akim Demaille <akim@epita.fr>
12418
12419 * src/output.c (output_obstack): Be static and rename as...
12420 (format_obstack): this, to avoid any confusion with files.c's
12421 output_obstack.
12422 * src/reader.h (muscle_obstack): Move to...
12423 * src/output.h: here, since it's defined in output.c.
12424
124252001-12-17 Akim Demaille <akim@epita.fr>
12426
12427 * src/output.c (action_row, save_column, default_goto)
12428 (sort_actions, matching_state, pack_vector): Better variable
12429 locality.
12430
124312001-12-17 Akim Demaille <akim@epita.fr>
12432
12433 * src/output.c: Various formatting changes.
12434
124352001-12-17 Akim Demaille <akim@epita.fr>
12436
12437 * src/files.c (output_files): Free the output_obstack.
12438 * src/main.c (main): Call print and print_graph conditionally.
12439 * src/print.c (print): Work unconditionally.
12440 * src/print_graph.c (print_graph): Work unconditionally.
12441 * src/conflicts.c (log_resolution): Output only if verbose_flag.
12442
124432001-12-16 Marc Autret <autret_m@epita.fr>
12444
12445 * src/output.c (actions_output): Fix. When we use %no-lines,
12446 there is one less line per action.
12447
124482001-12-16 Marc Autret <autret_m@epita.fr>
12449
12450 * src/bison.simple: Remove a useless #line directive.
12451 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
12452 * src/output.c (get_lines_number): New.
12453 (output_parser): Adjust, now takes care about the lines of a
12454 output muscles.
12455 Fix line numbering.
12456 (actions_output): Computes the number of lines taken by actions.
12457 (output_master_parser): Insert new skeleton which is the name of
12458 the output parser file name.
12459
124602001-12-15 Marc Autret <autret_m@epita.fr>
12461
12462 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
12463
124642001-12-15 Marc Autret <autret_m@epita.fr>
12465
12466 * src/output.c (output_gram): Keep track of the hairy one.
12467
124682001-12-15 Akim Demaille <akim@epita.fr>
12469
12470 Make `make distcheck' work.
12471
12472 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
12473 system.h which uses libgettext.h.
12474
124752001-12-15 Akim Demaille <akim@epita.fr>
12476
12477 * src/nullable.c (set_nullable): Useless rules must be skipped,
12478 otherwise, since we range over their symbols, we might look at a
12479 nonterminal which no longer ``exists'', i.e., it is not counted in
12480 `nvars', hence we overflow our arrays.
12481
124822001-12-15 Akim Demaille <akim@epita.fr>
12483
12484 The header can also be produced directly, without any obstack!
12485 Yahoo!
12486
12487 * src/files.c, src/files.h (defines_obstack): Remove.
12488 (compute_header_macro): Global.
12489 (defines_obstack_save): Remove.
12490 * src/reader.c (parse_union_decl): No longer output to
12491 defines_obstack: its content can be found in the `stype' muscle
12492 anyway.
12493 (output_token_translations): Merge into...
12494 (symbols_output): this.
12495 Rename as...
12496 (symbols_save): this.
12497 (reader): Adjust.
12498 * src/output.c (header_output): New.
12499 (output): Call it.
12500
125012001-12-15 Akim Demaille <akim@epita.fr>
12502
12503 * src/reader.c (parse_union_decl): Instead of handling two obstack
12504 simultaneously, use one to define the `stype' muscle, and use the
12505 value of the latter to fill defines_obstack.
12506 (copy_comment): Remove.
12507 (copy_comment2): Work for a single obstack.
12508 Rename as...
12509 (copy_comment): this.
12510
125112001-12-15 Akim Demaille <akim@epita.fr>
12512
12513 * src/lex.c, src/lex.h (xgetc): No longer static.
12514 * src/reader.c (parse_union_decl): Revamp.
12515
125162001-12-15 Akim Demaille <akim@epita.fr>
12517
12518 Still making progress in separating Bison into (i) input, (ii)
12519 process, (iii) output: now we can directly output the parser file
12520 without using table_obstack at all.
12521
12522 * src/files.c, src/files.h (table_obstack): Bye bye.
12523 (parser_file_name): New.
12524 * src/files.c (compute_output_file_names): Compute it.
12525 * src/output.c (actions_output, output_parser)
12526 (output_master_parser): To a file instead of an obstack.
12527
125282001-12-15 Akim Demaille <akim@epita.fr>
12529
12530 Attach actions to rules, instead of pre-outputting them to
12531 actions_obstack.
12532
12533 * src/gram.h (rule_t): action and action_line are new members.
12534 * src/reader.c (symbol_list): Likewise.
12535 (copy_action): Save the actions within the rule.
12536 (packgram): Save them in rule_table.
12537 * src/output.c (actions_output): New.
12538 (output_parser): Use it on `%%actions'.
12539 (output_rule_data): Don't free rule_table.
12540 (output): Do it.
12541 (prepare): Don't save the `action' muscle.
12542 * src/bison.simple: s/%%action/%%actions/.
12543
125442001-12-15 Akim Demaille <akim@epita.fr>
12545
12546 * src/reader.c (copy_action): When --yacc, don't append a `;'
12547 to the user action: let it fail if lacking.
12548 Suggested by Arnold Robbins and Tom Tromey.
12549
125502001-12-14 Akim Demaille <akim@epita.fr>
12551
12552 * src/lex.c (literalchar): Simply return the char you decoded, non
12553 longer mess around with obstacks and int pointers.
12554 Adjust all callers.
12555
125562001-12-14 Akim Demaille <akim@epita.fr>
12557
12558 * src/lex.c (literalchar): Don't escape the special characters,
12559 just decode them, and keep them as char (before, eol was output as
12560 the 2 char string `\n' etc.).
12561 * src/output.c (output_rule_data): Use quotearg to output the
12562 token strings.
12563
125642001-12-13 Paul Eggert <eggert@twinsun.com>
12565
12566 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
12567 Do not infringe on the global user namespace when using C++.
12568 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
12569 All uses of `fprintf' and `stderr' changed.
12570
12571 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
12572
125732001-12-13 Akim Demaille <akim@epita.fr>
12574
12575 The computation of nullable is broken: it doesn't handle empty
12576 RHS's properly.
12577
12578 * tests/torture.at (GNU AWK Grammar): New.
12579 * tests/sets.at (Nullable): New.
12580 * src/nullable.c (set_nullable): Instead of blindly looping over
12581 `ritems', loop over the rules, and then over their rhs's.
12582
12583 Work around Autotest bugs.
12584
12585 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
12586 frame, because Autotest understand lines starting with a `+' as
12587 traces from the shell. Then, they are not processed properly.
12588 Admittedly an Autotest bug, but we don't have time to wait for
12589 Autotest to catch up.
12590 * tests/regression.at (Broken Closure): Adjust to the new table
12591 frames.
12592 Move to...
12593 * tests/sets.at: here.
12594
125952001-12-13 Akim Demaille <akim@epita.fr>
12596
12597 * src/closure.c (closure): Use nrules instead of playing tricks
12598 with BITS_PER_WORD.
12599
126002001-12-13 Akim Demaille <akim@epita.fr>
12601
12602 * src/print.c (print_actions): Output the handling of `$' as the
12603 traces do: shifting the token EOF. Before EOF was treated as a
12604 nonterminal.
12605 * tests/regression.at: Adjust some tests.
12606 * src/print_graph.c (print_core): Complete the set of items via
12607 closure. The next-to-final and final states are still unsatisfying,
12608 but that's to be addressed elsewhere.
12609 No longer output the rule numbers, but do output the state number.
12610 A single loop for the shifts + gotos is enough, but picked a
12611 distinct color for each.
12612 (print_graph): Initialize and finalize closure.
12613
126142001-12-13 Akim Demaille <akim@epita.fr>
12615
12616 * src/reader.c (readgram): Remove dead code, an strip useless
12617 braces.
12618 (get_type): Remove, unused.
12619
126202001-12-12 Akim Demaille <akim@epita.fr>
12621
12622 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
12623 on that of lib/error.c.
12624
126252001-12-12 Akim Demaille <akim@epita.fr>
12626
12627 Some hosts don't like `/' in includes.
12628
12629 * src/system.h: Include libgettext.h without qualifying the path.
12630 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
12631 $(top_srcdir).
12632
126332001-12-11 Marc Autret <autret_m@epita.fr>
12634
12635 * src/output.c (output_parser): Remove useless muscle.
12636
126372001-12-11 Marc Autret <autret_m@epita.fr>
12638
12639 * src/bison.simple: Remove #line just before %%epilogue. It
12640 is now handled in ...
12641 * src/reader.c (read_additionnal_code): Add the output of a
12642 #line for the epilogue.
12643
126442001-12-10 Marc Autret <autret_m@epita.fr>
12645
12646 * src/reader.c (copy_definition): Re-use CPP-outed code which
12647 replace precedent remove.
12648 * src/bison.simple: Remove #line before %%prologue because
12649 %%input-line is wrong at this time.
12650
126512001-12-10 Marc Autret <autret_m@epita.fr>
12652
12653 * src/reader.c (symbols_output): Clean up.
12654 * src/output.c (output_gram, output): Clean up.
12655
126562001-12-10 Akim Demaille <akim@epita.fr>
12657
12658 * src/lalr.c (initialize_lookaheads): New. Extracted from...
12659 * src/LR0.c (set_state_table): here.
12660 * src/lalr.c (lalr): Call it.
12661
126622001-12-10 Akim Demaille <akim@epita.fr>
12663
12664 * src/state.h (shifts): Remove the `number' member: shifts are
12665 attached to state, hence no longer need to be labelled with a
12666 state number.
12667
126682001-12-10 Akim Demaille <akim@epita.fr>
12669
12670 Now that states have a complete set of members, the linked list of
12671 shifts is useless: just fill directly the state's shifts member.
12672
12673 * src/state.h (shifts): Remove the `next' member.
12674 * src/LR0.c (first_state, last_state): Remove.
12675 Adjust the callers.
12676 (augment_automaton): Don't look for the shifts that must be added
12677 a shift on EOF: it is those of the state we looked for! But now,
12678 since shifts are attached, it is no longer needed to looking
12679 merely by its id: its number.
12680
126812001-12-10 Akim Demaille <akim@epita.fr>
12682
12683 * src/LR0.c (augment_automaton): Better variable locality.
12684 Remove an impossible branch: if there is a state corresponding to
12685 the start symbol being shifted, then there is shift for the start
12686 symbol from the initial state.
12687
126882001-12-10 Akim Demaille <akim@epita.fr>
12689
12690 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
12691 only when appropriate: when insert_start_shifting_state' is not
12692 invoked.
12693 * tests/regression.at (Rule Line Numbers): Adjust.
12694
126952001-12-10 Akim Demaille <akim@epita.fr>
12696
12697 * src/LR0.c (augment_automaton): Now that all states have shifts,
12698 merge the two cases addition shifts to the initial state.
12699
127002001-12-10 Akim Demaille <akim@epita.fr>
12701
12702 * src/lalr.c (set_state_table): Move to...
12703 * src/LR0.c: here.
12704 * src/lalr.c (lalr): Don't call it...
12705 * src/LR0.c (generate_states): do it.
12706 * src/LR0.h (first_state): Remove, only the table is used.
12707
127082001-12-10 Akim Demaille <akim@epita.fr>
12709
12710 * src/LR0.h (first_shift, first_reduction): Remove.
12711 * src/lalr.c: Don't use first_shift: find shifts through the
12712 states.
12713
127142001-12-10 Akim Demaille <akim@epita.fr>
12715
12716 * src/LR0.c: Attach shifts to states as soon as they are
12717 computed.
12718 * src/lalr.c (set_state_table): Instead of assigning shifts to
12719 state, just assert that the mapping was properly done.
12720
127212001-12-10 Akim Demaille <akim@epita.fr>
12722
12723 * src/LR0.c (insert_start_shift): Rename as...
12724 (insert_start_shifting_state): this.
12725 (insert_eof_shifting_state, insert_accepting_state): New.
12726 (augment_automaton): Adjust.
12727 Better locality of the variables.
12728 When looking if the start_symbol is shifted from the initial
12729 state, using `while (... symbol != start_symbol ...)' sounds
12730 better than `while (... symbol < start_symbol ...)': If fail
12731 to see how the order between symbols could be relevant!
12732
127332001-12-10 Akim Demaille <akim@epita.fr>
12734
12735 * src/getargs.h: Don't declare `spec_name_prefix' and
12736 `spec_file_prefix', declared by src/files.h.
12737 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
12738 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
12739 * src/output.c (prepare): Adjust.
12740 * src/reader.c (symbols_output): Likewise.
12741 * src/vmsgetargs.c: Vaguely adjust, but who cares?
12742
127432001-12-10 Akim Demaille <akim@epita.fr>
12744
12745 * src/muscle_tab.c (muscle_init): NULL is a better default than
12746 `"0"'.
12747
127482001-12-10 Akim Demaille <akim@epita.fr>
12749
12750 * src/reader.c (reader): Calling symbols_output once is enough.
12751
127522001-12-10 Akim Demaille <akim@epita.fr>
12753
12754 Now that states have a complete set of members, the linked list of
12755 reductions is useless: just fill directly the state's reductions
12756 member.
12757
12758 * src/state.h (struct reductions): Remove member `number' and
12759 `next'.
12760 * src/LR0.c (first_reduction, last_reduction): Remove.
12761 (save_reductions): Don't link the new reductions, store them in
12762 this_state.
12763 * src/lalr.c (set_state_table): No need to attach reductions to
12764 states, it's already done.
12765 * src/output.c (output_actions): No longer free the shifts, then
12766 the reductions, then the states: free all the states and their
12767 members.
12768
127692001-12-10 Akim Demaille <akim@epita.fr>
12770
12771 * src/options.c (OPTN, DRTV, BOTH): New.
12772 (option_table): Use them.
12773
12774 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
12775 the job of system.h.
12776 * src/options.c: Don't include stdio.h and xalloc.h for the same
12777 reasons.
12778
127792001-12-10 Akim Demaille <akim@epita.fr>
12780
12781 * src/output.c (output, prepare): Make sure the values of the
12782 muscles `action' and `prologue' are 0-terminated.
12783
127842001-12-10 Akim Demaille <akim@epita.fr>
12785
12786 Clean up GCC warnings.
12787
12788 * src/reader.c (copy_action): `buf' is not used.
12789 (parse_skel_decl): Be static.
12790 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
12791 * src/options.h (create_long_option_table): Have a real prototype.
12792 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
12793 (hash_delete_at): Return const void *.
12794 Adjust casts to preserve the const.
12795
127962001-12-10 Akim Demaille <akim@epita.fr>
12797
12798 * configure.in: Require 2.52g.
12799 M4 is not needed, but AUTOM4TE is.
12800 * m4/m4.m4: Remove.
12801 * tests/Makefile.am: Adjust.
12802
128032001-12-10 Akim Demaille <akim@epita.fr>
12804
12805 One structure for states is enough, even though theoretically
12806 there are LR(0) states and LALR(1) states.
12807
12808 * src/lalr.h (state_t): Remove.
12809 (state_table): Be state_t **, not state_t *.
12810 * src/state.h (core, CORE_ALLOC): Rename as...
12811 (state_t, STATE_ALLOC): this.
12812 Add the LALR(1) members: shifts, reductions, errs.
12813 * src/LR0.c (state_table): Rename as...
12814 (state_hash): this, to avoid name clashes with the global
12815 `state_table'.
12816 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
12817 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
12818
128192001-12-10 Akim Demaille <akim@epita.fr>
12820
12821 Bison dumps core on bash.y.
12822 Reported by Pascal Bart.
12823
12824 * src/warshall.c (bitmatrix_print): New.
12825 (TC): Use it.
12826 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
12827 j must be the outer loop.
12828 * tests/regression.at (Broken Closure): New.
12829
128302001-12-05 Akim Demaille <akim@epita.fr>
12831
12832 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
12833 its argument.
12834 Reported by Peter Hamorsky.
12835
128362001-12-05 Akim Demaille <akim@epita.fr>
12837
12838 * src/conflicts.c (err_table): Remove.
12839 (resolve_sr_conflict): Adjust.
12840 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
12841 Rename as...
12842 (state_t.reductions, state_t.shifts): this.
12843
128442001-12-05 Akim Demaille <akim@epita.fr>
12845
12846 * src/reduce.c (reduce_grammar_tables): No longer disable the
12847 removal of useless rules via CPP but via `if (0)', so that the
12848 compiler still check the code is valid.
12849 For instance, it should have noticed `rline' no longer exists: use
12850 the `line' member of rule_t.
12851 * src/gram.c (dummy, rline): Remove, unused.
12852
128532001-12-05 Akim Demaille <akim@epita.fr>
12854
12855 * src/output.c (pack_vector): Use assert, not berror.
12856 * src/main.c (berror): Remove, unused.
12857
128582001-12-05 Akim Demaille <akim@epita.fr>
12859
12860 New experimental feature: if --verbose --trace output all the
12861 items of a state, not only its kernel.
12862
12863 * src/print.c (print_core): If `trace_flag', then invoke closure
12864 before outputting the items of the state (print_core is no longer
12865 a correct name them).
12866 (print_results): Invoke new_closure/free_closure if needed.
12867
128682001-12-05 Akim Demaille <akim@epita.fr>
12869
12870 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
12871 * src/closure.c, src/closure.h (itemsetsize): Rename as...
12872 (nitemset): for consistency with the rest of the project.
12873
128742001-12-05 Akim Demaille <akim@epita.fr>
12875
12876 * src/closure.c (print_closure): Improve.
12877 (closure): Use it for printing input and output.
12878
128792001-12-05 Akim Demaille <akim@epita.fr>
12880
12881 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
12882 indexed by nonterminals.
12883
128842001-12-05 Akim Demaille <akim@epita.fr>
12885
12886 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
12887 what it was!).
12888 * src/warshall.h: Remove accidental duplication of the content.
12889
128902001-12-05 Akim Demaille <akim@epita.fr>
12891
12892 * src/closure.c (set_fderives): De-obfuscate.
12893
128942001-12-05 Akim Demaille <akim@epita.fr>
12895
12896 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
12897
128982001-12-05 Akim Demaille <akim@epita.fr>
12899
12900 * src/closure.c (set_firsts): De-obfuscate.
12901
129022001-12-05 Akim Demaille <akim@epita.fr>
12903
12904 * src/output.c (action_row): De-obfuscate
12905 using the good o' techniques: arrays not pointers, variable
12906 locality, BITISSET, RESETBIT etc.
12907
129082001-12-05 Akim Demaille <akim@epita.fr>
12909
12910 Pessimize the code to simplify it: from now on, all the states
12911 have a valid SHIFTS, which NSHIFTS is possibly 0.
12912
12913 * src/LR0.c (shifts_new): Be global and move to..
12914 * src/state.c, src/state.h: here.
12915 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
12916 * src/print_graph: Adjust.
12917
129182001-12-05 Akim Demaille <akim@epita.fr>
12919
12920 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
12921 * src/conflicts.c: Use it.
12922 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
12923 incorrectly ``simplified''.
12924
129252001-12-05 Akim Demaille <akim@epita.fr>
12926
12927 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
12928 using the good o' techniques: arrays not pointers, variable
12929 locality, BITISSET, RESETBIT etc.
12930
129312001-12-05 Akim Demaille <akim@epita.fr>
12932
12933 * src/state.h (SHIFT_SYMBOL): New.
12934 * src/conflicts.c: Use it to deobfuscate.
12935
129362001-12-05 Akim Demaille <akim@epita.fr>
12937
12938 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
12939 (print_reductions): De-obfuscate using the good o' techniques:
12940 arrays not pointers, variable locality, BITISSET.
12941
129422001-12-05 Akim Demaille <akim@epita.fr>
12943
12944 * src/conflicts.c (print_reductions): Arrays, not pointers.
12945 Use BITISSET.
12946
129472001-12-05 Akim Demaille <akim@epita.fr>
12948
12949 * src/conflicts.c (print_reductions): Pessimize, but clarify.
12950
129512001-12-05 Akim Demaille <akim@epita.fr>
12952
12953 * src/conflicts.c (print_reductions): Improve variable locality.
12954
129552001-12-05 Akim Demaille <akim@epita.fr>
12956
12957 * src/conflicts.c (print_reductions): Pessimize, but clarify.
12958
129592001-12-05 Akim Demaille <akim@epita.fr>
12960
12961 * src/conflicts.c (print_reductions): Improve variable locality.
12962
129632001-12-05 Akim Demaille <akim@epita.fr>
12964
12965 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
12966 * src/lalr.c: Use them.
12967
129682001-12-05 Akim Demaille <akim@epita.fr>
12969
12970 * src/LR0.c (augment_automaton): Formatting changes.
12971 Better variable locality.
12972
129732001-12-05 Akim Demaille <akim@epita.fr>
12974
12975 * src/lalr.c (matrix_print): New.
12976 (transpose): Use it.
12977 Use arrays instead of pointers.
12978
129792001-12-05 Akim Demaille <akim@epita.fr>
12980
12981 * src/lalr.c (maxrhs): Move to...
12982 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
12983 * src/lalr.c (build_relations): Adjust.
12984
129852001-12-05 Akim Demaille <akim@epita.fr>
12986
12987 * src/lalr.c (transpose): Free the memory allocated to the
12988 argument, as it is replaced by the results by the unique caller.
12989 (build_relations): Merely invoke transpose: it handles the memory
12990 deallocation.
12991 Improve variable locality.
12992 Avoid variables used as mere abbreviations.
12993 (compute_lookaheads): Use arrays instead of pointers.
12994
129952001-12-05 Akim Demaille <akim@epita.fr>
12996
12997 * src/lalr.c (initialize_F): Improve variable locality.
12998 Avoid variables used as mere abbreviations.
12999
130002001-12-05 Akim Demaille <akim@epita.fr>
13001
13002 * src/derives.c (print_derives): Display the ruleno.
13003 * src/lalr.c (initialize_F, transpose): Better variable locality
13004 to improve readability.
13005 Avoid variables used as mere abbreviations.
13006
130072001-12-05 Akim Demaille <akim@epita.fr>
13008
13009 * src/lalr.c (traverse): Use arrays instead of pointers.
13010
130112001-12-05 Akim Demaille <akim@epita.fr>
13012
13013 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
13014 the handling of squeue.
13015 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13016
130172001-12-05 Akim Demaille <akim@epita.fr>
13018
13019 Because useless nonterminals are now kept alive (instead of being
13020 `destroyed'), we now sometimes examine them, and store information
13021 related to them. Hence we need to know their number, and adjust
13022 memory allocations.
13023
13024 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
13025 static.
13026 * src/LR0.c (allocate_itemsets): The memory allocated to
13027 `symbol_count' was used for two different purpose: once to count
13028 the number of occurrences of each symbol, and later reassigned to
13029 `shift_symbol', containing the symbol that can be shifted from a
13030 given state.
13031 Deobfuscate, i.e., allocate, use and free `symbol_count' here
13032 only, and...
13033 (new_itemsets): Allocate `shift_symbol' here.
13034 (allocate_itemsets): symbol_count includes useless nonterminals.
13035 Make room for them.
13036 (free_storage): Use `free', not `XFREE', for pointers that cannot
13037 be null.
13038
130392001-12-05 Akim Demaille <akim@epita.fr>
13040
13041 * src/nullable.c (set_nullable): Deobfuscate the handling of
13042 ritem.
13043 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
13044
130452001-12-05 Akim Demaille <akim@epita.fr>
13046
13047 * src/gram.c, src/gram.h (ritem_print): New.
13048 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
13049 (This useless function was defined only to work around VMS linkers
13050 that can't handle compilation units with variables only).
13051 * src/reduce.c (dump_grammar): Use it to trace the construction of
13052 ritem.
13053
130542001-12-04 Paul Eggert <eggert@twinsun.com>
13055
13056 * src/bison.simple (union yyalloc): Change member names
13057 to be the same as the stack names.
13058 (yyparse): yyptr is now union yyalloc *, not char *.
13059 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
13060 and may generate better code on some machines.
13061 (yystpcpy): Use prototype if __STDC__ is defined, not just
13062 if __cplusplus is defined.
13063
130642001-11-30 Akim Demaille <akim@epita.fr>
13065
13066 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
13067 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
13068 Gettext doesn't compile cleanly, and dies with -Werror.
13069 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
13070 Include WARNING_CFLAGS here.
13071 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
13072 before being defined.
13073
130742001-11-27 Paul Eggert <eggert@twinsun.com>
13075
13076 * lib/quotearg.h (quotearg_n, quotearg_n_style):
13077 First arg is int, not unsigned.
13078 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
13079 (SIZE_MAX, UINT_MAX): New macros.
13080 (quotearg_n_options): Abort if N is negative.
13081 Avoid overflow check on hosts where size_t is 64 bits and int
13082 is 32 bits, as overflow is impossible there.
13083 Fix off-by-one typo that caused unnecessary reallocation.
13084
130852001-11-29 Paul Eggert <eggert@twinsun.com>
13086
13087 Name space cleanup in generated parser.
13088
13089 * doc/bison.texinfo (Bison Parser): Discuss system headers
13090 and their effect on the user name space.
13091
13092 * src/bison.simple:
13093 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
13094 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
13095 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
13096
13097 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
13098 on user names when possible.
13099
13100 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
13101 Simplify test for whather <alloca.h> exists.
13102
13103 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
13104
13105 (<stdio.h>): Include if YYDEBUG.
13106
13107 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
13108 ! defined (yyoverflow) && ! defined (yymemcpy).
13109
13110 (yymemcpy, yyparse): Rename local variables as needed so that
13111 they all begin with 'yy'.
13112
13113 (yystrlen, yystpcpy): New functions.
13114
13115 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
13116 All uses changed.
13117
13118 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
13119 instead of relying on string.h functions. Use YYSTACK_ALLOC
13120 and YYSTACK_FREE instead of malloc and free.
13121
131222001-11-30 Akim Demaille <akim@epita.fr>
13123
13124 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
13125 before their first uses.
13126 (YYBISON, YYPURE): Move to the top of the output.
13127
131282001-11-30 Akim Demaille <akim@epita.fr>
13129
13130 * tests/reduce.at (Useless Nonterminals): Fix.
13131
131322001-11-30 Akim Demaille <akim@epita.fr>
13133
13134 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
13135 if body instead of `;' to pacify GCC's warnings.
13136
131372001-11-30 Akim Demaille <akim@epita.fr>
13138
13139 Instead of mapping the LHS of unused rules to -1, keep the LHS
13140 valid, but flag the rules as invalid.
13141
13142 * src/gram.h (rule_t): `useful' is a new member.
13143 * src/print.c (print_grammar): Adjust.
13144 * src/derives.c (set_derives): Likewise.
13145 * src/reader.c (packgram, reduce_output): Likewise.
13146 * src/reduce.c (reduce_grammar_tables): Likewise.
13147 * tests/reduce.at (Underivable Rules, Useless Rules): New.
13148
131492001-11-30 Akim Demaille <akim@epita.fr>
13150
13151 * src/reduce.c (reduce_output): Formatting changes.
13152 * src/print.c (print_results, print_grammar): Likewise.
13153 * tests/regression.at (Rule Line Numbers)
13154 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
13155
131562001-11-30 Akim Demaille <akim@epita.fr>
13157
13158 * src/reduce.c (nonterminals_reduce): Instead of throwing away
13159 useless nonterminals, move them at the end of the symbol arrays.
13160 (reduce_output): Adjust.
13161 * tests/reduce.at (Useless Nonterminals): Adjust.
13162
131632001-11-30 Akim Demaille <akim@epita.fr>
13164
13165 * src/reduce.c: Various comment/formatting changes.
13166 (nonterminals_reduce): New, extracted from...
13167 (reduce_grammar_tables): here.
13168 (reduce_grammar): Call nonterminals_reduce.
13169
131702001-11-29 Paul Eggert <eggert@twinsun.com>
13171
13172 * src/bison.simple (YYSTACK_REALLOC): Remove.
13173 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
13174 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
13175 New macros.
13176 (union yyalloc): New type.
13177 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
13178 an arbitrary restriction on hosts where size_t is wider than int.
13179
13180 (yyparse): Don't dump core if alloca or malloc fails; instead, report
13181 a parser stack overflow. Allocate just one block of memory for all
13182 three stacks, instead of allocating three blocks; this typically is
13183 faster and reduces fragmentation.
13184
13185 Do not limit the number of items in the stack to a value that fits
13186 in 'int', as this is an arbitrary limit on hosts with 64-bit
13187 size_t and 32-bit int.
13188
131892001-11-29 Marc Autret <autret_m@epita.fr>
13190
13191 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
13192 of defining YYERROR_VERBOSE.
13193 [AT_DATA]: $4 is now out of C declarations in the prologue.
13194
131952001-11-28 Marc Autret <autret_m@epita.fr>
13196
13197 * src/reader.c (parse_dquoted_param): New.
13198 (parse_skel_decl): Use it.
13199 * src/lex.h: Add its prototype.
13200 * src/lex.c (literalchar): Become not static.
13201
132022001-11-28 Marc Autret <autret_m@epita.fr>
13203
13204 * src/output.h: And put its extern declaration here.
13205 * src/output.c (error_verbose): Define here.
13206 (prepare): Echo name modification.
13207 * src/getargs.h: Clean its extern declaration.
13208 * src/getargs.c (error_verbose_flag): Remove.
13209 (getargs): Remove case 'e'.
13210 * src/options.c (option_table): 'error-verbose' is now seen as simple
13211 percent option.
13212 Include output.h.
13213
13214 * src/reader.c (read_declarations): Remove case tok_include.
13215 (parse_include_decl): Remove.
13216 * src/lex.h (token_t): Remove tok_include.
13217 * src/options.c (option_table): 'include' is now a simple command line
13218 option.
13219
132202001-11-28 Marc Autret <autret_m@epita.fr>
13221
13222 * src/bison.simple: Adjust muscle names.
13223 * src/muscle_tab.c (muscle_init): Also rename the muscles.
13224 * src/output.c (prepare): s/_/-/ for the muscles names.
13225 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
13226
132272001-11-28 Marc Autret <autret_m@epita.fr>
13228
13229 * src/bison.simple: Fix debug.
13230 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
13231
132322001-11-28 Akim Demaille <akim@epita.fr>
13233
13234 * src/LR0.c (shifts_new): New.
13235 (save_shifts, insert_start_shift, augment_automaton): Use it.
13236
132372001-11-28 Akim Demaille <akim@epita.fr>
13238
13239 * src/closure.c (closure): `b' and `ruleno' denote the same value:
13240 keep ruleno only.
13241
132422001-11-28 Akim Demaille <akim@epita.fr>
13243
13244 * src/closure.c (closure): Instead of looping over word in array
13245 then bits in words, loop over bits in array.
13246
132472001-11-28 Akim Demaille <akim@epita.fr>
13248
13249 * src/closure.c (closure): No longer optimize the special case
13250 where all the bits of `ruleset[r]' are set to 0, to make the code
13251 clearer.
13252
132532001-11-28 Akim Demaille <akim@epita.fr>
13254
13255 * src/closure.c (closure): `r' and `c' are new variables, used to
13256 de-obfuscate accesses to RULESET and CORE.
13257
132582001-11-28 Akim Demaille <akim@epita.fr>
13259
13260 * src/reduce.c (reduce_print): Use ngettext.
13261 (dump_grammar): Improve the trace accuracy.
13262
132632001-11-28 Akim Demaille <akim@epita.fr>
13264
13265 * src/reduce.c (dump_grammar): Don't translate trace messages.
13266
132672001-11-28 Akim Demaille <akim@epita.fr>
13268
13269 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
13270 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
13271 as all tags are free'ed afterwards.
13272 From Enrico Scholz.
13273
132742001-11-27 Paul Eggert <eggert@twinsun.com>
13275
13276 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
13277 use alloca when we didn't want to, and vice versa.
13278
132792001-11-27 Marc Autret <autret_m@epita.fr>
13280
13281 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
13282 initialization.
13283 * src/output.c (prepare): Remove its update.
13284
132852001-11-27 Marc Autret <autret_m@epita.fr>
13286
13287 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
13288 Use %error-verbose.
13289
132902001-11-27 Marc Autret <autret_m@epita.fr>
13291
13292 * src/bison.simple: Remove YYERROR_VERBOSE using.
13293 Use %%error_verbose.
13294 (yyparse): Likewise.
13295 * src/output.c (prepare): Give its final value.
13296 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
13297 * src/getargs.h: Add its extern declaration.
13298 * src/getargs.c (error_verbose_flag): New int.
13299 (getargs): Update to catch new case.
13300 * src/options.c (option_table): 'error-verbose' is a new option.
13301 (shortopts): Update.
13302
133032001-11-27 Akim Demaille <akim@epita.fr>
13304
13305 * src/system.h: Use intl/libgettext.h.
13306 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
13307
133082001-11-27 Akim Demaille <akim@epita.fr>
13309
13310 * tests/torture.at (Exploding the Stack Size with Malloc):
13311 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
13312
133132001-11-27 Akim Demaille <akim@epita.fr>
13314
13315 * src/files.c: Include error.h.
13316 Reported by Hans Aberg.
13317
133182001-11-26 Marc Autret <autret_m@epita.fr>
13319
13320 * src/reader.c (parse_include_decl): New, not yet implemented.
13321 (read_declarations): Add case tok_include.
13322 * src/getargs.h (include): Add its extern definition.
13323 * src/getargs.c (include): New const char *.
13324 (getargs): Add case '-I'.
13325 * src/options.c (option_table): Add include as command line and
13326 percent option.
13327 * src/lex.h (token_t): Add tok_include.
13328
133292001-11-26 Akim Demaille <akim@epita.fr>
13330
13331 * src/reader.c (readgram): Make sure rules for mid-rule actions
13332 have a lineno equal to that of their host rule.
13333 Reported by Hans Aberg.
13334 * tests/regression.at (Rule Line Numbers): New.
13335
133362001-11-26 Akim Demaille <akim@epita.fr>
13337
13338 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
13339 size_ts.
13340
133412001-11-26 Akim Demaille <akim@epita.fr>
13342
13343 * src/complain.c, src/complain.h (error): Remove, provided by
13344 lib/error.[ch].
13345
133462001-11-26 Akim Demaille <akim@epita.fr>
13347
13348 * src/reader.c (read_declarations): Don't abort on tok_illegal,
13349 issue an error message.
13350 * tests/regression.at (Invalid %directive): New.
13351 Reported by Hans Aberg.
13352
133532001-11-26 Akim Demaille <akim@epita.fr>
13354
13355 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
13356 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
13357
133582001-11-26 Akim Demaille <akim@epita.fr>
13359
13360 * src/conflicts.c (conflicts_print): Don't complain at all when
13361 there are no reduce/reduce conflicts, and as many shift/reduce
13362 conflicts as expected.
13363 * tests/regression.at (%expect right): Adjust.
13364
133652001-11-23 Akim Demaille <akim@epita.fr>
13366
13367 * lib/alloca.c: Update, from fileutils.
13368
133692001-11-23 Akim Demaille <akim@epita.fr>
13370
13371 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
13372
133732001-11-23 Akim Demaille <akim@epita.fr>
13374
13375 * src/system.h: Include alloca.h.
13376 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
13377
133782001-11-23 Akim Demaille <akim@epita.fr>
13379
13380 * src/print_graph.c (print_actions): Remove `rule', unused.
13381 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
13382 pacify GCC's signed < unsigned warnings.
13383 * src/closure.c (itemsetsize): Likewise.
13384 * src/reader.c (symbol_list_new): Static.
13385
133862001-11-23 Akim Demaille <akim@epita.fr>
13387
13388 Attaching lineno to buckets is stupid, since only one copy of each
13389 symbol is kept, only the line of the first occurrence is kept too.
13390
13391 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
13392 * src/reader.c (rline_allocated): Remove, unused.
13393 (symbol_list): Have a `line' member.
13394 (symbol_list_new): New.
13395 (readgram): Use it.
13396 * src/print.c (print_grammar): Output the rule line numbers.
13397 * tests/regression.at (Solved SR Conflicts)
13398 (Unresolved SR Conflicts): Adjust.
13399 Reported by Hans Aberg.
13400
134012001-11-22 Marc Autret <autret_m@epita.fr>
13402
13403 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
13404
134052001-11-22 Marc Autret <autret_m@epita.fr>
13406
13407 * src/muscle_tab.c (muscle_init): Remove initialization of
13408 skeleton muscle.
13409 * src/output.c (output_master_parser): Do it here.
13410
134112001-11-20 Akim Demaille <akim@epita.fr>
13412
13413 * po/sv.po: New.
13414 * configure.in (ALL_LINGUAS): Adjust.
13415 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
13416 longer contains strings to translate.
13417
134182001-11-19 Akim Demaille <akim@epita.fr>
13419
13420 * src/conflicts.c (conflicts_print): Add a missing \n.
13421
134222001-11-19 Akim Demaille <akim@epita.fr>
13423
13424 * src/nullable.c (nullable_print): New.
13425 (set_nullable): Call it when tracing.
13426 Better locality of variables.
13427
134282001-11-19 Akim Demaille <akim@epita.fr>
13429
13430 * src/print.c (print_actions): Better locality of variables.
13431
134322001-11-19 Akim Demaille <akim@epita.fr>
13433
13434 * src/derives.c (print_derives): Fix and enrich.
13435 * src/closure.c (print_fderives): Likewise.
13436
134372001-11-19 Akim Demaille <akim@epita.fr>
13438
13439 * src/closure.c (itemsetend): Remove, replaced with...
13440 (itemsetsize): new.
13441
134422001-11-19 Akim Demaille <akim@epita.fr>
13443
13444 * src/LR0.c (kernel_end): Remove, replaced with...
13445 (kernel_size): new.
13446
134472001-11-19 Akim Demaille <akim@epita.fr>
13448
13449 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
13450 to clarify.
13451
134522001-11-19 Akim Demaille <akim@epita.fr>
13453
13454 * src/closure.c (closure): Use arrays instead of pointers to clarify.
13455
134562001-11-19 Akim Demaille <akim@epita.fr>
13457
13458 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
13459 trace messages.
13460 * src/LR0.c: Likewise.
13461 (allocate_itemsets): Use arrays instead of pointers to clarify.
13462
134632001-11-19 Akim Demaille <akim@epita.fr>
13464
13465 * src/getargs.c (statistics_flag): Replace with...
13466 (trace_flag): New.
13467 (longopts): Accept --trace instead of --statistics.
13468 * src/getargs.h, src/options.c: Adjust.
13469 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
13470 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
13471
134722001-11-19 Akim Demaille <akim@epita.fr>
13473
13474 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
13475 pointers to clarify the code.
13476 (save_reductions, save_shifts): Factor common parts of alternatives.
13477
134782001-11-19 Akim Demaille <akim@epita.fr>
13479
13480 * src/LR0.c (new_state, get_state): Complete TRACE code.
13481 * src/closure.c: Include `reader.h' to get `tags', needed by the
13482 trace code.
13483 Rename the conditional DEBUG as TRACE.
13484 Output consistently TRACEs to stderr, not stdout.
13485 * src/derives.c: Likewise.
13486 * src/reduce.c: (inaccessable_symbols): Using if is better style
13487 than goto.
13488 Use `#if TRACE' instead of `#if 0' for tracing code.
13489
134902001-11-19 Akim Demaille <akim@epita.fr>
13491
13492 * src/system.h (LIST_FREE, shortcpy): New.
13493 * src/LR0.c: Use them.
13494 * src/output.c (free_itemsets, free_reductions, free_shifts):
13495 Remove, replaced by LIST_FREE.
13496
134972001-11-19 Akim Demaille <akim@epita.fr>
13498
13499 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
13500 (REDUCTIONS_ALLOC): New.
13501 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
13502 allocation.
13503
135042001-11-19 Akim Demaille <akim@epita.fr>
13505
13506 * src/LR0.c (new_state): Complete trace code.
13507 * src/nullable.c (set_nullable): Don't translate traces.
13508
135092001-11-19 Akim Demaille <akim@epita.fr>
13510
13511 * src/print_graph.c (print_core): Better locality of variables.
13512 * src/print.c (print_core): Likewise.
13513
135142001-11-19 Akim Demaille <akim@epita.fr>
13515
13516 * src/vcg.c: You do the output, so you are responsible of the
13517 handling of VCG syntax, in particular: use quotearg.
13518 * src/print_graph.c: Don't.
13519 (print_actions): Don't output the actions as part of the nodes,
13520 since that's the job of the edges.
13521 (print_state): Don't output by hand: fill the node description,
13522 and ask for its output.
13523
135242001-11-19 Akim Demaille <akim@epita.fr>
13525
13526 * src/bison.simple (yyparse): When verbosely reporting an error,
13527 no longer put additional quotes around token names.
13528 * tests/calc.at: Adjust.
13529
135302001-11-19 Akim Demaille <akim@epita.fr>
13531
13532 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
13533 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
13534 * src/output.c: Adjust.
13535
135362001-11-19 Akim Demaille <akim@epita.fr>
13537
13538 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
13539 (rule_t): this.
13540 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
13541
135422001-11-19 Akim Demaille <akim@epita.fr>
13543
13544 * src/gram.h (rule_t): New.
13545 (rule_table): New.
13546 (rrhs, rlhs): Remove, part of state_t.
13547 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
13548 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
13549 * src/reader.c, src/reduce.c: Adjust.
13550
135512001-11-19 Akim Demaille <akim@epita.fr>
13552
13553 * src/reader.c (symbols_output): New, extracted from...
13554 (packsymbols): Here.
13555 (reader): Call it.
13556
135572001-11-19 Akim Demaille <akim@epita.fr>
13558
13559 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
13560 (maxrhs): this new function.
13561
135622001-11-19 Akim Demaille <akim@epita.fr>
13563
13564 * src/lalr.c (F): New macro to access the variable F.
13565 Adjust.
13566
135672001-11-19 Akim Demaille <akim@epita.fr>
13568
13569 * src/lalr.h (LA): New macro to access the variable LA.
13570 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13571 * src/lalr.c: Adjust.
13572
135732001-11-19 Akim Demaille <akim@epita.fr>
13574
13575 * src/lalr.c (initialize_LA): Only initialize LA. Let...
13576 (set_state_table): handle the `lookaheads' members.
13577
135782001-11-19 Akim Demaille <akim@epita.fr>
13579
13580 * src/lalr.h (lookaheads): Removed array, whose contents is now
13581 a member of...
13582 (state_t): this structure.
13583 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13584 Adjust.
13585
135862001-11-19 Akim Demaille <akim@epita.fr>
13587
13588 * src/lalr.h (consistent): Removed array, whose contents is now
13589 a member of...
13590 (state_t): this structure.
13591 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13592 Adjust.
13593
135942001-11-19 Akim Demaille <akim@epita.fr>
13595
13596 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
13597 contents are now members of...
13598 (state_t): this structure.
13599 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
13600 Adjust.
13601
136022001-11-19 Akim Demaille <akim@epita.fr>
13603
13604 * src/lalr.h (state_t): New.
13605 (state_table): Be a state_t * instead of a core **.
13606 (accessing_symbol): Remove, part of state_t.
13607 * src/lalr.c: Adjust.
13608 (set_accessing_symbol): Merge into...
13609 (set_state_table): this.
13610 * src/print_graph.c, src/conflicts.c: Adjust.
13611
136122001-11-14 Akim Demaille <akim@epita.fr>
13613
13614 * tests/calc.at, tests/output.at, tests/regression.at,
13615 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
13616 now the tests are run in private dirs, therefore AC_CLEANUP and
13617 family can be simplified to 0-ary.
13618 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
13619 use abs. path to find config.h.
13620 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
13621 stderr, there can be way too much random noise.
13622 Instead pass -Werror to GCC and rely on the exit status.
13623 Reported by Wolfram Wagner.
13624
136252001-11-14 Akim Demaille <akim@epita.fr>
13626
13627 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
13628 defined only if yyoverflow is defined, to avoid `warning: unused
13629 variable `yyvs1''.
13630 Reported by The Test Suite.
13631
136322001-11-14 Akim Demaille <akim@epita.fr>
13633
13634 * src/print.c: Include reduce.h.
13635 Reported by Hans Aberg.
13636
136372001-11-14 Akim Demaille <akim@epita.fr>
13638
13639 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
13640 Revert a previous patch: these are really const.
13641 * src/conflicts.c (conflict_report): Additional useless pair of
13642 braces to pacify GCC's warnings for `if () if () {} else {}'.
13643 * src/lex.c (parse_percent_token): Replace equal_offset with
13644 arg_offset.
13645 arg is const.
13646 Be sure to strdup `arg' when used, since there is no reason for
13647 token_buffer not to change.
13648
136492001-11-14 Akim Demaille <akim@epita.fr>
13650
13651 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
13652 definition.
13653 * src/main.c (main): Use them.
13654 Suggested by Hans Aberg.
13655
136562001-11-12 Akim Demaille <akim@epita.fr>
13657
13658 * src/system.h (ngettext): Now that we use ngettext, be sure to
13659 provide a default definition when NLS are not used.
13660
136612001-11-12 Akim Demaille <akim@epita.fr>
13662
13663 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
13664 Use @kbd to denote user input.
13665 (Language and Grammar): ANSIfy the example.
13666 Adjust its layout for info/notinfo.
13667 (Location Tracking Calc): Output error messages to stderr.
13668 Output locations in a more GNUtically correct way.
13669 Fix a couple of Englishos.
13670 Adjust @group/@end group pairs.
13671
136722001-11-12 Akim Demaille <akim@epita.fr>
13673
13674 %expect was not functioning at all.
13675
13676 * src/conflicts.c (expected_conflicts): Set to -1.
13677 (conflict_report): Use ngettext.
13678 (conflicts_print): Check %expect and make its violation an error.
13679 * doc/bison.texinfo (Expect Decl): Adjust.
13680 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
13681 * tests/regression.at (%expect not enough, %expect right)
13682 (%expect too much): New.
13683
136842001-11-12 Akim Demaille <akim@epita.fr>
13685
13686 * tests/regression.at (Conflicts): Rename as...
13687 (Unresolved SR Conflicts): this.
13688 (Solved SR Conflicts): New.
13689
136902001-11-12 Akim Demaille <akim@epita.fr>
13691
13692 * src/reduce.c (print_results): Rename as...
13693 (reduce_output): This.
13694 Output to OUT, passed as argument, instead of output_obstack.
13695 (dump_grammar): Likewise.
13696 (reduce_free): New.
13697 Also free V1.
13698 (reduce_grammar): No longer call reduce_output, since...
13699 * src/print.c (print_results): do it.
13700 * src/main.c (main): Call reduce_free;
13701
137022001-11-12 Akim Demaille <akim@epita.fr>
13703
13704 * src/conflicts.c (print_reductions): Accept OUT as argument.
13705 Output to it, not to output_obstack.
13706 * src/print.c (print_actions): Adjust.
13707
137082001-11-12 Akim Demaille <akim@epita.fr>
13709
13710 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
13711 the result instead of using...
13712 (src_total, rrc_total, src_count, rrc_count): Remove.
13713 (any_conflicts): Remove.
13714 (print_conflicts): Split into...
13715 (conflicts_print, conflicts_output): New.
13716 * src/conflicts.h: Adjust.
13717 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
13718 * src/print.c (print_grammar): Issue `\n' between two rules.
13719 * tests/regression.at (Conflicts): New.
13720 Reported by Tom Lane.
13721
137222001-11-12 Akim Demaille <akim@epita.fr>
13723
13724 * tests/regression.at (Invalid input): Remove, duplicate with
13725 ``Invalid input: 1''.
13726
137272001-11-12 Akim Demaille <akim@epita.fr>
13728
13729 * tests/torture.at (AT_DATA_STACK_TORTURE)
13730 (Exploding the Stack Size with Alloca)
13731 (Exploding the Stack Size with Malloc): New.
13732
137332001-11-12 Akim Demaille <akim@epita.fr>
13734
13735 * src/bison.simple (YYSTACK_REALLOC): New.
13736 (yyparse) [!yyoverflow]: Use it and free the old stack.
13737 Reported by Per Allansson.
13738
137392001-11-12 Pascal Bart <pascal.bart@epita.fr>
13740
13741 * src/bison.simple: Define type yystype instead of YYSTYPE, and
13742 define CPP macro, which substitute YYSTYPE by yystype.
13743 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
13744 with yyltype/YYLTYPE. This allows inclusion of the generated
13745 header within the parser if the compiler, such as GGC, accepts
13746 multiple equivalent #defines.
13747 From Akim.
13748
137492001-11-05 Akim Demaille <akim@epita.fr>
13750
13751 * src/reader.c (symbols_output): New, extracted from...
13752 (packsymbols): here.
13753 (reader): Adjust.
13754
137552001-11-05 Akim Demaille <akim@epita.fr>
13756
13757 * src/lex.c (parse_percent_token): s/quotearg/quote/.
13758
137592001-11-05 Akim Demaille <akim@epita.fr>
13760
13761 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
13762 pattern.
13763
137642001-11-05 Akim Demaille <akim@epita.fr>
13765
13766 * src/options.h (struct option_table_struct): set_flags is void*.
13767 * src/options.c (longopts): Support `--output' and `%output'.
13768 (usage): Adjust.
13769 * src/lex.h (tok_setopt): Remove, replaced with...
13770 (tok_intopt, tok_stropt): these new guys.
13771 * src/lex.c (getopt.h): Not needed.
13772 (token_buffer, unlexed_token_buffer): Not const.
13773 (percent_table): Promote `-' over `_' in directive names.
13774 Active `%name-prefix', `file-prefix', and `output'.
13775 (parse_percent_token): Accept possible arguments to directives.
13776 Promote `-' over `_' in directive names.
13777
137782001-11-04 Akim Demaille <akim@epita.fr>
13779
13780 * doc/bison.texinfo (Decl Summary): Split the list into
13781 `directives for grammars' and `directives for bison'.
13782 Sort'em.
13783 Add description of `%name-prefix', `file-prefix', and `output'.
13784 Promote `-' over `_' in directive names.
13785 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
13786 Simplify the description of `--name-prefix'.
13787 Promote `-' over `_' in directive names.
13788 Promote `--output' over `--output-file'.
13789 Fix the description of `--defines'.
13790 * tests/output.at: Exercise %file-prefix and %output.
13791
137922001-11-02 Akim Demaille <akim@epita.fr>
13793
13794 * doc/refcard.tex: Update.
13795
137962001-11-02 Akim Demaille <akim@epita.fr>
13797
13798 * src/symtab.h (SUNDEF): New.
13799 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
13800 stand for `uninitialized', instead of 0.
13801 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
13802 * src/lex.c (lex): Adjust.
13803
13804 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
13805 Number it 0.
13806 Let yylex return it instead of a plain 0.
13807 Reported by Dick Streefland.
13808
138092001-11-02 Akim Demaille <akim@epita.fr>
13810
13811 * tests/regression.at (Mixing %token styles): New test.
13812
138132001-11-02 Akim Demaille <akim@epita.fr>
13814
13815 * src/reader.c (parse_thong_decl): Formatting changes.
13816 (token_translations_init): New, extracted from...
13817 (packsymbols): Here.
13818 Adjust.
13819
138202001-11-01 Akim Demaille <akim@epita.fr>
13821
13822 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
13823 Check that `9foo.y' produces correct cpp guards.
13824 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
13825 guards.
13826 Reported by Wwp.
13827
138282001-11-01 Akim Demaille <akim@epita.fr>
13829
13830 * tests/regression.at (Invalid input: 2): New.
13831 * src/lex.c (unlexed_token_buffer): New.
13832 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
13833 too.
13834 Reported by Wwp.
13835
138362001-11-01 Akim Demaille <akim@epita.fr>
13837
13838 * tests/calc.at: Catch up with 1.30.
13839 * configure.in: Bump to 1.49a.
13840 Adjust to newer Autotest.
13841
138422001-10-19 Pascal Bart <pascal.bart@epita.fr>
13843
13844 * src/conflicts.c: Move global variables rrc_total and src_total ...
13845 (print_conflicts): here.
13846 * src/output.c (output): Free global variable user_toknums.
13847 * src/lex.c (token_obstack): Become static.
13848
138492001-10-18 Akim Demaille <akim@epita.fr>
13850
13851 * tests/atlocal.in (GCC): Add.
13852 * tests/calc.at: s/m4_match/m4_bmatch/.
13853 s/m4_patsubst/m4_bpatsubst/.
13854 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
13855 * configure.in: AC_SUBST(GCC).
13856
138572001-10-14 Marc Autret <autret_m@epita.fr>
13858
13859 * src/options.c (create_long_option_table): Fix.
13860
138612001-10-10 Akim Demaille <akim@epita.fr>
13862
13863 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
13864
138652001-10-04 Akim Demaille <akim@epita.fr>
13866
13867 * src/reader.c (parse_union_decl): Push the caracters in
13868 union_obstack, not attrs_obstack.
13869
138702001-10-04 Akim Demaille <akim@epita.fr>
13871
13872 Merge in the branch 1.29.
13873
13874 * src/reader.c (packsymbols): Use a temporary obstack for
13875 `%%tokendef', since output_stack is already used elsewhere.
13876
13877 2001-10-02 Akim Demaille <akim@epita.fr>
13878
13879 Bump 1.29d.
13880
13881 2001-10-02 Akim Demaille <akim@epita.fr>
13882
13883 Version 1.29c.
13884
13885 2001-10-02 Akim Demaille <akim@epita.fr>
13886
13887 * tests/regression.at (Invalid CPP headers): New.
13888 From Alexander Belopolsky.
13889 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
13890
13891 2001-10-02 Akim Demaille <akim@epita.fr>
13892
13893 * tests/regression.at (Invalid input): New.
13894 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
13895 Reported by Shura.
13896
13897 2001-10-02 Akim Demaille <akim@epita.fr>
13898
13899 * tests/calc.at: Now that --debug works, the tests must be adjusted.
13900
13901 2001-10-02 Akim Demaille <akim@epita.fr>
13902
13903 * src/output.c (output_parser): Assert `skeleton'.
13904 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
13905 systems.
13906 From Shura.
13907
13908 2001-10-01 Marc Autret <autret_m@epita.fr>
13909
13910 * src/lex.h: Echo modifications.
13911 * src/lex.c (unlex): Parameter is now token_t.
13912 From Hans Aberg.
13913
13914 2001-10-01 Marc Autret <autret_m@epita.fr>
13915
13916 * src/main.c: Include lex.h.
13917 From Hans Aberg.
13918
13919 2001-09-29 Akim Demaille <akim@epita.fr>
13920
13921 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
13922
13923 2001-09-28 Akim Demaille <akim@epita.fr>
13924
13925 * tests/testsuite.at: Update to newer Autotest.
13926 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
13927
13928 2001-09-27 Akim Demaille <akim@epita.fr>
13929
13930 Position independent wrapper.
13931
13932 * tests/bison: Remove.
13933 * tests/bison.in: New.
13934 * configure.in: Adjust.
13935
13936 2001-09-27 Paul Eggert <eggert@twinsun.com>
13937
13938 Port quotearg fixes from tar 1.13.24.
13939
13940 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
13941 tm to be declared.
13942 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
13943 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
13944
13945 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
13946 * m4/mbrtowc.m4: New file.
13947 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
13948 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
13949
13950 2001-09-27 Akim Demaille <akim@epita.fr>
13951
13952 Bump to 1.29c.
13953
13954 2001-09-27 Akim Demaille <akim@epita.fr>
13955
13956 Version 1.29b.
13957
13958 2001-09-25 Akim Demaille <akim@epita.fr>
13959
13960 * src/system.h: Include `xalloc.h'.
13961 Remove it from the C files.
13962 * src/files.c (output_files): Free the obstacks.
13963 * src/lex.c (init_lex): Rename as...
13964 (lex_init): this.
13965 (lex_free): New.
13966 * src/main.c (main): Use it.
13967
13968 2001-09-24 Marc Autret <autret_m@epita.fr>
13969
13970 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
13971 to output informations in fout (FILE*).
13972 (open_graph, close_graph): Likewise.
13973 (output_graph, output_edge, output_node): Likewise.
13974 * src/vcg.h: Update function prototypes.
13975 * src/print_graph.c (print_graph): Open output graph file.
13976 (print_actions): Adjust.
13977 * src/files.h: Remove extern declaration.
13978 * src/files.c: Remove graph_obstack declaration.
13979 (open_files): Remove graph_obstack initialization.
13980 (output_files): Remove graph_obstack saving.
13981
13982 2001-09-24 Marc Autret <autret_m@epita.fr>
13983
13984 * src/files.c (compute_output_file_names): Fix.
13985
13986 2001-09-24 Marc Autret <autret_m@epita.fr>,
13987 Akim Demaille <akim@epita.fr>
13988
13989 * src/reader.c (reader): Remove call to free_symtab ().
13990 * src/main.c (main): Call it here.
13991 Include symtab.h.
13992 * src/conflicts.c (initialize_conflicts): Rename as...
13993 (solve_conflicts): this.
13994 * src/print.c (print_core, print_actions, print_state)
13995 (print_grammar): Dump to a file instead a `output_obstack'.
13996 (print_results): Dump `output_obstack', and then proceed with the
13997 FILE *.
13998 * src/files.c (compute_output_file_names, close_files): New.
13999 (output_files): Adjust.
14000 * src/main.c (main): Adjust.
14001
14002 2001-09-23 Marc Autret <autret_m@epita.fr>
14003
14004 * src/files.c (compute_header_macro): Computes header macro name
14005 from spec_defines_file when given.
14006
14007 2001-09-23 Marc Autret <autret_m@epita.fr>
14008
14009 * src/files.c (output_files): Add default extensions.
14010
14011 2001-09-22 Akim Demaille <akim@epita.fr>
14012
14013 * src/conflicts.c (finalize_conflicts): Rename as...
14014 (free_conflicts): this.
14015
14016 2001-09-22 Akim Demaille <akim@epita.fr>
14017
14018 * src/gram.c (gram_free): Rename back as...
14019 (dummy): this.
14020 (output_token_translations): Free `token_translations'.
14021 * src/symtab.c (free_symtab): Free the tag field.
14022
14023 2001-09-22 Akim Demaille <akim@epita.fr>
14024
14025 Remove `translations' as it is always set to true.
14026
14027 * src/gram.h: Adjust.
14028 * src/reader.c (packsymbols, parse_token_decl): Adjust
14029 * src/print.c (print_grammar): Adjust.
14030 * src/output.c (output_token_translations): Adjust.
14031 * src/lex.c (lex): Adjust.
14032 * src/gram.c: Be sure the set pointers to NULL.
14033 (dummy): Rename as...
14034 (gram_free): this.
14035
14036 2001-09-22 Akim Demaille <akim@epita.fr>
14037
14038 * configure.in: Invoke AM_LIB_DMALLOC.
14039 * src/system.h: Use dmalloc.
14040 * src/LR0.c: Be sure to have pointers initialized to NULL.
14041 (allocate_itemsets): Allocate kernel_items only if needed.
14042
14043 2001-09-22 Akim Demaille <akim@epita.fr>
14044
14045 * configure.in: Bump to 1.29b.
14046 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
14047 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
14048 need xmalloc.c in calc.y.
14049 From Pascal Bart.
14050
14051 2001-09-21 Akim Demaille <akim@epita.fr>
14052
14053 Version 1.29a.
14054 * Makefile.maint, config/config.guess, config/config.sub,
14055 * config/missing: Update from masters.
14056 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
14057 upon package.m4.
14058 * configure.in (ALL_LINGUAS): Add `tr'.
14059
14060 2001-09-21 Akim Demaille <akim@epita.fr>
14061
14062 * tests/Makefile.am (package.m4): Move to...
14063 ($(srcdir)/$(TESTSUITE)): here.
14064
14065 2001-09-20 Akim Demaille <akim@epita.fr>
14066
14067 * src/complain.c: No longer try to be standalone: use system.h.
14068 Don't assume __STDC__ is defined to 1. Just test if it is defined.
14069 * src/complain.h: Likewise.
14070 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
14071 Remove the unused variable `n'.
14072 From Albert Chin-A-Young.
14073
14074 2001-09-18 Marc Autret <autret_m@epita.fr>
14075
14076 * doc/bison.1: Update.
14077 * doc/bison.texinfo (Bison Options): Update --defines and --graph
14078 descriptions.
14079 (Option Cross Key): Update.
14080 Add --graph.
14081
14082 2001-09-18 Marc Autret <autret_m@epita.fr>
14083
14084 * tests/regression.at: New test (comment in %union).
14085
14086 2001-09-18 Marc Autret <autret_m@epita.fr>
14087
14088 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
14089 do that.
14090 Reported by Keith Browne.
14091
14092 2001-09-18 Marc Autret <autret_m@epita.fr>
14093
14094 * tests/output.at: Add tests for --defines and --graph.
14095
14096 2001-09-18 Marc Autret <autret_m@epita.fr>
14097
14098 * tests/output.at: Removes tests of %{header,src}_extension features.
14099
14100 2001-09-18 Akim Demaille <akim@epita.fr>
14101
14102 * tests/Makefile.am (package.m4): New.
14103 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
14104 (_AT_CHECK_CALC_ERROR): Likewise.
14105 Factor the `, ' part of verbose error messages.
14106
14107 2001-09-18 Marc Autret <autret_m@epita.fr>
14108
14109 * src/getargs.c (longopts): Declare --defines and --graph as options
14110 with optional arguments.
14111 * src/files.h: Add extern declarations.
14112 * src/files.c (spec_graph_file, spec_defines_file): New.
14113 (output_files): Update.
14114 Remove CPP-outed code.
14115
14116 2001-09-18 Marc Autret <autret_m@epita.fr>
14117
14118 Turn off %{source,header}_extension feature.
14119
14120 * src/files.c (compute_exts_from_gf): Update.
14121 (compute_exts_from_src): Update.
14122 (output_files): CPP-out useless code.
14123 * src/files.h: Remove {header,source}_extension extern declarations.
14124 * src/reader.c (parse_dquoted_param): CPP-out.
14125 (parse_header_extension_decl): Remove.
14126 (parse_source_extension_decl): Remove.
14127 (read_declarations): Remove cases tok_{hdrext,srcext}.
14128 * src/lex.c (percent_table): Remove {header,source}_extension entries.
14129 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
14130
14131 2001-09-10 Akim Demaille <akim@epita.fr>
14132
14133 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
14134 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
14135 (AT_CHECK_OUTPUT): this.
14136 Merely check ls' exit status, its output is useless.
14137
14138 2001-09-10 Akim Demaille <akim@epita.fr>
14139
14140 * tests/calc.at: Use m4_match.
14141 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
14142
14143 2001-09-10 Marc Autret <autret_m@epita.fr>,
14144 Akim Demaille <akim@epita.fr>
14145
14146 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
14147 enum color_e.
14148 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
14149 to `normal'.
14150 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
14151 * src/lex.h: Adjust prototype.
14152 (token_t): Add `tok_undef'.
14153 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
14154 (parse_percent_token): Now returns token_t.
14155 Add default statement in switch.
14156 (lex): Separate `c' as an input variable, from the token_t result
14157 part.
14158 (unlexed): Is a token_t.
14159
14160 2001-09-10 Akim Demaille <akim@epita.fr>
14161
14162 * configure.in: Bump to 1.29a.
14163
14164 2001-09-07 Akim Demaille <akim@epita.fr>
14165
14166 Version 1.29.
14167
14168 2001-08-30 Akim Demaille <akim@epita.fr>
14169
14170 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
14171 * m4/atconfig.m4: Remove.
14172 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
14173 * tests/bison: New.
14174 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
14175 m4_if, m4_patsubst, and m4_regexp.
14176 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
14177 `input' file instead of echo.
14178
14179 2001-08-29 Akim Demaille <akim@epita.fr>
14180
14181 Bump to 1.28e.
14182
14183 2001-08-29 Akim Demaille <akim@epita.fr>
14184
14185 Version 1.28d.
14186
14187 2001-08-29 Paul Eggert <eggert@twinsun.com>
14188
14189 * src/bison.simple (yyparse): Don't take the address of an
14190 item before the start of an array, as that doesn't conform to
14191 the C Standard.
14192
14193 2001-08-29 Robert Anisko <anisko_r@epita.fr>
14194
14195 * doc/bison.texinfo (Location Tracking Calc): New node.
14196
14197 2001-08-29 Paul Eggert <eggert@twinsun.com>
14198
14199 * src/output.c (output): Do not define const, as this now
14200 causes more problems than it cures.
14201
14202 2001-08-29 Akim Demaille <akim@epita.fr>
14203
14204 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
14205 the nodes.
14206 Be sure to tag the `detailmenu'.
14207
14208 2001-08-29 Akim Demaille <akim@epita.fr>
14209
14210 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
14211 download in a tmp dir.
14212
14213 2001-08-28 Marc Autret <autret_m@epita.fr>
14214
14215 * config/depcomp: New file.
14216
14217 2001-08-28 Marc Autret <autret_m@epita.fr>
14218
14219 * doc/bison.1 (mandoc): Adjust.
14220 From Juan Manuel Guerrero.
14221
14222 2001-08-28 Marc Autret <autret_m@epita.fr>
14223
14224 * src/print_graph.c (print_state): Fix.
14225
14226 2001-08-27 Marc Autret <autret_m@epita.fr>
14227
14228 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
14229 char * members.
14230 Echo modifications to the functions prototypes.
14231 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
14232
14233 2001-08-27 Marc Autret <autret_m@epita.fr>
14234
14235 * src/vcg.c: Include `xalloc.h'.
14236 (add_colorentry): New.
14237 (add_classname): New.
14238 (add_infoname): New.
14239 * src/vcg.h: Add new prototypes.
14240
14241 2001-08-27 Akim Demaille <akim@epita.fr>
14242
14243 * Makefile.maint: Sync. again with CVS Autoconf.
14244
14245 2001-08-27 Akim Demaille <akim@epita.fr>
14246
14247 * Makefile.maint: Formatting changes.
14248 (po-update, cvs-update, update): New targets.
14249 (AMTAR): Remove.
14250
14251 2001-08-27 Akim Demaille <akim@epita.fr>
14252
14253 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
14254 * Makefile.maint: Sync. with CVS Autoconf.
14255
14256 2001-08-27 Marc Autret <autret_m@epita.fr>
14257
14258 * src/vcg.h (struct infoname_s): New.
14259 (struct colorentry_s): New.
14260 (graph_s): New fields {vertical,horizontal}_order in structure.
14261 Add `infoname' field.
14262 Add `colorentry' field;
14263 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
14264 (G_HORIZONTAL_ORDER): New.
14265 (G_INFONAME): New.
14266 (G_COLORENTRY): New.
14267 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
14268 Add output of `infoname'.
14269 Add output of `colorentry'.
14270
14271 2001-08-27 Marc Autret <autret_m@epita.fr>
14272
14273 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
14274 This one shadowed a global parameter.
14275
14276 2001-08-24 Marc Autret <autret_m@epita.fr>
14277
14278 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
14279 instead of `unsigned'.
14280 (print_state): Do not call obstack_object_size () in obstack_grow ()
14281 to avoid macro variables shadowing.
14282
14283 2001-08-23 Marc Autret <autret_m@epita.fr>
14284
14285 * src/lex.c (percent_table): Typo: s/naem/name/.
14286 Add graph option.
14287 Normalize new options declarations.
14288
14289 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
14290
14291 * tests/suite.at: Exercise %header_extension and %source_extension.
14292
14293 2001-08-16 Marc Autret <autret_m@epita.fr>
14294
14295 * src/reader.c (parse_dquoted_param): New.
14296 (parse_header_extension_decl): Use it.
14297 (parse_source_extension_decl): Likewise.
14298
14299 2001-08-16 Marc Autret <autret_m@epita.fr>
14300
14301 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
14302 (get_xxxx_str): Use assert () instead of complain ().
14303 Remove return invokations in default cases.
14304 (get_decision_str): Modify default behaviour. Remove second argument.
14305 Echo modifications on calls.
14306 (output_graph): Fix.
14307
14308 2001-08-16 Marc Autret <autret_m@epita.fr>
14309
14310 * src/getargs.c (usage): Update with ``-g, --graph''.
14311
14312 2001-08-16 Marc Autret <autret_m@epita.fr>
14313
14314 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
14315 (Option Cross Key): Likewise.
14316 * doc/bison.1: Update.
14317
143182001-09-25 Pascal Bart <pascal.bart@epita.fr>
14319
14320 * src/output.c (output_master_parser): Don't finish action_obstack.
14321 (output_parser): Don't care about the muscle action, here.
14322 (prepare): Copy the action_obstack in the action muscle.
14323 (output): Free action_obstack.
14324
143252001-09-23 Pascal Bart <pascal.bart@epita.fr>
14326
14327 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
14328 will contain `%union' declaration.
14329 (parse_union_decl): Delete #line directive output.
14330 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
14331 informations about %union.
14332 (parse_union_decl): Copy the union_obstack in the muscle stype.
14333 * src/bison.simple: Add new #line directive.
14334 Add typdef %%stype YYSTYPE.
14335
143362001-09-23 Pascal Bart <pascal.bart@epita.fr>
14337
14338 * src/bison.simple: Add new `#line' directive.
14339
143402001-09-22 Pascal Bart <pascal.bart@epita.fr>
14341
14342 * src/bison.simple: New `#line' directive.
14343 * src/output.c (output_parser): Support new dynamic muscle input_line.
14344
143452001-09-22 Marc Autret <autret_m@epita.fr>
14346
14347 * src/output.c (output_master_parser): New.
14348 (output_parser): Be more re-entrant.
14349
143502001-09-21 Marc Autret <autret_m@epita.fr>
14351
14352 * src/reader.c (copy_definition, parse_union_decl): Update and use
14353 `linef' muscle.
14354 (copy_action): Likewise.
14355 Use obstack_1grow ().
14356 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
14357
143582001-09-21 Marc Autret <autret_m@epita.fr>
14359
14360 * src/options.c (option_table): Adjust.
14361 * src/lex.c (parse_percent_token): Fix.
14362
143632001-09-20 Pascal Bart <pascal.bart@epita.fr>
14364
14365 * src/options.c (symtab.h): Include it, need by lex.h.
14366
143672001-09-20 Pascal Bart <pascal.bart@epita.fr>
14368
14369 * src/lex.c (parse_percent_token): Change type of variable `tx', which
14370 is now an option_table_struct*.
14371 (option_strcmp): New function option_strcmp.
14372 (parse_percent_token): Call option_strcmp.
14373 * src/getargs.c (xalloc.h, options.h): Include it.
14374 (getargs): Call create_long_option_table.
14375 (getargs): Free longopts at the end of the function.
14376 (shortopts): Move in options.c.
14377 * src/options.c (create_long_option_table): New function. Convert
14378 information from option_table to option structure.
14379 * src/reader.c (options.h): Include it.
14380
14381 * src/Makefile.am: Adjust.
14382 * src/options.c (option_table): Create from longopts and percent_table.
14383 * src/getargs.c (longopts): Delete.
14384 * src/lex.c (struct percent_table_struct): Delete.
14385 (percent_table): Delete.
14386 (options.h): Include it.
14387 * src/options.c: Create.
14388 * src/options.h: Create.
14389 Declare enum opt_access_e.
14390 Define struct option_table_struct.
14391
143922001-09-20 Marc Autret <autret_m@epita.fr>
14393
14394 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
14395 sections of Bison.
14396
143972001-09-19 Pascal Bart <pascal.bart@epita.fr>
14398
14399 * src/bison.simple: s/%%filename/%%skeleton.
14400 * src/muscle_tab.c (getargs.h): Include it.
14401 (muscle_init): Insert new muscle skeleton.
14402
144032001-09-18 Pascal Bart <pascal.bart@epita.fr>
14404
14405 * src/output.c (output_parser): Delete unused variable actions_dumped.
14406
144072001-09-07 Pascal Bart <pascal.bart@epita.fr>
14408
14409 * src/output.c (output): Delete call to reader_output_yylsp.
14410 * src/reader.c (reader): Likewise.
14411 * src/reader.h: Delete declaration of reader_output_yylsp.
14412
144132001-09-02 Marc Autret <autret_m@epita.fr>
14414
14415 * src/reader.c: Include muscle_tab.h.
14416 (parse_union_decl): Update.
14417 (parse_macro_decl): Rename parse_muscle_decl.
14418 Update to use renamed functions and variable.
14419 (read_declarations, copy_action, read_additionnal_code, : Updated
14420 with correct variables and functions names.
14421 (packsymbols, reader): Likewise.
14422
14423 * src/reader.h (muscle_obstack): Extern declaration update.
14424
14425 * src/output.c: Include muscle_tab.h
14426 In all functions using macro_insert, change by using muscle_insert ().
14427 (macro_obstack): Rename muscle_obstack.
14428 Echo modifications in the whole file.
14429 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
14430 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
14431 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
14432
14433 * src/muscle_tab.h: Update double inclusion macros.
14434 (macro_entry_s): Rename muscle_entry_s.
14435 Update prototypes.
14436
14437 * src/muscle_tab.c: Include muscle_tab.h.
14438 Rename macro_tabble to muscle_table.
14439 (mhash1, mhash2, mcmp): Use muscle_entry.
14440 (macro_init): Rename muscle_init. Update.
14441 (macro_insert): Rename muscle_insert. Update.
14442 (macro_find): Rename muscle_find. Update.
14443
14444 * src/main.c: Include muscle_tab.h.
14445 (main): Call muscle_init ().
14446 * src/Makefile.am (bison_SOURCES): Echo modifications.
14447
144482001-09-02 Marc Autret <autret_m@epita.fr>
14449
14450 Now the files macro_tab.[ch] are named muscle_tab.[ch].
14451
14452 * src/muscle_tab.c, src/muscle_tab.h: Add files.
14453
144542001-09-02 Marc Autret <autret_m@epita.fr>
14455
14456 * src/macrotab.c, src/macrotab.h: Remove.
14457
144582001-09-01 Pascal Bart <pascal.bart@epita.fr>
14459
14460 * src/reader.c (copy_guard): Use muscle to specify the `#line'
14461 filename.
14462
144632001-09-01 Marc Autret <autret_m@epita.fr>
14464
14465 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
14466 to an explicit value to activate the feature. We do it here.
14467
144682001-08-31 Pascal Bart <pascal.bart@epita.fr>
14469
14470 * src/output.c (prepare): Delete the `filename' muscule insertion.
14471 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
14472 (parse_union_decl): Likewise.
14473 * src/macrotab.c (macro_init): Initialize filename by infile.
14474
144752001-08-31 Marc Autret <autret_m@epita.fr>
14476
14477 * src/bison.simple (YYLSP_NEEDED): New definition.
14478 * src/output.c (prepare): Add macro insertion of `locations_flag'
14479
144802001-08-31 Pascal Bart <pascal.bart@epita.fr>
14481
14482 * src/output.c (prepare): Delete insertion of previous muscles,
14483 and insert the `prefix' muscles.
14484 * src/macrotab.c (macro_init): Likewise.
14485 (macro_init): Initialization prefix directive by `yy'.
14486 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
14487 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
14488 yylval, yydebug, yyerror, yynerrs and yyparse.
14489 New directive `#define' to substitute yydebug, ... with option
14490 name_prefix.
14491
144922001-08-31 Pascal Bart <pascal.bart@epita.fr>
14493
14494 * src/main.c (main): Standardize.
14495 * src/output.c (output_table_data, output_parser): Likewise.
14496 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
14497
144982001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
14499
14500 * src/reader.c (read_additionnal_code): Rename %%user_code to
14501 %%epilogue.
14502 * src/output.c (output): Rename %%declarations to %%prologue.
14503 * src/bison.simple: Echo modifications.
14504
145052001-08-31 Marc Autret <autret_m@epita.fr>
14506
14507 * src/reader.c (readgram): CleanUp.
14508 (output_token_defines): Likewise.
14509 (packsymbols): Likewise.
14510 (reader): Likewise.
14511 * src/output.c (output): CPP-out useless code.
14512
145132001-08-31 Pascal Bart <pascal.bart@epita.fr>
14514
14515 * src/reader.c (reader): Delete obsolete call to function
14516 output_trailers and output_headers.
14517 * src/output.h: Remove obsolete functions prototypes of output_headers
14518 and output_trailers.
14519
145202001-08-30 Pascal Bart <pascal.bart@epita.fr>
14521
14522 * src/main.c: Include macrotab.h.
14523 * src/macrotab.h (macro_entry_s): Constify fields.
14524 Adjust functions prototypes.
14525 * src/macrotab.c (macro_insert): Constify key and value.
14526 (macro_find): Constify key.
14527 (macro_insert): Include 'xalloc.h'
14528 (macro_insert): Use XMALLOC.
14529 (macro_find): Constify return value.
14530 * src/output.c (output_table_data): Rename table to table_data.
14531 (output_parser): Constify macro_key, macro_value.
14532
145332001-08-30 Marc Autret <autret_m@epita.fr>
14534
14535 * src/reader.c (parse_skel_decl): New.
14536 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
14537 * src/lex.h (token_t): New token `tok_skel'.
14538 * src/lex.c (percent_table): Add skeleton option entry.
14539 Standardize.
14540
145412001-08-29 Marc Autret <autret_m@epita.fr>
14542
14543 * src/bison.simple: Add %%user_code directive at the end.
14544 * src/reader.c (read_additionnal_code): New.
14545 (reader): Use it.
14546 * src/output.c (output_program): Remove.
14547 (output): Update.
14548
145492001-08-28 Marc Autret <autret_m@epita.fr>
14550
14551 * src/output.c (output_actions): Clean up.
14552 (output_gram): CPP-out useless code.
14553 * src/reader.c (reader): Clean up, CPP-out useless code.
14554
145552001-08-28 Pascal Bart <pascal.bart@epita.fr>
14556
14557 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
14558 directive.
14559 * src/bison.simple: Add `%%definitions'.
14560
145612001-08-28 Marc Autret <autret_m@epita.fr>
14562
14563 * config/depcomp: New file.
14564
145652001-08-27 Paul Eggert <eggert@twinsun.com>
14566
14567 * src/bison.simple (yyparse): Don't take the address of an
14568 item before the start of an array, as that doesn't conform to
14569 the C Standard.
14570
145712001-08-27 Robert Anisko <robert.anisko@epita.fr>
14572
14573 * src/output.c (output): Remove the initialization of the macro
14574 obstack. It was done too late here.
14575
14576 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
14577 completely wrong.
14578 (reader): Initialize the macro obstack here, since we need it to grow
14579 '%define' directives.
14580
14581 * src/reader.h: Declare the macro obstack as extern.
14582
145832001-08-27 Robert Anisko <robert.anisko@epita.fr>
14584
14585 * src/output.c (output_parser): Fix. Store single '%' characters in
14586 the output obstack instead of throwing them away.
14587
145882001-08-27 Akim Demaille <akim@epita.fr>
14589
14590 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
14591
145922001-08-25 Robert Anisko <robert.anisko@epita.fr>
14593
14594 * lib/Makefile.am: Adjust.
14595
145962001-08-25 Robert Anisko <robert.anisko@epita.fr>
14597
14598 * src/bison.simple: Update and add '%%' directives.
14599
146002001-08-25 Robert Anisko <robert.anisko@epita.fr>
14601
14602 * src/reader.c (reader): Remove calls to 'output_headers' and
14603 'output_trailers'. Remove some C output.
14604 (readgram): Disable a piece of code that was writing a default
14605 definition for 'YYSTYPE'.
14606 (reader_output_yylsp): Remove.
14607 (packsymbols): Output token defintions to a macro.
14608 (copy_definition): Disable C output.
14609
14610 * src/reader.c (parse_macro_decl): New function used to parse macro
14611 declarations.
14612 (copy_string2): Put the body of copy_string into this new function.
14613 Add a parameter to let the caller choose whether he wants to copy the
14614 string delimiters or not.
14615 (copy_string): Be a simple call to copy_string2 with the last argument
14616 bound to true.
14617 (read_declarations): Add case for macro definition.
14618 (copy_identifier): New.
14619 (parse_macro_decl): Read macro identifiers using copy_identifier
14620 rather than lex.
14621
146222001-08-25 Robert Anisko <robert.anisko@epita.fr>
14623
14624 * src/output.c (prepare): Add prefixed names.
14625 (output_parser): Output semantic actions.
14626 (output_parser): Fix bug on '%%line' directives.
14627
14628 * src/output.c (output_headers): Remove. The C code printed by this
14629 function should now be in the skeletons.
14630 (output_trailers): Remove.
14631 (output): Disable call to 'reader_output_yylsp'.
14632 (output_rule_data): Do not output tables to the table obstack.
14633
14634 * src/output.c: Remove some C dedicated output.
14635 Improve the use of macro and output obstacks.
14636 (output_defines): Remove.
14637
14638 * src/output.c (output_token_translations): Associate 'translate'
14639 table with a macro. No output to the table obstack.
14640 (output_gram): Same for 'rhs' and 'prhs'.
14641 (output_stos): Same for 'stos'.
14642 (output_rule_data): Same for 'r1' and 'r2'.
14643 (token_actions): Same for 'defact'.
14644 (goto_actions): Same for 'defgoto'.
14645 (output_base): Same for 'pact' and 'pgoto'.
14646 (output_table): Same for 'table'.
14647 (output_check): Same for 'check'.
14648
14649 * src/output.c (output_table_data): New function.
14650 (output_short_table): Remove.
14651 (output_short_or_char_table): Remove.
14652
14653 * src/output.c (output_parser): Replace most of the skeleton copy code
14654 with something new. Skeletons are now processed character by character
14655 rather than line by line, and Bison looks for '%%' macros. This is the
14656 first step in making Bison's output process (a lot) more flexible.
14657 (output_parser): Use the macro table.
14658
146592001-08-25 Robert Anisko <robert.anisko@epita.fr>
14660
14661 * src/main.c (main): Initialize the macro table.
14662
146632001-08-25 Robert Anisko <robert.anisko@epita.fr>
14664
14665 * src/lex.c (percent_table): Add tok_define.
14666 * src/lex.h: Add tok_define.
14667
146682001-08-25 Robert Anisko <robert.anisko@epita.fr>
14669
14670 * src/macrotab.c: New file.
14671 * src/macrotab.h: New file.
14672 * src/Makefile.am: Update.
14673
146742001-08-25 Robert Anisko <robert.anisko@epita.fr>
14675
14676 * lib/hash.c: New file.
14677 * lib/hash.h: New file.
14678 * lib/Makefile.am: Update.
14679
146802001-08-15 Akim Demaille <akim@epita.fr>
14681
14682 Version 1.28c.
14683
146842001-08-15 Marc Autret <autret_m@epita.fr>
14685
14686 * src/reader.c (readgram): Indent output macro YYSTYPE.
14687 (packsymbols): Likewise.
14688 (output_token_defines): Likewise.
14689 * src/files.c: Standardize.
14690 (compute_header_macro): New.
14691 (defines_obstack_save): New. Use compute_header_macro.
14692 (output_files): Update. Use defines_obstack_save.
14693
146942001-08-15 Akim Demaille <akim@epita.fr>
14695
14696 * doc/bison.texinfo (Table of Symbols): Document
14697 YYSTACK_USE_ALLOCA.
14698
146992001-08-15 Akim Demaille <akim@epita.fr>
14700
14701 * missing: Update from CVS Automake.
14702 * config/config.guess, config/config.sub, config/texinfo.tex:
14703 Update from gnu.org.
14704
147052001-08-15 Akim Demaille <akim@epita.fr>
14706
14707 * Makefile.maint: Sync with CVS Autoconf.
14708
147092001-08-14 Pascal Bart <pascal.bart@epita.fr>
14710
14711 * doc/bison.texinfo: Include GNU Free Documentation License from
14712 `fdl.texi'.
14713 * doc/fdl.texi: Add to package.
14714
147152001-08-14 Marc Autret <autret_m@epita.fr>
14716
14717 Turn on %{source,header}_extension features.
14718
14719 * src/lex.c (percent_table): Un-CPP out header_extension and
14720 source_extension.
14721 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
14722 (compute_exts_from_src): Remove conditions. It restores priorities
14723 between options.
14724
147252001-08-14 Marc Autret <autret_m@epita.fr>
14726
14727 * src/files.c (compute_base_names): Add extensions computing when
14728 `--file-prefix' used.
14729 Standardize function calls.
14730
147312001-08-13 Marc Autret <autret_m@epita.fr>
14732
14733 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
14734 defining it (defined but null disables alloca).
14735
147362001-08-13 Marc Autret <autret_m@epita.fr>
14737
14738 * src/bison.simple (_yy_memcpy): CPP reformat.
14739
147402001-08-13 Pascal Bart <pascal.bart@epita.fr>
14741
14742 * tests/atconfig.in (CPPFLAGS): Fix.
14743
147442001-08-10 Pascal Bart <pascal.bart@epita.fr>
14745
14746 * doc/bison.texinfo: Include GNU General Public License from
14747 `gpl.texi'.
14748 * doc/gpl.texi: Add to package.
14749
147502001-08-10 Marc Autret <autret_m@epita.fr>
14751
14752 * src/print_graph.h: Fix.
14753 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
14754
147552001-08-10 Akim Demaille <akim@epita.fr>
14756
14757 * src/system.h: Provide default declarations for stpcpy, strndup,
14758 and strnlen.
14759
147602001-08-10 Robert Anisko <anisko_r@epita.fr>
14761
14762 * doc/bison.texinfo (Locations): Update @$ stuff.
14763
147642001-08-09 Robert Anisko <anisko_r@epita.fr>
14765
14766 * src/bison.simple (YYLLOC_DEFAULT): Update.
14767 (yyparse): Adjust.
14768
147692001-08-08 Marc Autret <autret_m@epita.fr>
14770
14771 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
14772 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
14773 Reported by Fabrice Bauzac.
14774
147752001-08-08 Marc Autret <autret_m@epita.fr>
14776
14777 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
14778 * src/vcg.c (output_node): Fix.
14779 * src/vcg.h: Cleanup.
14780 * src/print_graph.c: Add comments.
14781 (node_output_size): New global variable. Simplify the formatting of
14782 the VCG graph output.
14783 (print_actions): Unused code is now used. It notifies the final state
14784 and no action states in the VCG graph. It also give the reduce actions.
14785 The `shift and goto' edges are red and the `go to state' edges are
14786 blue.
14787 Get the current node name and node_obstack by argument.
14788 (node_obstack): New variable.
14789 (print_state): Manage node_obstack.
14790 (print_core): Use node_obstack given by argument.
14791 A node is not only computed here but in print_actions also.
14792 (print_graph): CPP out useless code instead of commenting it.
14793
147942001-08-07 Pascal Bart <pascal.bart@epita.fr>
14795
14796 * tests/atconfig.in (CPPFLAGS): Fix.
14797
147982001-08-07 Akim Demaille <akim@epita.fr>
14799
14800 * src/print_graph.c (quote): New.
14801 (print_core): Use it.
14802
148032001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
14804
14805 * src/vcg.c (complain.h): Include it.
14806 Unepitaize `return' invocations.
14807 [NDEBUG] (main): Remove.
14808 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
14809 * src/files.c (open_files): Initialize graph_obstack.
14810 * src/print_graph.c (print_actions): CPP out useless code.
14811 (print_core): Don't output the last `\n' in labels.
14812 Use `quote'.
14813 * src/files.c (output_files): Output the VCG file.
14814 * src/main.c (main): Invoke print_graph ();
14815
148162001-08-06 Marc Autret <autret_m@epita.fr>
14817
14818 Automaton VCG graph output.
14819 Using option ``-g'' or long option ``--graph'', you can generate
14820 a gram_filename.vcg file containing a VCG description of the LALR (1)
14821 automaton of your grammar.
14822
14823 * src/main.c: Call to print_graph() function.
14824 * src/getargs.h: Update.
14825 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
14826 (graph_flag): New flag.
14827 (longopts): Update.
14828 (getargs): Add case `g'.
14829 * src/files.c (graph_obstack): New obstack struct.
14830 (open_files): Initialize new obstack.
14831 (output_files): Saves graph_obstack if required.
14832 * src/files.h (graph_obstack): New extern declaration.
14833 * src/Makefile.am: Add new source files.
14834
148352001-08-06 Marc Autret <autret_m@epita.fr>
14836
14837 * src/print_graph.c, src/print_graph.h (graph): New.
14838 * src/vcg.h: New file.
14839 * src/vcg.c: New file, VCG graph handling.
14840
148412001-08-06 Marc Autret <autret_m@epita.fr>
14842
14843 Add of %source_extension and %header_extension which specify
14844 the source or/and the header output file extension.
14845
14846 * src/files.c (compute_base_names): Remove initialisation of
14847 src_extension and header_extension.
14848 (compute_exts_from_gf): Update.
14849 (compute_exts_from_src): Update.
14850 (output_files): Update.
14851 * src/reader.c (parse_header_extension_decl): New.
14852 (parse_source_extension_decl): New.
14853 (read_declarations): New case statements for the new tokens.
14854 * src/lex.c (percent_table): Add entries for %source_extension
14855 and %header_extension.
14856 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
14857
148582001-08-06 Marc Autret <autret_m@epita.fr>
14859
14860 * configure.in: Bump to 1.28c.
14861 * doc/bison.texinfo: Texinfo thingies.
14862
148632001-08-04 Pascal Bart <pascal.bart@epita.fr>
14864
14865 * tests/atconfig.in (CPPFLAGS): Add.
14866 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
14867
148682001-08-03 Akim Demaille <akim@epita.fr>
14869
14870 Version 1.28b.
14871
148722001-08-03 Akim Demaille <akim@epita.fr>
14873
14874 * tests/Makefile.am (check-local): Ship testsuite.
14875 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
14876 Include `string.h'.
14877
148782001-08-03 Akim Demaille <akim@epita.fr>
14879
14880 * configure.in: Try using -Wformat when compiling.
14881
148822001-08-03 Akim Demaille <akim@epita.fr>
14883
14884 * configure.in: Bump to 1.28b.
14885
148862001-08-03 Akim Demaille <akim@epita.fr>
14887
14888 * src/complain.c: Adjust strerror_r portability issues.
14889
148902001-08-03 Akim Demaille <akim@epita.fr>
14891
14892 Version 1.28a.
14893
148942001-08-03 Akim Demaille <akim@epita.fr>
14895
14896 * src/getargs.c, src/getarg.h (skeleton)): Constify.
14897 * src/lex.c (literalchar): Avoid name clashes on `buf'.
14898 * src/getargs.c: Include complain.h.
14899 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
14900 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
14901
149022001-08-03 Akim Demaille <akim@epita.fr>
14903
14904 * src/reader.c (readgram): Display hidden chars in error messages.
14905
149062001-08-03 Akim Demaille <akim@epita.fr>
14907
14908 Update to gettext 0.10.39.
14909
149102001-08-03 Akim Demaille <akim@epita.fr>
14911
14912 * lib/strspn.c: New.
14913
149142001-08-01 Marc Autret <autret_m@epita.fr>
14915
14916 * doc/bison.texinfo: Update.
14917 * doc/bison.1 (mandoc): Update.
14918 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
14919 * src/files.c: Support output files extensions computing.
14920 (src_extension): New static variable.
14921 (header_extension): New static variable.
14922 (tr): New function.
14923 (get_extension_index): New function, gets the index of an extension
14924 filename in a string.
14925 (compute_exts_from_gf): New function, computes extensions from the
14926 grammar file extension.
14927 (compute_exts_from_src): New functions, computes extensions from the
14928 C source file extension, file given by ``-o'' option.
14929 (compute_base_names): Update.
14930 (output_files): Update.
14931
149322001-08-01 Robert Anisko <anisko_r@epita.fr>
14933
14934 * doc/bison.texi: Document @$.
14935 (Locations): New section.
14936
149372001-07-18 Akim Demaille <akim@epita.fr>
14938
14939 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
14940 * config/prev-version.txt, config/move-if-change: New.
14941 * Makefile.am: Adjust.
14942
149432001-07-08 Pascal Bart <pascal.bart@epita.fr>
14944
14945 * src/bison.simple (yyparse): Suppress warning `comparaison
14946 between signed and unsigned'.
14947
149482001-07-05 Pascal Bart <pascal.bart@epita.fr>
14949
14950 * src/getargs.h (raw_flag): Remove.
14951 * src/getargs.c: Die on `-r'/`--raw'.
14952 * src/lex.c (parse_percent_token): Die on `%raw'.
14953 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
14954 * tests/calc.at: Suppress test with option `--raw'.
14955
149562001-07-14 Akim Demaille <akim@epita.fr>
14957
14958 * config/: New.
14959 * configure.in: Require Autoconf 2.50.
14960 Update to gettext 0.10.38.
14961
149622001-03-16 Akim Demaille <akim@epita.fr>
14963
14964 * doc/bison.texinfo: ANSIfy the examples.
14965
149662001-03-16 Akim Demaille <akim@epita.fr>
14967
14968 * getargs.c (skeleton): New variable.
14969 (longopts): --skeleton is a new option.
14970 (shortopts, getargs): -S is a new option.
14971 * getargs.h: Declare skeleton.
14972 * output.c (output_parser): Use it.
14973
149742001-03-16 Akim Demaille <akim@epita.fr>
14975
14976 * m4/strerror_r.m4: New.
14977 * m4/error.m4: Run AC_FUNC_STRERROR_R.
14978 * lib/error.h, lib/error.c: Update.
14979
149802001-03-16 Akim Demaille <akim@epita.fr>
14981
14982 * src/getargs.c (longopts): Clean up.
14983
149842001-02-21 Akim Demaille <akim@epita.fr>
14985
14986 * src/reader.c (gensym): `gensym_count' is your own.
14987 Use a static buf to create the symbol name, as token_buffer is no
14988 longer a buffer.
14989
149902001-02-08 Akim Demaille <akim@epita.fr>
14991
14992 * src/conflicts.c (conflict_report): Be sure not to append to res
14993 between two calls, which could happen if both first sprintf were
14994 skipped, but not the first cp += strlen.
14995
149962001-02-08 Akim Demaille <akim@epita.fr>
14997
14998 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
14999 New, from fileutils 4.0.37.
15000 * configure.in: Require Autoconf 2.49c. I took some time before
15001 making this decision. This is the only way out for portability
15002 issues in Bison, it would mean way too much duplicate effort to
15003 import in Bison features implemented in 2.49c since 2.13.
15004 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
15005
150062001-02-02 Akim Demaille <akim@epita.fr>
15007
15008 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
15009 * lib/xalloc.h, lib/xmalloc.c: Update.
15010
150112001-01-19 Akim Demaille <akim@epita.fr>
15012
15013 Get rid of the ad hoc handling of token_buffer in the scanner: use
15014 the obstacks.
15015
15016 * src/lex.c (token_obstack): New.
15017 (init_lex): Initialize it. No longer call...
15018 (grow_token_buffer): this. Remove it.
15019 Adjust all the places which used it to use the obstack.
15020
150212001-01-19 Akim Demaille <akim@epita.fr>
15022
15023 * src/lex.h: Rename all the tokens:
15024 s/\bENDFILE\b/tok_eof/g;
15025 s/\bIDENTIFIER\b/tok_identifier/g;
15026 etc.
15027 Let them be enums, not #define, to ease debugging.
15028 Adjust all the code.
15029
150302001-01-18 Akim Demaille <akim@epita.fr>
15031
15032 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
15033 * src/lex.c (maxtoken, grow_token_buffer): Static.
15034
150352001-01-18 Akim Demaille <akim@epita.fr>
15036
15037 Since we now use obstacks, more % directives can be enabled.
15038
15039 * src/lex.c (percent_table): Also accept `%yacc',
15040 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
15041 `%debug'.
15042 Handle the actions for `%semantic_parser' and `%pure_parser' here,
15043 instead of returning a token.
15044 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
15045 * src/reader.c (read_declarations): Adjust.
15046 * src/files.c (open_files): Don't call `compute_base_names', don't
15047 compute `attrsfile' since they depend upon data which might be
15048 *in* the input file now.
15049 (output_files): Do it here.
15050 * src/output.c (output_headers): Document the fact that this patch
15051 introduces a guaranteed SEGV for semantic parsers.
15052 * doc/bison.texinfo: Document them.
15053 * tests/suite.at: Exercise these %options.
15054
150552000-12-20 Akim Demaille <akim@epita.fr>
15056
15057 Also handle the output file (--verbose) with obstacks.
15058
15059 * files.c (foutput): Remove.
15060 (output_obstack): New.
15061 Adjust all dependencies.
15062 * src/conflicts.c: Return a string.
15063 * src/system.h (obstack_grow_string): Rename as...
15064 (obstack_sgrow): this. Be ready to work with non literals.
15065 (obstack_fgrow4): New.
15066
150672000-12-20 Akim Demaille <akim@epita.fr>
15068
15069 * src/files.c (open_files): Fix the computation of short_base_name
15070 in the case of `-o foo.tab.c'.
15071
150722000-12-20 Akim Demaille <akim@epita.fr>
15073
15074 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
15075 (copy_dollar): Now that everything uses obstacks, get rid of the
15076 FILE * parameters.
15077
150782000-12-20 Akim Demaille <akim@epita.fr>
15079
15080 * src/files.c (open_files): Actually the `.output' file is based
15081 on the short_base_name, not base_name.
15082 * tests/suite.at (Checking output file names): Adjust.
15083
150842000-12-20 Akim Demaille <akim@epita.fr>
15085
15086 * src/bison.s1: Remove, we now use directly...
15087 * src/bison.simple: this.
15088 * src/Makefile.am: Use pkgdata instead of data.
15089
150902000-12-20 Akim Demaille <akim@epita.fr>
15091
15092 * src/files.c (guard_obstack): New.
15093 (open_files): Initialize it.
15094 (output_files): Dump it...
15095 * src/files.h: Export it.
15096 * src/reader.c (copy_guard): Use it.
15097
150982000-12-19 Akim Demaille <akim@epita.fr>
15099
15100 * src/files.c (outfile, defsfile, actfile): Removed as global
15101 vars.
15102 (open_files): Don't compute them.
15103 (output_files): Adjust.
15104 (base_name, short_base_name): Be global.
15105 Adjust dependencies.
15106
151072000-12-19 Akim Demaille <akim@epita.fr>
15108
15109 * src/files.c (strsuffix): New.
15110 (stringappend): Be just like strcat but allocate.
15111 (base_names): Eve out from open_files.
15112 Try to simplify the rather hairy computation of base_name and
15113 short_base_name.
15114 (open_files): Use it.
15115 * tests/suite.at (Checking output file names): New test.
15116
151172000-12-19 Akim Demaille <akim@epita.fr>
15118
15119 * src/system.h (obstack_grow_literal_string): Rename as...
15120 (obstack_grow_string): this.
15121 * src/output.c (output_parser): Recognize `%% actions' instead of
15122 `$'.
15123 * src/bison.s1: s/$/%% actions/.
15124 * src/bison.hairy: Likewise.
15125
151262000-12-19 Akim Demaille <akim@epita.fr>
15127
15128 * src/output.c (output_parser): Compute the `#line' lines when
15129 there are.
15130 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
15131 Suggested by Hans Aberg.
15132
151332000-12-19 Akim Demaille <akim@epita.fr>
15134
15135 Let the handling of the skeleton files be local to the procedures
15136 that use it.
15137
15138 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
15139 longer static.
15140 (fparser, open_extra_files): Remove.
15141 (open_files, output_files): Don't take care of fparser.
15142 * src/files.h: Adjust.
15143 * src/output.c (output_parser): Open and close the file to the
15144 skeleton.
15145 * src/reader.c (read_declarations): When %semantic_parser, open
15146 fguard.
15147
151482000-12-19 Akim Demaille <akim@epita.fr>
15149
15150 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
15151 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
15152
151532000-12-19 Akim Demaille <akim@epita.fr>
15154
15155 * src/files.c (open_files): Yipee! We no longer need all the code
15156 looking for `/tmp' since we have no tmp file.
15157
151582000-12-19 Akim Demaille <akim@epita.fr>
15159
15160 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
15161 New macros.
15162 * src/files.c (open_files): Less dependency on MSDOS etc.
15163
151642000-12-14 Akim Demaille <akim@epita.fr>
15165
15166 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
15167 Provide a default definition.
15168 Use it when executing the default @ action.
15169 * src/reader.c (reader_output_yylsp): No longer include
15170 `timestamp' and `text' in the default YYLTYPE.
15171
151722000-12-12 Akim Demaille <akim@epita.fr>
15173
15174 * src/reader.c (copy_definition, parse_union_decl, copy_action)
15175 (copy_guard): Quote the file names.
15176 Reported by Laurent Mascherpa.
15177
151782000-12-12 Akim Demaille <akim@epita.fr>
15179
15180 * src/output.c (output_headers, output_program, output): Be sure
15181 to escape special characters when outputting filenames.
15182 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
15183 (output_headers): Don't depend on them, Use ACTSTR.
15184
151852000-11-17 Akim Demaille <akim@epita.fr>
15186
15187 * lib/obstack.h: Formatting changes.
15188 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
15189 prevents type checking.
15190 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
15191 cast the value to (void *): assigning a `foo *' to a `void *'
15192 variable is valid.
15193 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
15194 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
15195 append characters.
15196
151972000-11-17 Akim Demaille <akim@epita.fr>
15198
15199 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
15200 as...
15201 (suite.m4, regression.m4, calc.m4): these.
15202 * tests/atgeneral.m4: Update from CVS Autoconf.
15203
152042000-11-17 Akim Demaille <akim@epita.fr>
15205
15206 * tests/regression.m4 (%union and --defines): New test,
15207 demonstrating a current bug in the obstack implementation.
15208
152092000-11-17 Akim Demaille <akim@epita.fr>
15210
15211 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
15212 macros.
15213 Use them to declare the variables which are global or local to
15214 `yyparse'.
15215
152162000-11-17 Akim Demaille <akim@epita.fr>
15217
15218 * acconfig.h: Remove, no longer used.
15219
152202000-11-07 Akim Demaille <akim@epita.fr>
15221
15222 * src: s/Copyright (C)/Copyright/g.
15223
152242000-11-07 Akim Demaille <akim@epita.fr>
15225
15226 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
15227 defining.
15228 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
15229
152302000-11-07 Akim Demaille <akim@epita.fr>
15231
15232 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
15233 Merge in a single CPP if/else.
15234
152352000-11-07 Akim Demaille <akim@epita.fr>
15236
15237 * src/output.c (output): Remove useless variables.
15238 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
15239 argument `data' for consistency with the prototypes.
15240 Qualify it `const'.
15241 (obstack_copy, obstack_copy0): Rename the second argument as
15242 `address' for consistency. Qualify it `const'.
15243 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
15244 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
15245 `const' their input argument (`data' or `address').
15246 Adjust the corresponding macros to include `const' in casts.
15247
152482000-11-03 Akim Demaille <akim@epita.fr>
15249
15250 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
15251 s/PFILE1/BISON_HAIRY/.
15252 Adjust dependencies.
15253
152542000-11-03 Akim Demaille <akim@epita.fr>
15255
15256 For some reason, this was not applied.
15257
15258 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
15259 `unlink': it's no longer used.
15260
152612000-11-03 Akim Demaille <akim@epita.fr>
15262
15263 * src/files.c (skeleton_find): New function, eved out of...
15264 (open_files, open_extra_files): here.
15265
152662000-11-03 Akim Demaille <akim@epita.fr>
15267
15268 Don't use `atexit'.
15269
15270 * src/files.c (obstack_save): New function.
15271 (done): Rename as...
15272 (output_files): this.
15273 Use `obstack_save'.
15274 * src/main.c (main): Don't use `atexit' to register `done', since
15275 it no longer has to remove tmp files, just call `output_files'
15276 when there are no errors.
15277
152782000-11-02 Akim Demaille <akim@epita.fr>
15279
15280 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
15281 `unlink': it's no longer used.
15282 * src/files.h: Formatting changes.
15283
152842000-11-02 Akim Demaille <akim@epita.fr>
15285
15286 Remove the last uses of mktemp and unlink/delete.
15287
15288 * src/files.c (fdefines, ftable): Removed.
15289 (defines_ostack, table_obstack): New.
15290 Adjust dependencies of the former into uses of the latter.
15291 * src/output.c (output_short_or_char_table, output_short_table):
15292 Convert to using obstacks.
15293 * src/reader.c (copy_comment2): Accept one FILE * and two
15294 obstacks.
15295 (output_token_defines, reader_output_yylsp): Use obstacks.
15296 * src/system.h (obstack_fgrow3): New.
15297 * po/POTFILES.in: Adjust.
15298
152992000-11-01 Akim Demaille <akim@epita.fr>
15300
15301 Change each use of `fattrs' into a use of `attrs_obstack'.
15302
15303 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
15304 * src/files.c (fattrs): Remove.
15305 (attrs_obstack): New.
15306 Adjust all dependencies.
15307 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
15308
153092000-11-01 Akim Demaille <akim@epita.fr>
15310
15311 Introduce obstacks.
15312 Change each use of `faction' into a use of `action_obstack'.
15313
15314 * lib/obstack.h, lib/obstack.c: New files.
15315 * src/files.c (faction): Remove.
15316 (action_obstack): New.
15317 Adjust all dependencies.
15318
153192000-10-20 Akim Demaille <akim@epita.fr>
15320
15321 * lib/quote.h (PARAMS): New macro. Use it.
15322
153232000-10-16 Akim Demaille <akim@epita.fr>
15324
15325 * src/output.c (output_short_or_char_table): New function.
15326 (output_short_table, output_token_translations): Use it.
15327 (goto_actions): Use output_short_table.
15328
153292000-10-16 Akim Demaille <akim@epita.fr>
15330
15331 * src/symtab.c (bucket_new): New function.
15332 (getsym): Use it.
15333
15334 * src/output.c (output_short_table): New argument to display the
15335 comment associated with the table.
15336 Adjust dependencies.
15337 (output_gram): Use it.
15338 (output_rule_data): Nicer output layout for YYTNAME.
15339
153402000-10-16 Akim Demaille <akim@epita.fr>
15341
15342 * src/lex.c (read_typename): New function.
15343 (lex): Use it.
15344 * src/reader.c (copy_dollar): Likewise.
15345
153462000-10-16 Akim Demaille <akim@epita.fr>
15347
15348 * src/reader.c (copy_comment2): Expect the input stream to be on
15349 the `/' which is suspected to open a comment, instead of being
15350 called after `//' or `/*' was read.
15351 (copy_comment, copy_definition, parse_union_decl, copy_action)
15352 (copy_guard): Adjust.
15353
153542000-10-16 Akim Demaille <akim@epita.fr>
15355
15356 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
15357 `read_signed_integer'.
15358
153592000-10-16 Akim Demaille <akim@epita.fr>
15360
15361 * src/reader.c (copy_dollar): New function.
15362 (copy_guard, copy_action): Use it.
15363
153642000-10-16 Akim Demaille <akim@epita.fr>
15365
15366 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
15367 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
15368 New files, from Fileutils 4.0.27.
15369 * src/main.c (printable_version): Remove.
15370 * src/lex.c, src/reader.c: Use `quote'.
15371
153722000-10-04 Akim Demaille <akim@epita.fr>
15373
15374 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
15375
153762000-10-04 Akim Demaille <akim@epita.fr>
15377
15378 * doc/bison.texinfo: Various typos spotted by Neil Booth.
15379
153802000-10-04 Akim Demaille <akim@epita.fr>
15381
15382 When a literal string is used to define two different tokens,
15383 `bison -v' segfaults.
15384 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
15385
15386 * tests/regression.m4: New file.
15387 Include the core of the sample provided by Piotr Gackiewicz.
15388 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
15389 properly.
15390
153912000-10-04 Akim Demaille <akim@epita.fr>
15392
15393 * src/reader.c (parse_expect_decl): Keep `count' within the size
15394 of `buffer'.
15395 From Neil Booth.
15396
153972000-10-02 Paul Eggert <eggert@twinsun.com>
15398
15399 * bison.s1 (yyparse): Assign the default value
15400 unconditionally, to avoid a GCC warning and make the parser a
15401 tad smaller.
15402
154032000-10-02 Akim Demaille <akim@epita.fr>
15404
15405 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
15406 options.
15407
154082000-10-02 Akim Demaille <akim@epita.fr>
15409
15410 * src/derives.c, src/print.c, src/reduce.c: To ease the
15411 translation, move some `\n' out of the translated strings.
15412
154132000-10-02 Akim Demaille <akim@epita.fr>
15414
15415 The location tracking mechanism is precious for parse error
15416 messages. Nevertheless, it is enabled only when `@n' is used in
15417 the grammar, which is a different issue (you can use it in error
15418 message, but not in the grammar per se). Therefore, there should
15419 be another means to enable it.
15420
15421 * src/getargs.c (getargs): Support `--locations'.
15422 (usage): Report it.
15423 * src/getargs.h (locationsflag): Export it.
15424 * src/lex.c (percent_table): Support `%locations'.
15425 * src/reader.c (yylsp_needed): Remove this variable, now replaced
15426 with `locationsflag'.
15427 * doc/bison.texinfo: Document `--locations' and `%locations'.
15428 Sort the options.
15429 * tests/calc.m4: Test it.
15430
15431 For regularity of the names, replace each
15432 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
15433 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
15434 In addition replace each `flag' with `_flag'.
15435
154362000-10-02 Akim Demaille <akim@epita.fr>
15437
15438 Also test parse error messages, including with YYERROR_VERBOSE.
15439
15440 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
15441 associative).
15442 Use it to check the computations.
15443 Use it to check `nonassoc' is honored.
15444 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
15445 `--yyerror-verbose'.
15446 (_AT_CHECK_CALC): Adjust to this option.
15447 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
15448
154492000-10-02 Akim Demaille <akim@epita.fr>
15450
15451 Test also `--verbose', `--defines' and `--name-prefix'. Testing
15452 the latter demonstrates a flaw in the handling of non debugging
15453 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
15454 was used in order to simplify:
15455
15456 #if YYDEBUG
15457 if (yydebug)
15458 {
15459 ...
15460 }
15461 #endif
15462
15463 into
15464
15465 if (yydebug)
15466 {
15467 ...
15468 }
15469
15470 unfortunately this leads to a CPP conflict when
15471 `--name-prefix=foo' is used since it produces `#define yydebug
15472 foodebug'.
15473
15474 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
15475 (YYDPRINTF): New macro.
15476 Spread its use.
15477 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
15478 the bison options.
15479 Also test `--verbose', `--defines' and `--name-prefix'.
15480
154812000-10-02 Akim Demaille <akim@epita.fr>
15482
15483 Improve the readability of the produced parsers.
15484
15485 * src/bison.s1: Formatting changes.
15486 Improve the comment related to the `$' mark.
15487 (yydefault): Don't fall through to `yyresume': `goto' there.
15488 * src/output.c (output_parser): When the `$' is met, skip the end
15489 of its line.
15490 New variable, `number_of_dollar_signs', to check there's exactly
15491 one `$' in the parser skeleton.
15492
154932000-10-02 Akim Demaille <akim@epita.fr>
15494
15495 * lib/xstrdup.c: New file, from the fileutils.
15496 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
15497 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
15498 instead of strlen + xmalloc + strcpy.
15499 * src/symtab.c (copys): Remove, use xstrdup instead.
15500
155012000-10-02 Akim Demaille <akim@epita.fr>
15502
15503 * src/gram.h (associativity): New enum type which replaces the
15504 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
15505 `right_assoc', `left_assoc' and `non_assoc'.
15506 Adjust all dependencies.
15507 * src/reader.c: Formatting changes.
15508 (LTYPESTR): Don't define it, use it as a literal in
15509 `reader_output_yylsp'.
15510 * src/symtab.h (symbol_class): New enum type which replaces the
15511 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
15512 `sunknown', `stoken and `snterm'.
15513
155142000-10-02 Akim Demaille <akim@epita.fr>
15515
15516 * src/getargs.c (fixed_outfiles): Rename as...
15517 (yaccflag): for consistency and accuracy.
15518 Adjust dependencies.
15519
155202000-10-02 Akim Demaille <akim@epita.fr>
15521
15522 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
15523 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
15524 difficult and introduced a lot of core dump. It turns out that
15525 Bison used an implementation of `xmalloc' based on `calloc', and
15526 at various places it does depend upon the initialization to 0. I
15527 have not tried to isolate the pertinent places, and all the former
15528 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
15529 someone should address this issue.
15530
15531 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
15532 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
15533 files.
15534 Adjust dependencies.
15535 * src/warshall.h: New file.
15536 Propagate.
15537
155382000-10-02 Akim Demaille <akim@epita.fr>
15539
15540 Various anti-`extern in *.c' changes.
15541
15542 * src/system.h: Include `assert.h'.
15543
155442000-10-02 Akim Demaille <akim@epita.fr>
15545
15546 * src/state.h (nstates, final_state, first_state, first_shift)
15547 (first_reduction): Move their exportation from here...
15548 * src/LR0.h: to here.
15549 Adjust dependencies.
15550 * src/getargs.c (statisticsflag): New variable.
15551 Add support for `--statistics'.
15552 Adjust dependencies.
15553
15554 Remove a lot of now useless `extern' statements in most files.
15555
155562000-10-02 Akim Demaille <akim@epita.fr>
15557
15558 * src/LR0.h: New file.
15559 Propagate its use.
15560
155612000-10-02 Akim Demaille <akim@epita.fr>
15562
15563 * src/print.h: New file.
15564 Propagate its use.
15565 * src/print.c: Formatting and ordering changes.
15566 (verbose, terse): Replace with...
15567 (print_results): this new function.
15568 Adjust dependencies.
15569
155702000-10-02 Akim Demaille <akim@epita.fr>
15571
15572 * src/conflicts.c (conflict_report): New function.
15573 (conflict_log, verbose_conflict_log): Replace with...
15574 (print_conflicts): this function.
15575 Adjust dependencies.
15576 * src/conflicts.h: New file.
15577 Propagate its inclusion.
15578
155792000-10-02 Akim Demaille <akim@epita.fr>
15580
15581 * src/nullable.h: New file.
15582 Propagate its inclusion.
15583 * src/nullable.c: Formatting changes.
15584
155852000-10-02 Akim Demaille <akim@epita.fr>
15586
15587 * src/reduce.h: New file.
15588 Propagate its inclusion.
15589 * src/reduce.c: Topological sort and other formatting changes.
15590 (bool, TRUE, FALSE): Move their definition to...
15591 * src/system.h: here.
15592
155932000-10-02 Akim Demaille <akim@epita.fr>
15594
15595 * src/files.c: Formatting changes.
15596 (tryopen, tryclose, openfiles): Rename as...
15597 (xfopen, xfclose, open_files): this.
15598 (stringappend): static.
15599 * src/files.h: Complete the list of exported symbols.
15600 Propagate its use.
15601
156022000-10-02 Akim Demaille <akim@epita.fr>
15603
15604 * src/reader.h: New file.
15605 Propagate its use instead of tedious list of `extern' and
15606 prototypes.
15607 * src/reader.c: Formatting changes, topological sort,
15608 s/register//.
15609
156102000-10-02 Akim Demaille <akim@epita.fr>
15611
15612 * src/lex.h: Prototype `lex.c' exported functions.
15613 * src/reader.c: Adjust.
15614 * src/lex.c: Formatting changes.
15615 (safegetc): Rename as...
15616 (xgetc): this.
15617
156182000-10-02 Akim Demaille <akim@epita.fr>
15619
15620 * src/lalr.h: New file.
15621 Propagate its inclusion instead of prototypes and `extern'.
15622 * src/lalr.c: Formatting changes, topological sorting etc.
15623
156242000-10-02 Akim Demaille <akim@epita.fr>
15625
15626 * src/output.c (token_actions): Introduce a temporary array,
15627 YYDEFACT, that makes it possible for this function to use
15628 output_short_table.
15629
156302000-10-02 Akim Demaille <akim@epita.fr>
15631
15632 `user_toknums' is output as a `short[]' in `output.c', while it is
15633 defined as a `int[]' in `reader.c'. For consistency with the
15634 other output tables, `user_toknums' is now defined as a table of
15635 shorts.
15636
15637 * src/reader.c (user_toknums): Be a short table instead of an int
15638 table.
15639 Adjust dependencies.
15640
15641 Factor the short table outputs.
15642
15643 * src/output.c (output_short_table): New function.
15644 * src/output.c (output_gram, output_stos, output_rule_data)
15645 (output_base, output_table, output_check): Use it.
15646
156472000-10-02 Akim Demaille <akim@epita.fr>
15648
15649 * src/output.c (output): Topological sort of the functions, in
15650 order to get rid of the `static' prototypes.
15651 No longer use `register'.
15652 * src/output.h: New file.
15653 Propagate its inclusion in files explicitly prototyping functions
15654 from output.c.
15655
156562000-09-21 Akim Demaille <akim@epita.fr>
15657
15658 * src/atgeneral.m4: Update from Autoconf.
15659
156602000-09-21 Akim Demaille <akim@epita.fr>
15661
15662 * src/closure.h: New file.
15663 * src/closure.c: Formatting changes, topological sort over the
15664 functions, use of closure.h.
15665 (initialize_closure, finalize_closure): Rename as...
15666 (new_closure, free_closure): these. Adjust dependencies.
15667 * src/LR0.c: Formatting changes, topological sort, use of
15668 cloture.h.
15669 (initialize_states): Rename as...
15670 (new_states): this.
15671 * src/Makefile.am (noinst_HEADERS): Adjust.
15672
156732000-09-20 Akim Demaille <akim@epita.fr>
15674
15675 * src/acconfig.h: Don't protect config.h against multiple
15676 inclusion.
15677 Don't define PARAMS.
15678 * src/system.h: Define PARAMS.
15679 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
15680 purpose of config.h. system.h must not try to fix wrong
15681 definitions in config.h.
15682
156832000-09-20 Akim Demaille <akim@epita.fr>
15684
15685 * src/derives.h: New file.
15686 * src/main.c, src/derives.h: Use it.
15687 Formatting changes.
15688 * src/Makefile.am (noinst_HEADERS): Adjust.
15689
156902000-09-20 Akim Demaille <akim@epita.fr>
15691
15692 * tests/atgeneral.m4: Update from Autoconf.
15693 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
15694 (AT_CHECK_CALC): New macros.
15695 Use these macros to test bison with options `', `--raw',
15696 `--debug', `--yacc', `--yacc --debug'.
15697
156982000-09-19 Akim Demaille <akim@epita.fr>
15699
15700 * src/output.c: Formatting changes.
15701 * src/machine.h: Remove, leaving its contents in...
15702 * src/system.h: here.
15703 Include stdio.h.
15704 Adjust all dependencies on stdio.h and machine.h.
15705 * src/getargs.h: New file.
15706 Let all `extern' declarations about getargs.c be replaced with
15707 inclusion of `getargs.h'.
15708 * src/Makefile.am (noinst_HEADERS): Adjust.
15709
15710 * tests/calc.m4 (yyin): Be initialized in main, not on the global
15711 scope.
15712 (yyerror): Returns void, not int.
15713 * doc/bison.texinfo: Formatting changes.
15714
157152000-09-19 Akim Demaille <akim@epita.fr>
15716
15717 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
15718 portable.
15719
157202000-09-18 Akim Demaille <akim@epita.fr>
15721
15722 * configure.in: Append WARNING_CFLAGS to CFLAGS.
15723 * src/Makefile.am (INCLUDES): Don't.
15724 Be ready to fetch headers in lib/.
15725
157262000-09-18 Akim Demaille <akim@epita.fr>
15727
15728 * doc/bison.texinfo: Update the copyright.
15729 ANSIfy and GNUify the examples.
15730 Remove the old menu.
15731
157322000-09-18 Akim Demaille <akim@epita.fr>
15733
15734 First set of tests: use the `calc' example from the documentation.
15735
15736 * src/bison.s1 (yyparse): Condition the code using `yytname' which
15737 is defined only when YYDEBUG is.
15738 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
15739 * src/files.c (tryopen, tryclose): Formatting changes.
15740 Move to the top and be static.
15741 * src/reader.c (read_signed_integer): Likewise.
15742 * tests/calc.m4: New file.
15743 * Makefile.am, suite.m4: Adjust.
15744 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
15745
157462000-09-18 Akim Demaille <akim@epita.fr>
15747
15748 Add support for an Autotest test suite for Bison.
15749
15750 * m4/m4.m4, m4/atconfig.m4: New files.
15751 * m4/Makefile.am (EXTRA_DIST): Adjust.
15752 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
15753 files.
15754 * src/getargs.c: Display a more standard --version message.
15755 * src/reader.c (reader): Formatting changes.
15756 No longer depend upon VERSION_STRING.
15757 * configure.in: No longer use `dnl'.
15758 Set up the test suite and the new directory `tests/.
15759 (VERSION_STRING): Remove.
15760
157612000-04-14 Akim Demaille <akim@epita.fr>
15762
15763 * src/reader.c (copy_comment2): New function, same as former
15764 `copy_comment', but outputs into two FILE *.
15765 (copy_comment): Use it.
15766 (parse_union_decl): Use it.
15767 (get_type, parse_start_decl): Use the same `invalid' message.
15768 (parse_start_decl, parse_union_decl): Use the same `multiple'
15769 message.
15770 (parse_union_decl, copy_guard, copy_action): Use the same
15771 `unmatched' message.
15772 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
15773
157742000-03-31 Akim Demaille <akim@epita.fr>
15775
15776 * src/files.c (tryopen, tryclose): Move to the top.
15777 Be static.
15778
157792000-03-31 Akim Demaille <akim@epita.fr>
15780
15781 * src/main.c (main): Don't call `done', exit does it.
15782
157832000-03-31 Akim Demaille <akim@epita.fr>
15784
15785 * allocate.c: s/return (foo)/return foo/.
15786 * lalr.c: Likewise.
15787 * LR0.c: Likewise.
15788 * output.c: Likewise.
15789 * reader.c: Likewise.
15790 * symtab.c: Likewise.
15791 * vmsgetargs.c: Likewise.
15792
157932000-03-31 Akim Demaille <akim@epita.fr>
15794
15795 Clean up the error reporting functions.
15796
15797 * src/report.c: New file.
15798 * src/report.h: Likewise.
15799 * src/Makefile.am: Adjust.
15800 * m4/error.m4: New file.
15801 * m4/Makefile.am: Adjust.
15802 * configure.in (jm_PREREQ_ERROR): Call it.
15803 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
15804 Remove.
15805 (fatal, fatals): Remove. All callers use complain.c::fatal.
15806 (warn, warni, warns, warnss, warnss): Remove. All callers use
15807 complain.c::complain.
15808 (toomany): Remove, use fatal instead.
15809 * src/files.c (done): No argument, use complain_message_count.
15810 * src/main.c (main): Register `done' to `atexit'.
15811
15812 * src/getargs.c (usage): More `fputs', less `fprintf'.
15813
158142000-03-28 Akim Demaille <akim@epita.fr>
15815
15816 * lib/: New directory.
15817 * Makefile.am (SUBDIRS): Adjust.
15818 * configure.in: Adjust.
15819 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
15820 useless.
15821 * src/alloca.c: Moved to lib/.
15822 * src/getopt.c: Likewise.
15823 * src/getopt1.c: Likewise.
15824 * src/getopt.h: Likewise.
15825 * src/ansi2knr.c: Likewise.
15826 * src/ansi2knr.1: Likewise.
15827 * src/Makefile.am: Adjust.
15828 * lib/Makefile.am: New file.
15829
158302000-03-28 Akim Demaille <akim@epita.fr>
15831
15832 * src/getargs.c (usage): Refresh the help message.
15833
158342000-03-17 Akim Demaille <akim@epita.fr>
15835
15836 * src/getopt1.c: Updated from textutils 2.0e
15837 * src/getopt.c: Likewise.
15838 * src/getopt.h: Likewise.
15839
158402000-03-17 Akim Demaille <akim@epita.fr>
15841
15842 * src/Makefile.am (bison.simple): Fix the awk program: quote only
15843 the file name, not the whole `#line LINE FILE'.
15844
158452000-03-17 Akim Demaille <akim@epita.fr>
15846
15847 On syntax errors, report the token on which we choked.
15848
15849 * src/bison.s1 (yyparse): In the label yyerrlab, when
15850 YYERROR_VERBOSE, add yychar in msg.
15851
158522000-03-17 Akim Demaille <akim@epita.fr>
15853
15854 * src/reader.c (copy_at): New function.
15855 (copy_guard): Use it.
15856 (copy_action): Use it.
15857
158582000-03-17 Akim Demaille <akim@epita.fr>
15859
15860 Be kind to translators, save some useless translations.
15861
15862 * src/main.c (banner): New function.
15863 (fatal_banner): Use it.
15864 (warn_banner): Use it.
15865
158662000-03-17 Akim Demaille <akim@epita.fr>
15867
15868 * src/reader.c (copy_definition): Use copy_string and
15869 copy_comment. Removed now unused `match', `ended',
15870 `cplus_comment'.
15871 (copy_comment, copy_string): Moved, to be visible from
15872 copy_definition.
15873
158742000-03-17 Akim Demaille <akim@epita.fr>
15875
15876 * src/reader.c (copy_string): Declare `static inline'. No
15877 problems with inline, since it is checked by configure.
15878 (copy_comment): Likewise.
15879
158802000-03-17 Akim Demaille <akim@epita.fr>
15881
15882 * src/reader.c (packsymbols): Formatting changes.
15883
158842000-03-17 Akim Demaille <akim@epita.fr>
15885
15886 * src/reader.c (copy_comment): New function, factored out from:
15887 (copy_action): Use it. Removed now unused `match', `ended',
15888 `cplus_comment'.
15889 (copy_guard): Likewise.
15890
158912000-03-17 Akim Demaille <akim@epita.fr>
15892
15893 * src/reader.c (copy_string): New function, factored out from:
15894 (copy_action): Use it.
15895 (copy_guard): Likewise.
15896
158972000-03-17 Akim Demaille <akim@epita.fr>
15898
15899 Change the handling of @s so that they behave exactly like $s.
15900 There is now a pseudo variable @$ (readble and writable), location
15901 of the lhs of the rule (by default ranging from the location of
15902 the first symbol of the rhs, to the location of the last symbol,
15903 or, if the rhs is empty, YYLLOC).
15904
15905 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
15906 yyval.
15907 (yyparse): When providing a default semantic action, provide a
15908 default location action.
15909 (after the $): No longer change `*YYLSP', just stack YYLOC the
15910 same way you stack YYVAL.
15911 * src/reader.c (read_declarations): Use warns.
15912 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
15913 (copy_action, case '@'): Likewise.
15914 Use a standard error message, to save useless work from
15915 translators.
15916
159172000-03-17 Akim Demaille <akim@epita.fr>
15918
15919 * src/bison.s1: Formatting and cosmetics changes.
15920 * src/reader.c: Likewise.
15921 Update the Copyright notice.
15922
159232000-03-17 Akim Demaille <akim@epita.fr>
15924
15925 * src/bison.s1 (#line): All set to `#line' only, since the
15926 Makefile now handles them.
15927
159282000-03-16 Akim Demaille <akim@epita.fr>
15929
15930 * src/output.c (output_rule_data): Output the documentation of
15931 some of the tables.
15932 (Copyright notice): Update.
15933 Formatting changes.
15934
159352000-03-16 Akim Demaille <akim@epita.fr>
15936
15937 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
15938 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
15939 One `#if YYDEBUG' remains, since it uses variables which are
15940 defined only if `YYDEBUG != 0'.
15941
159422000-03-16 Akim Demaille <akim@epita.fr>
15943
15944 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
15945 and related variables so that the similarities are highlighted.
15946
159472000-03-16 Akim Demaille <akim@epita.fr>
15948
15949 * src/bison.s1: Properly indent CPP directives.
15950
159512000-03-16 Akim Demaille <akim@epita.fr>
15952
15953 * src/bison.s1: Properly indent the `alloca' CPP section.
15954
159552000-03-16 Akim Demaille <akim@epita.fr>
15956
15957 Do not hard code values of directories in `configure.in'.
15958 Update the `configure' tool chain.
15959
15960 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
15961 src/makefile.am.
15962 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
15963 (AC_OUTPUT): Add m4/Makefile.
15964 Bump to bison 1.28a, 1.29 has never been released.
15965 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
15966 handled via src/Makefile.am.
15967 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
15968 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
15969 autoheader.
15970 * Makefile.am (SUBDIRS): Add m4.
15971 (ACLOCAL_AM_FLAGS): New variable.
15972 (AUTOMAKE_OPTIONS): Add check-news.
15973 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
15974 the proper line number and file name.
15975 (DEFS): Propagate the location of bison library files and of the
15976 locale files.
15977 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
15978 builddir.
15979 * acinclude.m4: Remove, replaced by the directory m4.
15980 * m4/Makefile.am (EXTRA_DIST): New variable.
15981 * m4/gettext.m4: New file, from the fileutils.
15982 * m4/lcmessage.m4: Likewise
15983 * m4/progtest.m4: Likewise.
15984 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
15985
159862000-03-10 Akim Demaille <akim@epita.fr>
15987
15988 * src/closure.c:
15989 Formatting changes of various comments.
15990 Respect the GNU coding standards at various places.
15991 Don't use `_()' when no translation is needed.
15992
159931999-12-13 Jesse Thilo <jthilo@gnu.org>
15994
15995 * src/files.c:
15996 OS/2 honors TMPDIR environment variable.
15997
159981999-12-13 Jesse Thilo <jthilo@gnu.org>
15999
16000 * doc/bison.texinfo: Tweaked spelling and grammar.
16001 Updated ISBN.
16002 Removed reference to price of printed copy.
16003 Mention BISON_SIMPLE and BISON_HAIRY.
16004
160051999-12-13 Jesse Thilo <jthilo@gnu.org>
16006
16007 * configure.in, NEWS:
16008 Bison 1.29 released.
16009
160101999-10-27 Jesse Thilo <jthilo@gnu.org>
16011
16012 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
16013 Added reference card.
16014
160151999-07-26 Jesse Thilo <jthilo@gnu.org>
16016
16017 * po/ru.po: Added Russian translation.
16018
160191999-07-26 Jesse Thilo <jthilo@gnu.org>
16020
16021 * configure.in: Added Russian translation.
16022
160231999-07-06 Jesse Thilo <jthilo@gnu.org>
16024
16025 * configure.in, NEWS, README:
16026 Released version 1.28.
16027
160281999-06-14 Jesse Thilo <jthilo@gnu.org>
16029
16030 * src/system.h:
16031 Squashed redefinition warning on some systems.
16032
16033 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
16034 Have configure build version string instead of relying on ANSI string
16035 concatentation.
16036
160371999-06-14 Jesse Thilo <jthilo@gnu.org>
16038
16039 * po/POTFILES.in: Got rid of version.c.
16040
160411999-06-14 Jesse Thilo <jthilo@gnu.org>
16042
16043 * acconfig.h, configure.in:
16044 Have configure build version string instead of relying on ANSI string
16045 concatentation.
16046
160471999-06-08 Jesse Thilo <jthilo@gnu.org>
16048
16049 * doc/bison.1:
16050 Dropped mention of `+' for long-named options.
16051
160521999-05-30 Jesse Thilo <jthilo@gnu.org>
16053
16054 * src/files.c: Added <unistd.h> for unlink().
16055
16056 * src/Makefile.am, src/system.h:
16057 I18n fixes.
16058
160591999-05-30 Jesse Thilo <jthilo@gnu.org>
16060
16061 * README: Added a FAQ list.
16062
16063 * configure.in, acconfig.h:
16064 I18n fixes.
16065
160661999-05-30 Jesse Thilo <jthilo@gnu.org>
16067
16068 * doc/FAQ, doc/Makefile.am:
16069 Added a FAQ list.
16070
160711999-05-19 Jesse Thilo <jthilo@gnu.org>
16072
16073 * src/alloc.h, src/symtab.h, src/version.c:
16074 Protected inclusion of "config.h" with HAVE_CONFIG_H.
16075
160761999-04-18 Jesse Thilo <jthilo@gnu.org>
16077
16078 * src/.cvsignore, src/Makefile.am:
16079 Reorganized: sources in `src', documentation in `doc'.
16080
16081 * src/lex.c (literalchar):
16082 fixed the code for escaping double quotes (thanks
16083 Jonathan Czisny.)
16084
160851999-04-18 Jesse Thilo <jthilo@gnu.org>
16086
16087 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
16088 Adjusted paths to reflect directory reorganization.
16089
160901999-04-18 Jesse Thilo <jthilo@gnu.org>
16091
16092 * doc/.cvsignore, doc/Makefile.am:
16093 Reorganized: sources in `src', documentation in `doc'.
16094
160951999-04-18 Jesse Thilo <jthilo@gnu.org>
16096
16097 * configure.in:
16098 Updated AC_INIT file to reflect directory reorganization.
16099
16100 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
16101 Reorganized: sources in `src', documentation in `doc'.
16102
161031999-04-13 Jesse Thilo <jthilo@gnu.org>
16104
16105 * src/allocate.c:
16106 Don't declare calloc() and realloc() if not necessary.
16107
161081999-04-13 Jesse Thilo <jthilo@gnu.org>
16109
16110 * configure.in, acconfig.h, acinclude.m4:
16111 Don't declare calloc() and realloc() if not necessary.
16112
161131999-03-23 Jesse Thilo <jthilo@gnu.org>
16114
16115 * po/.cvsignore: Added i18n support.
16116
161171999-03-23 Jesse Thilo <jthilo@gnu.org>
16118
16119 * acconfig.h, configure.in, Makefile.am:
16120 Added i18n support.
16121
161221999-03-22 Jesse Thilo <jthilo@gnu.org>
16123
16124 * src/bison.s1: Fixed #line numbers.
16125
161261999-03-15 Jesse Thilo <jthilo@gnu.org>
16127
16128 * po/es.po, po/fr.po, po/nl.po, po/de.po:
16129 Added PO files from Translation Project.
16130
161311999-03-03 Jesse Thilo <jthilo@gnu.org>
16132
16133 * Makefile.am:
16134 Added support for non-ANSI compilers (ansi2knr).
16135
161361999-02-16 Jesse Thilo <jthilo@gnu.org>
16137
16138 * configure.in: Bumped version number to 1.27.
16139
16140 * Makefile.am:
16141 Added `bison.simple' to list of files removed by `make distclean'.
16142
161431999-02-12 Jesse Thilo <jthilo@gnu.org>
16144
16145 * src/files.c, src/files.h:
16146 Defined locations of parser files in config.h instead of Makefile.
16147
161481999-02-12 Jesse Thilo <jthilo@gnu.org>
16149
16150 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
16151 Defined locations of parser files in config.h instead of Makefile.
16152
161531999-02-09 Jesse Thilo <jthilo@gnu.org>
16154
16155 * Makefile.am:
16156 Removed inappropriate use of $< macro.
16157
161581999-02-05 Jesse Thilo <jthilo@gnu.org>
16159
16160 * po/Makefile.in.in, po/POTFILES.in:
16161 Add `po' directory skeleton.
16162
161631999-01-27 Jesse Thilo <jthilo@gnu.org>
16164
16165 * README: Document help-bison list.
16166
16167 * configure.in: Add check for mkstemp().
16168
161691999-01-20 Jesse Thilo <jthilo@gnu.org>
16170
16171 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
16172 Hush a few compiler warnings.
16173
16174 * src/files.c:
16175 Add tryclose(), which verifies that fclose was successful.
16176 Hush a couple of compiler warnings.
16177
161781999-01-20 Jesse Thilo <jthilo@gnu.org>
16179
16180 * Makefile.am, OChangeLog:
16181 ChangeLog is now automatically generated. Include the old version as
16182 OChangeLog.
16183
161841999-01-14 Jesse Thilo <jthilo@gnu.org>
16185
16186 * 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:
16187 Update FSF address.
16188
161891999-01-14 Jesse Thilo <jthilo@gnu.org>
16190
16191 * doc/bison.texinfo: Fix formatting glitch.
16192
16193 * doc/bison.texinfo: Update FSF address.
16194
161951999-01-14 Jesse Thilo <jthilo@gnu.org>
16196
16197 * acconfig.h: Update FSF address.
16198
161991999-01-08 Jesse Thilo <jthilo@gnu.org>
16200
16201 * src/system.h:
16202 Don't define PACKAGE here, since config.h defines it.
16203
162041998-12-30 Jesse Thilo <jthilo@gnu.org>
16205
16206 * src/reader.c: Update copyright date.
16207
16208 * src/main.c:
16209 Ditch sprintf to statically-sized buffers in fatal/warn functions in
16210 favor of output directly to stderr (avoids buffer overruns).
16211
16212 * src/reader.c: Some checks for premature EOF.
16213
16214 * 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:
16215 Use prototypes if the compiler understands them.
16216
16217 * src/files.c: Honor TMPDIR on Unix hosts.
16218 Use prototypes if the compiler understands them.
16219
16220 * src/reader.c:
16221 Fix a couple of buffer overrun bugs.
16222 Use prototypes if the compiler understands them.
16223
16224 * src/system.h: Include unistd.h and ctype.h.
16225 Use #ifdef instead of #if for NLS symbols.
16226
162271998-12-30 Jesse Thilo <jthilo@gnu.org>
16228
16229 * doc/bison.texinfo:
16230 Delete comment "consider using @set for edition number, etc..." since
16231 we now are doing so.
16232
162331998-12-30 Jesse Thilo <jthilo@gnu.org>
16234
16235 * configure.in:
16236 Use prototypes if the compiler understands them.
16237
16238 * NEWS: Document 1.26 highlights.
16239
16240 * Makefile.am: Require Automake 1.3 or later.
16241
16242 * acconfig.h:
16243 Use prototypes if the compiler understands them.
16244
162451998-12-29 Jesse Thilo <jthilo@gnu.org>
16246
16247 * src/version.c:
16248 Use VERSION symbol from automake for version number.
16249
162501998-12-29 Jesse Thilo <jthilo@gnu.org>
16251
16252 * acconfig.h, configure.in, version.cin:
16253 Use VERSION symbol from automake for version number.
16254
162551998-11-28 Jesse Thilo <jthilo@gnu.org>
16256
16257 * Makefile.am:
16258 Distribute original version of simple parser (bison.s1), not built
16259 version (bison.simple).
16260
162611998-11-28 Jesse Thilo <jthilo@gnu.org>
16262
16263 * doc/bison.texinfo: Add info dir entry.
16264
16265 * doc/bison.texinfo:
16266 Let automake put version number into documentation.
16267
162681998-11-26 Jesse Thilo <jthilo@gnu.org>
16269
16270 * src/bison.cld, src/build.com, src/vmshlp.mar:
16271 Add non-RCS files from /gd/gnu/bison.
16272
162731998-11-26 Jesse Thilo <jthilo@gnu.org>
16274
16275 * doc/bison.1:
16276 Document the BISON_HAIRY and BISON_SIMPLE variables.
16277
162781998-11-25 Jesse Thilo <jthilo@gnu.org>
16279
16280 * src/version.c: Build version.c automatically.
16281
16282 * src/reader.c:
16283 Fix token numbering (used to start at 258, not 257).
16284
16285 * src/system.h: Include config.h.
16286
16287 * src/getargs.c: Update bug report address.
16288
16289 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
16290 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
16291
162921998-11-25 Jesse Thilo <jthilo@gnu.org>
16293
16294 * Makefile.am:
16295 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
16296
16297 * configure.in, version.cin:
16298 Build version.c automatically.
16299
16300 * AUTHORS: Add AUTHORS file.
16301
16302 * README: Update bug report address.
16303
16304 * bison.simple:
16305 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
16306
16307 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
16308 Add automake stuff.
16309
163101998-11-25 Jesse Thilo <jthilo@gnu.org>
16311
16312 * doc/bison.texinfo: Clean up some formatting.
16313
163141998-05-05 Richard Stallman <rms@gnu.org>
16315
16316 * doc/bison.texinfo:
16317 Explain better why to make a pure parser.
16318
163191998-01-05 Richard Stallman <rms@gnu.org>
16320
16321 * src/files.c (openfiles):
16322 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
16323 find a temporary directory, if possible. Do not unlink files while
16324 they are open.
16325
163261997-08-25 Richard Stallman <rms@gnu.org>
16327
16328 * src/reader.c (stack_offset;):
16329 Change some warni to warns.
16330
16331 * src/lex.c (literalchar): Use warns, not warni.
16332
163331997-06-28 Richard Stallman <rms@gnu.org>
16334
16335 * src/bison.s1: Add a Bison version comment.
16336
16337 * src/main.c (fatal, warn, berror):
16338 Use program_name.
16339
163401997-06-28 Richard Stallman <rms@gnu.org>
16341
16342 * Makefile.in (bison_version): New variable.
16343 (dist): Use that variable.
16344 (bison.s1): Substitute the Bison version into bison.simple.
16345
16346 * bison.simple: Add a Bison version comment.
16347
163481997-06-18 Richard Stallman <rms@gnu.org>
16349
16350 * src/main.c (fatal, warn, berror):
16351 Make error messages standard.
16352 (toomany): Improve error message text.
16353
16354 * 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:
16355 new.h renamed to alloc.h.
16356
163571997-06-18 Richard Stallman <rms@gnu.org>
16358
16359 * Makefile.in: new.h renamed to alloc.h.
16360
163611997-05-24 Richard Stallman <rms@gnu.org>
16362
16363 * src/lex.c (literalchar):
16364 Fix the code for escaping \, " and '.
16365
16366 (lex): Avoid trouble when there are many chars
16367 to discard in a char literal with just several chars in it.
16368
163691997-05-17 Richard Stallman <rms@gnu.org>
16370
16371 * src/bison.s1:
16372 Use malloc, if using alloca is troublesome.
16373 (YYSTACK_USE_ALLOCA): New flag macro.
16374 Define it for some systems and compilers.
16375 (YYSTACK_ALLOC): New macro.
16376 (yyparse): Use YYSTACK_ALLOC to allocate stack.
16377 If it was malloc'd, free it.
16378
163791997-05-17 Richard Stallman <rms@gnu.org>
16380
16381 * bison.simple:
16382 Use malloc, if using alloca is troublesome.
16383 (YYSTACK_USE_ALLOCA): New flag macro.
16384 Define it for some systems and compilers.
16385 (YYSTACK_ALLOC): New macro.
16386 (yyparse): Use YYSTACK_ALLOC to allocate stack.
16387 If it was malloc'd, free it.
16388
163891997-04-23 Richard Stallman <rms@gnu.org>
16390
16391 * src/bison.s1:
16392 (alloca) [__hpux]: Always define as __builtin_alloca.
16393
163941997-04-23 Richard Stallman <rms@gnu.org>
16395
16396 * bison.simple:
16397 (alloca) [__hpux]: Always define as __builtin_alloca.
16398
163991997-04-22 Richard Stallman <rms@gnu.org>
16400
16401 * src/bison.s1:
16402 [__hpux]: Include alloca.h (right for HPUX 10)
16403 instead of declaring alloca (right for HPUX 9).
16404
16405 * src/bison.s1 (__yy_memcpy):
16406 Declare arg `count' as unsigned int.
16407 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
16408
164091997-04-22 Richard Stallman <rms@gnu.org>
16410
16411 * bison.simple:
16412 [__hpux]: Include alloca.h (right for HPUX 10)
16413 instead of declaring alloca (right for HPUX 9).
16414
16415 * bison.simple (__yy_memcpy):
16416 Declare arg `count' as unsigned int.
16417 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
16418
164191997-01-03 Richard Stallman <rms@gnu.org>
16420
16421 * src/allocate.c: [__STDC__ or _MSC_VER]:
16422 Declare calloc and realloc to return void *.
16423
164241997-01-02 Richard Stallman <rms@gnu.org>
16425
16426 * src/system.h:
16427 [_MSC_VER]: Include stdlib.h and process.h.
16428 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
16429
16430 * src/main.c (main): Return FAILURE as a value.
16431 (printable_version): Declare arg as int, not char.
16432
164331997-01-02 Richard Stallman <rms@gnu.org>
16434
16435 * Makefile.in (dist):
16436 Explicitly check for symlinks, and copy them.
16437
164381996-12-19 Richard Stallman <rms@gnu.org>
16439
16440 * src/files.c:
16441 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
16442
164431996-12-18 Paul Eggert <eggert@gnu.org>
16444
16445 * src/bison.s1 (yyparse):
16446 If __GNUC__ and YYPARSE_PARAM are both defined,
16447 declare yyparse to have a void * argument.
16448
164491996-12-18 Paul Eggert <eggert@gnu.org>
16450
16451 * bison.simple (yyparse):
16452 If __GNUC__ and YYPARSE_PARAM are both defined,
16453 declare yyparse to have a void * argument.
16454
164551996-12-17 Richard Stallman <rms@gnu.org>
16456
16457 * src/reduce.c (nbits): Add some casts.
16458
164591996-08-12 Richard Stallman <rms@gnu.org>
16460
16461 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
16462
164631996-08-12 Richard Stallman <rms@gnu.org>
16464
16465 * bison.simple: Test _MSDOS as well as _MSDOS_.
16466
164671996-07-31 Richard Stallman <rms@gnu.org>
16468
16469 * src/bison.s1:
16470 [__sun && __i386]: Include alloca.h.
16471
164721996-07-31 Richard Stallman <rms@gnu.org>
16473
16474 * bison.simple:
16475 [__sun && __i386]: Include alloca.h.
16476
164771996-07-30 Richard Stallman <rms@gnu.org>
16478
16479 * src/bison.s1: Comment change.
16480
16481 * src/bison.s1: Test _MSDOS_, not MSDOS.
16482
164831996-07-30 Richard Stallman <rms@gnu.org>
16484
16485 * bison.simple: Comment change.
16486
16487 * bison.simple: Test _MSDOS_, not MSDOS.
16488
164891996-06-01 Richard Stallman <rms@gnu.org>
16490
16491 * 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:
16492 Insert `_' macro around many string constants.
16493
16494 * src/main.c:
16495 Insert `_' macro around many string constants.
16496
16497 (main): Call setlocale, bindtextdomain and textdomain.
16498
16499 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
16500 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
16501 [ENABLE_NLS]: Include libintl.h.
16502 [ENABLE_NLS] (gettext): Define.
16503 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
16504 (N_, PACKAGE, LOCALEDIR): New macros.
16505
165061996-06-01 Richard Stallman <rms@gnu.org>
16507
16508 * POTFILES.in: New file.
16509
16510 * Makefile.in (allocate.o):
16511 Define target explicitly.
16512
16513 * Makefile.in (CFLAGS): Set to @CFLAGS@.
16514 (LDFLAGS): Set to @LDFLAGS@.
16515 (configure): Run autoconf only if preceding `cd' succeeds.
16516 (bison.s1): Redirect output to temporary file then move the
16517 temporary to the target, rather than redirecting directly to bison.s1.
16518 (clean): Remove config.status and config.log.
16519 (distclean): Don't remove config.status here.
16520
165211996-05-12 Richard Stallman <rms@gnu.org>
16522
16523 * src/bison.s1:
16524 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
16525
165261996-05-12 Richard Stallman <rms@gnu.org>
16527
16528 * bison.simple:
16529 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
16530
165311996-05-11 Richard Stallman <rms@gnu.org>
16532
16533 * src/bison.s1 (__yy_memcpy):
16534 Really reorder the args, as was supposedly done on Feb 14 1995.
16535 (yyparse): Calls changed accordingly.
16536
165371996-05-11 Richard Stallman <rms@gnu.org>
16538
16539 * Makefile.in (dist): Don't use $(srcdir).
16540
16541 * bison.simple (__yy_memcpy):
16542 Really reorder the args, as was supposedly done on Feb 14 1995.
16543 (yyparse): Calls changed accordingly.
16544
165451996-01-27 Richard Stallman <rms@gnu.org>
16546
16547 * src/output.c (output_rule_data):
16548 Test YYERROR_VERBOSE in the conditional
16549 around the definition of ttyname.
16550
165511995-12-29 Richard Stallman <rms@gnu.org>
16552
16553 * src/bison.s1:
16554 Fix line numbers in #line commands.
16555
165561995-12-29 Richard Stallman <rms@gnu.org>
16557
16558 * bison.simple:
16559 Fix line numbers in #line commands.
16560
165611995-12-27 Richard Stallman <rms@gnu.org>
16562
16563 * src/bison.s1 (YYPARSE_PARAM_DECL):
16564 In C++, make it always null.
16565 (YYPARSE_PARAM_ARG): New macro.
16566 (yyparse): Use YYPARSE_PARAM_ARG.
16567
165681995-12-27 Richard Stallman <rms@gnu.org>
16569
16570 * bison.simple (YYPARSE_PARAM_DECL):
16571 In C++, make it always null.
16572 (YYPARSE_PARAM_ARG): New macro.
16573 (yyparse): Use YYPARSE_PARAM_ARG.
16574
165751995-11-29 Richard Stallman <rms@gnu.org>
16576
16577 * doc/bison.texinfo:
16578 Describe literal string tokens, %raw, %no_lines, %token_table.
16579
165801995-11-29 Daniel Hagerty <hag@gnu.org>
16581
16582 * doc/bison.texinfo: Fixed update date
16583
165841995-10-16 Richard Stallman <rms@gnu.org>
16585
16586 * src/version.c: Version 1.25.
16587
165881995-10-16 Richard Stallman <rms@gnu.org>
16589
16590 * NEWS: *** empty log message ***
16591
165921995-10-16 Richard Stallman <rms@gnu.org>
16593
16594 * doc/bison.1, doc/bison.rnh:
16595 Add new options.
16596
165971995-10-15 Richard Stallman <rms@gnu.org>
16598
16599 * src/vmsgetargs.c, src/getargs.c:
16600 Added -n, -k, and -raw switches.
16601 (noparserflag, toknumflag, rawtoknumflag): New variables.
16602
16603 * src/symtab.h (SALIAS):
16604 New #define for adding aliases to %token.
16605 (struct bucket): Added `alias' field.
16606
16607 * src/reduce.c (reduce_grammar):
16608 Revise error message.
16609 (print_notices): Remove final `.' from error message.
16610
16611 * src/reader.c (reader_output_yylsp):
16612 New function.
16613 (readgram): Use `#if 0' around code that accepted %command
16614 inside grammar rules: The documentation doesn't allow it,
16615 and it will fail since the %command processors scan for the next %.
16616 (parse_token_decl): Extended the %token
16617 declaration to allow a multi-character symbol as an alias.
16618 (parse_thong_decl): New function.
16619 (read_declarations): Added %thong declarations.
16620 (read_declarations): Handle NOOP to deal with allowing
16621 % declarations as another means to specify the flags.
16622 (readgram): Allow %prec prior to semantics embedded in a rule.
16623 (skip_to_char, read_declarations, copy_definition)
16624 (parse_token_decl, parse_start_decl, parse_type_decl)
16625 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
16626 (get_type_name, copy_guard, copy_action, readgram)
16627 (get_type, packsymbols): Revised most error messages.
16628 Changed `fatal' to `warnxxx' to avoid aborting for error.
16629 Revised and use multiple warnxxx functions to avoid using VARARGS1.
16630 (read_declarations): Improve the error message for
16631 an invalid character. Do not abort.
16632 (read_declarations, copy_guard, copy_action): Use
16633 printable_version to avoid unprintable characters in printed output.
16634 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
16635 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
16636 Allow the type of a non-terminal can be given
16637 more than once, as long as all specifications give the same type.
16638
16639 * src/output.c:
16640 (output_headers, output_trailers, output, output_gram)
16641 (output_rule_data): Implement noparserflag variable.
16642 Implement toknumflag variable.
16643 (output): Call reader_output_yylsp to output LTYPESTR.
16644
16645 * src/main.c (main):
16646 If reader sees an error, don't process the grammar.
16647 (fatals): Updated to not use VARARGS1.
16648 (printable_version, int_to_string, warn, warni, warns, warnss)
16649 (warnsss): New error reporting functions. Avoid abort for error.
16650
16651 * src/lex.h:
16652 Added THONG and NOOP for alias processing.
16653 Added SETOPT for the new code that allows setting options with %flags.
16654
16655 * src/lex.c:
16656 Include getopt.h. Add some extern decls.
16657 (safegetc): New function to deal with EOF gracefully.
16658 (literalchar); new function to deal with reading \ escapes.
16659 (lex): Use literalchar.
16660 (lex): Implemented "..." tokens.
16661 (literalchar, lex, parse_percent_token): Made tokenbuffer
16662 always contain the token. This includes growing the token
16663 buffer while reading an integer.
16664 (parse_percent_token): Replaced if-else statement with percent_table.
16665 (parse_percent_token): Added % declarations as another
16666 way to specify the flags -n, -l, and -r. Also added hooks for
16667 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
16668 major changes to files.c.
16669 (lex) Retain in the incoming stream a character following
16670 an incorrect '/'.
16671 (skip_white_space, lex): Revised most error messages
16672 and changed fatal to warn to avoid aborting.
16673 (percent_table): Added %thong declarations.
16674
16675 * src/gram.h: Comment changes.
16676
16677 * src/files.c (openfiles, open_extra_files, done):
16678 Add faction flag
16679 and actfile file. Handle noparserflag. Both for -n switch.
16680
16681 * src/conflicts.c (resolve_sr_conflict):
16682 Remove use of alloca.
16683
166841995-06-01 Jim Meyering <meyering@gnu.org>
16685
16686 * doc/bison.texinfo: *** empty log message ***
16687
166881995-05-06 Richard Stallman <rms@gnu.org>
16689
16690 * src/bison.s1: Comment change.
16691
166921995-05-06 Richard Stallman <rms@gnu.org>
16693
16694 * bison.simple: Comment change.
16695
166961995-05-03 Richard Stallman <rms@gnu.org>
16697
16698 * src/version.c: Version now 1.24.
16699
16700 * src/bison.s1: Change distribution terms.
16701
16702 * src/version.c: Version now 1.23.
16703
167041995-05-03 Richard Stallman <rms@gnu.org>
16705
16706 * doc/bison.texinfo:
16707 Rewrite "Conditions for Using Bison".
16708 Update version to 1.24.
16709
167101995-05-03 Richard Stallman <rms@gnu.org>
16711
16712 * bison.simple: Change distribution terms.
16713
167141995-02-23 Richard Stallman <rms@gnu.org>
16715
16716 * src/files.c: Test __VMS_POSIX as well as VMS.
16717
167181995-02-14 Jim Meyering <meyering@gnu.org>
16719
16720 * src/bison.s1 (__yy_memcpy):
16721 Renamed from __yy_bcopy to avoid
16722 confusion. Reverse FROM and TO arguments to be consistent with
16723 those of memcpy.
16724
167251995-02-14 Jim Meyering <meyering@gnu.org>
16726
16727 * bison.simple (__yy_memcpy):
16728 Renamed from __yy_bcopy to avoid
16729 confusion. Reverse FROM and TO arguments to be consistent with
16730 those of memcpy.
16731
167321994-11-10 David J. MacKenzie <djm@gnu.org>
16733
16734 * NEWS: reformat
16735
16736 * NEWS: New file.
16737
16738 * Makefile.in (DISTFILES): Include NEWS.
16739
16740 * Makefile.in (DISTFILES):
16741 Include install-sh, not install.sh.
16742
16743 * configure.in: Update to Autoconf v2 macro names.
16744
167451994-10-05 David J. MacKenzie <djm@gnu.org>
16746
16747 * Makefile.in: fix typo
16748
16749 * Makefile.in (prefix, exec_prefix):
16750 Let configure set them.
16751
167521994-09-28 David J. MacKenzie <djm@gnu.org>
16753
16754 * Makefile.in: Set datadir to $(prefix)/share.
16755
167561994-09-15 Richard Stallman <rms@gnu.org>
16757
16758 * src/bison.s1:
16759 Update copyright notice and GPL version.
16760
167611994-09-15 Richard Stallman <rms@gnu.org>
16762
16763 * bison.simple:
16764 Update copyright notice and GPL version.
16765
167661994-07-12 Richard Stallman <rms@gnu.org>
16767
16768 * src/reduce.c, src/reader.c:
16769 entered into RCS
16770
167711994-05-05 David J. MacKenzie <djm@gnu.org>
16772
16773 * Makefile.in: entered into RCS
16774
167751994-03-26 Richard Stallman <rms@gnu.org>
16776
16777 * src/bison.s1: entered into RCS
16778
167791994-03-26 Richard Stallman <rms@gnu.org>
16780
16781 * bison.simple: entered into RCS
16782
167831994-03-25 Richard Stallman <rms@gnu.org>
16784
16785 * src/main.c: entered into RCS
16786
167871994-03-24 Richard Stallman <rms@gnu.org>
16788
16789 * src/conflicts.c: entered into RCS
16790
167911994-01-02 Richard Stallman <rms@gnu.org>
16792
16793 * Makefile.in: *** empty log message ***
16794
167951993-11-21 Richard Stallman <rms@gnu.org>
16796
16797 * src/bison.s1: *** empty log message ***
16798
167991993-11-21 Richard Stallman <rms@gnu.org>
16800
16801 * doc/bison.texinfo: entered into RCS
16802
16803 * doc/bison.texinfo: *** empty log message ***
16804
168051993-11-21 Richard Stallman <rms@gnu.org>
16806
16807 * bison.simple: *** empty log message ***
16808
168091993-10-25 David J. MacKenzie <djm@gnu.org>
16810
16811 * doc/bison.texinfo: *** empty log message ***
16812
168131993-10-19 Richard Stallman <rms@gnu.org>
16814
16815 * src/bison.s1: *** empty log message ***
16816
168171993-10-19 Richard Stallman <rms@gnu.org>
16818
16819 * bison.simple: *** empty log message ***
16820
168211993-10-14 Richard Stallman <rms@gnu.org>
16822
16823 * src/bison.s1: *** empty log message ***
16824
168251993-10-14 Richard Stallman <rms@gnu.org>
16826
16827 * bison.simple: *** empty log message ***
16828
168291993-09-14 David J. MacKenzie <djm@gnu.org>
16830
16831 * doc/bison.texinfo: *** empty log message ***
16832
168331993-09-13 Noah Friedman <friedman@gnu.org>
16834
16835 * Makefile.in: *** empty log message ***
16836
168371993-09-10 Richard Stallman <rms@gnu.org>
16838
16839 * src/conflicts.c: *** empty log message ***
16840
16841 * src/system.h: entered into RCS
16842
168431993-09-10 Richard Stallman <rms@gnu.org>
16844
16845 * doc/bison.1: entered into RCS
16846
168471993-09-06 Noah Friedman <friedman@gnu.org>
16848
16849 * src/version.c: entered into RCS
16850
168511993-09-06 Noah Friedman <friedman@gnu.org>
16852
16853 * Makefile.in: *** empty log message ***
16854
168551993-07-30 David J. MacKenzie <djm@gnu.org>
16856
16857 * Makefile.in: *** empty log message ***
16858
168591993-07-24 Richard Stallman <rms@gnu.org>
16860
16861 * src/bison.s1: *** empty log message ***
16862
168631993-07-24 Richard Stallman <rms@gnu.org>
16864
16865 * bison.simple: *** empty log message ***
16866
168671993-07-08 David J. MacKenzie <djm@gnu.org>
16868
16869 * Makefile.in: *** empty log message ***
16870
168711993-07-04 Richard Stallman <rms@gnu.org>
16872
16873 * src/bison.s1: *** empty log message ***
16874
168751993-07-04 Richard Stallman <rms@gnu.org>
16876
16877 * bison.simple: *** empty log message ***
16878
168791993-06-26 David J. MacKenzie <djm@gnu.org>
16880
16881 * src/getargs.c: entered into RCS
16882
168831993-06-26 David J. MacKenzie <djm@gnu.org>
16884
16885 * doc/bison.texinfo: *** empty log message ***
16886
16887 * doc/bison.1: New file.
16888
168891993-06-25 Richard Stallman <rms@gnu.org>
16890
16891 * src/getargs.c: New file.
16892
168931993-06-16 Richard Stallman <rms@gnu.org>
16894
16895 * src/bison.s1: *** empty log message ***
16896
168971993-06-16 Richard Stallman <rms@gnu.org>
16898
16899 * bison.simple: *** empty log message ***
16900
169011993-06-03 Richard Stallman <rms@gnu.org>
16902
16903 * src/bison.s1: New file.
16904
169051993-06-03 Richard Stallman <rms@gnu.org>
16906
16907 * doc/bison.texinfo: *** empty log message ***
16908
169091993-06-03 Richard Stallman <rms@gnu.org>
16910
16911 * bison.simple: New file.
16912
169131993-05-19 Richard Stallman <rms@gnu.org>
16914
16915 * doc/bison.texinfo: New file.
16916
169171993-05-07 Noah Friedman <friedman@gnu.org>
16918
16919 * Makefile.in: *** empty log message ***
16920
169211993-04-28 Noah Friedman <friedman@gnu.org>
16922
16923 * src/reader.c: *** empty log message ***
16924
169251993-04-23 Noah Friedman <friedman@gnu.org>
16926
16927 * src/alloc.h: entered into RCS
16928
169291993-04-20 David J. MacKenzie <djm@gnu.org>
16930
16931 * src/version.c: *** empty log message ***
16932
16933 * src/files.c, src/allocate.c:
16934 entered into RCS
16935
16936 * src/reader.c: *** empty log message ***
16937
16938 * src/lex.c: entered into RCS
16939
16940 * src/conflicts.c: New file.
16941
16942 * src/symtab.c: entered into RCS
16943
16944 * src/alloc.h: New file.
16945
16946 * src/LR0.c: entered into RCS
16947
169481993-04-18 Noah Friedman <friedman@gnu.org>
16949
16950 * src/reader.c: New file.
16951
16952 * src/version.c: *** empty log message ***
16953
169541993-04-18 Noah Friedman <friedman@gnu.org>
16955
16956 * Makefile.in: *** empty log message ***
16957
169581993-04-17 Noah Friedman <friedman@gnu.org>
16959
16960 * Makefile.in: *** empty log message ***
16961
169621993-04-15 Richard Stallman <rms@gnu.org>
16963
16964 * src/main.c, src/files.c:
16965 New file.
16966
169671993-04-15 Noah Friedman <friedman@gnu.org>
16968
16969 * configure.in: entered into RCS
16970
16971 * configure.in: *** empty log message ***
16972
16973 * configure.in: New file.
16974
169751993-04-14 Richard Stallman <rms@gnu.org>
16976
16977 * Makefile.in: New file.
16978
169791993-04-13 Richard Stallman <rms@gnu.org>
16980
16981 * src/version.c: New file.
16982
169831993-03-25 Richard Stallman <rms@gnu.org>
16984
16985 * src/output.c: entered into RCS
16986
169871992-09-25 Richard Stallman <rms@gnu.org>
16988
16989 * configure.bat: entered into RCS
16990
169911992-06-22 Richard Stallman <rms@gnu.org>
16992
16993 * src/vmsgetargs.c: entered into RCS
16994
169951992-06-22 Richard Stallman <rms@gnu.org>
16996
16997 * doc/bison.rnh: entered into RCS
16998
169991992-04-20 David J. MacKenzie <djm@gnu.org>
17000
17001 * README: entered into RCS
17002
170031992-01-22 Richard Stallman <rms@gnu.org>
17004
17005 * src/machine.h: entered into RCS
17006
170071991-12-21 Richard Stallman <rms@gnu.org>
17008
17009 * src/lalr.c, src/closure.c:
17010 entered into RCS
17011
170121991-12-20 Richard Stallman <rms@gnu.org>
17013
17014 * src/state.h: entered into RCS
17015
170161991-12-18 Richard Stallman <rms@gnu.org>
17017
17018 * src/print.c, src/nullable.c, src/derives.c:
17019 entered into RCS
17020
170211991-11-03 David J. MacKenzie <djm@gnu.org>
17022
17023 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
17024 entered into RCS
17025
170261988-09-09 Richard Stallman <rms@gnu.org>
17027
17028 * src/bison.hairy: entered into RCS
17029
170301987-12-16 Richard Stallman <rms@gnu.org>
17031
17032 * REFERENCES: entered into RCS
17033
17034
17035 -----
17036
17037 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
17038 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
17039 Software Foundation, Inc.
17040
17041 Copying and distribution of this file, with or without
17042 modification, are permitted provided the copyright notice and this
17043 notice are preserved.
17044
17045$Id$