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
camlp5 questions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-08-11 (23:45)
From: Nicolas Ojeda Bar <nojb@m...>
Subject: camlp5 questions

I am using Camlp5's extensible grammars to parse a language
of my own (no relation at all with Ocaml's). I have some questions
that the manual doesn't seem to address and I was wondering how
to do:

1. When I load my grammar in a suitable Ocaml toplevel, I get
wonderful error messages for the parser, but when I am running
my compiler stand alone, I only get an exception. Is there a
way to recover the error messages that I get when running under
the toplevel for my use?

2. What is the simplest way of replacing (not extending) Ocaml's
grammar using Camlp5 ? Or equivalently, if I have a parser that
generates Ocaml AST using q_MLast, how do I do to feed that to
the Ocaml compiler?