Commit Graph

138 Commits

Author SHA1 Message Date
Paul Eggert
02e090934a New translation. 2002-08-12 14:04:38 +00:00
Akim Demaille
c6f1a33c06 Separate parser tables computation and output.
* src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
(conflict_list, conflict_list_cnt, table, check, table_ninf)
(yydefgoto, yydefact, high): Move to...
* src/tables.h, src/tables.c: here.
* src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
(VECTOR_NUMBER_MIN, state_number_to_vector_number)
(symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
(froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
(ACTION_MIN, actrow, order, nentries, pos, conflrow)
(conflict_list_free, table_size, lowzero, table_grow, conflict_row)
(action_row, save_row, token_actions, save_column, default_goto)
(goto_actions, sort_actions, matching_state, pack_vector)
(table_ninf_remap, pack_table, prepare_actions): Move to...
* src/tables.c: here.
* src/tables.h, src/tables.c(tables_generate, tables_free): New.
* src/output.c (token_actions, output_base, output_conflicts)
(output_check): Merge into...
(prepare_actions): this.
(actions_output): Rename as...
(user_actions_output): this.
* src/main.c (main): Call tables_generate and tables_free.
2002-07-31 21:52:00 +00:00
Akim Demaille
c5f5043618 Regen. 2002-07-09 13:05:22 +00:00
Akim Demaille
3a9e26be57 Regen. 2002-07-03 12:50:58 +00:00
Akim Demaille
524346a3a3 Regen. 2002-07-02 11:39:04 +00:00
Akim Demaille
88e7e94146 Regen. 2002-06-30 17:37:38 +00:00
Akim Demaille
4fa887b790 regen. 2002-06-28 17:12:10 +00:00
Paul Hilfinger
676385e29c Initial check-in introducing experimental GLR parsing. See entry in
ChangeLog dated 2002-06-27 from Paul Hilfinger for details.
2002-06-28 02:26:44 +00:00
Akim Demaille
7cca31a2f2 Update. 2002-06-27 12:18:03 +00:00
Akim Demaille
2a10b47aaf Update. 2002-06-27 11:56:03 +00:00
Akim Demaille
1ae7286376 * data/bison.simple (b4_symbol_actions): New, replaces...
(b4_symbol_destructor, b4_symbol_printer): these.
(yysymprint): Be sure to call YYPRINT only for tokens, and using
user token numbers.
2002-06-20 11:46:59 +00:00
Akim Demaille
1ce5149ac8 Regen. 2002-06-20 09:05:10 +00:00
Akim Demaille
02097d3eab Regen. 2002-06-19 09:02:43 +00:00
Akim Demaille
abd741b1f6 Regen. 2002-06-17 08:44:05 +00:00
Akim Demaille
74886d31e7 Regen. 2002-06-15 18:27:15 +00:00
Akim Demaille
8efe435c05 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
(input): Don't try to initialize yylloc here, do it in the
scanner.
* src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
* src/gram.h (rule_t): Change line and action_line into location
and action_location, of location_t type.
Adjust all dependencies.
* src/location.h, src/location.c (empty_location): New.
* src/reader.h, src/reader.c (grammar_start_symbol_set)
(grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
(grammar_current_rule_symbol_append)
(grammar_current_rule_action_append): Expect a location as argument.
* src/reader.c (grammar_midrule_action): Adjust to attach an
action's location as dummy symbol location.
* src/symtab.h, src/symtab.c (startsymbol_location): New.
* tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
the line numbers.
2002-06-15 18:21:11 +00:00
Akim Demaille
e9955c8373 Have Bison grammars parsed by a Bison grammar.
* src/reader.c, src/reader.h (prologue_augment): New.
* src/reader.c (copy_definition): Remove.
* src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
(grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
(grammar_current_rule_prec_set, grammar_current_rule_check)
(grammar_current_rule_symbol_append)
(grammar_current_rule_action_append): Export.
* src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
(symbol_list_action_append): Remove.
Hook the routines from reader.
* src/scan-gram.l: In INITIAL, characters and strings are tokens.
* src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
* src/reader.c (read_declarations): Remove, unused.
* src/parse-gram.y: Handle the epilogue.
* src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
(grammar_start_symbol_set): this.
* src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
* src/reader.c (readgram): Remove, unused.
(reader): Adjust to insert eoftoken and axiom where appropriate.
* src/reader.c (copy_dollar): Replace with...
* src/scan-gram.h (handle_dollar): this.
* src/parse-gram.y: Remove `%thong'.
* src/reader.c (copy_at): Replace with...
* src/scan-gram.h (handle_at): this.
* src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
New.
* src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
time being.
* src/reader.h, src/reader.c (grammar_rule_end): New.
* src/parse.y (current_type, current_class): New.
Implement `%nterm', `%token' support.
Merge `%term' into `%token'.
(string_as_id): New.
* src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
type name.
* src/parse-gram.y: Be sure to handle properly the beginning of
rules.
* src/parse-gram.y: Handle %type.
* src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
* src/parse-gram.y: More directives support.
* src/options.c: No longer handle source directives.
* src/parse-gram.y: Fix %output.
* src/parse-gram.y: Handle %union.
Use the prologue locations.
* src/reader.c (parse_union_decl): Remove.
* src/reader.h, src/reader.c (epilogue_set): New.
* src/parse-gram.y: Use it.
* data/bison.simple, data/bison.c++: b4_stype is now either not
defined, then default to int, or to the contents of %union,
without `union' itself.
Adjust.
* src/muscle_tab.c (muscle_init): Don't predefine `stype'.
* src/output.c (actions_output): Don't output braces, as they are
already handled by the scanner.
* src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
characters to themselves.
* tests/reduce.at (Reduced Automaton): End the grammars with %% so
that the epilogue has a proper #line.
* src/parse-gram.y: Handle precedence/associativity.
* src/symtab.c (symbol_precedence_set): Requires the symbol to be
a terminal.
* src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
* tests/calc.at: Do not use `%token "foo"' as it makes not sense
at all to define terminals that cannot be emitted.
* src/scan-gram.l: Escape M4 characters.
* src/scan-gram.l: Working properly with escapes in user
strings/characters.
* tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
(AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
grammar.
Use more modest sizes, as for the time being the parser does not
release memory, and therefore the process swallows a huge amount
of memory.
* tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
stricter %token grammar.
* src/symtab.h (associativity): Add `undef_assoc'.
(symbol_precedence_set): Do nothing when passed an undef_assoc.
* src/symtab.c (symbol_check_alias_consistence): Adjust.
* tests/regression.at (Invalid %directive): Remove, as it is now
meaningless.
(Invalid inputs): Adjust to the new error messages.
(Token definitions): The new grammar doesn't allow too many
eccentricities.
* src/lex.h, src/lex.c: Remove.
* src/reader.c (lastprec, skip_to_char, read_signed_integer)
(copy_character, copy_string2, copy_string, copy_identifier)
(copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
(parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
(parse_action): Remove.
* po/POTFILES.in: Adjust.
2002-06-11 20:16:05 +00:00
Akim Demaille
39fd0b540d Regen. 2002-06-11 19:52:01 +00:00
Akim Demaille
5346290247 Regen. 2002-06-11 08:17:05 +00:00
Akim Demaille
0624954c7e Regen. 2002-06-10 08:44:06 +00:00
Akim Demaille
2f1afb737f Move symbols handling code out of the reader.
* src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
(axiom): Move to...
* src/symtab.h, src/symtab.c: here.
* src/gram.c (start_symbol): Remove: use startsymbol->number.
* src/reader.c (startval): Rename as...
* src/symtab.h, src/symtab.c (startsymbol): this.
* src/reader.c: Adjust.
* src/reader.c (symbol_check_defined, symbol_make_alias)
(symbol_check_alias_consistence, symbol_pack, symbol_translation)
(token_translations_init)
Move to...
* src/symtab.c: here.
* src/reader.c (packsymbols): Move to...
* src/symtab.h, src/symtab.c (symbols_pack): here.
* src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
argument.
2002-06-10 08:35:39 +00:00
Akim Demaille
9411f454b0 Regen. 2002-06-03 07:29:29 +00:00
Akim Demaille
b0e5f19eab Regen. 2002-05-27 06:29:28 +00:00
Akim Demaille
4fd2214bc6 Regen. 2002-05-26 18:38:21 +00:00
Akim Demaille
ec3bc3961d * doc/bison.texinfo (Debugging): Split into...
(Tracing): this new section, its former contents, and...
(Understanding): this new section.
* src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
by...
(report_flag): this.
Adjust all dependencies.
(report_args, report_types, report_argmatch): New.
(usage, getargs): Report/support -r, --report.
* src/options.h
(struct option_table_struct): Rename as..,
(struct option_table_s): this.
Rename the `set_flag' member to `flag' to match with getopt_long's
struct.
* src/options.c (option_table): Split verbose into an entry for
%verbose, and another for --verbose.
Support --report/-r, so remove -r from the obsolete --raw.
* src/print.c: Attach full item sets and lookaheads reports to
report_flag instead of trace_flag.
* lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2002-05-25 16:12:40 +00:00
Akim Demaille
5181e40827 Regen. 2002-05-06 08:33:43 +00:00
Akim Demaille
9bbd181ae0 Regen. 2002-05-06 07:45:55 +00:00
Akim Demaille
77f6f42074 Regen. 2002-05-02 16:46:05 +00:00
Akim Demaille
84614e1373 * configure.in (ALL_LINGUAS): Remove.
* po/LINGUAS, hr.po: New.
2002-05-02 15:13:09 +00:00
Akim Demaille
64bd62a1be Regen. 2002-05-02 15:05:02 +00:00
Akim Demaille
6cbfbcc58c * configure.in (AC_INIT): Bump to 1.49b.
(AM_INIT_AUTOMAKE): Short invocation.
2002-05-02 09:25:54 +00:00
Akim Demaille
b219268ad8 Update. 2002-05-02 07:46:51 +00:00
Akim Demaille
a05fafb944 Update from TP. 2002-05-02 07:30:41 +00:00
Akim Demaille
216eb8c9f2 Regen. 2002-04-22 09:00:44 +00:00
Akim Demaille
01e5c81773 Regen. 2002-04-10 17:13:15 +00:00
Akim Demaille
491bdd7ae5 Regen. 2002-04-08 12:34:08 +00:00
Akim Demaille
df33b92836 Regen. 2002-04-07 17:46:22 +00:00
Akim Demaille
c3b407f430 * src/gram.h, src/gram.c (rules_rhs_length): New.
(ritem_longest_rhs): Use it.
* src/gram.h (rule_t): `number' is a new member.
* src/reader.c (packgram): Set it.
* src/reduce.c (reduce_grammar_tables): Move the useless rules at
the end of `rules', and count them out of `nrules'.
(reduce_output, dump_grammar): Adjust.
* src/print.c (print_grammar): It is no longer needed to check for
the usefulness of a rule, as useless rules are beyond `nrules + 1'.
* tests/reduce.at (Reduced Automaton): New test.
2002-04-07 17:36:38 +00:00
Akim Demaille
4416fcdb02 Regen. 2002-04-07 16:13:46 +00:00
Akim Demaille
9651150243 Regen. 2002-03-19 08:29:19 +00:00
Akim Demaille
01228b70de Regen. 2002-03-19 07:45:46 +00:00
Akim Demaille
9208d17fa9 Use Gettext 0.11.1. 2002-03-14 18:31:14 +00:00
Akim Demaille
e69bfebb45 Regen. 2002-03-06 17:19:14 +00:00
Akim Demaille
c1a29a5b2d Regen. 2002-03-04 16:45:18 +00:00
Akim Demaille
b23e820381 Regen. 2002-03-04 14:04:09 +00:00
Akim Demaille
ad950f8307 Regen. 2002-02-25 14:55:38 +00:00
Akim Demaille
10b6b2be55 Regen. 2002-02-25 13:44:36 +00:00
Akim Demaille
3309b786a3 Regen. 2002-02-14 11:51:36 +00:00
Akim Demaille
b418ecd84f * tests/regression.at (%nonassoc and eof): Don't include
nonportable headers.
2002-02-11 13:38:43 +00:00
Akim Demaille
9f007dfecc Regen. 2002-02-06 17:21:18 +00:00