mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 14:23:04 +00:00
Allow %start after the first rule.
* src/reader.c (grammar_current_rule_begin): Don't set the start symbol when parsing the first rule. (check_and_convert_grammar): Search for it here after all grammar declarations have been parsed. Skip midrules, which have dummy LHS nonterminals. * src/symtab.c (symbol_is_dummy): New function. * src/symtab.h (symbol_is_dummy): Declare it. * tests/input.at (%start after first rule): New test.
This commit is contained in:
@@ -133,6 +133,9 @@ symbol *symbol_get (const char *key, location loc);
|
||||
Its name cannot conflict with the user's names. */
|
||||
symbol *dummy_symbol_get (location loc);
|
||||
|
||||
/** Is this a dummy nonterminal? */
|
||||
bool symbol_is_dummy (const symbol *sym);
|
||||
|
||||
/** Declare the new symbol \c sym. Make it an alias of \c symval. */
|
||||
void symbol_make_alias (symbol *sym, symbol *symval, location loc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user