bison-mysterious-conflict.mly 358 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
/* This grammar is not LALR(1). It is taken from the Bison manual. */

%token ID COMMA COLON
%start <unit> def

%%

def:
  param_spec return_spec COMMA
    { () }

param_spec:
  typ
    { () }
| separated_nonempty_list(COMMA, name) COLON typ
    { () }

return_spec:
  typ
    { () }
| name COLON typ
    { () }

typ:
  ID
    { () }

name:
  ID
    { () }