/* Input parser for bison
- Copyright 1984, 1986, 1989, 1992, 1998, 2000, 2001
+ Copyright (C) 1984, 1986, 1989, 1992, 1998, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
unlex (t1);
symval = ssave;
if (t1 == tok_colon)
- break;
+ {
+ complain (_("previous rule lacks an ending `;'"));
+ break;
+ }
if (!first_rhs) /* JF */
first_rhs = symval;
/* Warn if there is no default for $$ but we need one. */
else if (!xactions && !first_rhs && lhs->type_name != 0)
complain (_("empty rule for typed nonterminal, and no action"));
+ if (t == tok_two_percents || t == tok_eof)
+ complain (_("previous rule lacks an ending `;'"));
if (t == tok_semicolon)
t = lex ();
}
/* The grammar as a symbol_list is no longer needed. */
LIST_FREE (symbol_list, grammar);
}
+
+void
+grammar_free (void)
+{
+ XFREE (ritem);
+ free (rules + 1);
+ /* Free the symbol table data structure. */
+ free_symtab ();
+}