anonymous.mly 205 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
/* Test of the new anonymous rule syntax. */

%token<int> A B C D EOF
%start<int list> phrase

%%

phrase:
  xs = list(x = A | x = B | x = C { x })
  ys = list(x = D y = D { x + y })
  EOF
    { xs @ ys }