]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* data/glr.c: Correct typo in Emacs-mode directive. Slightly
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2
3 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
4 reorganize first lines parallel to yacc.c.
5
62002-06-28 Akim Demaille <akim@epita.fr>
7
8 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
9 (b4_token_enum, b4_token_defines): New, factored from...
10 * data/lalr1.cc, data/yacc.c, glr.c: here.
11
122002-06-28 Akim Demaille <akim@epita.fr>
13
14 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
15 unused variables.
16 * src/output.c (merger_output): static.
17
182002-06-28 Akim Demaille <akim@epita.fr>
19
20 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
21 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
22 pacify GCC.
23 * src/output.c (save_row): Initialize all the variables to pacify GCC.
24
252002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
26
27 Accumulated changelog for new GLR parsing features.
28
29 * src/conflicts.c (count_total_conflicts): Change name to
30 conflicts_total_count.
31 * src/conflicts.h: Ditto.
32 * src/output.c (token_actions): Use the new name.
33 (output_conflicts): Change conflp => conflict_list_heads, and
34 confl => conflict_list for better readability.
35 * data/glr.c: Use the new names.
36 * NEWS: Add self to GLR announcement.
37
38 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
39
40 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
41 Akim Demaille.
42
43 * data/bison.glr: Change name to glr.c
44 * data/glr.c: Renamed from bison.glr.
45 * data/Makefile.am: Add glr.c
46
47 * src/getargs.c:
48
49 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
50 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
51
52 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
53
54 * data/bison.glr: Be sure to restore the
55 current #line when returning to the skeleton contents after having
56 exposed the input file's #line.
57
58 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
59
60 * data/bison.glr: Bring up to date with changes to bison.simple.
61
62 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
63
64 * data/bison.glr: Correct definitions that use b4_prefix.
65 Various reformatting.
66 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
67 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
68 yytokenp argument; now part of stack.
69 (yychar): Define to behave as documented.
70 (yyclearin): Ditto.
71
72 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
73
74 * src/reader.h: Add declaration for free_merger_functions.
75
76 * src/reader.c (merge_functions): New variable.
77 (get_merge_function): New function.
78 (free_merger_functions): New function.
79 (readgram): Check for %prec that is not followed by a symbol.
80 Handle %dprec and %merge declarations.
81 (packgram): Initialize dprec and merger fields in rules array.
82
83 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
84 conflict_list_cnt, conflict_list_free): New variables.
85 (table_grow): Also grow conflict_table.
86 (prepare_rules): Output dprec and merger tables.
87 (conflict_row): New function.
88 (action_row): Output conflict lists for GLR parser. Don't use
89 default reduction in conflicted states for GLR parser so that there
90 are spaces for the conflict lists.
91 (save_row): Also save conflict information.
92 (token_actions): Allocate conflict list.
93 (merger_output): New function.
94 (pack_vector): Pack conflict table, too.
95 (output_conflicts): New function to output yyconflp and yyconfl.
96 (output_check): Allocate conflict_tos.
97 (output_actions): Output conflict tables, also.
98 (output_skeleton): Output b4_mergers definition.
99 (prepare): Output b4_max_rhs_length definition.
100 Use 'bison.glr' as default skeleton for GLR parsers.
101
102 * src/gram.c (glr_parser): New flag.
103 (grammar_free): Call free_merger_functions.
104
105 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
106 all pairs of conflicting reductions, rather than just all tokens
107 causing conflicts. Needed to size conflict tables.
108 (conflicts_output): Modify call to count_rr_conflicts for new
109 interface.
110 (conflicts_print): Ditto.
111 (count_total_conflicts): New function.
112
113 * src/reader.h (merger_list): New type.
114 (merge_functions): New variable.
115
116 * src/lex.h (tok_dprec, tok_merge): New token types.
117
118 * src/gram.h (rule_s): Add dprec and merger fields.
119 (glr_parser): New flag.
120
121 * src/conflicts.h (count_total_conflicts): New function.
122
123 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
124
125 * doc/bison.texinfo (Generalized LR Parsing): New section.
126 (GLR Parsers): New section.
127 (Language and Grammar): Mention GLR parsing.
128 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
129 Correct typo ("tge" -> "the").
130
131 * data/bison.glr: New skeleton for GLR parsing.
132
133 * tests/cxx-gram.at: New tests for GLR parsing.
134
135 * tests/testsuite.at: Include cxx-gram.at.
136
137 * tests/Makefile.am: Add cxx-gram.at.
138
139 * src/parse-gram.y:
140
141 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
142
143 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
144
1452002-06-27 Akim Demaille <akim@epita.fr>
146
147 * src/options.h, src/options.c: Remove.
148 * src/getargs.c (short_options, long_options): New.
149
1502002-06-27 Akim Demaille <akim@epita.fr>
151
152 * data/bison.simple, data/bison.c++: Rename as...
153 * data/yacc.c, data/lalr1.cc: these.
154 * doc/bison.texinfo (Environment Variables): Remove.
155
1562002-06-25 Raja R Harinath <harinath@cs.umn.edu>
157
158 * src/getargs.c (report_argmatch): Initialize strtok().
159
1602002-06-20 Akim Demaille <akim@epita.fr>
161
162 * data/bison.simple (b4_symbol_actions): New, replaces...
163 (b4_symbol_destructor, b4_symbol_printer): these.
164 (yysymprint): Be sure to call YYPRINT only for tokens, and using
165 user token numbers.
166
1672002-06-20 Akim Demaille <akim@epita.fr>
168
169 * data/bison.simple (yydestructor): Rename as...
170 (yydestruct): this.
171
1722002-06-20 Akim Demaille <akim@epita.fr>
173
174 * src/symtab.h, src/symtab.c (symbol_type_set)
175 (symbol_destructor_set, symbol_precedence_set): The location is
176 the last argument.
177 Adjust all callers.
178
1792002-06-20 Akim Demaille <akim@epita.fr>
180
181 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
182 internals.
183 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
184 Takes a location.
185 * src/symtab.h, src/symtab.c (symbol_class_set)
186 (symbol_user_token_number_set): Likewise.
187 Adjust all callers.
188 Promote complain_at.
189 * tests/input.at (Type Clashes): Adjust.
190
1912002-06-20 Akim Demaille <akim@epita.fr>
192
193 * data/bison.simple (YYLEX): Fix the declaration when
194 %pure-parser.
195
1962002-06-20 Akim Demaille <akim@epita.fr>
197
198 * data/bison.simple (yysymprint): Don't print the token number,
199 just its name.
200 * tests/actions.at (Destructors): Rename as...
201 (Printers and Destructors): this.
202 Also exercise %printer.
203
2042002-06-20 Akim Demaille <akim@epita.fr>
205
206 * data/bison.simple (YYDSYMPRINT): New.
207 Use it to remove many of the #if YYDEBUG/if (yydebug).
208
2092002-06-20 Akim Demaille <akim@epita.fr>
210
211 * src/symtab.h, src/symtab.c (symbol_t): printer and
212 printer_location are new members.
213 (symbol_printer_set): New.
214 * src/parse-gram.y (PERCENT_PRINTER): New token.
215 Handle its associated rule.
216 * src/scan-gram.l: Adjust.
217 (handle_destructor_at, handle_destructor_dollar): Rename as...
218 (handle_symbol_code_at, handle_symbol_code_dollar): these.
219 * src/output.c (symbol_printers_output): New.
220 (output_skeleton): Call it.
221 * data/bison.simple (yysymprint): New. Cannot be named yyprint
222 since there are already many grammar files with a user `yyprint'.
223 Replace the calls to YYPRINT to calls to yysymprint.
224 * tests/calc.at: Adjust.
225 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
226 taking advantage of parser very internal details (stack size!).
227
2282002-06-20 Akim Demaille <akim@epita.fr>
229
230 * src/scan-gram.l: Complete the scanner with the missing patterns
231 to pacify Flex.
232 Use `quote' and `symbol_tag_get' where appropriate.
233
2342002-06-19 Akim Demaille <akim@epita.fr>
235
236 * tests/actions.at (Destructors): Augment to test locations.
237 * data/bison.simple (yydestructor): Pass it the current location
238 if locations are enabled.
239 Prototype only when __STDC__ or C++.
240 Change the argument names to move into the yy name space: there is
241 user code here.
242
2432002-06-19 Akim Demaille <akim@epita.fr>
244
245 * data/bison.simple (b4_pure_if): New.
246 Use it instead of #ifdef YYPURE.
247
2482002-06-19 Akim Demaille <akim@epita.fr>
249
250 * data/bison.simple (b4_location_if): New.
251 Use it instead of #ifdef YYLSP_NEEDED.
252
2532002-06-19 Akim Demaille <akim@epita.fr>
254
255 Prepare @$ in %destructor, but currently don't bind it in the
256 skeleton, as %location use is not cleaned up yet.
257
258 * src/scan-gram.l (handle_dollar, handle_destructor_at)
259 (handle_action_at): New.
260 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
261 a braced_code_t and a location as additional arguments.
262 (handle_destructor_dollar): Instead of requiring `b4_eval', just
263 unquote one when outputting `b4_dollar_dollar'.
264 Adjust callers.
265 * data/bison.simple (b4_eval): Remove.
266 (b4_symbol_destructor): Adjust.
267 * tests/input.at (Invalid @n): Adjust.
268
2692002-06-19 Zack Weinberg <zack@codesourcery.com>
270
271 * doc/bison.texinfo: Document ability to have multiple
272 prologue sections.
273
2742002-06-18 Akim Demaille <akim@epita.fr>
275
276 * src/files.c (compute_base_names): When computing the output file
277 names from the input file name, strip the directory part.
278
2792002-06-18 Akim Demaille <akim@epita.fr>
280
281 * data/bison.simple.new: Comment changes.
282 Reported by Andreas Schwab.
283
2842002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
285
286 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
287 there are no `label `yyoverflowlab' defined but not used' warnings
288 when yyoverflow is defined.
289
2902002-06-18 Akim Demaille <akim@epita.fr>
291
292 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
293 new member.
294 (symbol_destructor_set): Adjust.
295 * src/output.c (symbol_destructors_output): Output the destructor
296 locations.
297 Output the symbol name.
298 * data/bison.simple (b4_symbol_destructor): Adjust.
299
3002002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
301 and Akim Demaille <akim@epita.fr>
302
303 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
304 what's left on the stack when the error recovery hits EOF.
305 * tests/actions.at (Destructors): Complete to exercise this case.
306
3072002-06-17 Akim Demaille <akim@epita.fr>
308
309 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
310 arguments is really empty, not only equal to `[]'.
311 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
312 member.
313 (symbol_destructor_set): New.
314 * src/output.c (symbol_destructors_output): New.
315 * src/reader.h (brace_code_t, current_braced_code): New.
316 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
317 (handle_dollar): Rename as...
318 (handle_action_dollar): this.
319 (handle_destructor_dollar): New.
320 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
321 (grammar_declaration): Use it.
322 * data/bison.simple (yystos): Is always defined.
323 (yydestructor): New.
324 * tests/actions.at (Destructors): New.
325 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
326
3272002-06-17 Akim Demaille <akim@epita.fr>
328
329 * src/symlist.h, src/symlist.c (symbol_list_length): New.
330 * src/scan-gram.l (handle_dollar, handle_at): Compute the
331 rule_length only when needed.
332 * src/output.c (actions_output, token_definitions_output): Output
333 the full M4 block.
334 * src/symtab.c: Don't access directly to the symbol tag, use
335 symbol_tag_get.
336 * src/parse-gram.y: Use symbol_list_free.
337
3382002-06-17 Akim Demaille <akim@epita.fr>
339
340 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
341 (symbol_list_prepend, get_type_name): Move to...
342 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
343 (symbol_list_prepend, symbol_list_n_type_name_get): here.
344 Adjust all callers.
345 (symbol_list_free): New.
346 * src/scan-gram.l (handle_dollar): Takes a location.
347 * tests/input.at (Invalid $n): Adjust.
348
3492002-06-17 Akim Demaille <akim@epita.fr>
350
351 * src/reader.h, src/reader.c (symbol_list_new): Export it.
352 (symbol_list_prepend): New.
353 * src/parse-gram.y (%union): `list' is a new member.
354 (symbols.1): New, replaces...
355 (terms_to_prec.1, nterms_to_type.1): these.
356 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
357 Take a location as additional argument.
358 Adjust all callers.
359
3602002-06-15 Akim Demaille <akim@epita.fr>
361
362 * src/parse-gram.y: Move %token in the declaration section so that
363 we don't depend upon CVS Bison.
364
3652002-06-15 Akim Demaille <akim@epita.fr>
366
367 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
368 * src/print.c (print_core): Use it.
369
3702002-06-15 Akim Demaille <akim@epita.fr>
371
372 * src/conflicts.c (log_resolution): Accept the rule involved in
373 the sr conflicts instead of the lookahead number that points to
374 that rule.
375 (flush_reduce): Accept the current lookahead vector as argument,
376 instead of the index in LA.
377 (resolve_sr_conflict): Accept the current number of lookahead
378 bitset to consider for the STATE, instead of the index in LA.
379 (set_conflicts): Adjust.
380 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
381
3822002-06-15 Akim Demaille <akim@epita.fr>
383
384 * src/state.h (state_t): Replace the `lookaheadsp' member, a
385 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
386 Adjust all dependencies.
387 * src/lalr.c (initialize_lookaheads): Split into...
388 (states_lookaheads_count, states_lookaheads_initialize): these.
389 (lalr): Adjust.
390
3912002-06-15 Akim Demaille <akim@epita.fr>
392
393 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
394 out of...
395 (grammar_rules_print): here.
396 * src/reduce.c (reduce_output): Use it.
397 * tests/reduce.at (Useless Rules, Reduced Automaton)
398 (Underivable Rules): Adjust.
399
4002002-06-15 Akim Demaille <akim@epita.fr>
401
402 Copy BYacc's nice way to report the grammar.
403
404 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
405 New.
406 Don't print the rules' location, it is confusing and useless.
407 (rule_print): Use grammar_rhs_print.
408 * src/print.c (print_grammar): Use grammar_rules_print.
409
4102002-06-15 Akim Demaille <akim@epita.fr>
411
412 Complete and rationalize `useless thing' warnings.
413
414 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
415 (symbol_tag_print): New.
416 Use them everywhere in place of accessing directly the tag member.
417 * src/gram.h, src/gram.c (rule_print): New.
418 Use it where a rule used to be printed `by hand'.
419 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
420 (reduce_grammar_tables): Report the useless rules.
421 (reduce_print): Useless things are a warning, not an error.
422 Report it as such.
423 * tests/reduce.at (Useless Nonterminals, Useless Rules):
424 (Reduced Automaton, Underivable Rules): Adjust.
425 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
426 * tests/conflicts.at (Unresolved SR Conflicts)
427 (Solved SR Conflicts): Adjust.
428
4292002-06-15 Akim Demaille <akim@epita.fr>
430
431 Let symbols have a location.
432
433 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
434 (getsym): Adjust.
435 Adjust all callers.
436 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
437 Use location_t, not int.
438 * src/symtab.c (symbol_check_defined): Take advantage of the
439 location.
440 * tests/regression.at (Invalid inputs): Adjust.
441
4422002-06-15 Akim Demaille <akim@epita.fr>
443
444 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
445 (input): Don't try to initialize yylloc here, do it in the
446 scanner.
447 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
448 * src/gram.h (rule_t): Change line and action_line into location
449 and action_location, of location_t type.
450 Adjust all dependencies.
451 * src/location.h, src/location.c (empty_location): New.
452 * src/reader.h, src/reader.c (grammar_start_symbol_set)
453 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
454 (grammar_current_rule_symbol_append)
455 (grammar_current_rule_action_append): Expect a location as argument.
456 * src/reader.c (grammar_midrule_action): Adjust to attach an
457 action's location as dummy symbol location.
458 * src/symtab.h, src/symtab.c (startsymbol_location): New.
459 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
460 the line numbers.
461
4622002-06-14 Akim Demaille <akim@epita.fr>
463
464 Grammar declarations may be found in the grammar section.
465
466 * src/parse-gram.y (rules_or_grammar_declaration): New.
467 (declarations): Each declaration may end with a semicolon, not
468 just...
469 (grammar_declaration): `"%union"'.
470 (grammar): Branch to rules_or_grammar_declaration.
471
4722002-06-14 Akim Demaille <akim@epita.fr>
473
474 * src/main.c (main): Invoke scanner_free.
475
4762002-06-14 Akim Demaille <akim@epita.fr>
477
478 * src/output.c (m4_invoke): Extracted from...
479 (output_skeleton): here.
480 Free tempfile.
481
4822002-06-14 Akim Demaille <akim@epita.fr>
483
484 * src/parse-gram.y (directives, directive, gram)
485 (grammar_directives, precedence_directives, precedence_directive):
486 Rename as...
487 (declarations, declaration, grammar, grammar_declaration)
488 (precedence_declaration, precedence_declarator): these.
489 (symbol_declaration): New.
490
4912002-06-14 Akim Demaille <akim@epita.fr>
492
493 * src/files.c (action_obstack): Remove, unused.
494 (output_obstack): Remove it, and all its dependencies, as it is no
495 longer needed.
496 * src/reader.c (epilogue_set): Build the epilogue in the
497 muscle_obstack.
498 * src/output.h, src/output.c (muscle_obstack): Move to...
499 * src/muscle_tab.h, src/muscle_tab.h: here.
500 (muscle_init): Initialize muscle_obstack.
501 (muscle_free): New.
502 * src/main.c (main): Call it.
503
5042002-06-14 Akim Demaille <akim@epita.fr>
505
506 * src/location.h: New, extracted from...
507 * src/reader.h: here.
508 * src/Makefile.am (noinst_HEADERS): Merge into
509 (bison_SOURCES): this.
510 Add location.h.
511 * src/parse-gram.y: Use location_t instead of Bison's.
512 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
513 Use location_t instead of ints.
514
5152002-06-14 Akim Demaille <akim@epita.fr>
516
517 * data/bison.simple, data/bison.c++: Be sure to restore the
518 current #line when returning to the skeleton contents after having
519 exposed the input file's #line.
520
5212002-06-12 Akim Demaille <akim@epita.fr>
522
523 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
524 eager.
525 * tests/actions.at (Exotic Dollars): New.
526
5272002-06-12 Akim Demaille <akim@epita.fr>
528
529 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
530 ['"/] too eagerly.
531 * tests/input.at (Torturing the Scanner): New.
532
5332002-06-11 Akim Demaille <akim@epita.fr>
534
535 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
536 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
537 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
538 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
539 * src/reader.c (reader): Use it.
540
5412002-06-11 Akim Demaille <akim@epita.fr>
542
543 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
544 Adjust all callers.
545 (scanner_last_string_free): New.
546
5472002-06-11 Akim Demaille <akim@epita.fr>
548
549 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
550 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
551 (last_string, YY_OBS_FREE): New.
552 Use them when returning an ID.
553
5542002-06-11 Akim Demaille <akim@epita.fr>
555
556 Have Bison grammars parsed by a Bison grammar.
557
558 * src/reader.c, src/reader.h (prologue_augment): New.
559 * src/reader.c (copy_definition): Remove.
560
561 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
562 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
563 (grammar_current_rule_prec_set, grammar_current_rule_check)
564 (grammar_current_rule_symbol_append)
565 (grammar_current_rule_action_append): Export.
566 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
567 (symbol_list_action_append): Remove.
568 Hook the routines from reader.
569 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
570 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
571
572 * src/reader.c (read_declarations): Remove, unused.
573
574 * src/parse-gram.y: Handle the epilogue.
575 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
576 (grammar_start_symbol_set): this.
577 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
578 * src/reader.c (readgram): Remove, unused.
579 (reader): Adjust to insert eoftoken and axiom where appropriate.
580
581 * src/reader.c (copy_dollar): Replace with...
582 * src/scan-gram.h (handle_dollar): this.
583 * src/parse-gram.y: Remove `%thong'.
584
585 * src/reader.c (copy_at): Replace with...
586 * src/scan-gram.h (handle_at): this.
587
588 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
589 New.
590
591 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
592 time being.
593
594 * src/reader.h, src/reader.c (grammar_rule_end): New.
595
596 * src/parse.y (current_type, current_class): New.
597 Implement `%nterm', `%token' support.
598 Merge `%term' into `%token'.
599 (string_as_id): New.
600 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
601 type name.
602
603 * src/parse-gram.y: Be sure to handle properly the beginning of
604 rules.
605
606 * src/parse-gram.y: Handle %type.
607 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
608
609 * src/parse-gram.y: More directives support.
610 * src/options.c: No longer handle source directives.
611
612 * src/parse-gram.y: Fix %output.
613
614 * src/parse-gram.y: Handle %union.
615 Use the prologue locations.
616 * src/reader.c (parse_union_decl): Remove.
617
618 * src/reader.h, src/reader.c (epilogue_set): New.
619 * src/parse-gram.y: Use it.
620
621 * data/bison.simple, data/bison.c++: b4_stype is now either not
622 defined, then default to int, or to the contents of %union,
623 without `union' itself.
624 Adjust.
625 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
626
627 * src/output.c (actions_output): Don't output braces, as they are
628 already handled by the scanner.
629
630 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
631 characters to themselves.
632
633 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
634 that the epilogue has a proper #line.
635
636 * src/parse-gram.y: Handle precedence/associativity.
637
638 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
639 a terminal.
640 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
641 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
642 at all to define terminals that cannot be emitted.
643
644 * src/scan-gram.l: Escape M4 characters.
645
646 * src/scan-gram.l: Working properly with escapes in user
647 strings/characters.
648
649 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
650 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
651 grammar.
652 Use more modest sizes, as for the time being the parser does not
653 release memory, and therefore the process swallows a huge amount
654 of memory.
655
656 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
657 stricter %token grammar.
658
659 * src/symtab.h (associativity): Add `undef_assoc'.
660 (symbol_precedence_set): Do nothing when passed an undef_assoc.
661 * src/symtab.c (symbol_check_alias_consistence): Adjust.
662
663 * tests/regression.at (Invalid %directive): Remove, as it is now
664 meaningless.
665 (Invalid inputs): Adjust to the new error messages.
666 (Token definitions): The new grammar doesn't allow too many
667 eccentricities.
668
669 * src/lex.h, src/lex.c: Remove.
670 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
671 (copy_character, copy_string2, copy_string, copy_identifier)
672 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
673 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
674 (parse_action): Remove.
675 * po/POTFILES.in: Adjust.
676
6772002-06-11 Akim Demaille <akim@epita.fr>
678
679 * src/reader.c (parse_action): Don't store directly into the
680 rule's action member: return the action as a string.
681 Don't require `rule_length' as an argument: compute it.
682 (grammar_current_rule_symbol_append)
683 (grammar_current_rule_action_append): New, eved out from
684 (readgram): here.
685 Remove `action_flag', `rulelength', unused now.
686
6872002-06-11 Akim Demaille <akim@epita.fr>
688
689 * src/reader.c (grammar_current_rule_prec_set).
690 (grammar_current_rule_check): New, eved out from...
691 (readgram): here.
692 Remove `xaction', `first_rhs': useless.
693 * tests/input.at (Type clashes): New.
694 * tests/existing.at (GNU Cim Grammar): Adjust.
695
6962002-06-11 Akim Demaille <akim@epita.fr>
697
698 * src/reader.c (grammar_midrule_action): New, Eved out from
699 (readgram): here.
700
7012002-06-11 Akim Demaille <akim@epita.fr>
702
703 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
704 New.
705 (readgram): Use them as replacement of inlined code, crule and
706 crule1.
707
7082002-06-11 Akim Demaille <akim@epita.fr>
709
710 * src/reader.c (grammar_end, grammar_symbol_append): New.
711 (readgram): Use them.
712 Make the use of `p' as local as possible.
713
7142002-06-10 Akim Demaille <akim@epita.fr>
715
716 GCJ's parser requires the tokens to be defined before the prologue.
717
718 * data/bison.simple: Output the token definition before the user's
719 prologue.
720 * tests/regression.at (Braces parsing, Duplicate string)
721 (Mixing %token styles): Check the output from bison.
722 (Early token definitions): New.
723
7242002-06-10 Akim Demaille <akim@epita.fr>
725
726 * src/symtab.c (symbol_user_token_number_set): Don't complain when
727 assigning twice the same user number to a token, so that we can
728 use it in...
729 * src/lex.c (lex): here.
730 Also use `symbol_class_set' instead of hand written code.
731 * src/reader.c (parse_assoc_decl): Likewise.
732
7332002-06-10 Akim Demaille <akim@epita.fr>
734
735 * src/symtab.c, src/symtab.c (symbol_class_set)
736 (symbol_user_token_number_set): New.
737 * src/reader.c (parse_token_decl): Use them.
738 Use a switch instead of ifs.
739 Use a single argument.
740
7412002-06-10 Akim Demaille <akim@epita.fr>
742
743 Remove `%thong' support as it is undocumented, unused, duplicates
744 `%token's job, and creates useless e-mail traffic with people who
745 want to know what it is, why it is undocumented, unused, and
746 duplicates `%token's job.
747
748 * src/reader.c (parse_thong_decl): Remove.
749 * src/options.c (option_table): Remove "thong".
750 * src/lex.h (tok_thong): Remove.
751
7522002-06-10 Akim Demaille <akim@epita.fr>
753
754 * src/symtab.c, src/symtab.c (symbol_type_set)
755 (symbol_precedence_set): New.
756 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
757 (value_components_used): Remove, unused.
758
7592002-06-09 Akim Demaille <akim@epita.fr>
760
761 Move symbols handling code out of the reader.
762
763 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
764 (axiom): Move to...
765 * src/symtab.h, src/symtab.c: here.
766
767 * src/gram.c (start_symbol): Remove: use startsymbol->number.
768 * src/reader.c (startval): Rename as...
769 * src/symtab.h, src/symtab.c (startsymbol): this.
770 * src/reader.c: Adjust.
771
772 * src/reader.c (symbol_check_defined, symbol_make_alias)
773 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
774 (token_translations_init)
775 Move to...
776 * src/symtab.c: here.
777 * src/reader.c (packsymbols): Move to...
778 * src/symtab.h, src/symtab.c (symbols_pack): here.
779 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
780 argument.
781
7822002-06-03 Akim Demaille <akim@epita.fr>
783
784 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
785 then statements.
786
7872002-06-03 Akim Demaille <akim@epita.fr>
788
789 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
790 structs with non literals.
791 * src/scan-skel.l: never-interactive.
792 * src/conflicts.c (enum conflict_resolution_e): No trailing
793 comma.
794 * src/getargs.c (usage): Split long literal strings.
795 Reported by Hans Aberg.
796
7972002-05-28 Akim Demaille <akim@epita.fr>
798
799 * data/bison.c++: Use C++ ostreams.
800 (cdebug_): New member.
801
8022002-05-28 Akim Demaille <akim@epita.fr>
803
804 * src/output.c (output_skeleton): Be sure to allocate enough room
805 for `/' _and_ for `\0' in full_skeleton.
806
8072002-05-28 Akim Demaille <akim@epita.fr>
808
809 * data/bison.c++: Catch up with bison.simple:
810 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
811 and Paul Eggert <eggert@twinsun.com>: `error' handing.
812 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
813 and popping traces.
814
8152002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
816
817 * src/output.c (output_skeleton): Put an explicit path in front of
818 the skeleton file name, rather than relying on the -I directory,
819 to partially alleviate effects of having a skeleton file lying around
820 in the current directory.
821
8222002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
823
824 * src/conflicts.c (log_resolution): Correct typo:
825 obstack_printf should be obstack_fgrow1.
826
8272002-05-26 Akim Demaille <akim@epita.fr>
828
829 * src/state.h (state_t): `solved_conflicts' is a new member.
830 * src/LR0.c (new_state): Set it to 0.
831 * src/conflicts.h, src/conflicts.c (print_conflicts)
832 (free_conflicts, solve_conflicts): Rename as...
833 (conflicts_print, conflicts_free, conflicts_solve): these.
834 Adjust callers.
835 * src/conflicts.c (enum conflict_resolution_e)
836 (solved_conflicts_obstack): New, used by...
837 (log_resolution): this.
838 Adjust to attach the conflict resolution to each state.
839 Complete the description with the precedence/associativity
840 information.
841 (resolve_sr_conflict): Adjust.
842 * src/print.c (print_state): Output its solved_conflicts.
843 * tests/conflicts.at (Unresolved SR Conflicts)
844 (Solved SR Conflicts): Exercise --report=all.
845
8462002-05-26 Akim Demaille <akim@epita.fr>
847
848 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
849 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
850 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
851 (token_number_t, item_number_as_token_number)
852 (token_number_as_item_number, muscle_insert_token_number_table):
853 Rename as...
854 (symbol_number_t, item_number_as_symbol_number)
855 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
856 these, since it is more appropriate.
857
8582002-05-26 Akim Demaille <akim@epita.fr>
859
860 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
861 `Error:' lines.
862 * data/bison.simple (yystos) [YYDEBUG]: New.
863 (yyparse) [YYDEBUG]: Display the symbols which are popped during
864 error recovery.
865 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
866
8672002-05-25 Akim Demaille <akim@epita.fr>
868
869 * doc/bison.texinfo (Debugging): Split into...
870 (Tracing): this new section, its former contents, and...
871 (Understanding): this new section.
872 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
873 by...
874 (report_flag): this.
875 Adjust all dependencies.
876 (report_args, report_types, report_argmatch): New.
877 (usage, getargs): Report/support -r, --report.
878 * src/options.h
879 (struct option_table_struct): Rename as..,
880 (struct option_table_s): this.
881 Rename the `set_flag' member to `flag' to match with getopt_long's
882 struct.
883 * src/options.c (option_table): Split verbose into an entry for
884 %verbose, and another for --verbose.
885 Support --report/-r, so remove -r from the obsolete --raw.
886 * src/print.c: Attach full item sets and lookaheads reports to
887 report_flag instead of trace_flag.
888 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
889
8902002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
891 and Paul Eggert <eggert@twinsun.com>
892
893 * data/bison.simple (yyparse): Correct error handling to conform to
894 POSIX and yacc. Specifically, after syntax error is discovered,
895 do not reduce further before shifting the error token.
896 Clean up the code a bit by removing the labels yyerrdefault,
897 yyerrhandle, yyerrpop.
898 * NEWS: Document the above.
899
9002002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
901
902 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
903 type; it isn't always big enough, since it doesn't necessarily
904 include non-terminals.
905 (yytranslate): Expand definition of yy_token_number_type, so that
906 the latter can be removed.
907 (yy_token_number_type): Remove, only one use.
908 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
909 don't use TokenNumberType as element type.
910
911 * tests/regression.at: Modify expected output to agree with change
912 to yyr1 and yytranslate.
913
9142002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
915
916 * src/reader.c (parse_action): Use copy_character instead of
917 obstack_1grow.
918
9192002-05-13 Akim Demaille <akim@epita.fr>
920
921 * tests/regression.at (Token definitions): Prototype yylex and
922 yyerror.
923
9242002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
925
926 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
927 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
928 32-bit arithmetic.
929 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
930
9312002-05-07 Akim Demaille <akim@epita.fr>
932
933 * tests/synclines.at: Be sure to prototype yylex and yyerror to
934 avoid GCC warnings.
935
9362002-05-07 Akim Demaille <akim@epita.fr>
937
938 Kill GCC warnings.
939
940 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
941 over the RHS of each rule.
942 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
943 * src/state.h (state_t): Member `nitems' is unsigned short.
944 * src/LR0.c (get_state): Adjust.
945 * src/reader.c (packgram): Likewise.
946 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
947 `Type'.
948 (muscle_insert_int_table): Remove, unused.
949 (prepare_rules): Remove `max'.
950
9512002-05-06 Akim Demaille <akim@epita.fr>
952
953 * src/closure.c (print_firsts): Display of the symbol tags.
954 (bitmatrix_print): Move to...
955 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
956 here.
957 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
958
9592002-05-06 Akim Demaille <akim@epita.fr>
960
961 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
962 hash_do_for_each.
963
9642002-05-06 Akim Demaille <akim@epita.fr>
965
966 * src/LR0.c (new_state, get_state): Instead of using the global
967 `kernel_size' and `kernel_base', have two new arguments:
968 `core_size' and `core'.
969 Adjust callers.
970
9712002-05-06 Akim Demaille <akim@epita.fr>
972
973 * src/reader.c (packgram): No longer end `ritem' with a 0
974 sentinel: it is not used.
975
9762002-05-05 Akim Demaille <akim@epita.fr>
977
978 New experimental feature: display the lookaheads in the report and
979 graph.
980
981 * src/print (print_core): When --trace-flag, display the rules
982 lookaheads.
983 * src/print_graph.c (print_core): Likewise.
984 Swap the arguments.
985 Adjust caller.
986
9872002-05-05 Akim Demaille <akim@epita.fr>
988
989 * tests/torture.at (Many lookaheads): New test.
990
9912002-05-05 Akim Demaille <akim@epita.fr>
992
993 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
994 (GENERATE_MUSCLE_INSERT_TABLE): this.
995 (output_int_table, output_unsigned_int_table, output_short_table)
996 (output_token_number_table, output_item_number_table): Replace with...
997 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
998 (muscle_insert_short_table, muscle_insert_token_number_table)
999 (muscle_insert_item_number_table): these.
1000 Adjust all callers.
1001 (prepare_tokens): Don't free `translations', since...
1002 * src/reader.h, src/reader.c (grammar_free): do it.
1003 Move to...
1004 * src/gram.h, src/gram.c (grammar_free): here.
1005 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1006 b4_translate_max.
1007
10082002-05-05 Akim Demaille <akim@epita.fr>
1009
1010 * src/output.c (output_unsigned_int_table): New.
1011 (prepare_rules): `i' is unsigned.
1012 `prhs', `rline', `r2' are unsigned int.
1013 Rename muscle `rhs_number_max' as `rhs_max'.
1014 Output muscles `prhs_max', `rline_max', and `r2_max'.
1015 Free rline and r1.
1016 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1017 to compute types instead of constant types.
1018 * tests/regression.at (Web2c Actions): Adjust.
1019
10202002-05-04 Akim Demaille <akim@epita.fr>
1021
1022 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1023 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1024 Adjust dependencies.
1025 * src/output.c (token_definitions_output): Be sure not to output a
1026 `#define 'a'' when fed with `%token 'a' "a"'.
1027 * tests/regression.at (Token definitions): New.
1028
10292002-05-03 Paul Eggert <eggert@twinsun.com>
1030
1031 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1032 for K&R C.
1033
10342002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1035
1036 * Makefile.am (SUBDIRS): Remove intl.
1037 (EXTRA_DIST): Add config/config.rpath.
1038
10392002-05-03 Akim Demaille <akim@epita.fr>
1040
1041 * data/bison.simple (m4_if): Don't output empty enums.
1042 And actually, output valid enum definitions :(.
1043
10442002-05-03 Akim Demaille <akim@epita.fr>
1045
1046 * configure.bat: Remove, completely obsolete.
1047 * Makefile.am (EXTRA_DIST): Adjust.
1048 Don't distribute config.rpath...
1049 * config/Makefile.am (EXTRA_DIST): Do it.
1050
10512002-05-03 Akim Demaille <akim@epita.fr>
1052
1053 * configure.in (GETTEXT_VERSION): New.
1054 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1055
10562002-05-03 Akim Demaille <akim@epita.fr>
1057
1058 * data/bison.simple (b4_token_enum): New.
1059 (b4_token_defines): Use it to output tokens both as #define and
1060 enums.
1061 Suggested by Paul Eggert.
1062 * src/output.c (token_definitions_output): Don't output spurious
1063 white spaces.
1064
10652002-05-03 Akim Demaille <akim@epita.fr>
1066
1067 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1068
10692002-05-02 Robert Anisko <robert@lrde.epita.fr>
1070
1071 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1072 Update the stack class, give a try to deque as the default container.
1073
10742002-05-02 Akim Demaille <akim@epita.fr>
1075
1076 * data/bison.simple (yyparse): Do not implement @$ = @1.
1077 (YYLLOC_DEFAULT): Adjust to do it.
1078 * doc/bison.texinfo (Location Default Action): Fix.
1079
10802002-05-02 Akim Demaille <akim@epita.fr>
1081
1082 * src/reader.c (parse_braces): Merge into...
1083 (parse_action): this.
1084
10852002-05-02 Akim Demaille <akim@epita.fr>
1086
1087 * configure.in (ALL_LINGUAS): Remove.
1088 * po/LINGUAS, hr.po: New.
1089
10902002-05-02 Akim Demaille <akim@epita.fr>
1091
1092 Remove the so called hairy (semantic) parsers.
1093
1094 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1095 * src/gram.h, src/gram.c (semantic_parser): Remove.
1096 (rule_t): Remove the guard and guard_line members.
1097 * src/lex.h (token_t): remove tok_guard.
1098 * src/options.c (option_table): Remove %guard and %semantic_parser
1099 support.
1100 * src/output.c, src/output.h (guards_output): Remove.
1101 (prepare): Adjust.
1102 (token_definitions_output): Don't output the `T'
1103 tokens (???).
1104 (output_skeleton): Don't output the guards.
1105 * src/files.c, src/files.c (attrsfile): Remove.
1106 * src/reader.c (symbol_list): Remove the guard and guard_line
1107 members.
1108 Adjust dependencies.
1109 (parse_guard): Remove.
1110 * data/bison.hairy: Remove.
1111 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1112 BISON_HAIRY.
1113
11142002-05-02 Akim Demaille <akim@epita.fr>
1115
1116 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1117 (parse_guard): Rename the formal argument `stack_offset' as
1118 `rule_length', which is more readable.
1119 Adjust callers.
1120 (copy_at, copy_dollar): Instead of outputting the hard coded
1121 values of $$, $n and so forth, output invocation to b4_lhs_value,
1122 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
1123 Note: this patch partially drops `semantic-parser' support: it
1124 always does `rule_length - n', where semantic parsers ought to
1125 always use `-n'.
1126 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1127 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1128
11292002-05-02 Akim Demaille <akim@epita.fr>
1130
1131 * configure.in (AC_INIT): Bump to 1.49b.
1132 (AM_INIT_AUTOMAKE): Short invocation.
1133
11342002-05-02 Akim Demaille <akim@epita.fr>
1135
1136 Version 1.49a.
1137
11382002-05-01 Akim Demaille <akim@epita.fr>
1139
1140 * src/skeleton.h: Remove.
1141
11422002-05-01 Akim Demaille <akim@epita.fr>
1143
1144 * src/skeleton.h: Fix the #endif.
1145 Reported by Magnus Fromreide.
1146
11472002-04-26 Paul Eggert <eggert@twinsun.com>
1148
1149 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1150 Define if we define YYSTYPE and YYLTYPE, respectively.
1151 (YYCOPY): Fix [] quoting problem in the non-GCC case.
1152
11532002-04-25 Robert Anisko <robert@lrde.epita.fr>
1154
1155 * src/scan-skel.l: Postprocess quadrigraphs.
1156
1157 * src/reader.c (copy_character): New function, used to output
1158 single characters while replacing `[' and `]' with quadrigraphs, to
1159 avoid troubles with M4 quotes.
1160 (copy_comment): Output characters with copy_character.
1161 (read_additionnal_code): Likewise.
1162 (copy_string2): Likewise.
1163 (copy_definition): Likewise.
1164
1165 * tests/calc.at: Exercise M4 quoting.
1166
11672002-04-25 Akim Demaille <akim@epita.fr>
1168
1169 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1170 between `!' and the command.
1171 Reported by Paul Eggert.
1172
11732002-04-24 Robert Anisko <robert@lrde.epita.fr>
1174
1175 * tests/calc.at: Exercise prologue splitting.
1176
1177 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1178 `b4_post_prologue' instead of `b4_prologue'.
1179
1180 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1181 muscles.
1182 (output): Free pre_prologue_obstack and post_prologue_obstack.
1183 * src/files.h, src/files.c (attrs_obstack): Remove.
1184 (pre_prologue_obstack, post_prologue_obstack): New.
1185 * src/reader.c (copy_definition): Add a parameter to specify the
1186 obstack to fill, instead of using attrs_obstack unconditionally.
1187 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1188 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1189
11902002-04-23 Paul Eggert <eggert@twinsun.com>
1191
1192 * data/bison.simple: Remove unnecessary commentary and white
1193 space differences from 1_29-branch.
1194 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1195
1196 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1197 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1198 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1199 constructors or destructors.
1200
1201 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1202
12032002-04-23 Akim Demaille <akim@epita.fr>
1204
1205 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1206 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1207 location with columns.
1208 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1209 All reported by Paul Eggert.
1210
12112002-04-22 Akim Demaille <akim@epita.fr>
1212
1213 * src/reduce.c (dump_grammar): Move to...
1214 * src/gram.h, src/gram.c (grammar_dump): here.
1215 Be sure to separate long item numbers.
1216 Don't read the members of a rule's prec if its nil.
1217
12182002-04-22 Akim Demaille <akim@epita.fr>
1219
1220 * src/output.c (table_size, table_grow): New.
1221 (MAXTABLE): Remove, replace uses with table_size.
1222 (pack_vector): Instead of dying when the table is too big, grow it.
1223
12242002-04-22 Akim Demaille <akim@epita.fr>
1225
1226 * data/bison.simple (yyr1): Its type is that of a token number.
1227 * data/bison.c++ (r1_): Likewise.
1228 * tests/regression.at (Web2c Actions): Adjust.
1229
12302002-04-22 Akim Demaille <akim@epita.fr>
1231
1232 * src/reader.c (token_translations_init): 256 is now the default
1233 value for the error token, i.e., it will be assigned another
1234 number if the user assigned 256 to one of her tokens.
1235 (reader): Don't force 256 to error.
1236 * doc/bison.texinfo (Symbols): Adjust.
1237 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1238 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1239 etc. instead of 10, 20, 30 (which was used to `jump' over error
1240 (256) and undefined (2)).
1241
12422002-04-22 Akim Demaille <akim@epita.fr>
1243
1244 Propagate more token_number_t.
1245
1246 * src/gram.h (token_number_as_item_number)
1247 (item_number_as_token_number): New.
1248 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1249 Use it to create output_item_number_table and
1250 output_token_number_table.
1251 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1252 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1253 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1254 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1255
12562002-04-22 Akim Demaille <akim@epita.fr>
1257
1258 * src/output.h, src/output.c (get_lines_number): Remove.
1259
12602002-04-19 Akim Demaille <akim@epita.fr>
1261
1262 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1263 as Lex/Flex'.
1264 (Debugging): More details about enabling the debugging features.
1265 (Table of Symbols): Describe $$, $n, @$, and @n.
1266 Suggested by Tim Josling.
1267
12682002-04-19 Akim Demaille <akim@epita.fr>
1269
1270 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1271
12722002-04-10 Akim Demaille <akim@epita.fr>
1273
1274 * src/system.h: Rely on HAVE_LIMITS_H.
1275 Suggested by Paul Eggert.
1276
12772002-04-09 Akim Demaille <akim@epita.fr>
1278
1279 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1280 full stderr, and strip it according to the bison options, instead
1281 of composing the error message from different bits.
1282 This makes it easier to check for several error messages.
1283 Adjust all the invocations.
1284 Add an invocation exercising the error token.
1285 Add an invocation demonstrating a stupid error message.
1286 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1287 Adjust the tests.
1288 Error message are for stderr, not stdout.
1289
12902002-04-09 Akim Demaille <akim@epita.fr>
1291
1292 * src/gram.h, src/gram.c (error_token_number): Remove, use
1293 errtoken->number.
1294 * src/reader.c (reader): Don't specify the user token number (2)
1295 for $undefined, as it uselessly prevents using it.
1296 * src/gram.h (token_number_t): Move to...
1297 * src/symtab.h: here.
1298 (state_t.number): Is a token_number_t.
1299 * src/print.c, src/reader.c: Use undeftoken->number instead of
1300 hard coded 2.
1301 (Even though this 2 is not the same as above: the number of the
1302 undeftoken remains being 2, it is its user token number which
1303 might not be 2).
1304 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1305 `user_token_number_max'.
1306 Output `undef_token_number'.
1307 * data/bison.simple, data/bison.c++: Use them.
1308 Be sure to map invalid yylex return values to
1309 `undef_token_number'. This saves us from gratuitous SEGV.
1310
1311 * tests/conflicts.at (Solved SR Conflicts)
1312 (Unresolved SR Conflicts): Adjust.
1313 * tests/regression.at (Web2c Actions): Adjust.
1314
13152002-04-08 Akim Demaille <akim@epita.fr>
1316
1317 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1318 Adding #line.
1319 Remove the duplicate `typedefs'.
1320 (RhsNumberType): Fix the declaration and various other typos.
1321 Use __ofile__.
1322 * data/bison.simple: Use __ofile__.
1323 * src/scan-skel.l: Handle __ofile__.
1324
13252002-04-08 Akim Demaille <akim@epita.fr>
1326
1327 * src/gram.h (item_number_t): New, the type of item numbers in
1328 RITEM. Note that it must be able to code symbol numbers as
1329 positive number, and the negation of rule numbers as negative
1330 numbers.
1331 Adjust all dependencies (pretty many).
1332 * src/reduce.c (rule): Remove this `short *' pointer: use
1333 item_number_t.
1334 * src/system.h (MINSHORT, MAXSHORT): Remove.
1335 Include `limits.h'.
1336 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1337 (shortcpy): Remove.
1338 (MAXTABLE): Move to...
1339 * src/output.c (MAXTABLE): here.
1340 (prepare_rules): Use output_int_table to output rhs.
1341 * data/bison.simple, data/bison.c++: Adjust.
1342 * tests/torture.at (Big triangle): Move the limit from 254 to
1343 500.
1344 * tests/regression.at (Web2c Actions): Ajust.
1345
1346 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1347 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1348 passes, but produces negative #line number, once fixed, GCC is
1349 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1350 C), it passes.
1351 * src/state.h (state_h): Code input lines on ints, not shorts.
1352
13532002-04-08 Akim Demaille <akim@epita.fr>
1354
1355 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1356 and then the grammar.
1357
13582002-04-08 Akim Demaille <akim@epita.fr>
1359
1360 * src/system.h: No longer using strndup.
1361
13622002-04-07 Akim Demaille <akim@epita.fr>
1363
1364 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1365 * src/output.c (output_table_data): Return the longest number.
1366 (prepare_tokens): Output `token_number_max').
1367 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1368 New.
1369 Use them to define yy_token_number_type/TokenNumberType.
1370 Use this type for yytranslate.
1371 * tests/torture.at (Big triangle): Push the limit from 124 to
1372 253.
1373 * tests/regression.at (Web2c Actions): Adjust.
1374
13752002-04-07 Akim Demaille <akim@epita.fr>
1376
1377 * tests/torture.at (Big triangle): New.
1378 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1379 * tests/existing.at: here.
1380
13812002-04-07 Akim Demaille <akim@epita.fr>
1382
1383 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1384 nritems.
1385 Adjust dependencies.
1386
13872002-04-07 Akim Demaille <akim@epita.fr>
1388
1389 * src/reader.c: Normalize increments to prefix form.
1390
13912002-04-07 Akim Demaille <akim@epita.fr>
1392
1393 * src/reader.c, symtab.c: Remove debugging code.
1394
13952002-04-07 Akim Demaille <akim@epita.fr>
1396
1397 Rename all the `bucket's as `symbol_t'.
1398
1399 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1400 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1401 * src/symtab.c, src/symtab.h (bucket): Rename as...
1402 (symbol_t): this.
1403 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1404 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1405 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1406 (buckets_new, buckets_free, buckets_do): Rename as...
1407 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1408 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1409 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1410 (symbols_new, symbols_free, symbols_do): these.
1411
14122002-04-07 Akim Demaille <akim@epita.fr>
1413
1414 Use lib/hash for the symbol table.
1415
1416 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1417 EOF.
1418 * src/lex.c (lex): Set the `number' member of new terminals.
1419 * src/reader.c (bucket_check_defined, bucket_make_alias)
1420 (bucket_check_alias_consistence, bucket_translation): New.
1421 (reader, grammar_free, readgram, token_translations_init)
1422 (packsymbols): Adjust.
1423 (reader): Number the predefined tokens.
1424 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1425 for predefined tokens.
1426 * src/symtab.h (bucket): Remove all the hash table related
1427 members.
1428 * src/symtab.c (symtab): Replace by...
1429 (bucket_table): this.
1430 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1431 (buckets_new, buckets_do): New.
1432
14332002-04-07 Akim Demaille <akim@epita.fr>
1434
1435 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1436 (start_symbol, max_user_token_number, semantic_parser)
1437 (error_token_number): Initialize.
1438 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1439 Initialize.
1440 (reader): Don't.
1441 (errtoken, eoftoken, undeftoken, axiom): Extern.
1442
14432002-04-07 Akim Demaille <akim@epita.fr>
1444
1445 * src/gram.h (rule_s): prec and precsym are now pointers
1446 to the bucket giving the priority/associativity.
1447 Member `associativity' removed: useless.
1448 * src/reduce.c, src/conflicts.c: Adjust.
1449
14502002-04-07 Akim Demaille <akim@epita.fr>
1451
1452 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1453 Properly escape the symbols' TAG when outputting them.
1454
14552002-04-07 Akim Demaille <akim@epita.fr>
1456
1457 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1458
14592002-04-07 Akim Demaille <akim@epita.fr>
1460
1461 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1462 (LArule): this, which is an array to rule_t*.
1463 * src/print.c, src/conflicts.c: Adjust.
1464
14652002-04-07 Akim Demaille <akim@epita.fr>
1466
1467 * src/gram.h (rule_t): Rename `number' as `user_number'.
1468 `number' is a new member.
1469 Adjust dependencies.
1470 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1471
14722002-04-07 Akim Demaille <akim@epita.fr>
1473
1474 As a result of the previous patch, it is no longer needed
1475 to reorder ritem itself.
1476
1477 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1478
14792002-04-07 Akim Demaille <akim@epita.fr>
1480
1481 Be sure never to walk through RITEMS, but use only data related to
1482 the rules themselves. RITEMS should be banished.
1483
1484 * src/output.c (output_token_translations): Rename as...
1485 (prepare_tokens): this.
1486 In addition to `translate', prepare the muscles `tname' and
1487 `toknum', which were handled by...
1488 (output_rule_data): this.
1489 Remove, and move the remainder of its outputs into...
1490 (prepare_rules): this new routines, which also merges content from
1491 (output_gram): this.
1492 (prepare_rules): Be sure never to walk through RITEMS.
1493 (output_stos): Rename as...
1494 (prepare_stos): this.
1495 (output): Always invoke prepare_states, after all, just don't use it
1496 in the output if you don't need it.
1497
14982002-04-07 Akim Demaille <akim@epita.fr>
1499
1500 * src/LR0.c (new_state): Display `nstates' as the name of the
1501 newly created state.
1502 Adjust to initialize first_state and last_state if needed.
1503 Be sure to distinguish the initial from the final state.
1504 (new_states): Create the itemset of the initial state, and use
1505 new_state.
1506 * src/closure.c (closure): Now that the initial state has its
1507 items properly set, there is no need for a special case when
1508 creating `ruleset'.
1509
1510 As a result, now the rule 0, reducing to $axiom, is visible in the
1511 outputs. Adjust the test suite.
1512
1513 * tests/conflicts.at (Solved SR Conflicts)
1514 (Unresolved SR Conflicts): Adjust.
1515 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1516 * tests/conflicts.at (S/R in initial): New.
1517
15182002-04-07 Akim Demaille <akim@epita.fr>
1519
1520 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1521 the RHS of the rules.
1522 * src/output.c (output_gram): Likewise.
1523
15242002-04-07 Akim Demaille <akim@epita.fr>
1525
1526 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1527 bucket.
1528 Adjust all dependencies.
1529 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1530 `number' of the buckets too.
1531 * src/gram.h: Include `symtab.h'.
1532 (associativity): Move to...
1533 * src/symtab.h: here.
1534 No longer include `gram.h'.
1535
15362002-04-07 Akim Demaille <akim@epita.fr>
1537
1538 * src/gram.h, src/gram.c (rules_rhs_length): New.
1539 (ritem_longest_rhs): Use it.
1540 * src/gram.h (rule_t): `number' is a new member.
1541 * src/reader.c (packgram): Set it.
1542 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1543 the end of `rules', and count them out of `nrules'.
1544 (reduce_output, dump_grammar): Adjust.
1545 * src/print.c (print_grammar): It is no longer needed to check for
1546 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1547 * tests/reduce.at (Reduced Automaton): New test.
1548
15492002-04-07 Akim Demaille <akim@epita.fr>
1550
1551 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1552 lacking `+ 1' to nrules, Bison reported as useless a token if it
1553 was used solely to set the precedence of the last rule...
1554
15552002-04-07 Akim Demaille <akim@epita.fr>
1556
1557 * data/bison.c++, data/bison.simple: Don't output the current file
1558 name in #line, to avoid useless diffs between two identical
1559 outputs under different names.
1560
15612002-04-07 Akim Demaille <akim@epita.fr>
1562
1563 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1564 Normalize loops to using `< nrules + 1', not `<= nrules'.
1565
15662002-04-07 Akim Demaille <akim@epita.fr>
1567
1568 * TODO: Update.
1569
15702002-04-07 Akim Demaille <akim@epita.fr>
1571
1572 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1573 bucket.value as bucket.number.
1574
15752002-04-07 Akim Demaille <akim@epita.fr>
1576
1577 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1578 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1579 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1580 RHS, instead of being an index in RITEMS.
1581
15822002-04-04 Paul Eggert <eggert@twinsun.com>
1583
1584 * doc/bison.texinfo: Update copyright date.
1585 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1586 (Symbols): Warn about running Bison in one character set,
1587 but compiling and/or running in an incompatible one.
1588 Warn about character code 256, too.
1589
15902002-04-03 Paul Eggert <eggert@twinsun.com>
1591
1592 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1593 YYERROR_VERBOSE is nonzero, not whether it is defined.
1594
1595 Merge changes from bison-1_29-branch.
1596
15972002-03-20 Paul Eggert <eggert@twinsun.com>
1598
1599 Merge fixes from Debian bison_1.34-1.diff.
1600
1601 * configure.in (AC_PREREQ): 2.53.
1602
16032002-03-20 Akim Demaille <akim@epita.fr>
1604
1605 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1606
16072002-03-19 Paul Eggert <eggert@twinsun.com>
1608
1609 * src/bison.simple (YYCOPY): New macro.
1610 (YYSTACK_RELOCATE): Use it.
1611 Remove Type arg; no longer needed. All callers changed.
1612 (yymemcpy): Remove; no longer needed.
1613
1614 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1615 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1616
16172002-03-19 Akim Demaille <akim@epita.fr>
1618
1619 Test and fix the #line outputs.
1620
1621 * tests/atlocal.at (GCC): New.
1622 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1623 (Prologue synch line, ,%union synch line, Postprologue synch line)
1624 (Action synch line, Epilogue synch line): New tests.
1625 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1626 * data/bison.simple, data/bison.c++: Use it.
1627
16282002-03-19 Akim Demaille <akim@epita.fr>
1629
1630 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1631 (Solved SR Conflicts, %expect not enough, %expect right)
1632 (%expect too much): Move to...
1633 * tests/conflicts.at: this new file.
1634
16352002-03-19 Akim Demaille <akim@epita.fr>
1636
1637 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1638 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1639 that we can move to enums for instance.
1640 * src/output.c (token_definitions_output): Output a list of
1641 `token-name, token-number' instead of the #define.
1642 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1643
16442002-03-14 Akim Demaille <akim@epita.fr>
1645
1646 Use Gettext 0.11.1.
1647
16482002-03-09 Robert Anisko <robert@lrde.epita.fr>
1649
1650 * data/bison.c++: Make the user able to add members to the generated
1651 parser by subclassing.
1652
16532002-03-05 Robert Anisko <robert@lrde.epita.fr>
1654
1655 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1656 a character.
1657 Reported by Nicolas Tisserand and Nicolas Burrus.
1658
16592002-03-04 Robert Anisko <robert@lrde.epita.fr>
1660
1661 * src/reader.c: Warn about lacking semi-colons, do not complain.
1662
16632002-03-04 Robert Anisko <robert@lrde.epita.fr>
1664
1665 * data/bison.c++: Remove a debug line.
1666
16672002-03-04 Robert Anisko <robert@lrde.epita.fr>
1668
1669 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1670 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1671 provide a default implementation.
1672
16732002-03-04 Akim Demaille <akim@epita.fr>
1674
1675 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1676 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1677 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1678 * tests/semantic.at (Parsing Guards): Similarly.
1679 * src/reader.at (readgram): Complain if the last rule is not ended
1680 with a semi-colon.
1681
16822002-03-04 Akim Demaille <akim@epita.fr>
1683
1684 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1685 * src/closure.c: here.
1686 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1687 RTC.
1688 * src/warshall.h, src/warshall.c: Remove.
1689 * tests/sets.at (Broken Closure): Adjust.
1690
16912002-03-04 Akim Demaille <akim@epita.fr>
1692
1693 * src/output.c (output_skeleton): tempdir is const.
1694 bytes_read is unused.
1695
16962002-03-04 Akim Demaille <akim@epita.fr>
1697
1698 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1699 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1700 Update.
1701 From Michael Hayes.
1702
17032002-03-04 Akim Demaille <akim@epita.fr>
1704
1705 * src/closure.c (closure): `r' is unused.
1706
17072002-03-04 Akim Demaille <akim@epita.fr>
1708
1709 * tests/sets.at (Broken Closure): Add the ending `;'.
1710 * src/reader.at (readgram): Complain if a rule is not ended with a
1711 semi-colon.
1712
17132002-03-04 Akim Demaille <akim@epita.fr>
1714
1715 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1716 (count_sr_conflicts): Use bitset_count.
1717 * src/reduce.c (inaccessable_symbols): Ditto.
1718 (bits_size): Remove.
1719 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1720
17212002-03-04 Akim Demaille <akim@epita.fr>
1722
1723 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1724 * src/reduce.c: Remove the `bitset_zero's following the
1725 `bitset_create's, as now it is performed by the latter.
1726
17272002-03-04 Akim Demaille <akim@epita.fr>
1728
1729 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1730 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1731 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1732 latest sources from Michael.
1733
17342002-03-04 Akim Demaille <akim@epita.fr>
1735
1736 * src/output.c (output): Don't free the grammar.
1737 * src/reader.c (grammar_free): New.
1738 * src/main.c (main): Call it and don't free symtab here.
1739
17402002-03-04 Akim Demaille <akim@epita.fr>
1741
1742 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1743 before returning.
1744 Reported by Benoit Perrot.
1745
17462002-03-04 Akim Demaille <akim@epita.fr>
1747
1748 Use bitset operations when possible, not loops over bits.
1749
1750 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1751 bitset_or.
1752 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1753 * src/reduce.c (useless_nonterminals): Formatting changes.
1754 * src/warshall.c (TC): Use bitset_or.
1755
17562002-03-04 Akim Demaille <akim@epita.fr>
1757
1758 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1759 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1760 Ditto.
1761
17622002-03-04 Akim Demaille <akim@epita.fr>
1763
1764 * src/lalr.c (F): Now a bitset*.
1765 Adjust all dependencies.
1766
17672002-03-04 Akim Demaille <akim@epita.fr>
1768
1769 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1770 Adjust all dependencies.
1771
17722002-03-04 Akim Demaille <akim@epita.fr>
1773
1774 * src/L0.c, src/LR0.h (nstates): Be size_t.
1775 Adjust comparisons (signed vs unsigned).
1776 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1777 bitset*.
1778 Adjust all dependencies.
1779
17802002-03-04 Akim Demaille <akim@epita.fr>
1781
1782 * src/closure.c (firsts): Now, also a bitset.
1783 Adjust all dependencies.
1784 (varsetsize): Remove, now unused.
1785 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1786
17872002-03-04 Akim Demaille <akim@epita.fr>
1788
1789 * src/print.c: Convert to use bitset.h, not hand coded iterations
1790 over ints.
1791
17922002-03-04 Akim Demaille <akim@epita.fr>
1793
1794 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1795
17962002-03-04 Akim Demaille <akim@epita.fr>
1797
1798 * src/closure.c (ruleset): Be a bitset.
1799 (rulesetsize): Remove.
1800
18012002-03-04 Akim Demaille <akim@epita.fr>
1802
1803 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1804 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1805 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1806 * src/closure.c (fderives): Be an array of bitsets.
1807
18082002-02-28 Robert Anisko <robert@lrde.epita.fr>
1809
1810 * data/bison.c++: Merge the two generated headers. Insert a copyright
1811 notice in each output file.
1812
18132002-02-28 Akim Demaille <akim@epita.fr>
1814
1815 * data/bison.c++: Copy the prologue of bison.simple to fetch
1816 useful M4 definitions, such as b4_header_guard.
1817
18182002-02-25 Akim Demaille <akim@epita.fr>
1819
1820 * src/getargs.c (version): Give the name of the authors, and use a
1821 translator friendly scheme for the bgr
1822 copyright notice.
1823
18242002-02-25 Akim Demaille <akim@epita.fr>
1825
1826 * src/output.c (header_output): Remove, now handled completely via
1827 M4.
1828
18292002-02-25 Akim Demaille <akim@epita.fr>
1830
1831 * m4/m4.m4: New, from CVS Autoconf.
1832 * configure.in: Invoke it.
1833 * src/output.c (output_skeleton): Use its result instead of the
1834 hard coded name.
1835
18362002-02-25 Akim Demaille <akim@epita.fr>
1837
1838 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1839 Fileutils 4.1.5.
1840 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1841 * src/output.c (output_skeleton): Use mkstemp to create a real
1842 temporary file.
1843 Move the filling of `skeleton' and its muscle to...
1844 (prepare): here.
1845 (output): Move the definition of the prologue muscle to...
1846 (prepare): here.
1847 * src/system.h (DEFAULT_TMPDIR): New.
1848
18492002-02-14 Paul Eggert <eggert@twinsun.com>
1850
1851 Remove the support for C++ namespace cleanliness; it was
1852 causing more problems than it was curing, since it didn't work
1853 properly on some nonstandard C++ compilers. This can wait
1854 for a proper C++ parser.
1855
1856 * NEWS: Document this.
1857 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1858 of C++, as it's treated like C now.
1859 * src/bison.simple (YYSTD): Remove.
1860 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1861 Treat C++ just like Standard C instead of trying to support
1862 namespace cleanliness.
1863
18642002-02-14 Akim Demaille <akim@epita.fr>
1865
1866 * tests/regression.at (else): Adjust to Andreas' change.
1867
18682002-02-14 Akim Demaille <akim@epita.fr>
1869
1870 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1871
18722002-02-13 Andreas Schwab <schwab@suse.de>
1873
1874 * src/output.c (output_rule_data): Don't output NULL, it might
1875 not be defined yet.
1876
18772002-02-11 Robert Anisko <robert@lrde.epita.fr>
1878
1879 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1880 (Copyright notice): Update.
1881
18822002-02-11 Akim Demaille <akim@epita.fr>
1883
1884 * tests/regression.at (%nonassoc and eof): Don't include
1885 nonportable headers.
1886
18872002-02-08 Robert Anisko <robert@lrde.epita.fr>
1888
1889 * data/bison.c++: Correct error recovery. Make the user able to
1890 initialize the starting location.
1891
18922002-02-07 Akim Demaille <akim@epita.fr>
1893
1894 * tests/input.at: New.
1895
18962002-02-07 Robert Anisko <robert@lrde.epita.fr>
1897
1898 * data/bison.c++: Replace some direct m4 expansions by constants. Be
1899 more consistent when naming methods and variables. Put preprocessor
1900 directives around tables only needed for debugging.
1901
19022002-02-07 Robert Anisko <robert@lrde.epita.fr>
1903
1904 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1905 C++ parsers.
1906 (yy::b4_name::parse): Use print_.
1907
19082002-02-07 Robert Anisko <robert@lrde.epita.fr>
1909
1910 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1911
19122002-02-07 Robert Anisko <robert@lrde.epita.fr>
1913
1914 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1915 C++ parsers.
1916 (yy::b4_name::parse): Build verbose error messages, and use error_.
1917
19182002-02-06 Robert Anisko <robert@lrde.epita.fr>
1919
1920 * data/bison.c++: Fix m4 quoting in comments.
1921
19222002-02-06 Robert Anisko <robert@lrde.epita.fr>
1923
1924 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1925 not expanded by m4.
1926
19272002-02-05 Akim Demaille <akim@epita.fr>
1928
1929 * data/bison.c++: Adjust to the M4 back end.
1930 More is certainly needed.
1931
19322002-02-05 Akim Demaille <akim@epita.fr>
1933
1934 Give a try to M4 as a back end.
1935
1936 * lib/readpipe.c: New, from wdiff.
1937 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1938 BISON_HAIRY.
1939 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1940 specific values. Now it is m4 that performs the lookup.
1941 * src/parse-skel.y: Remove.
1942 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1943 * src/output.c (actions_output, guards_output)
1944 (token_definitions_output): No longer keeps track of the output
1945 line number, hence remove the second argument.
1946 (guards_output): Check against the guard member of a rule, not the
1947 action member.
1948 Adjust callers.
1949 (output_skeleton): Don't look for the skeleton location, let m4 do
1950 that.
1951 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1952 file will be used.
1953 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1954 (prepare): Given that for the time being changesyntax is not
1955 usable in M4, rename the muscles using `-' to `_'.
1956 Define `defines_flag', `output_parser_name' and `output_header_name'.
1957 * src/output.h (actions_output, guards_output)
1958 (token_definitions_output): Adjust prototypes.
1959 * src/scan-skel.l: Instead of scanning the skeletons, it now
1960 processes the output of m4: `__oline__' and `#output'.
1961 * data/bison.simple: Adjust to be used by M4(sugar).
1962 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1963 to date.
1964 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1965 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1966 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1967 shamelessly stolen from CVS Autoconf.
1968
19692002-02-05 Akim Demaille <akim@epita.fr>
1970
1971 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1972 * configure.in: Check for the declarations of free and malloc.
1973 * src/muscle_tab.c: Adjust.
1974
19752002-02-05 Akim Demaille <akim@epita.fr>
1976
1977 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1978 which have no values.
1979
19802002-02-05 Akim Demaille <akim@epita.fr>
1981
1982 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1983 * data/: here.
1984
19852002-01-29 Paul Eggert <eggert@twinsun.com>
1986
1987 * src/bison.simple (YYSIZE_T): Do not define merely because
1988 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1989 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1990
19912002-01-27 Akim Demaille <akim@epita.fr>
1992
1993 Fix `%nonassoc and eof'.
1994
1995 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1996 which were not properly copied! Replace
1997 memcpy (res->errs, src->errs, src->nerrs);
1998 with
1999 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2000 !!!
2001 * tests/regression.at (%nonassoc and eof): Adjust to newest
2002 Autotest: `.' is not in the PATH.
2003
20042002-01-27 Akim Demaille <akim@epita.fr>
2005
2006 * tests/sets.at (AT_EXTRACT_SETS): New.
2007 (Nullable): Use it.
2008 (Firsts): New.
2009
20102002-01-26 Akim Demaille <akim@epita.fr>
2011
2012 * tests/actions.at, tests/calc.at, tests/headers.at,
2013 * tests/torture.at: Adjust to the newest Autotest which no longer
2014 forces `.' in the PATH.
2015
20162002-01-25 Akim Demaille <akim@epita.fr>
2017
2018 * tests/regression.at (%nonassoc and eof): New.
2019 Suggested by Robert Anisko.
2020
20212002-01-24 Akim Demaille <akim@epita.fr>
2022
2023 Bison dumps core when trying to complain about broken input files.
2024 Reported by Cris van Pelt.
2025
2026 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2027 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2028 into...
2029 (Invalid inputs): Strengthen: exercise parse_percent_token.
2030
20312002-01-24 Robert Anisko <robert.anisko@epita.fr>
2032
2033 * src/Makefile.am: Add bison.c++.
2034 * src/bison.c++: New skeleton.
2035
20362002-01-21 Paolo Bonzini <bonzini@gnu.org>
2037
2038 * po/it.po: New.
2039
20402002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2041
2042 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2043
20442002-01-20 Marc Autret <marc@gnu.org>
2045
2046 * src/files.c (compute_output_file_names): Fix
2047
20482002-01-20 Marc Autret <marc@gnu.org>
2049
2050 * tests/output.at: New test.
2051 * src/files.c (compute_base_names): Don't map extensions when
2052 the YACC flag is set, use defaults.
2053 Reported by Evgeny Stambulchik.
2054
20552002-01-20 Marc Autret <marc@gnu.org>
2056
2057 * src/system.h: Need to define __attribute__ away for non-GCC
2058 compilers as well (i.e. the vendor C compiler).
2059 Suggested by Albert Chin-A-Young.
2060
20612002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2062
2063 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2064 canonical definition.
2065 * src/system.h: Use the canonical definition for PARAMS (avoids
2066 a conflict with the macro from lib/hash.h).
2067
20682002-01-11 Akim Demaille <akim@epita.fr>
2069
2070 * configure.in: Use AC_FUNC_STRNLEN.
2071 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
2072
20732002-01-09 Akim Demaille <akim@epita.fr>
2074
2075 * src/files.c, src/files.h (output_infix): New.
2076 (tab_extension): Remove.
2077 (compute_base_names): Compute the former, drop the latter.
2078 * src/output.c (prepare): Insert the muscles `output-infix', and
2079 `output-suffix'.
2080 * src/parse-skel.y (string, string.1): New.
2081 (section.header): Use it.
2082 (section.yacc): Remove.
2083 (prefix): Remove too.
2084 * src/scan-skel.l: Adjust.
2085 * src/bison.simple, src/bison.hairy: Adjust.
2086
20872002-01-09 Akim Demaille <akim@epita.fr>
2088
2089 * configure.in (WERROR_CFLAGS): Compute it.
2090 * src/Makefile.am (CFLAGS): Pass it.
2091 * tests/atlocal.in (CFLAGS): Idem.
2092 * src/files.c: Fix a few warnings.
2093 (get_extension_index): Remove, unused.
2094
20952002-01-08 Akim Demaille <akim@epita.fr>
2096
2097 * src/getargs.c (AS_FILE_NAME): New.
2098 (getargs): Use it to convert DOSish file names.
2099 * src/files.c (base_name): Rename as full_base_name to avoid
2100 clashes with `base_name ()'.
2101 (filename_split): New.
2102 (compute_base_names): N-th rewrite, using filename_split.
2103
21042002-01-08 Akim Demaille <akim@epita.fr>
2105
2106 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2107 New, stolen from the Fileutils 4.1.
2108 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2109 * configure.in: Check for the presence of memrchr, and of its
2110 prototype.
2111
21122002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2113
2114 * lib/hash.h (__P): Added definition for this macro.
2115 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2116 BUILT_SOURCES, to ensure they are generated first.
2117 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2118 %error-verbose to allow bootstrapping with bison 1.30x.
2119
21202002-01-06 Akim Demaille <akim@epita.fr>
2121
2122 * src/reader.c (parse_braces): Don't fetch the next char, the
2123 convention is to fetch on entry.
2124 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2125 'switch' without a following semicolon.
2126 * tests/regression.at (braces parsing): New.
2127
21282002-01-06 Akim Demaille <akim@epita.fr>
2129
2130 Bison is dead wrong in its RR conflict reports.
2131
2132 * tests/torture.at (GNU Cim Grammar): New.
2133 * src/conflicts.c (count_rr_conflicts): Fix.
2134
21352002-01-06 Akim Demaille <akim@epita.fr>
2136
2137 Creating package.m4 from configure.ac causes too many problems.
2138
2139 * tests/Makefile.am (package.m4): Create it by hand,
2140 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2141
21422002-01-06 Akim Demaille <akim@epita.fr>
2143
2144 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2145 skeleton.h.
2146
21472002-01-04 Paul Eggert <eggert@twinsun.com>
2148
2149 * doc/bison.texinfo (Debugging):
2150 Remove YYSTDERR; it's no longer defined or used.
2151 Also, s/cstdio.h/cstdio/.
2152
21532002-01-03 Akim Demaille <akim@epita.fr>
2154
2155 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2156
21572002-01-03 Akim Demaille <akim@epita.fr>
2158
2159 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2160 tracing code to --trace, wait for a better --trace option, with
2161 args.
2162
21632002-01-03 Akim Demaille <akim@epita.fr>
2164
2165 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2166 The ISO C++ standard is extremely clear about it: stderr is
2167 considered a macro, not a regular symbol (see table 94 `Header
2168 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2169 Therefore std:: does not apply to it. It still does with fprintf.
2170 Also, s/cstdio.h/cstdio/.
2171
21722002-01-03 Akim Demaille <akim@epita.fr>
2173
2174 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2175 for non system headers.
2176
21772002-01-02 Akim Demaille <akim@epita.fr>
2178
2179 Equip the skeleton chain with location tracking, runtime trace,
2180 pure parser and scanner.
2181
2182 * src/parse-skel.y: Request a pure parser, locations, and prefix
2183 renaming.
2184 (%union): Having several members with the same type does not help
2185 type mismatches, simplify.
2186 (YYPRINT, yyprint): New.
2187 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2188 (skel_error): this.
2189 Handle locations.
2190 * src/scan-skel.l: Adjust to these changes.
2191 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2192 (LOCATION_PRINT, skel_control_t): New.
2193
21942001-12-30 Akim Demaille <akim@epita.fr>
2195
2196 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2197 replace `gb' with BLANKS.
2198 * src/scan-skel.l: Adjust.
2199
22002001-12-30 Akim Demaille <akim@epita.fr>
2201
2202 * src/system.h: We don't need nor want bcopy.
2203 Throw away MS-DOS crap: we don't need getpid.
2204 * configure.in: We don't need strndup. It was even causing
2205 problems: because Flex includes the headers *before* us,
2206 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2207 not visible.
2208 * lib/xstrndup.c: New.
2209 * src/scan-skel.l: Use it.
2210 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2211 * src/parse-skel.y: Use %directives instead of #defines.
2212
22132001-12-30 Akim Demaille <akim@epita.fr>
2214
2215 * src/skeleton.h: New.
2216 * src/output.c (output_parser, output_master_parser): Remove, dead
2217 code.
2218 * src/output.h (get_lines_number, actions_output, guards_output)
2219 (token_definitions_output): Prototype them.
2220 * src/parse-skel.y: Add the license notice.
2221 Include output.h and skeleton.h.
2222 (process_skeleton): Returns void, and takes a single parameter.
2223 * src/scan-skel.l: Add the license notice.
2224 Include skeleton.h.
2225 Don't use %option yylineno: it seems that then Flex imagines
2226 REJECT has been used, and therefore it won't reallocate its
2227 buffers (which makes no other sense to me than a bug). It results
2228 in warnings for `unused: yy_flex_realloc'.
2229
22302001-12-30 Robert Anisko <robert.anisko@epita.fr>
2231
2232 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2233 (MUSCLE_INSERT_PREFIX): ...to there.
2234 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2235 (MUSCLE_INSERT_PREFIX): Move from here...
2236
2237 * src/bison.hairy: Add a section directive. Put braces around muscle
2238 names. This parser skeleton is still broken, but Bison should not
2239 choke on a bad muscle 'syntax'.
2240 * src/bison.simple: Add a section directive. Put braces around muscle
2241 names.
2242
2243 * src/files.h (strsuffix, stringappend): Add declarations.
2244 (tab_extension): Add declaration.
2245 (short_base_name): Add declaration.
2246
2247 * src/files.c (strsuffix, stringappend): No longer static. These
2248 functions are used in the skeleton parser.
2249 (tab_extension): New.
2250 (compute_base_names): Use the computations done in this function
2251 to guess if the generated parsers should have '.tab' in their
2252 names.
2253 (short_base_name): No longer static.
2254
2255 * src/output.c (output_skeleton): New.
2256 (output): Disable call to output_master_parser, and give a try to
2257 a new skeleton handling system.
2258 (guards_output, actions_output): No longer static.
2259 (token_definitions_output, get_lines_number): No longer static.
2260
2261 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2262
2263 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
2264 parse-skel.y.
2265
2266 * src/parse-skel.y: New file.
2267 * src/scan-skel.l: New file.
2268
22692001-12-29 Akim Demaille <akim@epita.fr>
2270
2271 %name-prefix is broken.
2272
2273 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2274 Adjust all dependencies.
2275 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2276 %name-prefix.
2277
2278 Renaming yylval but not yylloc is not consistent. Now we do.
2279
2280 * src/bison.simple: Prefix yylloc if used.
2281 * doc/bison.texinfo (Decl Summary): Document that.
2282
22832001-12-29 Akim Demaille <akim@epita.fr>
2284
2285 * doc/bison.texinfo: Promote `%long-directive' over
2286 `%long_directive'.
2287 Remove all references to fixed-output-files, yacc is enough.
2288
22892001-12-29 Akim Demaille <akim@epita.fr>
2290
2291 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2292 user prologue. These are defaults.
2293 * tests/actions.at (Mid-rule actions): Make sure the user can
2294 define YYDEBUG and YYERROR_VERBOSE.
2295
22962001-12-29 Akim Demaille <akim@epita.fr>
2297
2298 * src/output.c (header_output): Don't forget to export YYLTYPE and
2299 yylloc.
2300 * tests/headers.at (export YYLTYPE): New, make sure it does.
2301 * tests/regression.at (%union and --defines, Invalid CPP headers):
2302 Move to...
2303 * tests/headers.at: here.
2304
23052001-12-29 Akim Demaille <akim@epita.fr>
2306
2307 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2308
23092001-12-29 Akim Demaille <akim@epita.fr>
2310
2311 * tests/actions.at (Mid-rule actions): Output on a single line
2312 instead of several.
2313
23142001-12-29 Akim Demaille <akim@epita.fr>
2315
2316 * doc/bison.texinfo: Formatting changes.
2317
23182001-12-29 Akim Demaille <akim@epita.fr>
2319
2320 Don't store the token defs in a muscle, just be ready to output it
2321 on command. Now possible via `symbols'. Fixes a memory leak.
2322
2323 * src/output.c (token_definitions_output): New.
2324 (output_parser, header_output): Use it.
2325 * src/reader.c (symbols_save): Remove.
2326
23272001-12-29 Akim Demaille <akim@epita.fr>
2328
2329 * src/bison.simple: Do not provide a default for YYSTYPE and
2330 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2331 default.
2332
23332001-12-29 Akim Demaille <akim@epita.fr>
2334
2335 Mid-rule actions are simply... ignored!
2336
2337 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2338 the empty-rule associated to the dummy symbol, not to the host
2339 rule.
2340 * tests/actions.at (Mid-rule actions): New.
2341
23422001-12-29 Akim Demaille <akim@epita.fr>
2343
2344 Memory leak.
2345
2346 * src/reader.c (reader): Free grammar.
2347
23482001-12-29 Akim Demaille <akim@epita.fr>
2349
2350 Memory leak.
2351
2352 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2353 since it allocates it for each state, although only one is needed.
2354 (allocate_storage): Do it here.
2355
23562001-12-29 Akim Demaille <akim@epita.fr>
2357
2358 * src/options.h, src/options.c (create_long_option_table): Rename
2359 as...
2360 (long_option_table_new): this, with a clearer prototype.
2361 (percent_table): Remove, unused,
2362 * src/getargs.c (getargs): Adjust.
2363
23642001-12-29 Akim Demaille <akim@epita.fr>
2365
2366 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2367 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2368 as states.
2369
23702001-12-29 Akim Demaille <akim@epita.fr>
2371
2372 * src/lalr.c (build_relations): Rename `states' as `states1'.
2373 Sorry, I don't understand exactly what it is, no better name...
2374
23752001-12-29 Akim Demaille <akim@epita.fr>
2376
2377 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2378 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2379 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2380 as rules.
2381
23822001-12-29 Akim Demaille <akim@epita.fr>
2383
2384 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2385 ago.
2386
23872001-12-29 Akim Demaille <akim@epita.fr>
2388
2389 * src/reader.c, src/reader.h (user_toknums): Remove.
2390 Adjust all users to use symbols[i]->user_token_number.
2391
23922001-12-29 Akim Demaille <akim@epita.fr>
2393
2394 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2395 Adjust all users to use symbols[i]->prec or ->assoc.
2396
23972001-12-29 Akim Demaille <akim@epita.fr>
2398
2399 * src/reader.c, src/reader.h (tags): Remove.
2400 Adjust all users to use symbols[i]->tag.
2401
24022001-12-29 Akim Demaille <akim@epita.fr>
2403
2404 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2405 and rule_table.
2406 * src/reader.c (packsymbols): Fill this table.
2407 Drop sprec.
2408 * src/conflicts.c (resolve_sr_conflict): Adjust.
2409 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2410 single table.
2411 Use symbols[i]->tag instead of tags[i].
2412
24132001-12-29 Akim Demaille <akim@epita.fr>
2414
2415 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2416 In addition, put a comment in there, to replace...
2417 * tests/regression.at (%union and C comments): Remove.
2418
24192001-12-29 Akim Demaille <akim@epita.fr>
2420
2421 * tests/regression.at (Web2c Actions): Blindly move the actual
2422 output as expected output. The contents *seem* right to me, but I
2423 can't pretend reading perfectly parser tables... Nonetheless, all
2424 the other tests pass correctly, the table look OK, even though the
2425 presence of `$axiom' is to be noted: AFAICS it is useless (but
2426 harmless).
2427
24282001-12-29 Akim Demaille <akim@epita.fr>
2429
2430 * src/reader.c (readgram): Don't add the rule 0 if there were no
2431 rules read. In other words, add it _after_ having performed
2432 grammar sanity checks.
2433 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2434
24352001-12-29 Akim Demaille <akim@epita.fr>
2436
2437 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2438 visible, and some states have now a different number.
2439
24402001-12-29 Akim Demaille <akim@epita.fr>
2441
2442 * src/reader.c (readgram): Bind the initial rule's lineno to that
2443 of the first rule.
2444 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2445 (Solved SR Conflicts): Adjust rule 0's line number.
2446
24472001-12-29 Akim Demaille <akim@epita.fr>
2448
2449 Fix the `GAWK Grammar' failure.
2450
2451 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2452 the reductions of the first state which was mistakenly confused
2453 with the final state because precisely final_state was initialized
2454 to 0.
2455 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2456 now noticed by Bison.
2457 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2458 have a reduction on $default.
2459
24602001-12-29 Akim Demaille <akim@epita.fr>
2461
2462 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2463 rule line numbers.
2464 * src/closure.c (print_closure): Likewise.
2465 * src/derives.c (print_derives): Likewise.
2466 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2467 now.
2468
24692001-12-29 Akim Demaille <akim@epita.fr>
2470
2471 * src/lalr.c (lookaheads_print): New.
2472 (lalr): Call it when --trace-flag.
2473 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2474 are dumped.
2475
24762001-12-29 Akim Demaille <akim@epita.fr>
2477
2478 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2479 when walking through ritem, even via rule->rhs.
2480 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2481 (useful_production, useless_nonterminals): Likewise.
2482 (reduce_grammar_tables): Likewise, plus update nritems.
2483 * src/nullable.c (set_nullable): Likewise.
2484 * src/lalr.c (build_relations): Likewise.
2485 * tests/sets.at (Nullable): Adjust.
2486 Fortunately, now, the $axiom is no longer nullable.
2487
24882001-12-29 Akim Demaille <akim@epita.fr>
2489
2490 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2491 the 0-sentinel.
2492 * src/gram.c (ritem_longest_rhs): Likewise.
2493 * src/reduce.c (nonterminals_reduce): Likewise.
2494 * src/print_graph.c (print_graph): Likewise.
2495 * src/output.c (output_rule_data): Likewise.
2496 * src/nullable.c (set_nullable): Likewise.
2497
24982001-12-29 Akim Demaille <akim@epita.fr>
2499
2500 * src/output.c: Comment changes.
2501
25022001-12-27 Paul Eggert <eggert@twinsun.com>
2503
2504 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2505 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2506 Sparc, as they were causing more porting problems than the
2507 (minor) performance improvement was worth.
2508
2509 Also, catch up with 1.31's YYSTD.
2510
25112001-12-27 Akim Demaille <akim@epita.fr>
2512
2513 * src/output.c (output_gram): Rely on nritems, not the
2514 0-sentinel. See below.
2515 Use -1 as separator, not 0.
2516 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2517 Rely on -1 as separator in yyrhs, instead of 0.
2518 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2519 twice `Now at end of input', therefore there are two lines less to
2520 expect.
2521
25222001-12-27 Akim Demaille <akim@epita.fr>
2523
2524 * tests/regression.at (Unresolved SR Conflicts):
2525 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2526 below.
2527
25282001-12-27 Akim Demaille <akim@epita.fr>
2529
2530 * src/LR0.c (new_state): Recognize the final state by the fact it
2531 is reached by eoftoken.
2532 (insert_start_shifting_state, insert_eof_shifting_state)
2533 (insert_accepting_state, augment_automaton): Remove, since now
2534 these states are automatically computed from the initial state.
2535 (generate_states): Adjust.
2536 * src/print.c: When reporting a rule number to the user, substract
2537 1, so that the axiom rule is rule 0, and the first user rule is 1.
2538 * src/reduce.c: Likewise.
2539 * src/print_graph.c (print_core): For the time being, just as for
2540 the report, depend upon --trace-flags to dump the full set of
2541 items.
2542 * src/reader.c (readgram): Once the grammar read, insert the rule
2543 0: `$axiom: START-SYMBOL $'.
2544 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2545 number of the states has changed (the final state is no longer
2546 necessarily the last), catch up.
2547
25482001-12-27 Akim Demaille <akim@epita.fr>
2549
2550 Try to make the use of the eoftoken valid. Given that its value
2551 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2552 is used instead of > 0 where appropriate, (ii), depend upon nritems
2553 instead of the 0-sentinel.
2554
2555 * src/gram.h, src/gram.c (nritems): New.
2556 Expected to be duplication of nitems, but for the time being...
2557 * src/reader.c (packgram): Assert nritems and nitems are equal.
2558 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2559 * src/closure.c (print_closure, print_fderives): Likewise.
2560 * src/gram.c (ritem_print): Likewise.
2561 * src/print.c (print_core, print_grammar): Likewise.
2562 * src/print_graph.c: Likewise.
2563
25642001-12-27 Akim Demaille <akim@epita.fr>
2565
2566 * src/main.c (main): If there are complains after grammar
2567 reductions, then output the report anyway if requested, then die.
2568 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2569 * src/reader.c (eoftoken): New.
2570 (parse_token_decl): If the token being defined has value `0', it
2571 is the eoftoken.
2572 (packsymbols): No longer hack `tags' to insert `$' by hand.
2573 Be sure to preserve the value of the eoftoken.
2574 (reader): Make sure eoftoken is defined.
2575 Initialize nsyms to 0: now eoftoken is created just like the others.
2576 * src/print.c (print_grammar): Don't special case the eof token.
2577 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2578 lie anyway, albeit pleasant.
2579 * tests/calc.at: Exercise error messages with eoftoken.
2580 Change the grammar so that empty input is invalid.
2581 Adjust expectations.
2582 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2583
25842001-12-27 Akim Demaille <akim@epita.fr>
2585
2586 * configure.in: Check the protos of strchr ans strspn.
2587 Replace strchr if needed.
2588 * src/system.h: Provide the protos of strchr, strspn and memchr if
2589 missing.
2590 * lib/strchr.c: New.
2591 * src/reader.c (symbols_save): Use strchr.
2592
25932001-12-27 Akim Demaille <akim@epita.fr>
2594
2595 * src/print.c, src/print_graph.c (escape): New.
2596 Use it to quote the TAGS outputs.
2597 * src/print_graph.c (print_state): Now errors are in red, and
2598 reductions in green.
2599 Prefer high to wide: output the state number on a line of its own.
2600
26012001-12-27 Akim Demaille <akim@epita.fr>
2602
2603 * src/state.h, src/state.c (reductions_new): New.
2604 * src/LR0.c (set_state_table): Let all the states have a
2605 `reductions', even if reduced to 0.
2606 (save_reductions): Adjust.
2607 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2608 * src/print.c (print_reductions, print_actions): Adjust.
2609 * src/output.c (action_row): Adjust.
2610
26112001-12-27 Akim Demaille <akim@epita.fr>
2612
2613 * src/state.h, src/state.c (errs_new, errs_dup): New.
2614 * src/LR0.c (set_state_table): Let all the states have an errs,
2615 even if reduced to 0.
2616 * src/print.c (print_errs, print_reductions): Adjust.
2617 * src/output.c (output_actions, action_row): Adjust.
2618 * src/conflicts.c (resolve_sr_conflict): Adjust.
2619
26202001-12-27 Akim Demaille <akim@epita.fr>
2621
2622 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2623
26242001-12-27 Akim Demaille <akim@epita.fr>
2625
2626 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2627 * src/print.c: here.
2628 (lookaheadset, shiftset): New, used as additional storage by
2629 print_reductions.
2630 (print_results): Adjust.
2631 (print_shifts, print_gotos, print_errs): New, extracted from...
2632 (print_actions): here.
2633 * src/print_graph.c (print_actions): Remove dead code.
2634
26352001-12-27 Akim Demaille <akim@epita.fr>
2636
2637 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2638 `$n' and `@n'.
2639
26402001-12-27 Akim Demaille <akim@epita.fr>
2641
2642 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2643 (build_relations): Adjust.
2644
26452001-12-27 Akim Demaille <akim@epita.fr>
2646
2647 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2648 duplication.
2649
26502001-12-27 Akim Demaille <akim@epita.fr>
2651
2652 * src/reader.c (packgram): Catch nitems overflows.
2653
26542001-12-27 Akim Demaille <akim@epita.fr>
2655
2656 * src/files.c, src/files.h (guard_obstack): Remove.
2657 * src/output.c (output): Adjust.
2658 * src/reader.c (parse_braces): New, factoring...
2659 (copy_action, copy_guard): these two which are renamed as...
2660 (parse_action, parse_guard): these.
2661 As a voluntary consequence, using braces around guards is now
2662 mandatory.
2663
26642001-12-27 Akim Demaille <akim@epita.fr>
2665
2666 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2667 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2668 members.
2669 (symbol_list_new): Adjust.
2670 (copy_action): action_line is the first line, not the last.
2671 (copy_guard): Just as for actions, store the `action' only, not
2672 the switch/case/break flesh.
2673 Don't parse the user action that might follow the guard, let...
2674 (readgram): do it, i.e., now, there can be an action after a
2675 guard.
2676 In other words the guard is just explicitly optional.
2677 (packgram): Adjust.
2678 * src/output.c (guards_output): New.
2679 (output_parser): Call it when needed.
2680 (output): Also free the guard and attrs obstacks.
2681 * src/files.c, src/files.h (obstack_save): Remove.
2682 (output_files): Remove.
2683 As a result, if one needs the former `.act' file, using an
2684 appropriate skeleton which requires actions and guards is now
2685 required.
2686 * src/main.c (main): Adjust.
2687 * tests/semantic.at: New.
2688 * tests/regression.at: Use `input.y' as input file name.
2689 Avoid 8+3 problems by requiring input.c when the test needs the
2690 parser.
2691
26922001-12-27 Akim Demaille <akim@epita.fr>
2693
2694 * src/reader.c (symbol_list_new): Be sure to initialize all the
2695 fields.
2696
26972001-12-27 Akim Demaille <akim@epita.fr>
2698
2699 All the hacks using a final pseudo state are now useless.
2700
2701 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2702 * src/lalr.c (nLA): New.
2703 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2704 instead of lookaheadsp from the pseudo state (nstate + 1).
2705
27062001-12-27 Akim Demaille <akim@epita.fr>
2707
2708 * src/output.c (action_row, token_actions): Use a state_t instead
2709 of a integer, and nlookaheads instead of the following state's
2710 lookaheadsp.
2711
27122001-12-27 Akim Demaille <akim@epita.fr>
2713
2714 * src/conflicts.c (log_resolution, flush_shift)
2715 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2716 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2717 (conflicts_print, print_reductions): Use a state_t instead of an
2718 integer when referring to a state.
2719 As much as possible, depend upon nlookaheads, instead of the
2720 `lookaheadsp' member of the following state (since lookaheads of
2721 successive states are successive, the difference between state n + 1
2722 and n served as the number of lookaheads for state n).
2723 * src/lalr.c (add_lookback_edge): Likewise.
2724 * src/print.c (print_core, print_actions, print_state)
2725 (print_results): Likewise.
2726 * src/print_graph.c (print_core, print_actions, print_state)
2727 (print_graph): Likewise.
2728 * src/conflicts.h: Adjust.
2729
27302001-12-27 Akim Demaille <akim@epita.fr>
2731
2732 * src/bison.hairy: Formatting/comment changes.
2733 ANSIfy.
2734 Remove `register' indications.
2735 Add plenty of `static'.
2736
27372001-12-27 Akim Demaille <akim@epita.fr>
2738
2739 * src/output.c (prepare): Drop the muscle `ntbase' which
2740 duplicates ntokens.
2741 * src/bison.simple: Formatting/comment changes.
2742 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2743 is an undocumented synonym.
2744
27452001-12-22 Akim Demaille <akim@epita.fr>
2746
2747 * src/output.c (output_table_data): Change the prototype to use
2748 `int' for array ranges: some invocations do pass an int, not a
2749 short.
2750 Reported by Wayne Green.
2751
27522001-12-22 Akim Demaille <akim@epita.fr>
2753
2754 Some actions of web2c.y are improperly triggered.
2755 Reported by Mike Castle.
2756
2757 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2758 * tests/regression.at (Web2c): Rename as...
2759 (Web2c Report): this.
2760 (Web2c Actions): New.
2761
27622001-12-22 Akim Demaille <akim@epita.fr>
2763
2764 Reductions in web2c.y are improperly reported.
2765 Reported by Mike Castle.
2766
2767 * src/conflicts.c (print_reductions): Fix.
2768 * tests/regression.at (Web2c): New.
2769
27702001-12-18 Akim Demaille <akim@epita.fr>
2771
2772 Some host fail on `assert (!"foo")', which expands to
2773 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2774 Reported by Nelson Beebee.
2775
2776 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2777 `#define it_succeeded 0' and `assert (it_succeeded)'.
2778
27792001-12-17 Marc Autret <autret_m@epita.fr>
2780
2781 * src/bison.simple: Don't hard code the skeleton line and filename.
2782 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2783 New line counter 'skeleton_line' (skeleton-line muscle).
2784
27852001-12-17 Paul Eggert <eggert@twinsun.com>
2786
2787 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2788 YYDEBUG must be defined to a nonzero value.
2789
2790 * src/bison.simple (yytname): Do not assume that the user defines
2791 YYDEBUG to a properly parenthesized expression.
2792
27932001-12-17 Akim Demaille <akim@epita.fr>
2794
2795 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2796 nlookaheads is a new member.
2797 Adjust all users.
2798 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2799 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2800 state.
2801
28022001-12-17 Akim Demaille <akim@epita.fr>
2803
2804 * src/files.h, src/files.c (open_files, close_files): Remove.
2805 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2806 let...
2807 * src/reader.c (reader): Do it.
2808
28092001-12-17 Akim Demaille <akim@epita.fr>
2810
2811 * src/conflicts.c (print_reductions): Formatting changes.
2812
28132001-12-17 Akim Demaille <akim@epita.fr>
2814
2815 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2816 (flush_reduce): New.
2817 (resolve_sr_conflict): Adjust.
2818
28192001-12-17 Akim Demaille <akim@epita.fr>
2820
2821 * src/output.c (output_obstack): Be static and rename as...
2822 (format_obstack): this, to avoid any confusion with files.c's
2823 output_obstack.
2824 * src/reader.h (muscle_obstack): Move to...
2825 * src/output.h: here, since it's defined in output.c.
2826
28272001-12-17 Akim Demaille <akim@epita.fr>
2828
2829 * src/output.c (action_row, save_column, default_goto)
2830 (sort_actions, matching_state, pack_vector): Better variable
2831 locality.
2832
28332001-12-17 Akim Demaille <akim@epita.fr>
2834
2835 * src/output.c: Various formatting changes.
2836
28372001-12-17 Akim Demaille <akim@epita.fr>
2838
2839 * src/files.c (output_files): Free the output_obstack.
2840 * src/main.c (main): Call print and print_graph conditionally.
2841 * src/print.c (print): Work unconditionally.
2842 * src/print_graph.c (print_graph): Work unconditionally.
2843 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2844
28452001-12-16 Marc Autret <autret_m@epita.fr>
2846
2847 * src/output.c (actions_output): Fix. When we use %no-lines,
2848 there is one less line per action.
2849
28502001-12-16 Marc Autret <autret_m@epita.fr>
2851
2852 * src/bison.simple: Remove a useless #line directive.
2853 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2854 * src/output.c (get_lines_number): New.
2855 (output_parser): Adjust, now takes care about the lines of a
2856 output muscles.
2857 Fix line numbering.
2858 (actions_output): Computes the number of lines taken by actions.
2859 (output_master_parser): Insert new skeleton which is the name of
2860 the output parser file name.
2861
28622001-12-15 Marc Autret <autret_m@epita.fr>
2863
2864 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2865
28662001-12-15 Marc Autret <autret_m@epita.fr>
2867
2868 * src/output.c (output_gram): Keep track of the hairy one.
2869
28702001-12-15 Akim Demaille <akim@epita.fr>
2871
2872 Make `make distcheck' work.
2873
2874 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2875 system.h which uses libgettext.h.
2876
28772001-12-15 Akim Demaille <akim@epita.fr>
2878
2879 * src/nullable.c (set_nullable): Useless rules must be skipped,
2880 otherwise, since we range over their symbols, we might look at a
2881 nonterminal which no longer ``exists'', i.e., it is not counted in
2882 `nvars', hence we overflow our arrays.
2883
28842001-12-15 Akim Demaille <akim@epita.fr>
2885
2886 The header can also be produced directly, without any obstack!
2887 Yahoo!
2888
2889 * src/files.c, src/files.h (defines_obstack): Remove.
2890 (compute_header_macro): Global.
2891 (defines_obstack_save): Remove.
2892 * src/reader.c (parse_union_decl): No longer output to
2893 defines_obstack: its content can be found in the `stype' muscle
2894 anyway.
2895 (output_token_translations): Merge into...
2896 (symbols_output): this.
2897 Rename as...
2898 (symbols_save): this.
2899 (reader): Adjust.
2900 * src/output.c (header_output): New.
2901 (output): Call it.
2902
29032001-12-15 Akim Demaille <akim@epita.fr>
2904
2905 * src/reader.c (parse_union_decl): Instead of handling two obstack
2906 simultaneously, use one to define the `stype' muscle, and use the
2907 value of the latter to fill defines_obstack.
2908 (copy_comment): Remove.
2909 (copy_comment2): Work for a single obstack.
2910 Rename as...
2911 (copy_comment): this.
2912
29132001-12-15 Akim Demaille <akim@epita.fr>
2914
2915 * src/lex.c, src/lex.h (xgetc): No longer static.
2916 * src/reader.c (parse_union_decl): Revamp.
2917
29182001-12-15 Akim Demaille <akim@epita.fr>
2919
2920 Still making progress in separating Bison into (i) input, (ii)
2921 process, (iii) output: now we can directly output the parser file
2922 without using table_obstack at all.
2923
2924 * src/files.c, src/files.h (table_obstack): Bye bye.
2925 (parser_file_name): New.
2926 * src/files.c (compute_output_file_names): Compute it.
2927 * src/output.c (actions_output, output_parser)
2928 (output_master_parser): To a file instead of an obstack.
2929
29302001-12-15 Akim Demaille <akim@epita.fr>
2931
2932 Attach actions to rules, instead of pre-outputting them to
2933 actions_obstack.
2934
2935 * src/gram.h (rule_t): action and action_line are new members.
2936 * src/reader.c (symbol_list): Likewise.
2937 (copy_action): Save the actions within the rule.
2938 (packgram): Save them in rule_table.
2939 * src/output.c (actions_output): New.
2940 (output_parser): Use it on `%%actions'.
2941 (output_rule_data): Don't free rule_table.
2942 (output): Do it.
2943 (prepare): Don't save the `action' muscle.
2944 * src/bison.simple: s/%%action/%%actions/.
2945
29462001-12-15 Akim Demaille <akim@epita.fr>
2947
2948 * src/reader.c (copy_action): When --yacc, don't append a `;'
2949 to the user action: let it fail if lacking.
2950 Suggested by Arnold Robbins and Tom Tromey.
2951
29522001-12-14 Akim Demaille <akim@epita.fr>
2953
2954 * src/lex.c (literalchar): Simply return the char you decoded, non
2955 longer mess around with obstacks and int pointers.
2956 Adjust all callers.
2957
29582001-12-14 Akim Demaille <akim@epita.fr>
2959
2960 * src/lex.c (literalchar): Don't escape the special characters,
2961 just decode them, and keep them as char (before, eol was output as
2962 the 2 char string `\n' etc.).
2963 * src/output.c (output_rule_data): Use quotearg to output the
2964 token strings.
2965
29662001-12-13 Paul Eggert <eggert@twinsun.com>
2967
2968 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2969 Do not infringe on the global user namespace when using C++.
2970 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2971 All uses of `fprintf' and `stderr' changed.
2972
2973 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2974
29752001-12-13 Akim Demaille <akim@epita.fr>
2976
2977 The computation of nullable is broken: it doesn't handle empty
2978 RHS's properly.
2979
2980 * tests/torture.at (GNU AWK Grammar): New.
2981 * tests/sets.at (Nullable): New.
2982 * src/nullable.c (set_nullable): Instead of blindly looping over
2983 `ritems', loop over the rules, and then over their rhs's.
2984
2985 Work around Autotest bugs.
2986
2987 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2988 frame, because Autotest understand lines starting with a `+' as
2989 traces from the shell. Then, they are not processed properly.
2990 Admittedly an Autotest bug, but we don't have time to wait for
2991 Autotest to catch up.
2992 * tests/regression.at (Broken Closure): Adjust to the new table
2993 frames.
2994 Move to...
2995 * tests/sets.at: here.
2996
29972001-12-13 Akim Demaille <akim@epita.fr>
2998
2999 * src/closure.c (closure): Use nrules instead of playing tricks
3000 with BITS_PER_WORD.
3001
30022001-12-13 Akim Demaille <akim@epita.fr>
3003
3004 * src/print.c (print_actions): Output the handling of `$' as the
3005 traces do: shifting the token EOF. Before EOF was treated as a
3006 nonterminal.
3007 * tests/regression.at: Adjust some tests.
3008 * src/print_graph.c (print_core): Complete the set of items via
3009 closure. The next-to-final and final states are still unsatisfying,
3010 but that's to be addressed elsewhere.
3011 No longer output the rule numbers, but do output the state number.
3012 A single loop for the shifts + gotos is enough, but picked a
3013 distinct color for each.
3014 (print_graph): Initialize and finalize closure.
3015
30162001-12-13 Akim Demaille <akim@epita.fr>
3017
3018 * src/reader.c (readgram): Remove dead code, an strip useless
3019 braces.
3020 (get_type): Remove, unused.
3021
30222001-12-12 Akim Demaille <akim@epita.fr>
3023
3024 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3025 on that of lib/error.c.
3026
30272001-12-12 Akim Demaille <akim@epita.fr>
3028
3029 Some hosts don't like `/' in includes.
3030
3031 * src/system.h: Include libgettext.h without qualifying the path.
3032 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3033 $(top_srcdir).
3034
30352001-12-11 Marc Autret <autret_m@epita.fr>
3036
3037 * src/output.c (output_parser): Remove useless muscle.
3038
30392001-12-11 Marc Autret <autret_m@epita.fr>
3040
3041 * src/bison.simple: Remove #line just before %%epilogue. It
3042 is now handled in ...
3043 * src/reader.c (read_additionnal_code): Add the output of a
3044 #line for the epilogue.
3045
30462001-12-10 Marc Autret <autret_m@epita.fr>
3047
3048 * src/reader.c (copy_definition): Re-use CPP-outed code which
3049 replace precedent remove.
3050 * src/bison.simple: Remove #line before %%prologue because
3051 %%input-line is wrong at this time.
3052
30532001-12-10 Marc Autret <autret_m@epita.fr>
3054
3055 * src/reader.c (symbols_output): Clean up.
3056 * src/output.c (output_gram, output): Clean up.
3057
30582001-12-10 Akim Demaille <akim@epita.fr>
3059
3060 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3061 * src/LR0.c (set_state_table): here.
3062 * src/lalr.c (lalr): Call it.
3063
30642001-12-10 Akim Demaille <akim@epita.fr>
3065
3066 * src/state.h (shifts): Remove the `number' member: shifts are
3067 attached to state, hence no longer need to be labelled with a
3068 state number.
3069
30702001-12-10 Akim Demaille <akim@epita.fr>
3071
3072 Now that states have a complete set of members, the linked list of
3073 shifts is useless: just fill directly the state's shifts member.
3074
3075 * src/state.h (shifts): Remove the `next' member.
3076 * src/LR0.c (first_state, last_state): Remove.
3077 Adjust the callers.
3078 (augment_automaton): Don't look for the shifts that must be added
3079 a shift on EOF: it is those of the state we looked for! But now,
3080 since shifts are attached, it is no longer needed to looking
3081 merely by its id: its number.
3082
30832001-12-10 Akim Demaille <akim@epita.fr>
3084
3085 * src/LR0.c (augment_automaton): Better variable locality.
3086 Remove an impossible branch: if there is a state corresponding to
3087 the start symbol being shifted, then there is shift for the start
3088 symbol from the initial state.
3089
30902001-12-10 Akim Demaille <akim@epita.fr>
3091
3092 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3093 only when appropriate: when insert_start_shifting_state' is not
3094 invoked.
3095 * tests/regression.at (Rule Line Numbers): Adjust.
3096
30972001-12-10 Akim Demaille <akim@epita.fr>
3098
3099 * src/LR0.c (augment_automaton): Now that all states have shifts,
3100 merge the two cases addition shifts to the initial state.
3101
31022001-12-10 Akim Demaille <akim@epita.fr>
3103
3104 * src/lalr.c (set_state_table): Move to...
3105 * src/LR0.c: here.
3106 * src/lalr.c (lalr): Don't call it...
3107 * src/LR0.c (generate_states): do it.
3108 * src/LR0.h (first_state): Remove, only the table is used.
3109
31102001-12-10 Akim Demaille <akim@epita.fr>
3111
3112 * src/LR0.h (first_shift, first_reduction): Remove.
3113 * src/lalr.c: Don't use first_shift: find shifts through the
3114 states.
3115
31162001-12-10 Akim Demaille <akim@epita.fr>
3117
3118 * src/LR0.c: Attach shifts to states as soon as they are
3119 computed.
3120 * src/lalr.c (set_state_table): Instead of assigning shifts to
3121 state, just assert that the mapping was properly done.
3122
31232001-12-10 Akim Demaille <akim@epita.fr>
3124
3125 * src/LR0.c (insert_start_shift): Rename as...
3126 (insert_start_shifting_state): this.
3127 (insert_eof_shifting_state, insert_accepting_state): New.
3128 (augment_automaton): Adjust.
3129 Better locality of the variables.
3130 When looking if the start_symbol is shifted from the initial
3131 state, using `while (... symbol != start_symbol ...)' sounds
3132 better than `while (... symbol < start_symbol ...)': If fail
3133 to see how the order between symbols could be relevant!
3134
31352001-12-10 Akim Demaille <akim@epita.fr>
3136
3137 * src/getargs.h: Don't declare `spec_name_prefix' and
3138 `spec_file_prefix', declared by src/files.h.
3139 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3140 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3141 * src/output.c (prepare): Adjust.
3142 * src/reader.c (symbols_output): Likewise.
3143 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3144
31452001-12-10 Akim Demaille <akim@epita.fr>
3146
3147 * src/muscle_tab.c (muscle_init): NULL is a better default than
3148 `"0"'.
3149
31502001-12-10 Akim Demaille <akim@epita.fr>
3151
3152 * src/reader.c (reader): Calling symbols_output once is enough.
3153
31542001-12-10 Akim Demaille <akim@epita.fr>
3155
3156 Now that states have a complete set of members, the linked list of
3157 reductions is useless: just fill directly the state's reductions
3158 member.
3159
3160 * src/state.h (struct reductions): Remove member `number' and
3161 `next'.
3162 * src/LR0.c (first_reduction, last_reduction): Remove.
3163 (save_reductions): Don't link the new reductions, store them in
3164 this_state.
3165 * src/lalr.c (set_state_table): No need to attach reductions to
3166 states, it's already done.
3167 * src/output.c (output_actions): No longer free the shifts, then
3168 the reductions, then the states: free all the states and their
3169 members.
3170
31712001-12-10 Akim Demaille <akim@epita.fr>
3172
3173 * src/options.c (OPTN, DRTV, BOTH): New.
3174 (option_table): Use them.
3175
3176 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3177 the job of system.h.
3178 * src/options.c: Don't include stdio.h and xalloc.h for the same
3179 reasons.
3180
31812001-12-10 Akim Demaille <akim@epita.fr>
3182
3183 * src/output.c (output, prepare): Make sure the values of the
3184 muscles `action' and `prologue' are 0-terminated.
3185
31862001-12-10 Akim Demaille <akim@epita.fr>
3187
3188 Clean up GCC warnings.
3189
3190 * src/reader.c (copy_action): `buf' is not used.
3191 (parse_skel_decl): Be static.
3192 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3193 * src/options.h (create_long_option_table): Have a real prototype.
3194 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3195 (hash_delete_at): Return const void *.
3196 Adjust casts to preserve the const.
3197
31982001-12-10 Akim Demaille <akim@epita.fr>
3199
3200 * configure.in: Require 2.52g.
3201 M4 is not needed, but AUTOM4TE is.
3202 * m4/m4.m4: Remove.
3203 * tests/Makefile.am: Adjust.
3204
32052001-12-10 Akim Demaille <akim@epita.fr>
3206
3207 One structure for states is enough, even though theoretically
3208 there are LR(0) states and LALR(1) states.
3209
3210 * src/lalr.h (state_t): Remove.
3211 (state_table): Be state_t **, not state_t *.
3212 * src/state.h (core, CORE_ALLOC): Rename as...
3213 (state_t, STATE_ALLOC): this.
3214 Add the LALR(1) members: shifts, reductions, errs.
3215 * src/LR0.c (state_table): Rename as...
3216 (state_hash): this, to avoid name clashes with the global
3217 `state_table'.
3218 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3219 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3220
32212001-12-10 Akim Demaille <akim@epita.fr>
3222
3223 Bison dumps core on bash.y.
3224 Reported by Pascal Bart.
3225
3226 * src/warshall.c (bitmatrix_print): New.
3227 (TC): Use it.
3228 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3229 j must be the outer loop.
3230 * tests/regression.at (Broken Closure): New.
3231
32322001-12-05 Akim Demaille <akim@epita.fr>
3233
3234 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3235 its argument.
3236