anonymous-param-redundant.opp.exp 1013 Bytes
Newer Older
1 2 3 4
%{ type ('a, 'b) either = Left of 'a | Right of 'b %}
%start other
%start phrase
%token <int> A
5 6 7 8
%token <int> B
%token <int> C
%token <int> D
%token <int> EOF
9 10 11 12
%type <unit> other
%type <(int, int) either> phrase
%%

13
midrule___anonymous_1_:
14
  _1 = C
15
    {let x =
16
                ()
17 18
in
    ( x )}
19
| _1 = D
20
    {let x =
21
                       ()
22 23 24 25 26 27
in
    ( x )}

list___anonymous_0_A_B__:
  
    {    ( [] )}
28
| x' = A xs = list___anonymous_0_A_B__
29
    {let x =
30
  let x = x' in
31 32 33
            ( Left  x )
in
    ( x :: xs )}
34
| y = B xs = list___anonymous_0_A_B__
35 36 37 38 39
    {let x =
            ( Right y )
in
    ( x :: xs )}

40
phrase:
41
  _1 = C _2 = list___anonymous_0_A_B__ _1' = D _2' = list___anonymous_0_A_B__ _3 = EOF
42
    {let ys =
43 44
  let _2 = _2' in
  let _1 = _1' in
45 46 47 48 49 50 51 52 53 54 55 56 57 58
      ( _1 )
in
let xs =
      ( _1 )
in
    ( xs @ ys )}

other:
  _1 = seplist_A_ _2 = EOF
    {                 ()}

seplist_A_:
  _1 = A
    {    ()}
59 60
| _1 = A _2 = midrule___anonymous_1_ _3 = seplist_A_
    {                                    ()}
61

62 63 64
%%