%{ type ('a, 'b) either = Left of 'a | Right of 'b %}
%start other
%start phrase
%token A
%token B
%token C
%token D
%token EOF
%type other
%type <(int, int) either> phrase
%%
midrule___anonymous_1_:
_1 = C
{let x =
()
in
( x )}
| _1 = D
{let x =
()
in
( x )}
list___anonymous_0_A_B__:
{ ( [] )}
| x' = A xs = list___anonymous_0_A_B__
{let x =
let x = x' in
( Left x )
in
( x :: xs )}
| y = B xs = list___anonymous_0_A_B__
{let x =
( Right y )
in
( x :: xs )}
phrase:
_1 = C _2 = list___anonymous_0_A_B__ _1' = D _2' = list___anonymous_0_A_B__ _3 = EOF
{let ys =
let _2 = _2' in
let _1 = _1' in
( _1 )
in
let xs =
( _1 )
in
( xs @ ys )}
other:
_1 = seplist_A_ _2 = EOF
{ ()}
seplist_A_:
_1 = A
{ ()}
| _1 = A _2 = midrule___anonymous_1_ _3 = seplist_A_
{ ()}
%%