From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yquem.inria.fr (Postfix, from userid 25991) id 80DADBBAF; Thu, 12 Aug 2010 17:02:06 +0200 (CEST) Date: Thu, 12 Aug 2010 17:02:06 +0200 From: Daniel de Rauglaudre To: Nicolas Ojeda Bar Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] camlp5 questions Message-ID: <20100812150206.GA18721@yquem.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Spam: no; 0.00; rauglaudre:01 rauglaudre:01 camlp:01 ocaml's:01 camlp:01 equivalently:01 parser:01 ocaml:01 mlast:01 ocaml:01 compiler:01 syntax:01 ocamlc:01 -pp:01 cmo:01 Hi, > 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? I added a (small) chapter about how to make one's syntax for OCaml using Camlp5. This chapter will be in next version (5.16) but you can see it there: http://pauillac.inria.fr/~ddr/camlp5/doc/html/redef.html For the current Camlp5 version (5.15), this part works except that you have to compile the file "mysyntax.ml" (of that chapter) by: ocamlc -pp "camlp5r pa_extend.cmo q_MLast.cmo" -I $(camlp5 -where) -c mysyntax.ml -- Daniel de Rauglaudre http://pauillac.inria.fr/~ddr/