belloeil.mly 759 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
(* Submitted by Thierry Belloeil -- thanks. *)

(* This grammar shows a problem with the conflict explanation module.
   The %nonassoc directives force a shift/reduce conflict to be resolved
   in favor of reduction. This cuts a transition in the automaton, which
   in turn prevents another shift/reduce conflict from being explained. *)

(* Beware: removing the %nonassoc or %prec directives causes the final
   numbering of states to change (but the raw numbers remain the same). *)

%token SIZE LOG EOF ARROW BANG

%nonassoc BANG
%nonassoc below_NUM

%start desc

%type <unit> desc

%%

desc:
  exprl ARROW expr EOF {}

expr:
  | expr BANG  {}
  | expr SIZE  {}
  | LOG exprl  {}

exprl:
    BANG exprl {}
  | SIZE exprl {}
  |	       {} %prec below_NUM