%{ open Ast %} %token ID %token COMMENT %token AT %token LPAREN %token RPAREN %token SCOLON %token EQUALS %token EOF %start prog %% prog: | e = expr; EOF { e } ; expr: | c = COMMENT { Comment c } | AT; a = ID; { Ainstr a } | LPAREN; s = ID; RPAREN { Ginstr s } | c = ID; SCOLON; j = ID { Cinstr ("", c, j) } | d = ID; EQUALS; c = ID { Cinstr (d, c, "") } | c = ID; { Cinstr ("", c, "") } | e = expr; COMMENT { e } ;