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:
Joel E. Denny
2006-08-20 03:10:18 +00:00
parent 6d0ef4ec20
commit 4d7370cb4f
5 changed files with 58 additions and 7 deletions

View File

@@ -1,3 +1,15 @@
2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
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.
2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
Redo some of the previous commit: add back the ability to use