From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 9A64BBBAF for ; Thu, 12 Aug 2010 01:45:28 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlADABfTYkyM9xyZi2dsb2JhbACTNo0YAQEBCgsKGCK0JIhkhToEiVA X-IronPort-AV: E=Sophos;i="4.55,355,1278280800"; d="scan'208";a="56988920" Received: from math.harvard.edu (HELO abel.math.harvard.edu) ([140.247.28.153]) by mail2-smtp-roc.national.inria.fr with ESMTP; 12 Aug 2010 01:45:28 +0200 Received: from dhcp-0059423277-df-47.client.student.harvard.edu (dhcp-0059423277-df-47.client.student.harvard.edu [140.247.163.159]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by abel.math.harvard.edu (Postfix) with ESMTP id EA905A5BB for ; Wed, 11 Aug 2010 19:45:26 -0400 (EDT) Subject: camlp5 questions From: Nicolas Ojeda Bar Content-Type: text/plain; charset=us-ascii Message-Id: Date: Wed, 11 Aug 2010 19:45:26 -0400 To: caml-list@yquem.inria.fr Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v1081) X-Mailer: Apple Mail (2.1081) X-Spam: no; 0.00; camlp:01 camlp:01 grammars:01 ocaml's:01 ocaml:01 toplevel:01 parser:01 compiler:01 toplevel:01 ocaml's:01 equivalently:01 parser:01 ocaml:01 mlast:01 compiler:01 Hello, 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? Thanks! N