Commit 3dad74fc authored by POTTIER Francois's avatar POTTIER Francois

bench/good: enable --explain during "make test".

bench/good: added the known bug cutdown.mly.
parent 71d3aaad
......@@ -51,7 +51,7 @@ test: clean $(RESULTS)
fi; \
if test -e $*.expected; then \
if diff $@ $*.expected >& /dev/null; then \
if $(MENHIR) $$CMD >& $*.out; then \
if $(MENHIR) --explain $$CMD >& $*.out; then \
echo "[OK] $$FILES"; \
else \
if ! grep $* 00KNOWN_FAILURES >& /dev/null; then ( \
......
%{ %}
%start goal
%token R_BRACKET
%token NEW
%token L_BRACKET
%token <string> INTEGER_LITERAL
%token EOF
%token ASSIGN
%type <unit> goal
%%
goal:
| assignment EOF
{ }
primary:
| INTEGER_LITERAL
{ }
| array_access
{ }
primary_not_name:
| array_access
{ }
| NEW L_BRACKET expression R_BRACKET
{ }
array_access:
| expression L_BRACKET primary_not_name R_BRACKET
{ }
expression:
| primary
{ }
| assignment
{ }
assignment:
| left_hand_side ASSIGN expression
{ }
left_hand_side:
| primary_not_name
{ }
%%
/* Bug reported by Jan Midtgaard on 2012/09/25. */
/* The bug manifests itself when --explain is provided. */
/* Menhir says:
Warning: one state has shift/reduce conflicts.
Warning: one state has reduce/reduce conflicts.
** Internal failure (Pager's theorem).
** Tokens of interest: R_BRACKET
** Goal state: 14
*/
%{ %}
%token EOF
%token NEW
%token L_BRACKET R_BRACKET
%token ASSIGN
%token <string>INTEGER_LITERAL
%start <unit> goal /* the entry point */
%%
goal : assignment EOF { }
;
primary
: INTEGER_LITERAL { }
| array_access { }
;
primary_not_name
: array_access { }
| NEW L_BRACKET expression R_BRACKET { }
;
array_access
: expression L_BRACKET primary_not_name R_BRACKET { }
expression
: primary { }
| assignment { }
;
assignment
: left_hand_side ASSIGN expression { }
;
left_hand_side
: primary_not_name { }
;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment