* src/parse-gram.y (rules_or_grammar_declaration): Add an error

recovery rule, and forbid extensions when --yacc.
(gram_error): Use complain_at.
* src/reader.c (reader): Exit if there were parse errors.
This commit is contained in:
Akim Demaille
2002-07-09 14:48:01 +00:00
parent c5f5043618
commit b275314e2d
5 changed files with 209 additions and 174 deletions

View File

@@ -502,6 +502,11 @@ reader (void)
scanner_initialize ();
gram_parse (&gram_control);
/* If something went wrong during the parsing, don't try to
continue. */
if (complain_message_count)
exit (1);
/* Grammar has been read. Do some checking */
if (nrules == 0)
fatal (_("no rules in the input grammar"));