%{ %} /* Tokens and types */ %token INT %token IDENT %token EOF ADD SUB MUL NOT EQUAL LPAREN RPAREN %start start %type expr %type start %% start: | expr EOF { $1 } expr: | IDENT { () } | INT { () } | NOT expr { () } | SUB expr { () } | expr ADD expr { () } | expr SUB expr { () } | expr MUL expr { () } | LPAREN expr RPAREN { () }