%{ (* Emacs, open this with -*- tuareg -*- *) open AST %} %token INT %token ID %token PLUS EOF %start phrase %left PLUS %% phrase: e=exp EOF { e } exp: x=INT { LInt x } | x=ID { Id x } | e1=exp PLUS e2=exp { Add (e1, e2) }