Commit Graph

225 Commits

Author SHA1 Message Date
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
Akim Demaille
5bb18f9a19 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
* data/: here.
2002-02-05 09:57:52 +00:00
Akim Demaille
30f8c3953f * tests/regression.at (%nonassoc and eof): New.
Suggested by Robert Anisko.
2002-01-25 16:24:40 +00:00
Akim Demaille
bb0146c2a9 * po/it.po: New. 2002-01-21 19:29:04 +00:00
Akim Demaille
c57b2479ff * configure.in: Use AC_FUNC_STRNLEN. 2002-01-11 13:33:05 +00:00
Akim Demaille
e9f87b5b7d Regen. 2002-01-07 08:44:08 +00:00
Akim Demaille
25d810906c * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
skeleton.h.
2002-01-06 20:49:27 +00:00
Akim Demaille
1239777d4f * src/skeleton.h: New.
* src/output.c (output_parser, output_master_parser): Remove, dead
code.
* src/output.h (get_lines_number, actions_output, guards_output)
(token_definitions_output): Prototype them.
* src/parse-skel.y: Add the license notice.
Include output.h and skeleton.h.
(process_skeleton): Returns void, and takes a single parameter.
* src/scan-skel.l: Add the license notice.
Include skeleton.h.
Don't use %option yylineno: it seems that then Flex imagines
REJECT has been used, and therefore it won't reallocate its
buffers (which makes no other sense to me than a bug).  It results
in warnings for `unused: yy_flex_realloc'.
to guess if the generated parsers should have '.tab' in their
* src/Makefile.am (bison_SOURCES): Add scan-skel.l and
2001-12-30 21:05:12 +00:00
Akim Demaille
3cd5bcdd19 Regen. 2001-12-29 14:46:03 +00:00
Akim Demaille
5499894828 ChangeLog fixes, and PO regen. 2001-12-27 18:26:20 +00:00
Akim Demaille
7742ddebf1 * src/output.c (prepare): Drop the muscle `ntbase' which
duplicates ntokens.
* src/bison.simple: Formatting/comment changes.
Use YYNTOKENS only, which is documented, but not YYNTBASE, which
is an undocumented synonym.
2001-12-27 18:04:28 +00:00
Akim Demaille
23a1adea4a Regen. 2001-12-17 17:33:59 +00:00
Akim Demaille
367c7a47d4 Regen. 2001-12-17 17:30:47 +00:00
Akim Demaille
5ee2aaf2fa Regen. 2001-12-15 17:11:49 +00:00