]> git.saurik.com Git - bison.git/blame - ChangeLog
GCJ's parser requires the tokens to be defined before the prologue.
[bison.git] / ChangeLog
CommitLineData
69078d4b
AD
12002-06-10 Akim Demaille <akim@epita.fr>
2
3 GCJ's parser requires the tokens to be defined before the prologue.
4
5 * data/bison.simple: Output the token definition before the user's
6 prologue.
7 * tests/regression.at (Braces parsing, Duplicate string)
8 (Mixing %token styles): Check the output from bison.
9 (Early token definitions): New.
10
5e424082
AD
112002-06-10 Akim Demaille <akim@epita.fr>
12
13 * src/symtab.c (symbol_user_token_number_set): Don't complain when
14 assigning twice the same user number to a token, so that we can
15 use it in...
16 * src/lex.c (lex): here.
17 Also use `symbol_class_set' instead of hand written code.
18 * src/reader.c (parse_assoc_decl): Likewise.
19
44536b35
AD
202002-06-10 Akim Demaille <akim@epita.fr>
21
22 * src/symtab.c, src/symtab.c (symbol_class_set)
23 (symbol_user_token_number_set): New.
24 * src/reader.c (parse_token_decl): Use them.
25 Use a switch instead of ifs.
26 Use a single argument.
27
8b9f2372
AD
282002-06-10 Akim Demaille <akim@epita.fr>
29
30 Remove `%thong' support as it is undocumented, unused, duplicates
31 `%token's job, and creates useless e-mail traffic with people who
32 want to know what it is, why it is undocumented, unused, and
33 duplicates `%token's job.
34
35 * src/reader.c (parse_thong_decl): Remove.
36 * src/options.c (option_table): Remove "thong".
37 * src/lex.h (tok_thong): Remove.
38
3ae2b51f
AD
392002-06-10 Akim Demaille <akim@epita.fr>
40
41 * src/symtab.c, src/symtab.c (symbol_type_set)
42 (symbol_precedence_set): New.
43 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
44 (value_components_used): Remove, unused.
45
2f1afb73
AD
462002-06-09 Akim Demaille <akim@epita.fr>
47
48 Move symbols handling code out of the reader.
49
50 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
51 (axiom): Move to...
52 * src/symtab.h, src/symtab.c: here.
53
54 * src/gram.c (start_symbol): Remove: use startsymbol->number.
55 * src/reader.c (startval): Rename as...
56 * src/symtab.h, src/symtab.c (startsymbol): this.
57 * src/reader.c: Adjust.
58
59 * src/reader.c (symbol_check_defined, symbol_make_alias)
60 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
61 (token_translations_init)
62 Move to...
63 * src/symtab.c: here.
64 * src/reader.c (packsymbols): Move to...
65 * src/symtab.h, src/symtab.c (symbols_pack): here.
66 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
67 argument.
68
e9bca3ad
AD
692002-06-03 Akim Demaille <akim@epita.fr>
70
71 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
72 then statements.
73
86eff183
AD
742002-06-03 Akim Demaille <akim@epita.fr>
75
76 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
77 structs with non literals.
78 * src/scan-skel.l: never-interactive.
79 * src/conflicts.c (enum conflict_resolution_e): No trailing
80 comma.
81 * src/getargs.c (usage): Split long literal strings.
82 Reported by Hans Aberg.
83
717be197
AD
842002-05-28 Akim Demaille <akim@epita.fr>
85
86 * data/bison.c++: Use C++ ostreams.
87 (cdebug_): New member.
88
670ddffd
AD
892002-05-28 Akim Demaille <akim@epita.fr>
90
91 * src/output.c (output_skeleton): Be sure to allocate enough room
92 for `/' _and_ for `\0' in full_skeleton.
93
769b430f
AD
942002-05-28 Akim Demaille <akim@epita.fr>
95
96 * data/bison.c++: Catch up with bison.simple:
97 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
98 and Paul Eggert <eggert@twinsun.com>: `error' handing.
99 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
100 and popping traces.
101
7067cb36
PH
1022002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
103
104 * src/output.c (output_skeleton): Put an explicit path in front of
105 the skeleton file name, rather than relying on the -I directory,
106 to partially alleviate effects of having a skeleton file lying around
107 in the current directory.
769b430f 108
4a713ec2
PH
1092002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
110
769b430f 111 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
112 obstack_printf should be obstack_fgrow1.
113
b408954b
AD
1142002-05-26 Akim Demaille <akim@epita.fr>
115
116 * src/state.h (state_t): `solved_conflicts' is a new member.
117 * src/LR0.c (new_state): Set it to 0.
118 * src/conflicts.h, src/conflicts.c (print_conflicts)
119 (free_conflicts, solve_conflicts): Rename as...
120 (conflicts_print, conflicts_free, conflicts_solve): these.
121 Adjust callers.
122 * src/conflicts.c (enum conflict_resolution_e)
123 (solved_conflicts_obstack): New, used by...
124 (log_resolution): this.
125 Adjust to attach the conflict resolution to each state.
126 Complete the description with the precedence/associativity
127 information.
128 (resolve_sr_conflict): Adjust.
129 * src/print.c (print_state): Output its solved_conflicts.
130 * tests/conflicts.at (Unresolved SR Conflicts)
131 (Solved SR Conflicts): Exercise --report=all.
132
a49aecd5
AD
1332002-05-26 Akim Demaille <akim@epita.fr>
134
135 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
136 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
137 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
138 (token_number_t, item_number_as_token_number)
139 (token_number_as_item_number, muscle_insert_token_number_table):
140 Rename as...
141 (symbol_number_t, item_number_as_symbol_number)
142 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
143 these, since it is more appropriate.
144
5504898e
AD
1452002-05-26 Akim Demaille <akim@epita.fr>
146
147 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
148 `Error:' lines.
149 * data/bison.simple (yystos) [YYDEBUG]: New.
150 (yyparse) [YYDEBUG]: Display the symbols which are popped during
151 error recovery.
152 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
153
ec3bc396
AD
1542002-05-25 Akim Demaille <akim@epita.fr>
155
156 * doc/bison.texinfo (Debugging): Split into...
157 (Tracing): this new section, its former contents, and...
158 (Understanding): this new section.
159 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
160 by...
161 (report_flag): this.
162 Adjust all dependencies.
163 (report_args, report_types, report_argmatch): New.
164 (usage, getargs): Report/support -r, --report.
165 * src/options.h
166 (struct option_table_struct): Rename as..,
167 (struct option_table_s): this.
168 Rename the `set_flag' member to `flag' to match with getopt_long's
169 struct.
170 * src/options.c (option_table): Split verbose into an entry for
171 %verbose, and another for --verbose.
172 Support --report/-r, so remove -r from the obsolete --raw.
173 * src/print.c: Attach full item sets and lookaheads reports to
174 report_flag instead of trace_flag.
175 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
176
78df8250
PE
1772002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
178 and Paul Eggert <eggert@twinsun.com>
769b430f 179
78df8250
PE
180 * data/bison.simple (yyparse): Correct error handling to conform to
181 POSIX and yacc. Specifically, after syntax error is discovered,
182 do not reduce further before shifting the error token.
183 Clean up the code a bit by removing the labels yyerrdefault,
184 yyerrhandle, yyerrpop.
185 * NEWS: Document the above.
186
c0c9ea05
PH
1872002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
188
189 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
190 type; it isn't always big enough, since it doesn't necessarily
191 include non-terminals.
769b430f 192 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
193 the latter can be removed.
194 (yy_token_number_type): Remove, only one use.
195 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
196 don't use TokenNumberType as element type.
769b430f 197
c0c9ea05
PH
198 * tests/regression.at: Modify expected output to agree with change
199 to yyr1 and yytranslate.
769b430f 200
6390a83f
FK
2012002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
202
203 * src/reader.c (parse_action): Use copy_character instead of
204 obstack_1grow.
205
db7c8e9a
AD
2062002-05-13 Akim Demaille <akim@epita.fr>
207
208 * tests/regression.at (Token definitions): Prototype yylex and
209 yyerror.
210
fcc61800
PH
2112002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
212
158c687b 213 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
214 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
215 32-bit arithmetic.
216 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
217
5683e9b2
AD
2182002-05-07 Akim Demaille <akim@epita.fr>
219
220 * tests/synclines.at: Be sure to prototype yylex and yyerror to
221 avoid GCC warnings.
222
0c2d3f4c
AD
2232002-05-07 Akim Demaille <akim@epita.fr>
224
225 Kill GCC warnings.
226
227 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
228 over the RHS of each rule.
229 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
230 * src/state.h (state_t): Member `nitems' is unsigned short.
231 * src/LR0.c (get_state): Adjust.
232 * src/reader.c (packgram): Likewise.
233 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
234 `Type'.
235 (muscle_insert_int_table): Remove, unused.
236 (prepare_rules): Remove `max'.
237
1565b720
AD
2382002-05-06 Akim Demaille <akim@epita.fr>
239
240 * src/closure.c (print_firsts): Display of the symbol tags.
241 (bitmatrix_print): Move to...
242 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
243 here.
244 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
245
cfaee611
AD
2462002-05-06 Akim Demaille <akim@epita.fr>
247
248 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
249 hash_do_for_each.
250
458be8e0
AD
2512002-05-06 Akim Demaille <akim@epita.fr>
252
253 * src/LR0.c (new_state, get_state): Instead of using the global
254 `kernel_size' and `kernel_base', have two new arguments:
255 `core_size' and `core'.
256 Adjust callers.
257
a900a624
AD
2582002-05-06 Akim Demaille <akim@epita.fr>
259
260 * src/reader.c (packgram): No longer end `ritem' with a 0
261 sentinel: it is not used.
262
d4e7d3a1
AD
2632002-05-05 Akim Demaille <akim@epita.fr>
264
265 New experimental feature: display the lookaheads in the report and
266 graph.
267
268 * src/print (print_core): When --trace-flag, display the rules
269 lookaheads.
270 * src/print_graph.c (print_core): Likewise.
271 Swap the arguments.
272 Adjust caller.
273
39ceb25b
AD
2742002-05-05 Akim Demaille <akim@epita.fr>
275
276 * tests/torture.at (Many lookaheads): New test.
277
5372019f
AD
2782002-05-05 Akim Demaille <akim@epita.fr>
279
280 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
281 (GENERATE_MUSCLE_INSERT_TABLE): this.
282 (output_int_table, output_unsigned_int_table, output_short_table)
283 (output_token_number_table, output_item_number_table): Replace with...
284 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
285 (muscle_insert_short_table, muscle_insert_token_number_table)
286 (muscle_insert_item_number_table): these.
287 Adjust all callers.
288 (prepare_tokens): Don't free `translations', since...
289 * src/reader.h, src/reader.c (grammar_free): do it.
290 Move to...
291 * src/gram.h, src/gram.c (grammar_free): here.
292 * data/bison.simple, data/bison.c++: b4_token_number_max is now
293 b4_translate_max.
294
5df5f6d5
AD
2952002-05-05 Akim Demaille <akim@epita.fr>
296
297 * src/output.c (output_unsigned_int_table): New.
298 (prepare_rules): `i' is unsigned.
299 `prhs', `rline', `r2' are unsigned int.
300 Rename muscle `rhs_number_max' as `rhs_max'.
301 Output muscles `prhs_max', `rline_max', and `r2_max'.
302 Free rline and r1.
303 * data/bison.simple, data/bison.c++: Adjust to use these muscles
304 to compute types instead of constant types.
305 * tests/regression.at (Web2c Actions): Adjust.
306
b87f8b21
AD
3072002-05-04 Akim Demaille <akim@epita.fr>
308
309 * src/symtab.h (SALIAS, SUNDEF): Rename as...
310 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
311 Adjust dependencies.
312 * src/output.c (token_definitions_output): Be sure not to output a
313 `#define 'a'' when fed with `%token 'a' "a"'.
314 * tests/regression.at (Token definitions): New.
315
8bb936e4
PE
3162002-05-03 Paul Eggert <eggert@twinsun.com>
317
318 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
319 for K&R C.
320
3212002-05-03 gettextize <bug-gnu-gettext@gnu.org>
322
323 * Makefile.am (SUBDIRS): Remove intl.
324 (EXTRA_DIST): Add config/config.rpath.
325
53c71a12
AD
3262002-05-03 Akim Demaille <akim@epita.fr>
327
328 * data/bison.simple (m4_if): Don't output empty enums.
329 And actually, output valid enum definitions :(.
330
289dd0cf
AD
3312002-05-03 Akim Demaille <akim@epita.fr>
332
333 * configure.bat: Remove, completely obsolete.
334 * Makefile.am (EXTRA_DIST): Adjust.
335 Don't distribute config.rpath...
336 * config/Makefile.am (EXTRA_DIST): Do it.
337
db85e524
AD
3382002-05-03 Akim Demaille <akim@epita.fr>
339
340 * configure.in (GETTEXT_VERSION): New.
341 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
342
83ccf991
AD
3432002-05-03 Akim Demaille <akim@epita.fr>
344
345 * data/bison.simple (b4_token_enum): New.
346 (b4_token_defines): Use it to output tokens both as #define and
347 enums.
348 Suggested by Paul Eggert.
349 * src/output.c (token_definitions_output): Don't output spurious
350 white spaces.
351
1f418995
AD
3522002-05-03 Akim Demaille <akim@epita.fr>
353
354 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
355
45119f04
RA
3562002-05-02 Robert Anisko <robert@lrde.epita.fr>
357
358 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
359 Update the stack class, give a try to deque as the default container.
360
b2d52318
AD
3612002-05-02 Akim Demaille <akim@epita.fr>
362
363 * data/bison.simple (yyparse): Do not implement @$ = @1.
364 (YYLLOC_DEFAULT): Adjust to do it.
365 * doc/bison.texinfo (Location Default Action): Fix.
366
3a8b4109
AD
3672002-05-02 Akim Demaille <akim@epita.fr>
368
369 * src/reader.c (parse_braces): Merge into...
370 (parse_action): this.
371
84614e13
AD
3722002-05-02 Akim Demaille <akim@epita.fr>
373
374 * configure.in (ALL_LINGUAS): Remove.
375 * po/LINGUAS, hr.po: New.
376
fdbcd8e2
AD
3772002-05-02 Akim Demaille <akim@epita.fr>
378
379 Remove the so called hairy (semantic) parsers.
380
381 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
382 * src/gram.h, src/gram.c (semantic_parser): Remove.
383 (rule_t): Remove the guard and guard_line members.
384 * src/lex.h (token_t): remove tok_guard.
385 * src/options.c (option_table): Remove %guard and %semantic_parser
386 support.
387 * src/output.c, src/output.h (guards_output): Remove.
388 (prepare): Adjust.
389 (token_definitions_output): Don't output the `T'
390 tokens (???).
391 (output_skeleton): Don't output the guards.
392 * src/files.c, src/files.c (attrsfile): Remove.
393 * src/reader.c (symbol_list): Remove the guard and guard_line
394 members.
395 Adjust dependencies.
396 (parse_guard): Remove.
397 * data/bison.hairy: Remove.
398 * doc/bison.texinfo (Environment Variables): Remove occurrences of
399 BISON_HAIRY.
400
82b6cb3f
AD
4012002-05-02 Akim Demaille <akim@epita.fr>
402
403 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
404 (parse_guard): Rename the formal argument `stack_offset' as
405 `rule_length', which is more readable.
406 Adjust callers.
407 (copy_at, copy_dollar): Instead of outputting the hard coded
408 values of $$, $n and so forth, output invocation to b4_lhs_value,
409 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
410 Note: this patch partially drops `semantic-parser' support: it
411 always does `rule_length - n', where semantic parsers ought to
412 always use `-n'.
82b6cb3f
AD
413 * data/bison.simple, data/bison.c++ (b4_lhs_value)
414 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
415
6cbfbcc5
AD
4162002-05-02 Akim Demaille <akim@epita.fr>
417
418 * configure.in (AC_INIT): Bump to 1.49b.
419 (AM_INIT_AUTOMAKE): Short invocation.
420
b8548114
AD
4212002-05-02 Akim Demaille <akim@epita.fr>
422
423 Version 1.49a.
424
c20cd1fa
AD
4252002-05-01 Akim Demaille <akim@epita.fr>
426
427 * src/skeleton.h: Remove.
428
8a9566d4
AD
4292002-05-01 Akim Demaille <akim@epita.fr>
430
431 * src/skeleton.h: Fix the #endif.
432 Reported by Magnus Fromreide.
433
8c6d399a
PE
4342002-04-26 Paul Eggert <eggert@twinsun.com>
435
436 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
437 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 438 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 439
2b7ed18a
RA
4402002-04-25 Robert Anisko <robert@lrde.epita.fr>
441
442 * src/scan-skel.l: Postprocess quadrigraphs.
443
444 * src/reader.c (copy_character): New function, used to output
445 single characters while replacing `[' and `]' with quadrigraphs, to
446 avoid troubles with M4 quotes.
447 (copy_comment): Output characters with copy_character.
448 (read_additionnal_code): Likewise.
449 (copy_string2): Likewise.
450 (copy_definition): Likewise.
451
452 * tests/calc.at: Exercise M4 quoting.
453
34a89c50
AD
4542002-04-25 Akim Demaille <akim@epita.fr>
455
456 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
457 between `!' and the command.
458 Reported by Paul Eggert.
459
0dd1580a
RA
4602002-04-24 Robert Anisko <robert@lrde.epita.fr>
461
462 * tests/calc.at: Exercise prologue splitting.
463
464 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
465 `b4_post_prologue' instead of `b4_prologue'.
466
467 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
468 muscles.
469 (output): Free pre_prologue_obstack and post_prologue_obstack.
470 * src/files.h, src/files.c (attrs_obstack): Remove.
471 (pre_prologue_obstack, post_prologue_obstack): New.
472 * src/reader.c (copy_definition): Add a parameter to specify the
473 obstack to fill, instead of using attrs_obstack unconditionally.
474 (read_declarations): Pass pre_prologue_obstack to copy_definition if
475 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
476
83c1796f
PE
4772002-04-23 Paul Eggert <eggert@twinsun.com>
478
479 * data/bison.simple: Remove unnecessary commentary and white
480 space differences from 1_29-branch.
481 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
482
483 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
484 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
485 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
486 constructors or destructors.
487
488 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
489
1207eeac
AD
4902002-04-23 Akim Demaille <akim@epita.fr>
491
492 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
493 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
494 location with columns.
495 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
496 All reported by Paul Eggert.
497
78ab8f67
AD
4982002-04-22 Akim Demaille <akim@epita.fr>
499
500 * src/reduce.c (dump_grammar): Move to...
501 * src/gram.h, src/gram.c (grammar_dump): here.
502 Be sure to separate long item numbers.
503 Don't read the members of a rule's prec if its nil.
504
133c20e2
AD
5052002-04-22 Akim Demaille <akim@epita.fr>
506
507 * src/output.c (table_size, table_grow): New.
508 (MAXTABLE): Remove, replace uses with table_size.
509 (pack_vector): Instead of dying when the table is too big, grow it.
510
9515e8a7
AD
5112002-04-22 Akim Demaille <akim@epita.fr>
512
513 * data/bison.simple (yyr1): Its type is that of a token number.
514 * data/bison.c++ (r1_): Likewise.
515 * tests/regression.at (Web2c Actions): Adjust.
516
23c5a174
AD
5172002-04-22 Akim Demaille <akim@epita.fr>
518
519 * src/reader.c (token_translations_init): 256 is now the default
520 value for the error token, i.e., it will be assigned another
521 number if the user assigned 256 to one of her tokens.
522 (reader): Don't force 256 to error.
523 * doc/bison.texinfo (Symbols): Adjust.
524 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
525 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
526 etc. instead of 10, 20, 30 (which was used to `jump' over error
527 (256) and undefined (2)).
528
5fbb0954
AD
5292002-04-22 Akim Demaille <akim@epita.fr>
530
531 Propagate more token_number_t.
532
533 * src/gram.h (token_number_as_item_number)
534 (item_number_as_token_number): New.
535 * src/output.c (GENERATE_OUTPUT_TABLE): New.
536 Use it to create output_item_number_table and
537 output_token_number_table.
538 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
539 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
540 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
541 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
542
4f940944
AD
5432002-04-22 Akim Demaille <akim@epita.fr>
544
545 * src/output.h, src/output.c (get_lines_number): Remove.
546
3ded9a63
AD
5472002-04-19 Akim Demaille <akim@epita.fr>
548
549 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
550 as Lex/Flex'.
551 (Debugging): More details about enabling the debugging features.
552 (Table of Symbols): Describe $$, $n, @$, and @n.
553 Suggested by Tim Josling.
554
e0c471a9
AD
5552002-04-19 Akim Demaille <akim@epita.fr>
556
557 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
558
fecc10cd
AD
5592002-04-10 Akim Demaille <akim@epita.fr>
560
561 * src/system.h: Rely on HAVE_LIMITS_H.
562 Suggested by Paul Eggert.
563
51dec47b
AD
5642002-04-09 Akim Demaille <akim@epita.fr>
565
566 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
567 full stderr, and strip it according to the bison options, instead
568 of composing the error message from different bits.
569 This makes it easier to check for several error messages.
570 Adjust all the invocations.
571 Add an invocation exercising the error token.
572 Add an invocation demonstrating a stupid error message.
573 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
574 Adjust the tests.
575 Error message are for stderr, not stdout.
576
007a50a4
AD
5772002-04-09 Akim Demaille <akim@epita.fr>
578
579 * src/gram.h, src/gram.c (error_token_number): Remove, use
580 errtoken->number.
581 * src/reader.c (reader): Don't specify the user token number (2)
582 for $undefined, as it uselessly prevents using it.
583 * src/gram.h (token_number_t): Move to...
584 * src/symtab.h: here.
585 (state_t.number): Is a token_number_t.
586 * src/print.c, src/reader.c: Use undeftoken->number instead of
587 hard coded 2.
588 (Even though this 2 is not the same as above: the number of the
589 undeftoken remains being 2, it is its user token number which
590 might not be 2).
591 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
592 `user_token_number_max'.
593 Output `undef_token_number'.
594 * data/bison.simple, data/bison.c++: Use them.
595 Be sure to map invalid yylex return values to
596 `undef_token_number'. This saves us from gratuitous SEGV.
597
598 * tests/conflicts.at (Solved SR Conflicts)
599 (Unresolved SR Conflicts): Adjust.
600 * tests/regression.at (Web2c Actions): Adjust.
601
06446ccf
AD
6022002-04-08 Akim Demaille <akim@epita.fr>
603
604 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
605 Adding #line.
606 Remove the duplicate `typedefs'.
607 (RhsNumberType): Fix the declaration and various other typos.
608 Use __ofile__.
609 * data/bison.simple: Use __ofile__.
610 * src/scan-skel.l: Handle __ofile__.
611
62a3e4f0
AD
6122002-04-08 Akim Demaille <akim@epita.fr>
613
614 * src/gram.h (item_number_t): New, the type of item numbers in
615 RITEM. Note that it must be able to code symbol numbers as
616 positive number, and the negation of rule numbers as negative
617 numbers.
618 Adjust all dependencies (pretty many).
619 * src/reduce.c (rule): Remove this `short *' pointer: use
620 item_number_t.
621 * src/system.h (MINSHORT, MAXSHORT): Remove.
622 Include `limits.h'.
623 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
624 (shortcpy): Remove.
625 (MAXTABLE): Move to...
626 * src/output.c (MAXTABLE): here.
627 (prepare_rules): Use output_int_table to output rhs.
628 * data/bison.simple, data/bison.c++: Adjust.
629 * tests/torture.at (Big triangle): Move the limit from 254 to
630 500.
631 * tests/regression.at (Web2c Actions): Ajust.
632
633 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
634 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
635 passes, but produces negative #line number, once fixed, GCC is
636 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
637 C), it passes.
638 * src/state.h (state_h): Code input lines on ints, not shorts.
639
bb88b0fc
AD
6402002-04-08 Akim Demaille <akim@epita.fr>
641
642 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
643 and then the grammar.
644
9a636f47
AD
6452002-04-08 Akim Demaille <akim@epita.fr>
646
647 * src/system.h: No longer using strndup.
648
680e8701
AD
6492002-04-07 Akim Demaille <akim@epita.fr>
650
651 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
652 * src/output.c (output_table_data): Return the longest number.
653 (prepare_tokens): Output `token_number_max').
654 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
655 New.
656 Use them to define yy_token_number_type/TokenNumberType.
657 Use this type for yytranslate.
658 * tests/torture.at (Big triangle): Push the limit from 124 to
659 253.
660 * tests/regression.at (Web2c Actions): Adjust.
661
817e9f41
AD
6622002-04-07 Akim Demaille <akim@epita.fr>
663
664 * tests/torture.at (Big triangle): New.
665 (GNU AWK Grammar, GNU Cim Grammar): Move to...
666 * tests/existing.at: here.
667
5123689b
AD
6682002-04-07 Akim Demaille <akim@epita.fr>
669
670 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
671 nritems.
672 Adjust dependencies.
673
f3849179
AD
6742002-04-07 Akim Demaille <akim@epita.fr>
675
676 * src/reader.c: Normalize increments to prefix form.
677
bd02036a
AD
6782002-04-07 Akim Demaille <akim@epita.fr>
679
680 * src/reader.c, symtab.c: Remove debugging code.
681
db8837cb
AD
6822002-04-07 Akim Demaille <akim@epita.fr>
683
684 Rename all the `bucket's as `symbol_t'.
685
686 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
687 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
688 * src/symtab.c, src/symtab.h (bucket): Rename as...
689 (symbol_t): this.
690 (symbol_list_new, bucket_check_defined, bucket_make_alias)
691 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
692 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
693 (buckets_new, buckets_free, buckets_do): Rename as...
694 (symbol_list_new, symbol_check_defined, symbol_make_alias)
695 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
696 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
697 (symbols_new, symbols_free, symbols_do): these.
698
72a23c97
AD
6992002-04-07 Akim Demaille <akim@epita.fr>
700
701 Use lib/hash for the symbol table.
702
703 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
704 EOF.
705 * src/lex.c (lex): Set the `number' member of new terminals.
706 * src/reader.c (bucket_check_defined, bucket_make_alias)
707 (bucket_check_alias_consistence, bucket_translation): New.
708 (reader, grammar_free, readgram, token_translations_init)
709 (packsymbols): Adjust.
710 (reader): Number the predefined tokens.
711 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
712 for predefined tokens.
713 * src/symtab.h (bucket): Remove all the hash table related
714 members.
715 * src/symtab.c (symtab): Replace by...
716 (bucket_table): this.
717 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
718 (buckets_new, buckets_do): New.
719
280a38c3
AD
7202002-04-07 Akim Demaille <akim@epita.fr>
721
722 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
723 (start_symbol, max_user_token_number, semantic_parser)
724 (error_token_number): Initialize.
725 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
726 Initialize.
727 (reader): Don't.
728 (errtoken, eoftoken, undeftoken, axiom): Extern.
729
03b31c0c
AD
7302002-04-07 Akim Demaille <akim@epita.fr>
731
732 * src/gram.h (rule_s): prec and precsym are now pointers
733 to the bucket giving the priority/associativity.
734 Member `associativity' removed: useless.
735 * src/reduce.c, src/conflicts.c: Adjust.
736
8b3df748
AD
7372002-04-07 Akim Demaille <akim@epita.fr>
738
739 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
740 Properly escape the symbols' TAG when outputting them.
741
e601aa1d
AD
7422002-04-07 Akim Demaille <akim@epita.fr>
743
744 * src/lalr.h (LA): Is a bitsetv, not bitset*.
745
b0299a2e
AD
7462002-04-07 Akim Demaille <akim@epita.fr>
747
748 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
749 (LArule): this, which is an array to rule_t*.
750 * src/print.c, src/conflicts.c: Adjust.
751
d7e1f00c
AD
7522002-04-07 Akim Demaille <akim@epita.fr>
753
754 * src/gram.h (rule_t): Rename `number' as `user_number'.
755 `number' is a new member.
756 Adjust dependencies.
757 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
758
cc9305dd
AD
7592002-04-07 Akim Demaille <akim@epita.fr>
760
761 As a result of the previous patch, it is no longer needed
762 to reorder ritem itself.
763
764 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
765
b0940840
AD
7662002-04-07 Akim Demaille <akim@epita.fr>
767
768 Be sure never to walk through RITEMS, but use only data related to
769 the rules themselves. RITEMS should be banished.
770
771 * src/output.c (output_token_translations): Rename as...
772 (prepare_tokens): this.
773 In addition to `translate', prepare the muscles `tname' and
774 `toknum', which were handled by...
775 (output_rule_data): this.
776 Remove, and move the remainder of its outputs into...
777 (prepare_rules): this new routines, which also merges content from
778 (output_gram): this.
779 (prepare_rules): Be sure never to walk through RITEMS.
780 (output_stos): Rename as...
781 (prepare_stos): this.
782 (output): Always invoke prepare_states, after all, just don't use it
783 in the output if you don't need it.
784
643a5994
AD
7852002-04-07 Akim Demaille <akim@epita.fr>
786
787 * src/LR0.c (new_state): Display `nstates' as the name of the
788 newly created state.
789 Adjust to initialize first_state and last_state if needed.
790 Be sure to distinguish the initial from the final state.
791 (new_states): Create the itemset of the initial state, and use
792 new_state.
793 * src/closure.c (closure): Now that the initial state has its
794 items properly set, there is no need for a special case when
795 creating `ruleset'.
796
797 As a result, now the rule 0, reducing to $axiom, is visible in the
798 outputs. Adjust the test suite.
799
800 * tests/conflicts.at (Solved SR Conflicts)
801 (Unresolved SR Conflicts): Adjust.
802 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
803 * tests/conflicts.at (S/R in initial): New.
804
b4c4ccc2
AD
8052002-04-07 Akim Demaille <akim@epita.fr>
806
807 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
808 the RHS of the rules.
809 * src/output.c (output_gram): Likewise.
810
bba97eb2
AD
8112002-04-07 Akim Demaille <akim@epita.fr>
812
813 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
814 bucket.
815 Adjust all dependencies.
816 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
817 `number' of the buckets too.
818 * src/gram.h: Include `symtab.h'.
819 (associativity): Move to...
820 * src/symtab.h: here.
821 No longer include `gram.h'.
822
c3b407f4
AD
8232002-04-07 Akim Demaille <akim@epita.fr>
824
825 * src/gram.h, src/gram.c (rules_rhs_length): New.
826 (ritem_longest_rhs): Use it.
827 * src/gram.h (rule_t): `number' is a new member.
828 * src/reader.c (packgram): Set it.
829 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
830 the end of `rules', and count them out of `nrules'.
831 (reduce_output, dump_grammar): Adjust.
832 * src/print.c (print_grammar): It is no longer needed to check for
833 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
834 * tests/reduce.at (Reduced Automaton): New test.
835
11652ab3
AD
8362002-04-07 Akim Demaille <akim@epita.fr>
837
838 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
839 lacking `+ 1' to nrules, Bison reported as useless a token if it
840 was used solely to set the precedence of the last rule...
841
26b23c1a
AD
8422002-04-07 Akim Demaille <akim@epita.fr>
843
844 * data/bison.c++, data/bison.simple: Don't output the current file
845 name in #line, to avoid useless diffs between two identical
846 outputs under different names.
847
18bcecb0
AD
8482002-04-07 Akim Demaille <akim@epita.fr>
849
850 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
851 Normalize loops to using `< nrules + 1', not `<= nrules'.
852
fa770c86
AD
8532002-04-07 Akim Demaille <akim@epita.fr>
854
855 * TODO: Update.
856
d9b739c3
AD
8572002-04-07 Akim Demaille <akim@epita.fr>
858
859 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
860 bucket.value as bucket.number.
861
99013900
AD
8622002-04-07 Akim Demaille <akim@epita.fr>
863
864 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
865 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
866 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
867 RHS, instead of being an index in RITEMS.
868
e966383b
PE
8692002-04-04 Paul Eggert <eggert@twinsun.com>
870
871 * doc/bison.texinfo: Update copyright date.
872 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
873 (Symbols): Warn about running Bison in one character set,
874 but compiling and/or running in an incompatible one.
875 Warn about character code 256, too.
876
8772002-04-03 Paul Eggert <eggert@twinsun.com>
878
879 * src/bison.data (YYSTACK_ALLOC): Depend on whether
880 YYERROR_VERBOSE is nonzero, not whether it is defined.
881
882 Merge changes from bison-1_29-branch.
c307773e 883
8d6c48b9
PE
8842002-03-20 Paul Eggert <eggert@twinsun.com>
885
886 Merge fixes from Debian bison_1.34-1.diff.
887
888 * configure.in (AC_PREREQ): 2.53.
889
e53c6322
AD
8902002-03-20 Akim Demaille <akim@epita.fr>
891
892 * src/conflicts.c (log_resolution): Argument `resolution' is const.
893
9ffbeca7
PE
8942002-03-19 Paul Eggert <eggert@twinsun.com>
895
21db0b2a
PE
896 * src/bison.simple (YYCOPY): New macro.
897 (YYSTACK_RELOCATE): Use it.
898 Remove Type arg; no longer needed. All callers changed.
899 (yymemcpy): Remove; no longer needed.
900
9ffbeca7
PE
901 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
902 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
903
642cb8f8
AD
9042002-03-19 Akim Demaille <akim@epita.fr>
905
906 Test and fix the #line outputs.
907
908 * tests/atlocal.at (GCC): New.
909 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
910 (Prologue synch line, ,%union synch line, Postprologue synch line)
911 (Action synch line, Epilogue synch line): New tests.
912 * src/reader.c (parse_union_decl): Define the muscle stype_line.
913 * data/bison.simple, data/bison.c++: Use it.
914
3c31a486
AD
9152002-03-19 Akim Demaille <akim@epita.fr>
916
917 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
918 (Solved SR Conflicts, %expect not enough, %expect right)
919 (%expect too much): Move to...
920 * tests/conflicts.at: this new file.
921
0d8bed56
AD
9222002-03-19 Akim Demaille <akim@epita.fr>
923
924 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
925 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
926 that we can move to enums for instance.
927 * src/output.c (token_definitions_output): Output a list of
928 `token-name, token-number' instead of the #define.
929 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
930
9208d17f
AD
9312002-03-14 Akim Demaille <akim@epita.fr>
932
933 Use Gettext 0.11.1.
934
af27eacb
RA
9352002-03-09 Robert Anisko <robert@lrde.epita.fr>
936
937 * data/bison.c++: Make the user able to add members to the generated
938 parser by subclassing.
939
9101a310
RA
9402002-03-05 Robert Anisko <robert@lrde.epita.fr>
941
942 * src/reader.c (read_additionnal_code): `c' should be an integer, not
943 a character.
944 Reported by Nicolas Tisserand and Nicolas Burrus.
945
fff9bf0b
RA
9462002-03-04 Robert Anisko <robert@lrde.epita.fr>
947
948 * src/reader.c: Warn about lacking semi-colons, do not complain.
949
64dba31e
RA
9502002-03-04 Robert Anisko <robert@lrde.epita.fr>
951
952 * data/bison.c++: Remove a debug line.
953
374f5a14
RA
9542002-03-04 Robert Anisko <robert@lrde.epita.fr>
955
956 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
957 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
958 provide a default implementation.
959
bfcf1f3a
AD
9602002-03-04 Akim Demaille <akim@epita.fr>
961
962 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
963 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
964 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
965 * tests/semantic.at (Parsing Guards): Similarly.
966 * src/reader.at (readgram): Complain if the last rule is not ended
967 with a semi-colon.
968
65ccf9fc
AD
9692002-03-04 Akim Demaille <akim@epita.fr>
970
971 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
972 * src/closure.c: here.
973 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
974 RTC.
975 * src/warshall.h, src/warshall.c: Remove.
976 * tests/sets.at (Broken Closure): Adjust.
977
d0039cbc
AD
9782002-03-04 Akim Demaille <akim@epita.fr>
979
980 * src/output.c (output_skeleton): tempdir is const.
981 bytes_read is unused.
982
345cea78
AD
9832002-03-04 Akim Demaille <akim@epita.fr>
984
985 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
986 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
987 Update.
988 From Michael Hayes.
989
564801f7
AD
9902002-03-04 Akim Demaille <akim@epita.fr>
991
992 * src/closure.c (closure): `r' is unused.
993
e5352bc7
AD
9942002-03-04 Akim Demaille <akim@epita.fr>
995
996 * tests/sets.at (Broken Closure): Add the ending `;'.
997 * src/reader.at (readgram): Complain if a rule is not ended with a
998 semi-colon.
999
914feea9
AD
10002002-03-04 Akim Demaille <akim@epita.fr>
1001
1002 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1003 (count_sr_conflicts): Use bitset_count.
1004 * src/reduce.c (inaccessable_symbols): Ditto.
1005 (bits_size): Remove.
1006 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1007
f0250de6
AD
10082002-03-04 Akim Demaille <akim@epita.fr>
1009
1010 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1011 * src/reduce.c: Remove the `bitset_zero's following the
1012 `bitset_create's, as now it is performed by the latter.
1013
ef017502
AD
10142002-03-04 Akim Demaille <akim@epita.fr>
1015
1016 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1017 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1018 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1019 latest sources from Michael.
1020
76514394
AD
10212002-03-04 Akim Demaille <akim@epita.fr>
1022
1023 * src/output.c (output): Don't free the grammar.
1024 * src/reader.c (grammar_free): New.
1025 * src/main.c (main): Call it and don't free symtab here.
1026
55024580
AD
10272002-03-04 Akim Demaille <akim@epita.fr>
1028
1029 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1030 before returning.
1031 Reported by Benoit Perrot.
1032
f9abaa2c
AD
10332002-03-04 Akim Demaille <akim@epita.fr>
1034
1035 Use bitset operations when possible, not loops over bits.
1036
1037 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1038 bitset_or.
1039 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1040 * src/reduce.c (useless_nonterminals): Formatting changes.
1041 * src/warshall.c (TC): Use bitset_or.
1042
0e721e75
AD
10432002-03-04 Akim Demaille <akim@epita.fr>
1044
1045 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1046 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1047 Ditto.
1048
0fb1ffb1
AD
10492002-03-04 Akim Demaille <akim@epita.fr>
1050
1051 * src/lalr.c (F): Now a bitset*.
1052 Adjust all dependencies.
1053
b86796bf
AD
10542002-03-04 Akim Demaille <akim@epita.fr>
1055
1056 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1057 Adjust all dependencies.
1058
602bbf31
AD
10592002-03-04 Akim Demaille <akim@epita.fr>
1060
1061 * src/L0.c, src/LR0.h (nstates): Be size_t.
1062 Adjust comparisons (signed vs unsigned).
1063 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1064 bitset*.
1065 Adjust all dependencies.
1066
d8a0245c
AD
10672002-03-04 Akim Demaille <akim@epita.fr>
1068
1069 * src/closure.c (firsts): Now, also a bitset.
1070 Adjust all dependencies.
1071 (varsetsize): Remove, now unused.
1072 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1073
34ba9743
AD
10742002-03-04 Akim Demaille <akim@epita.fr>
1075
1076 * src/print.c: Convert to use bitset.h, not hand coded iterations
1077 over ints.
1078
ed86e78c
AD
10792002-03-04 Akim Demaille <akim@epita.fr>
1080
1081 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1082
dfdb1797
AD
10832002-03-04 Akim Demaille <akim@epita.fr>
1084
1085 * src/closure.c (ruleset): Be a bitset.
1086 (rulesetsize): Remove.
1087
7086e707
AD
10882002-03-04 Akim Demaille <akim@epita.fr>
1089
1090 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1091 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1092 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1093 * src/closure.c (fderives): Be an array of bitsets.
1094
98254360
RA
10952002-02-28 Robert Anisko <robert@lrde.epita.fr>
1096
1097 * data/bison.c++: Merge the two generated headers. Insert a copyright
1098 notice in each output file.
1099
a75c057f
AD
11002002-02-28 Akim Demaille <akim@epita.fr>
1101
1102 * data/bison.c++: Copy the prologue of bison.simple to fetch
1103 useful M4 definitions, such as b4_header_guard.
1104
06b00abc
AD
11052002-02-25 Akim Demaille <akim@epita.fr>
1106
1107 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1108 translator friendly scheme for the bgr
1109 copyright notice.
06b00abc 1110
70e7d534
AD
11112002-02-25 Akim Demaille <akim@epita.fr>
1112
1113 * src/output.c (header_output): Remove, now handled completely via
1114 M4.
1115
abe017f6
AD
11162002-02-25 Akim Demaille <akim@epita.fr>
1117
1118 * m4/m4.m4: New, from CVS Autoconf.
1119 * configure.in: Invoke it.
1120 * src/output.c (output_skeleton): Use its result instead of the
1121 hard coded name.
1122
381fb12e
AD
11232002-02-25 Akim Demaille <akim@epita.fr>
1124
1125 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1126 Fileutils 4.1.5.
1127 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1128 * src/output.c (output_skeleton): Use mkstemp to create a real
1129 temporary file.
1130 Move the filling of `skeleton' and its muscle to...
1131 (prepare): here.
1132 (output): Move the definition of the prologue muscle to...
1133 (prepare): here.
1134 * src/system.h (DEFAULT_TMPDIR): New.
1135
6f38107f
PE
11362002-02-14 Paul Eggert <eggert@twinsun.com>
1137
1138 Remove the support for C++ namespace cleanliness; it was
1139 causing more problems than it was curing, since it didn't work
1140 properly on some nonstandard C++ compilers. This can wait
1141 for a proper C++ parser.
1142
1143 * NEWS: Document this.
1144 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1145 of C++, as it's treated like C now.
1146 * src/bison.simple (YYSTD): Remove.
1147 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1148 Treat C++ just like Standard C instead of trying to support
1149 namespace cleanliness.
1150
80cce3da
AD
11512002-02-14 Akim Demaille <akim@epita.fr>
1152
1153 * tests/regression.at (else): Adjust to Andreas' change.
1154
842e8679
AD
11552002-02-14 Akim Demaille <akim@epita.fr>
1156
1157 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1158
4bda3f10
AD
11592002-02-13 Andreas Schwab <schwab@suse.de>
1160
1161 * src/output.c (output_rule_data): Don't output NULL, it might
1162 not be defined yet.
1163
4162fa07 11642002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 1165
4162fa07
RA
1166 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1167 (Copyright notice): Update.
b418ecd8 1168
bd16a5dc
AD
11692002-02-11 Akim Demaille <akim@epita.fr>
1170
1171 * tests/regression.at (%nonassoc and eof): Don't include
1172 nonportable headers.
1173
8d69a1a3
RA
11742002-02-08 Robert Anisko <robert@lrde.epita.fr>
1175
1176 * data/bison.c++: Correct error recovery. Make the user able to
1177 initialize the starting location.
1178
9b2d0677
AD
11792002-02-07 Akim Demaille <akim@epita.fr>
1180
1181 * tests/input.at: New.
1182
69e2658b
RA
11832002-02-07 Robert Anisko <robert@lrde.epita.fr>
1184
1185 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 1186 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
1187 directives around tables only needed for debugging.
1188
4aacc3a7
RA
11892002-02-07 Robert Anisko <robert@lrde.epita.fr>
1190
1191 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1192 C++ parsers.
1193 (yy::b4_name::parse): Use print_.
1194
762a801e
RA
11952002-02-07 Robert Anisko <robert@lrde.epita.fr>
1196
1197 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1198
4bb2bc3f
RA
11992002-02-07 Robert Anisko <robert@lrde.epita.fr>
1200
1201 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1202 C++ parsers.
1203 (yy::b4_name::parse): Build verbose error messages, and use error_.
1204
6b45a3ca
RA
12052002-02-06 Robert Anisko <robert@lrde.epita.fr>
1206
1207 * data/bison.c++: Fix m4 quoting in comments.
1208
50997c6e
RA
12092002-02-06 Robert Anisko <robert@lrde.epita.fr>
1210
1211 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1212 not expanded by m4.
1213
3f3eed27
AD
12142002-02-05 Akim Demaille <akim@epita.fr>
1215
1216 * data/bison.c++: Adjust to the M4 back end.
1217 More is certainly needed.
1218
be2a1a68
AD
12192002-02-05 Akim Demaille <akim@epita.fr>
1220
1221 Give a try to M4 as a back end.
1222
1223 * lib/readpipe.c: New, from wdiff.
1224 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1225 BISON_HAIRY.
1226 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1227 specific values. Now it is m4 that performs the lookup.
1228 * src/parse-skel.y: Remove.
1229 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1230 * src/output.c (actions_output, guards_output)
1231 (token_definitions_output): No longer keeps track of the output
1232 line number, hence remove the second argument.
1233 (guards_output): Check against the guard member of a rule, not the
1234 action member.
1235 Adjust callers.
1236 (output_skeleton): Don't look for the skeleton location, let m4 do
1237 that.
1238 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1239 file will be used.
1240 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1241 (prepare): Given that for the time being changesyntax is not
1242 usable in M4, rename the muscles using `-' to `_'.
1243 Define `defines_flag', `output_parser_name' and `output_header_name'.
1244 * src/output.h (actions_output, guards_output)
1245 (token_definitions_output): Adjust prototypes.
1246 * src/scan-skel.l: Instead of scanning the skeletons, it now
1247 processes the output of m4: `__oline__' and `#output'.
1248 * data/bison.simple: Adjust to be used by M4(sugar).
1249 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1250 to date.
1251 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1252 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1253 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1254 shamelessly stolen from CVS Autoconf.
1255
beda758b
AD
12562002-02-05 Akim Demaille <akim@epita.fr>
1257
1258 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1259 * configure.in: Check for the declarations of free and malloc.
1260 * src/muscle_tab.c: Adjust.
1261
5ece6d43
AD
12622002-02-05 Akim Demaille <akim@epita.fr>
1263
1264 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1265 which have no values.
1266
5bb18f9a
AD
12672002-02-05 Akim Demaille <akim@epita.fr>
1268
1269 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1270 * data/: here.
1271
894dd62e
PE
12722002-01-29 Paul Eggert <eggert@twinsun.com>
1273
1274 * src/bison.simple (YYSIZE_T): Do not define merely because
1275 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1276 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1277
82841af7
AD
12782002-01-27 Akim Demaille <akim@epita.fr>
1279
1280 Fix `%nonassoc and eof'.
1281
1282 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1283 which were not properly copied! Replace
1284 memcpy (res->errs, src->errs, src->nerrs);
1285 with
1286 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1287 !!!
1288 * tests/regression.at (%nonassoc and eof): Adjust to newest
1289 Autotest: `.' is not in the PATH.
1290
318b76e9
AD
12912002-01-27 Akim Demaille <akim@epita.fr>
1292
1293 * tests/sets.at (AT_EXTRACT_SETS): New.
1294 (Nullable): Use it.
1295 (Firsts): New.
1296
30d2f3d5
AD
12972002-01-26 Akim Demaille <akim@epita.fr>
1298
1299 * tests/actions.at, tests/calc.at, tests/headers.at,
1300 * tests/torture.at: Adjust to the newest Autotest which no longer
1301 forces `.' in the PATH.
1302
30f8c395
AD
13032002-01-25 Akim Demaille <akim@epita.fr>
1304
1305 * tests/regression.at (%nonassoc and eof): New.
1306 Suggested by Robert Anisko.
1307
29ae55f1
AD
13082002-01-24 Akim Demaille <akim@epita.fr>
1309
1310 Bison dumps core when trying to complain about broken input files.
1311 Reported by Cris van Pelt.
1312
1313 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
1314 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
1315 into...
1316 (Invalid inputs): Strengthen: exercise parse_percent_token.
1317
2b548aa6
RA
13182002-01-24 Robert Anisko <robert.anisko@epita.fr>
1319
1320 * src/Makefile.am: Add bison.c++.
1321 * src/bison.c++: New skeleton.
1322
bb0146c2
AD
13232002-01-21 Paolo Bonzini <bonzini@gnu.org>
1324
1325 * po/it.po: New.
1326
bec30531
AD
13272002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
1328
1329 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
1330
fc6edc45
MA
13312002-01-20 Marc Autret <marc@gnu.org>
1332
1333 * src/files.c (compute_output_file_names): Fix
1334
5e5d5415
MA
13352002-01-20 Marc Autret <marc@gnu.org>
1336
1337 * tests/output.at: New test.
1338 * src/files.c (compute_base_names): Don't map extensions when
1339 the YACC flag is set, use defaults.
1340 Reported by Evgeny Stambulchik.
1341
44ea3fbd
MA
13422002-01-20 Marc Autret <marc@gnu.org>
1343
bb0146c2 1344 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
1345 compilers as well (i.e. the vendor C compiler).
1346 Suggested by Albert Chin-A-Young.
1347
338963d1
TVH
13482002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1349
1350 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1351 canonical definition.
1352 * src/system.h: Use the canonical definition for PARAMS (avoids
1353 a conflict with the macro from lib/hash.h).
1354
c57b2479
AD
13552002-01-11 Akim Demaille <akim@epita.fr>
1356
1357 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 1358 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 1359
b85810ae
AD
13602002-01-09 Akim Demaille <akim@epita.fr>
1361
1362 * src/files.c, src/files.h (output_infix): New.
1363 (tab_extension): Remove.
1364 (compute_base_names): Compute the former, drop the latter.
1365 * src/output.c (prepare): Insert the muscles `output-infix', and
1366 `output-suffix'.
1367 * src/parse-skel.y (string, string.1): New.
1368 (section.header): Use it.
1369 (section.yacc): Remove.
1370 (prefix): Remove too.
1371 * src/scan-skel.l: Adjust.
1372 * src/bison.simple, src/bison.hairy: Adjust.
1373
cae60122
AD
13742002-01-09 Akim Demaille <akim@epita.fr>
1375
1376 * configure.in (WERROR_CFLAGS): Compute it.
1377 * src/Makefile.am (CFLAGS): Pass it.
1378 * tests/atlocal.in (CFLAGS): Idem.
1379 * src/files.c: Fix a few warnings.
1380 (get_extension_index): Remove, unused.
1381
ae404801
AD
13822002-01-08 Akim Demaille <akim@epita.fr>
1383
1384 * src/getargs.c (AS_FILE_NAME): New.
1385 (getargs): Use it to convert DOSish file names.
1386 * src/files.c (base_name): Rename as full_base_name to avoid
1387 clashes with `base_name ()'.
1388 (filename_split): New.
1389 (compute_base_names): N-th rewrite, using filename_split.
1390
22312b71
AD
13912002-01-08 Akim Demaille <akim@epita.fr>
1392
1393 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1394 New, stolen from the Fileutils 4.1.
1395 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1396 * configure.in: Check for the presence of memrchr, and of its
1397 prototype.
1398
a67cef01
TVH
13992002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1400
1401 * lib/hash.h (__P): Added definition for this macro.
1402 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1403 BUILT_SOURCES, to ensure they are generated first.
1404 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1405 %error-verbose to allow bootstrapping with bison 1.30x.
1406
2b25d624
AD
14072002-01-06 Akim Demaille <akim@epita.fr>
1408
1409 * src/reader.c (parse_braces): Don't fetch the next char, the
1410 convention is to fetch on entry.
1411 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1412 'switch' without a following semicolon.
1413 * tests/regression.at (braces parsing): New.
1414
3460813b
AD
14152002-01-06 Akim Demaille <akim@epita.fr>
1416
1417 Bison is dead wrong in its RR conflict reports.
1418
1419 * tests/torture.at (GNU Cim Grammar): New.
1420 * src/conflicts.c (count_rr_conflicts): Fix.
1421
73784c64
AD
14222002-01-06 Akim Demaille <akim@epita.fr>
1423
1424 Creating package.m4 from configure.ac causes too many problems.
1425
1426 * tests/Makefile.am (package.m4): Create it by hand,
1427 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1428
25d81090
AD
14292002-01-06 Akim Demaille <akim@epita.fr>
1430
1431 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1432 skeleton.h.
1433
a9b8959e
PE
14342002-01-04 Paul Eggert <eggert@twinsun.com>
1435
1436 * doc/bison.texinfo (Debugging):
1437 Remove YYSTDERR; it's no longer defined or used.
1438 Also, s/cstdio.h/cstdio/.
1439
25d81090
AD
14402002-01-03 Akim Demaille <akim@epita.fr>
1441
1442 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1443
1109455c
AD
14442002-01-03 Akim Demaille <akim@epita.fr>
1445
1446 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1447 tracing code to --trace, wait for a better --trace option, with
1448 args.
1449
7ea5e977
AD
14502002-01-03 Akim Demaille <akim@epita.fr>
1451
1452 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1453 The ISO C++ standard is extremely clear about it: stderr is
1454 considered a macro, not a regular symbol (see table 94 `Header
1455 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1456 Therefore std:: does not apply to it. It still does with fprintf.
1457 Also, s/cstdio.h/cstdio/.
1458
fab5b110
AD
14592002-01-03 Akim Demaille <akim@epita.fr>
1460
1461 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1462 for non system headers.
1463
aed7fd9b
AD
14642002-01-02 Akim Demaille <akim@epita.fr>
1465
1466 Equip the skeleton chain with location tracking, runtime trace,
1467 pure parser and scanner.
1468
1469 * src/parse-skel.y: Request a pure parser, locations, and prefix
1470 renaming.
1471 (%union): Having several members with the same type does not help
1472 type mismatches, simplify.
1473 (YYPRINT, yyprint): New.
1474 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1475 (skel_error): this.
1476 Handle locations.
1477 * src/scan-skel.l: Adjust to these changes.
1478 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1479 (LOCATION_PRINT, skel_control_t): New.
1480
24fad99e
AD
14812001-12-30 Akim Demaille <akim@epita.fr>
1482
1483 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1484 replace `gb' with BLANKS.
1485 * src/scan-skel.l: Adjust.
1486
a4b36db4
AD
14872001-12-30 Akim Demaille <akim@epita.fr>
1488
1489 * src/system.h: We don't need nor want bcopy.
1490 Throw away MS-DOS crap: we don't need getpid.
1491 * configure.in: We don't need strndup. It was even causing
1492 problems: because Flex includes the headers *before* us,
1493 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1494 not visible.
1495 * lib/xstrndup.c: New.
1496 * src/scan-skel.l: Use it.
1497 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1498 * src/parse-skel.y: Use %directives instead of #defines.
1499
1239777d
AD
15002001-12-30 Akim Demaille <akim@epita.fr>
1501
1502 * src/skeleton.h: New.
1503 * src/output.c (output_parser, output_master_parser): Remove, dead
1504 code.
1505 * src/output.h (get_lines_number, actions_output, guards_output)
1506 (token_definitions_output): Prototype them.
1507 * src/parse-skel.y: Add the license notice.
1508 Include output.h and skeleton.h.
1509 (process_skeleton): Returns void, and takes a single parameter.
1510 * src/scan-skel.l: Add the license notice.
1511 Include skeleton.h.
1512 Don't use %option yylineno: it seems that then Flex imagines
1513 REJECT has been used, and therefore it won't reallocate its
1514 buffers (which makes no other sense to me than a bug). It results
1515 in warnings for `unused: yy_flex_realloc'.
1516
9b3add5b
RA
15172001-12-30 Robert Anisko <robert.anisko@epita.fr>
1518
1519 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1520 (MUSCLE_INSERT_PREFIX): ...to there.
1521 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1522 (MUSCLE_INSERT_PREFIX): Move from here...
1523
1524 * src/bison.hairy: Add a section directive. Put braces around muscle
1525 names. This parser skeleton is still broken, but Bison should not
1526 choke on a bad muscle 'syntax'.
1527 * src/bison.simple: Add a section directive. Put braces around muscle
1528 names.
1529
1530 * src/files.h (strsuffix, stringappend): Add declarations.
1531 (tab_extension): Add declaration.
1532 (short_base_name): Add declaration.
1533
1534 * src/files.c (strsuffix, stringappend): No longer static. These
1535 functions are used in the skeleton parser.
1536 (tab_extension): New.
1537 (compute_base_names): Use the computations done in this function
fab5b110 1538 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1539 names.
1540 (short_base_name): No longer static.
1541
1542 * src/output.c (output_skeleton): New.
1543 (output): Disable call to output_master_parser, and give a try to
1544 a new skeleton handling system.
1545 (guards_output, actions_output): No longer static.
1546 (token_definitions_output, get_lines_number): No longer static.
1547
1548 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1549
fab5b110 1550 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1551 parse-skel.y.
1552
1553 * src/parse-skel.y: New file.
1554 * src/scan-skel.l: New file.
1555
b5b61c61
AD
15562001-12-29 Akim Demaille <akim@epita.fr>
1557
1558 %name-prefix is broken.
1559
1560 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1561 Adjust all dependencies.
1562 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1563 %name-prefix.
1564
1565 Renaming yylval but not yylloc is not consistent. Now we do.
1566
1567 * src/bison.simple: Prefix yylloc if used.
1568 * doc/bison.texinfo (Decl Summary): Document that.
1569
8c9a50be
AD
15702001-12-29 Akim Demaille <akim@epita.fr>
1571
1572 * doc/bison.texinfo: Promote `%long-directive' over
1573 `%long_directive'.
1574 Remove all references to fixed-output-files, yacc is enough.
1575
d99361e6
AD
15762001-12-29 Akim Demaille <akim@epita.fr>
1577
1578 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1579 user prologue. These are defaults.
1580 * tests/actions.at (Mid-rule actions): Make sure the user can
1581 define YYDEBUG and YYERROR_VERBOSE.
1582
b9cecb91
AD
15832001-12-29 Akim Demaille <akim@epita.fr>
1584
1585 * src/output.c (header_output): Don't forget to export YYLTYPE and
1586 yylloc.
1587 * tests/headers.at (export YYLTYPE): New, make sure it does.
1588 * tests/regression.at (%union and --defines, Invalid CPP headers):
1589 Move to...
1590 * tests/headers.at: here.
1591
aea13e97
AD
15922001-12-29 Akim Demaille <akim@epita.fr>
1593
1594 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1595
931394cb
AD
15962001-12-29 Akim Demaille <akim@epita.fr>
1597
1598 * tests/actions.at (Mid-rule actions): Output on a single line
1599 instead of several.
1600
704a47c4
AD
16012001-12-29 Akim Demaille <akim@epita.fr>
1602
1603 * doc/bison.texinfo: Formatting changes.
1604
091e20bb
AD
16052001-12-29 Akim Demaille <akim@epita.fr>
1606
1607 Don't store the token defs in a muscle, just be ready to output it
1608 on command. Now possible via `symbols'. Fixes a memory leak.
1609
1610 * src/output.c (token_definitions_output): New.
1611 (output_parser, header_output): Use it.
1612 * src/reader.c (symbols_save): Remove.
1613
cce71710
AD
16142001-12-29 Akim Demaille <akim@epita.fr>
1615
1616 * src/bison.simple: Do not provide a default for YYSTYPE and
1617 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1618 default.
1619
82c035a8
AD
16202001-12-29 Akim Demaille <akim@epita.fr>
1621
1622 Mid-rule actions are simply... ignored!
1623
1624 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1625 the empty-rule associated to the dummy symbol, not to the host
1626 rule.
1627 * tests/actions.at (Mid-rule actions): New.
1628
8419d367
AD
16292001-12-29 Akim Demaille <akim@epita.fr>
1630
1631 Memory leak.
1632
1633 * src/reader.c (reader): Free grammar.
1634
375d5806
AD
16352001-12-29 Akim Demaille <akim@epita.fr>
1636
1637 Memory leak.
1638
1639 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1640 since it allocates it for each state, although only one is needed.
1641 (allocate_storage): Do it here.
1642
f51cb8ff
AD
16432001-12-29 Akim Demaille <akim@epita.fr>
1644
1645 * src/options.h, src/options.c (create_long_option_table): Rename
1646 as...
1647 (long_option_table_new): this, with a clearer prototype.
1648 (percent_table): Remove, unused,
1649 * src/getargs.c (getargs): Adjust.
1650
29e88316
AD
16512001-12-29 Akim Demaille <akim@epita.fr>
1652
1653 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1654 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1655 as states.
1656
b9f71f19
AD
16572001-12-29 Akim Demaille <akim@epita.fr>
1658
1659 * src/lalr.c (build_relations): Rename `states' as `states1'.
1660 Sorry, I don't understand exactly what it is, no better name...
1661
1a2b5d37
AD
16622001-12-29 Akim Demaille <akim@epita.fr>
1663
1664 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1665 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1666 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1667 as rules.
1668
1cca533e
AD
16692001-12-29 Akim Demaille <akim@epita.fr>
1670
1671 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1672 ago.
1673
c03ae966
AD
16742001-12-29 Akim Demaille <akim@epita.fr>
1675
1676 * src/reader.c, src/reader.h (user_toknums): Remove.
1677 Adjust all users to use symbols[i]->user_token_number.
1678
5a670b1e
AD
16792001-12-29 Akim Demaille <akim@epita.fr>
1680
1681 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1682 Adjust all users to use symbols[i]->prec or ->assoc.
1683
ad949da9
AD
16842001-12-29 Akim Demaille <akim@epita.fr>
1685
1686 * src/reader.c, src/reader.h (tags): Remove.
1687 Adjust all users to use symbols[i]->tag.
1688
0e78e603
AD
16892001-12-29 Akim Demaille <akim@epita.fr>
1690
1691 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1692 and rule_table.
1693 * src/reader.c (packsymbols): Fill this table.
1694 Drop sprec.
1695 * src/conflicts.c (resolve_sr_conflict): Adjust.
1696 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1697 single table.
1698 Use symbols[i]->tag instead of tags[i].
1699
213e640e
AD
17002001-12-29 Akim Demaille <akim@epita.fr>
1701
1702 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1703 In addition, put a comment in there, to replace...
1704 * tests/regression.at (%union and C comments): Remove.
1705
e7b8bef1
AD
17062001-12-29 Akim Demaille <akim@epita.fr>
1707
1708 * tests/regression.at (Web2c Actions): Blindly move the actual
1709 output as expected output. The contents *seem* right to me, but I
1710 can't pretend reading perfectly parser tables... Nonetheless, all
1711 the other tests pass correctly, the table look OK, even though the
1712 presence of `$axiom' is to be noted: AFAICS it is useless (but
1713 harmless).
1714
b68e7744
AD
17152001-12-29 Akim Demaille <akim@epita.fr>
1716
1717 * src/reader.c (readgram): Don't add the rule 0 if there were no
1718 rules read. In other words, add it _after_ having performed
1719 grammar sanity checks.
1720 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1721
78d5bae9
AD
17222001-12-29 Akim Demaille <akim@epita.fr>
1723
1724 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1725 visible, and some states have now a different number.
1726
ff442794
AD
17272001-12-29 Akim Demaille <akim@epita.fr>
1728
1729 * src/reader.c (readgram): Bind the initial rule's lineno to that
1730 of the first rule.
1731 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1732 (Solved SR Conflicts): Adjust rule 0's line number.
1733
610ab194
AD
17342001-12-29 Akim Demaille <akim@epita.fr>
1735
1736 Fix the `GAWK Grammar' failure.
1737
1738 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1739 the reductions of the first state which was mistakenly confused
1740 with the final state because precisely final_state was initialized
1741 to 0.
1742 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1743 now noticed by Bison.
1744 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1745 have a reduction on $default.
1746
29d29c8f
AD
17472001-12-29 Akim Demaille <akim@epita.fr>
1748
1749 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1750 rule line numbers.
1751 * src/closure.c (print_closure): Likewise.
1752 * src/derives.c (print_derives): Likewise.
1753 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1754 now.
1755
7c6b64d0
AD
17562001-12-29 Akim Demaille <akim@epita.fr>
1757
1758 * src/lalr.c (lookaheads_print): New.
1759 (lalr): Call it when --trace-flag.
1760 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1761 are dumped.
1762
3d4daee3
AD
17632001-12-29 Akim Demaille <akim@epita.fr>
1764
1765 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1766 when walking through ritem, even via rule->rhs.
1767 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1768 (useful_production, useless_nonterminals): Likewise.
1769 (reduce_grammar_tables): Likewise, plus update nritems.
1770 * src/nullable.c (set_nullable): Likewise.
1771 * src/lalr.c (build_relations): Likewise.
1772 * tests/sets.at (Nullable): Adjust.
1773 Fortunately, now, the $axiom is no longer nullable.
1774
9e7f6bbd
AD
17752001-12-29 Akim Demaille <akim@epita.fr>
1776
1777 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1778 the 0-sentinel.
1779 * src/gram.c (ritem_longest_rhs): Likewise.
1780 * src/reduce.c (nonterminals_reduce): Likewise.
1781 * src/print_graph.c (print_graph): Likewise.
1782 * src/output.c (output_rule_data): Likewise.
1783 * src/nullable.c (set_nullable): Likewise.
1784
255ef638
AD
17852001-12-29 Akim Demaille <akim@epita.fr>
1786
1787 * src/output.c: Comment changes.
1788
0d8a7363
AD
17892001-12-27 Paul Eggert <eggert@twinsun.com>
1790
1791 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1792 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1793 Sparc, as they were causing more porting problems than the
1794 (minor) performance improvement was worth.
1795
1796 Also, catch up with 1.31's YYSTD.
1797
3db472b9
AD
17982001-12-27 Akim Demaille <akim@epita.fr>
1799
1800 * src/output.c (output_gram): Rely on nritems, not the
1801 0-sentinel. See below.
1802 Use -1 as separator, not 0.
1803 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1804 Rely on -1 as separator in yyrhs, instead of 0.
1805 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1806 twice `Now at end of input', therefore there are two lines less to
1807 expect.
1808
b365aa05
AD
18092001-12-27 Akim Demaille <akim@epita.fr>
1810
1811 * tests/regression.at (Unresolved SR Conflicts):
1812 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1813 below.
1814
30171f79
AD
18152001-12-27 Akim Demaille <akim@epita.fr>
1816
1817 * src/LR0.c (new_state): Recognize the final state by the fact it
1818 is reached by eoftoken.
1819 (insert_start_shifting_state, insert_eof_shifting_state)
1820 (insert_accepting_state, augment_automaton): Remove, since now
1821 these states are automatically computed from the initial state.
1822 (generate_states): Adjust.
1823 * src/print.c: When reporting a rule number to the user, substract
1824 1, so that the axiom rule is rule 0, and the first user rule is 1.
1825 * src/reduce.c: Likewise.
1826 * src/print_graph.c (print_core): For the time being, just as for
1827 the report, depend upon --trace-flags to dump the full set of
1828 items.
1829 * src/reader.c (readgram): Once the grammar read, insert the rule
1830 0: `$axiom: START-SYMBOL $'.
1831 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1832 number of the states has changed (the final state is no longer
1833 necessarily the last), catch up.
1834
75142d45
AD
18352001-12-27 Akim Demaille <akim@epita.fr>
1836
1837 Try to make the use of the eoftoken valid. Given that its value
1838 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1839 is used instead of > 0 where appropriate, (ii), depend upon nritems
1840 instead of the 0-sentinel.
1841
1842 * src/gram.h, src/gram.c (nritems): New.
1843 Expected to be duplication of nitems, but for the time being...
1844 * src/reader.c (packgram): Assert nritems and nitems are equal.
1845 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1846 * src/closure.c (print_closure, print_fderives): Likewise.
1847 * src/gram.c (ritem_print): Likewise.
1848 * src/print.c (print_core, print_grammar): Likewise.
1849 * src/print_graph.c: Likewise.
1850
b7c49edf
AD
18512001-12-27 Akim Demaille <akim@epita.fr>
1852
1853 * src/main.c (main): If there are complains after grammar
1854 reductions, then output the report anyway if requested, then die.
1855 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1856 * src/reader.c (eoftoken): New.
1857 (parse_token_decl): If the token being defined has value `0', it
1858 is the eoftoken.
1859 (packsymbols): No longer hack `tags' to insert `$' by hand.
1860 Be sure to preserve the value of the eoftoken.
1861 (reader): Make sure eoftoken is defined.
1862 Initialize nsyms to 0: now eoftoken is created just like the others.
1863 * src/print.c (print_grammar): Don't special case the eof token.
1864 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1865 lie anyway, albeit pleasant.
1866 * tests/calc.at: Exercise error messages with eoftoken.
1867 Change the grammar so that empty input is invalid.
1868 Adjust expectations.
1869 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1870
ec2da99f
AD
18712001-12-27 Akim Demaille <akim@epita.fr>
1872
1873 * configure.in: Check the protos of strchr ans strspn.
1874 Replace strchr if needed.
1875 * src/system.h: Provide the protos of strchr, strspn and memchr if
1876 missing.
1877 * lib/strchr.c: New.
1878 * src/reader.c (symbols_save): Use strchr.
1879
8adfa272
AD
18802001-12-27 Akim Demaille <akim@epita.fr>
1881
1882 * src/print.c, src/print_graph.c (escape): New.
1883 Use it to quote the TAGS outputs.
1884 * src/print_graph.c (print_state): Now errors are in red, and
1885 reductions in green.
1886 Prefer high to wide: output the state number on a line of its own.
1887
80dac38c
AD
18882001-12-27 Akim Demaille <akim@epita.fr>
1889
1890 * src/state.h, src/state.c (reductions_new): New.
1891 * src/LR0.c (set_state_table): Let all the states have a
1892 `reductions', even if reduced to 0.
1893 (save_reductions): Adjust.
1894 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1895 * src/print.c (print_reductions, print_actions): Adjust.
1896 * src/output.c (action_row): Adjust.
1897
2cec70b9
AD
18982001-12-27 Akim Demaille <akim@epita.fr>
1899
1900 * src/state.h, src/state.c (errs_new, errs_dup): New.
1901 * src/LR0.c (set_state_table): Let all the states have an errs,
1902 even if reduced to 0.
1903 * src/print.c (print_errs, print_reductions): Adjust.
1904 * src/output.c (output_actions, action_row): Adjust.
1905 * src/conflicts.c (resolve_sr_conflict): Adjust.
1906
13ca549a
AD
19072001-12-27 Akim Demaille <akim@epita.fr>
1908
1909 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1910
5092aba5
AD
19112001-12-27 Akim Demaille <akim@epita.fr>
1912
1913 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1914 * src/print.c: here.
1915 (lookaheadset, shiftset): New, used as additional storage by
1916 print_reductions.
1917 (print_results): Adjust.
1918 (print_shifts, print_gotos, print_errs): New, extracted from...
1919 (print_actions): here.
1920 * src/print_graph.c (print_actions): Remove dead code.
1921
11e2beca
AD
19222001-12-27 Akim Demaille <akim@epita.fr>
1923
1924 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1925 `$n' and `@n'.
1926
dac3c910
AD
19272001-12-27 Akim Demaille <akim@epita.fr>
1928
1929 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1930 (build_relations): Adjust.
1931
d0b0fefa
AD
19322001-12-27 Akim Demaille <akim@epita.fr>
1933
1934 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1935 duplication.
1936
adc8c848
AD
19372001-12-27 Akim Demaille <akim@epita.fr>
1938
1939 * src/reader.c (packgram): Catch nitems overflows.
1940
14d293ac
AD
19412001-12-27 Akim Demaille <akim@epita.fr>
1942
1943 * src/files.c, src/files.h (guard_obstack): Remove.
1944 * src/output.c (output): Adjust.
1945 * src/reader.c (parse_braces): New, factoring...
1946 (copy_action, copy_guard): these two which are renamed as...
1947 (parse_action, parse_guard): these.
1948 As a voluntary consequence, using braces around guards is now
1949 mandatory.
1950
f499b062
AD
19512001-12-27 Akim Demaille <akim@epita.fr>
1952
1953 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1954 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1955 members.
1956 (symbol_list_new): Adjust.
1957 (copy_action): action_line is the first line, not the last.
1958 (copy_guard): Just as for actions, store the `action' only, not
1959 the switch/case/break flesh.
1960 Don't parse the user action that might follow the guard, let...
1961 (readgram): do it, i.e., now, there can be an action after a
1962 guard.
1963 In other words the guard is just explicitly optional.
1964 (packgram): Adjust.
1965 * src/output.c (guards_output): New.
1966 (output_parser): Call it when needed.
1967 (output): Also free the guard and attrs obstacks.
1968 * src/files.c, src/files.h (obstack_save): Remove.
1969 (output_files): Remove.
1970 As a result, if one needs the former `.act' file, using an
1971 appropriate skeleton which requires actions and guards is now
1972 required.
1973 * src/main.c (main): Adjust.
1974 * tests/semantic.at: New.
1975 * tests/regression.at: Use `input.y' as input file name.
1976 Avoid 8+3 problems by requiring input.c when the test needs the
1977 parser.
1978
d945f5cd
AD
19792001-12-27 Akim Demaille <akim@epita.fr>
1980
1981 * src/reader.c (symbol_list_new): Be sure to initialize all the
1982 fields.
1983
d200e455
AD
19842001-12-27 Akim Demaille <akim@epita.fr>
1985
1986 All the hacks using a final pseudo state are now useless.
1987
1988 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1989 * src/lalr.c (nLA): New.
1990 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1991 instead of lookaheadsp from the pseudo state (nstate + 1).
1992
f9507c28
AD
19932001-12-27 Akim Demaille <akim@epita.fr>
1994
1995 * src/output.c (action_row, token_actions): Use a state_t instead
1996 of a integer, and nlookaheads instead of the following state's
1997 lookaheadsp.
1998
065fbd27
AD
19992001-12-27 Akim Demaille <akim@epita.fr>
2000
2001 * src/conflicts.c (log_resolution, flush_shift)
2002 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2003 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2004 (conflicts_print, print_reductions): Use a state_t instead of an
2005 integer when referring to a state.
2006 As much as possible, depend upon nlookaheads, instead of the
2007 `lookaheadsp' member of the following state (since lookaheads of
2008 successive states are successive, the difference between state n + 1
2009 and n served as the number of lookaheads for state n).
2010 * src/lalr.c (add_lookback_edge): Likewise.
2011 * src/print.c (print_core, print_actions, print_state)
2012 (print_results): Likewise.
2013 * src/print_graph.c (print_core, print_actions, print_state)
2014 (print_graph): Likewise.
2015 * src/conflicts.h: Adjust.
2016
1b177bd7
AD
20172001-12-27 Akim Demaille <akim@epita.fr>
2018
2019 * src/bison.hairy: Formatting/comment changes.
2020 ANSIfy.
2021 Remove `register' indications.
2022 Add plenty of `static'.
2023
7742ddeb
AD
20242001-12-27 Akim Demaille <akim@epita.fr>
2025
2026 * src/output.c (prepare): Drop the muscle `ntbase' which
2027 duplicates ntokens.
2028 * src/bison.simple: Formatting/comment changes.
2029 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2030 is an undocumented synonym.
2031
1fa14068
AD
20322001-12-22 Akim Demaille <akim@epita.fr>
2033
2034 * src/output.c (output_table_data): Change the prototype to use
2035 `int' for array ranges: some invocations do pass an int, not a
2036 short.
2037 Reported by Wayne Green.
2038
b9752825
AD
20392001-12-22 Akim Demaille <akim@epita.fr>
2040
2041 Some actions of web2c.y are improperly triggered.
2042 Reported by Mike Castle.
2043
2044 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2045 * tests/regression.at (Web2c): Rename as...
2046 (Web2c Report): this.
2047 (Web2c Actions): New.
2048
776209d6
AD
20492001-12-22 Akim Demaille <akim@epita.fr>
2050
2051 Reductions in web2c.y are improperly reported.
2052 Reported by Mike Castle.
2053
2054 * src/conflicts.c (print_reductions): Fix.
2055 * tests/regression.at (Web2c): New.
2056
275fc3ad
AD
20572001-12-18 Akim Demaille <akim@epita.fr>
2058
2059 Some host fail on `assert (!"foo")', which expands to
2060 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2061 Reported by Nelson Beebee.
2062
2063 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2064 `#define it_succeeded 0' and `assert (it_succeeded)'.
2065
897668ee
MA
20662001-12-17 Marc Autret <autret_m@epita.fr>
2067
2068 * src/bison.simple: Don't hard code the skeleton line and filename.
2069 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2070 New line counter 'skeleton_line' (skeleton-line muscle).
2071
ab3399e0
PE
20722001-12-17 Paul Eggert <eggert@twinsun.com>
2073
2074 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2075 YYDEBUG must be defined to a nonzero value.
2076
2077 * src/bison.simple (yytname): Do not assume that the user defines
2078 YYDEBUG to a properly parenthesized expression.
2079
3877f72b
AD
20802001-12-17 Akim Demaille <akim@epita.fr>
2081
2082 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2083 nlookaheads is a new member.
2084 Adjust all users.
2085 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2086 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2087 state.
776209d6 2088
331dbc1b
AD
20892001-12-17 Akim Demaille <akim@epita.fr>
2090
2091 * src/files.h, src/files.c (open_files, close_files): Remove.
2092 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2093 let...
2094 * src/reader.c (reader): Do it.
776209d6 2095
be750e4c
AD
20962001-12-17 Akim Demaille <akim@epita.fr>
2097
2098 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2099
709ae8c6
AD
21002001-12-17 Akim Demaille <akim@epita.fr>
2101
2102 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2103 (flush_reduce): New.
2104 (resolve_sr_conflict): Adjust.
776209d6 2105
f87685c3
AD
21062001-12-17 Akim Demaille <akim@epita.fr>
2107
2108 * src/output.c (output_obstack): Be static and rename as...
2109 (format_obstack): this, to avoid any confusion with files.c's
2110 output_obstack.
2111 * src/reader.h (muscle_obstack): Move to...
2112 * src/output.h: here, since it's defined in output.c.
2113
837491d8
AD
21142001-12-17 Akim Demaille <akim@epita.fr>
2115
2116 * src/output.c (action_row, save_column, default_goto)
2117 (sort_actions, matching_state, pack_vector): Better variable
2118 locality.
2119
796d61fb
AD
21202001-12-17 Akim Demaille <akim@epita.fr>
2121
2122 * src/output.c: Various formatting changes.
776209d6 2123
64d15509
AD
21242001-12-17 Akim Demaille <akim@epita.fr>
2125
2126 * src/files.c (output_files): Free the output_obstack.
2127 * src/main.c (main): Call print and print_graph conditionally.
2128 * src/print.c (print): Work unconditionally.
2129 * src/print_graph.c (print_graph): Work unconditionally.
2130 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2131
fbc8ecb7
MA
21322001-12-16 Marc Autret <autret_m@epita.fr>
2133
2134 * src/output.c (actions_output): Fix. When we use %no-lines,
2135 there is one less line per action.
2136
f0440388
MA
21372001-12-16 Marc Autret <autret_m@epita.fr>
2138
2139 * src/bison.simple: Remove a useless #line directive.
2140 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2141 * src/output.c (get_lines_number): New.
776209d6 2142 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2143 output muscles.
2144 Fix line numbering.
2145 (actions_output): Computes the number of lines taken by actions.
2146 (output_master_parser): Insert new skeleton which is the name of
2147 the output parser file name.
2148
a79986b8
MA
21492001-12-15 Marc Autret <autret_m@epita.fr>
2150
2151 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2152
4ec8e00f
MA
21532001-12-15 Marc Autret <autret_m@epita.fr>
2154
2155 * src/output.c (output_gram): Keep track of the hairy one.
2156
1a4648ff
AD
21572001-12-15 Akim Demaille <akim@epita.fr>
2158
2159 Make `make distcheck' work.
2160
2161 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2162 system.h which uses libgettext.h.
2163
9c2c67e6
AD
21642001-12-15 Akim Demaille <akim@epita.fr>
2165
2166 * src/nullable.c (set_nullable): Useless rules must be skipped,
2167 otherwise, since we range over their symbols, we might look at a
2168 nonterminal which no longer ``exists'', i.e., it is not counted in
2169 `nvars', hence we overflow our arrays.
2170
93ede233
AD
21712001-12-15 Akim Demaille <akim@epita.fr>
2172
2173 The header can also be produced directly, without any obstack!
2174 Yahoo!
2175
2176 * src/files.c, src/files.h (defines_obstack): Remove.
2177 (compute_header_macro): Global.
2178 (defines_obstack_save): Remove.
2179 * src/reader.c (parse_union_decl): No longer output to
2180 defines_obstack: its content can be found in the `stype' muscle
2181 anyway.
2182 (output_token_translations): Merge into...
2183 (symbols_output): this.
2184 Rename as...
2185 (symbols_save): this.
2186 (reader): Adjust.
2187 * src/output.c (header_output): New.
2188 (output): Call it.
2189
2666f928
AD
21902001-12-15 Akim Demaille <akim@epita.fr>
2191
2192 * src/reader.c (parse_union_decl): Instead of handling two obstack
2193 simultaneously, use one to define the `stype' muscle, and use the
2194 value of the latter to fill defines_obstack.
2195 (copy_comment): Remove.
2196 (copy_comment2): Work for a single obstack.
2197 Rename as...
2198 (copy_comment): this.
2199
428046f8
AD
22002001-12-15 Akim Demaille <akim@epita.fr>
2201
2202 * src/lex.c, src/lex.h (xgetc): No longer static.
2203 * src/reader.c (parse_union_decl): Revamp.
2204
ea52d706
AD
22052001-12-15 Akim Demaille <akim@epita.fr>
2206
2207 Still making progress in separating Bison into (i) input, (ii)
2208 process, (iii) output: now we can directly output the parser file
2209 without using table_obstack at all.
2210
2211 * src/files.c, src/files.h (table_obstack): Bye bye.
2212 (parser_file_name): New.
2213 * src/files.c (compute_output_file_names): Compute it.
2214 * src/output.c (actions_output, output_parser)
2215 (output_master_parser): To a file instead of an obstack.
2216
3f96f4dc
AD
22172001-12-15 Akim Demaille <akim@epita.fr>
2218
2219 Attach actions to rules, instead of pre-outputting them to
2220 actions_obstack.
2221
2222 * src/gram.h (rule_t): action and action_line are new members.
2223 * src/reader.c (symbol_list): Likewise.
2224 (copy_action): Save the actions within the rule.
2225 (packgram): Save them in rule_table.
2226 * src/output.c (actions_output): New.
2227 (output_parser): Use it on `%%actions'.
2228 (output_rule_data): Don't free rule_table.
2229 (output): Do it.
2230 (prepare): Don't save the `action' muscle.
2231 * src/bison.simple: s/%%action/%%actions/.
2232
51576fb3
AD
22332001-12-15 Akim Demaille <akim@epita.fr>
2234
2235 * src/reader.c (copy_action): When --yacc, don't append a `;'
2236 to the user action: let it fail if lacking.
dee049eb 2237 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 2238
2648a72d
AD
22392001-12-14 Akim Demaille <akim@epita.fr>
2240
2241 * src/lex.c (literalchar): Simply return the char you decoded, non
2242 longer mess around with obstacks and int pointers.
2243 Adjust all callers.
2244
92790e5b
AD
22452001-12-14 Akim Demaille <akim@epita.fr>
2246
2247 * src/lex.c (literalchar): Don't escape the special characters,
2248 just decode them, and keep them as char (before, eol was output as
2249 the 2 char string `\n' etc.).
2250 * src/output.c (output_rule_data): Use quotearg to output the
2251 token strings.
2252
927c1557
PE
22532001-12-13 Paul Eggert <eggert@twinsun.com>
2254
2255 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2256 Do not infringe on the global user namespace when using C++.
2257 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2258 All uses of `fprintf' and `stderr' changed.
2259
2260 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2261
ed8e1f68
AD
22622001-12-13 Akim Demaille <akim@epita.fr>
2263
2264 The computation of nullable is broken: it doesn't handle empty
2265 RHS's properly.
2266
2267 * tests/torture.at (GNU AWK Grammar): New.
2268 * tests/sets.at (Nullable): New.
2269 * src/nullable.c (set_nullable): Instead of blindly looping over
2270 `ritems', loop over the rules, and then over their rhs's.
2271
2272 Work around Autotest bugs.
2273
2274 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2275 frame, because Autotest understand lines starting with a `+' as
2276 traces from the shell. Then, they are not processed properly.
2277 Admittedly an Autotest bug, but we don't have time to wait for
2278 Autotest to catch up.
2279 * tests/regression.at (Broken Closure): Adjust to the new table
2280 frames.
2281 Move to...
2282 * tests/sets.at: here.
2283
cb581495
AD
22842001-12-13 Akim Demaille <akim@epita.fr>
2285
2286 * src/closure.c (closure): Use nrules instead of playing tricks
2287 with BITS_PER_WORD.
2288
2e729273
AD
22892001-12-13 Akim Demaille <akim@epita.fr>
2290
2291 * src/print.c (print_actions): Output the handling of `$' as the
2292 traces do: shifting the token EOF. Before EOF was treated as a
2293 nonterminal.
2294 * tests/regression.at: Adjust some tests.
2295 * src/print_graph.c (print_core): Complete the set of items via
2296 closure. The next-to-final and final states are still unsatisfying,
2297 but that's to be addressed elsewhere.
2298 No longer output the rule numbers, but do output the state number.
2299 A single loop for the shifts + gotos is enough, but picked a
2300 distinct color for each.
2301 (print_graph): Initialize and finalize closure.
2302
107f7dfb
AD
23032001-12-13 Akim Demaille <akim@epita.fr>
2304
2305 * src/reader.c (readgram): Remove dead code, an strip useless
2306 braces.
2307 (get_type): Remove, unused.
2308
9b53a24f
AD
23092001-12-12 Akim Demaille <akim@epita.fr>
2310
2311 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
2312 on that of lib/error.c.
2313
dbfb6dcd
AD
23142001-12-12 Akim Demaille <akim@epita.fr>
2315
2316 Some hosts don't like `/' in includes.
2317
2318 * src/system.h: Include libgettext.h without qualifying the path.
2319 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
2320 $(top_srcdir).
2321
c25fb648
MA
23222001-12-11 Marc Autret <autret_m@epita.fr>
2323
2324 * src/output.c (output_parser): Remove useless muscle.
2325
710ddc4f
MA
23262001-12-11 Marc Autret <autret_m@epita.fr>
2327
2328 * src/bison.simple: Remove #line just before %%epilogue. It
2329 is now handled in ...
2330 * src/reader.c (read_additionnal_code): Add the output of a
2331 #line for the epilogue.
2332
e83d80b8
MA
23332001-12-10 Marc Autret <autret_m@epita.fr>
2334
927c1557 2335 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
2336 replace precedent remove.
2337 * src/bison.simple: Remove #line before %%prologue because
2338 %%input-line is wrong at this time.
2339
971d5158
MA
23402001-12-10 Marc Autret <autret_m@epita.fr>
2341
2342 * src/reader.c (symbols_output): Clean up.
927c1557 2343 * src/output.c (output_gram, output): Clean up.
971d5158 2344
5edafffd
AD
23452001-12-10 Akim Demaille <akim@epita.fr>
2346
2347 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2348 * src/LR0.c (set_state_table): here.
2349 * src/lalr.c (lalr): Call it.
2350
0279f8e9
AD
23512001-12-10 Akim Demaille <akim@epita.fr>
2352
2353 * src/state.h (shifts): Remove the `number' member: shifts are
2354 attached to state, hence no longer need to be labelled with a
2355 state number.
2356
190c4f5f
AD
23572001-12-10 Akim Demaille <akim@epita.fr>
2358
2359 Now that states have a complete set of members, the linked list of
2360 shifts is useless: just fill directly the state's shifts member.
2361
2362 * src/state.h (shifts): Remove the `next' member.
2363 * src/LR0.c (first_state, last_state): Remove.
2364 Adjust the callers.
2365 (augment_automaton): Don't look for the shifts that must be added
2366 a shift on EOF: it is those of the state we looked for! But now,
2367 since shifts are attached, it is no longer needed to looking
2368 merely by its id: its number.
2369
2a73b93d
AD
23702001-12-10 Akim Demaille <akim@epita.fr>
2371
2372 * src/LR0.c (augment_automaton): Better variable locality.
2373 Remove an impossible branch: if there is a state corresponding to
2374 the start symbol being shifted, then there is shift for the start
2375 symbol from the initial state.
2376
74392f6a
AD
23772001-12-10 Akim Demaille <akim@epita.fr>
2378
2379 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2380 only when appropriate: when insert_start_shifting_state' is not
2381 invoked.
2382 * tests/regression.at (Rule Line Numbers): Adjust.
2383
37c82725
AD
23842001-12-10 Akim Demaille <akim@epita.fr>
2385
2386 * src/LR0.c (augment_automaton): Now that all states have shifts,
2387 merge the two cases addition shifts to the initial state.
2388
6a164e0c
AD
23892001-12-10 Akim Demaille <akim@epita.fr>
2390
2391 * src/lalr.c (set_state_table): Move to...
2392 * src/LR0.c: here.
2393 * src/lalr.c (lalr): Don't call it...
2394 * src/LR0.c (generate_states): do it.
2395 * src/LR0.h (first_state): Remove, only the table is used.
2396
7215de24
AD
23972001-12-10 Akim Demaille <akim@epita.fr>
2398
2399 * src/LR0.h (first_shift, first_reduction): Remove.
2400 * src/lalr.c: Don't use first_shift: find shifts through the
2401 states.
2402
80e25d4d
AD
24032001-12-10 Akim Demaille <akim@epita.fr>
2404
2405 * src/LR0.c: Attach shifts to states as soon as they are
2406 computed.
2407 * src/lalr.c (set_state_table): Instead of assigning shifts to
2408 state, just assert that the mapping was properly done.
2409
0ab3728b
AD
24102001-12-10 Akim Demaille <akim@epita.fr>
2411
2412 * src/LR0.c (insert_start_shift): Rename as...
2413 (insert_start_shifting_state): this.
2414 (insert_eof_shifting_state, insert_accepting_state): New.
2415 (augment_automaton): Adjust.
2416 Better locality of the variables.
2417 When looking if the start_symbol is shifted from the initial
2418 state, using `while (... symbol != start_symbol ...)' sounds
2419 better than `while (... symbol < start_symbol ...)': If fail
2420 to see how the order between symbols could be relevant!
2421
78af9bbc
AD
24222001-12-10 Akim Demaille <akim@epita.fr>
2423
2424 * src/getargs.h: Don't declare `spec_name_prefix' and
2425 `spec_file_prefix', declared by src/files.h.
2426 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2427 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2428 * src/output.c (prepare): Adjust.
2429 * src/reader.c (symbols_output): Likewise.
2430 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2431
bdef2a41
AD
24322001-12-10 Akim Demaille <akim@epita.fr>
2433
2434 * src/muscle_tab.c (muscle_init): NULL is a better default than
2435 `"0"'.
2436
3735969c
AD
24372001-12-10 Akim Demaille <akim@epita.fr>
2438
2439 * src/reader.c (reader): Calling symbols_output once is enough.
2440
49701457
AD
24412001-12-10 Akim Demaille <akim@epita.fr>
2442
2443 Now that states have a complete set of members, the linked list of
2444 reductions is useless: just fill directly the state's reductions
2445 member.
2446
2447 * src/state.h (struct reductions): Remove member `number' and
2448 `next'.
2449 * src/LR0.c (first_reduction, last_reduction): Remove.
2450 (save_reductions): Don't link the new reductions, store them in
2451 this_state.
2452 * src/lalr.c (set_state_table): No need to attach reductions to
2453 states, it's already done.
2454 * src/output.c (output_actions): No longer free the shifts, then
2455 the reductions, then the states: free all the states and their
2456 members.
2457
0edad749
AD
24582001-12-10 Akim Demaille <akim@epita.fr>
2459
2460 * src/options.c (OPTN, DRTV, BOTH): New.
2461 (option_table): Use them.
2462
0edad749
AD
2463 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2464 the job of system.h.
2465 * src/options.c: Don't include stdio.h and xalloc.h for the same
2466 reasons.
2467
5449dd0f
AD
24682001-12-10 Akim Demaille <akim@epita.fr>
2469
2470 * src/output.c (output, prepare): Make sure the values of the
2471 muscles `action' and `prologue' are 0-terminated.
2472
a870c567
AD
24732001-12-10 Akim Demaille <akim@epita.fr>
2474
2475 Clean up GCC warnings.
2476
2477 * src/reader.c (copy_action): `buf' is not used.
2478 (parse_skel_decl): Be static.
2479 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2480 * src/options.h (create_long_option_table): Have a real prototype.
2481 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2482 (hash_delete_at): Return const void *.
2483 Adjust casts to preserve the const.
2484
80df8768
AD
24852001-12-10 Akim Demaille <akim@epita.fr>
2486
2487 * configure.in: Require 2.52g.
2488 M4 is not needed, but AUTOM4TE is.
2489 * m4/m4.m4: Remove.
2490 * tests/Makefile.am: Adjust.
2491
f693ad14
AD
24922001-12-10 Akim Demaille <akim@epita.fr>
2493
2494 One structure for states is enough, even though theoretically
2495 there are LR(0) states and LALR(1) states.
2496
2497 * src/lalr.h (state_t): Remove.
2498 (state_table): Be state_t **, not state_t *.
2499 * src/state.h (core, CORE_ALLOC): Rename as...
2500 (state_t, STATE_ALLOC): this.
2501 Add the LALR(1) members: shifts, reductions, errs.
2502 * src/LR0.c (state_table): Rename as...
2503 (state_hash): this, to avoid name clashes with the global
2504 `state_table'.
2505 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2506 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2507
74ffbcb6
AD
25082001-12-10 Akim Demaille <akim@epita.fr>
2509
2510 Bison dumps core on bash.y.
2511 Reported by Pascal Bart.
2512
2513 * src/warshall.c (bitmatrix_print): New.
2514 (TC): Use it.
2515 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2516 j must be the outer loop.
2517 * tests/regression.at (Broken Closure): New.
2518
07708e19
AD
25192001-12-05 Akim Demaille <akim@epita.fr>
2520
2521 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2522 its argument.
2523