It is impossible to guess what is wrong on your side, since you are not revealing enough information. I can guess that you somehow read the error message incorrectly, and the problem is in another file. For example, the following file:
%{ let f PLUS _ = () %} %token PLUS %left PLUS %start exp %type <unit> exp %% exp : exp PLUS exp {f PLUS $1}
compiles any problems or warnings with
ocamlbuild Parser.byte
I can only suggest, look at the generated Parser.ml and see what happens there.
In general, this message means that you are referencing a constructor that has not been delivered to scope. In Parser.mly tokens are always in scope, so you do not see this error in this file. You can usually do this in your lexer. So make sure you have open Parser in your lexer entry.
source share