Yecc Bug

Manolis Papadakis manopapad@REDACTED
Thu Mar 4 12:38:04 CET 2010


The parser produced by this grammar:

Nonterminals boolean command.
Terminals '(' ')' if then else true and or skip while do.
Rootsymbol command.
Left 100 or.
Left 200 and.
boolean -> '(' boolean ')'.
boolean -> 'true'.
boolean -> boolean 'and' boolean.
boolean -> boolean 'or' boolean.
command -> 'skip'.
command -> 'if' boolean 'then' command 'else' command.
command -> 'while' boolean 'do' command.

crashes when encountering an 'or', but works fine with 'and'. Here is
an example:

3> bug2:parse([{'if',1}, {'true',1}, {'or',1}, {'true',1}, {'then',1},
{'skip',1}, {'else',1}, {'skip',1}]).
** exception error: {yecc_bug,"1.3",{missing_state_in_action_table,11}}
     in function  bug2:yeccpars2/7
     in call from bug2:yeccpars0/5

This is as simple as I've managed to get the failing grammar. Removing
the parentheses, 'and' or 'while' constructs from the grammar fixes
the crash.


More information about the erlang-bugs mailing list