multistart: allow tokens as start symbols

After all, why not?

* src/reader.c (switching_token): Use symbol_id_get.
(check_start_symbols): Require that the start symbol is a token only
if it's the only one.
* examples/c/lexcalc/parse.y: Let NUM be a start symbol.
This commit is contained in:
Akim Demaille
2020-08-04 16:47:19 +02:00
parent d9cf99b6a5
commit 683040b324
3 changed files with 15 additions and 9 deletions

View File

@@ -79,7 +79,7 @@
%type <int> exp expression line
%printer { fprintf (yyo, "%d", $$); } <int>
%start input expression
%start input expression NUM
// Precedence (from lowest to highest) and associativity.
%left "+" "-"