Implement defined rules for OCaml

Without this, if defined rules are used in the input file, bnfc does not report an error, but the .mly file refers to functions which are not created, so there will be a compile error. The commit adds the code needed to create the functions.