Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] putting stuff in an ocamlyacc-generated mli file
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Rafael 'Dido' Sevilla <sevillar@t...>
Subject: [Caml-list] putting stuff in an ocamlyacc-generated mli file
I've been trying to streamline the error handling for my ocamlyacc-based
compiler, and have this exception defined in my parser.mly:

exception Undef_sym of string;

This is raised whenever the compiler encounters an undefined symbol.

The file that actually uses the compiler, does something like:

  let result = Parser.main Lexer.token lexbuf in
    Parser.Undef_sym x -> Printf.fprintf stderr "Undefined symbol %s" x

Unfortunately, compiling the compiler with this causes it to choke
saying that Parser.Undef_sym is not found.  It's not in the generated
parser.mli file, of course.  So apart from editing that (automatically
generated) file manually, how do I get ocamlyacc to put them there?

Rafael R. Sevilla <>   +63(2)   8177746 ext. 8311
Programmer, Inter.Net Philippines                +63(917) 4458925                OpenPGP Key ID: 0x5CDA17D8
Bug reports:  FAQ:
To unsubscribe, mail  Archives: