From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=AWL autolearn=disabled version=3.1.3 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 486D4BBAF for ; Tue, 24 Jun 2008 17:38:12 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEALixYEjAXQIn/2dsb2JhbACLNqdB X-IronPort-AV: E=Sophos;i="4.27,697,1204498800"; d="asc'?scan'208";a="12478940" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Jun 2008 17:38:12 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m5OFcBPx022100 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 24 Jun 2008 17:38:12 +0200 X-IronPort-AV: E=Sophos;i="4.27,697,1204498800"; d="asc'?scan'208";a="14374025" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail1-relais-roc.national.inria.fr with SMTP; 24 Jun 2008 17:38:11 +0200 Received: by ausone.inria.fr (sSMTP sendmail emulation); Tue, _d Jun 2008 17:37:46 +0200 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Caml-list] Custom lexer in Camlp4 To: Jeremy Yallop References: <4860F097.1000701@ed.ac.uk> <1214317779-sup-8964@port-ext16.ensta.fr> <486104FF.1080201@ed.ac.uk> In-Reply-To: <486104FF.1080201@ed.ac.uk> Date: Tue, 24 Jun 2008 17:37:38 +0200 Message-Id: <1214321827-sup-3937@port-ext16.ensta.fr> User-Agent: Sup/git Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=-1214321866-936685-99775-3608-6-="; micalg="pgp-sha1" MIME-Version: 1.0 X-Miltered: at concorde with ID 486114E3.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lexer:01 camlp:01 lexer:01 camlp:01 ocaml:01 grammars:01 functor:01 struct:01 persuade:98 wrote:01 caml-list:01 short:01 slightly:03 rebuild:03 seems:03 X-Attachments: cset="UTF-8" type="application/pgp-signature" name="signature.asc" name="signature.asc" --=-1214321866-936685-99775-3608-6-= Content-Type: text/plain; charset=UTF-8 Excerpts from Jeremy Yallop's message of Tue Jun 24 16:30:23 +0200 2008: > Nicolas Pouillard wrote: > > Excerpts from Jeremy Yallop's message of Tue Jun 24 15:03:19 +0200 2008: > >> Is there a way to replace the default lexer in Camlp4? I'd like to use > >> (an extended version of) one of the OCaml grammars, but with a different > >> lexer. > > > > You can rebuild (I mean functor application), your own camlp4 by giving > > another Lexer module. Basically you will have to copy/paste the short > > Camlp4.PreCast module (or a part of), by substituting Camlp4.Struct.Lexer > > by your Lexer implementation. That's fairly heavy but works. > > Ok, I've built a slightly modified clone of PreCast. What's the best > way to persuade Camlp4 to use it? The original PreCast seems fairly > hardwired, e.g. in the Register module. Hum, you can't you have to build your own camlp4 driver :( -- Nicolas Pouillard aka Ertai --=-1214321866-936685-99775-3608-6-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) iEYEARECAAYFAkhhFMIACgkQj+FCNw9dwLm7AwCgi3qbymBPisZP6/5Df++Sg2Lx UrIAnRjO9u/lQG6vOtbqhAqilmY8zVZy =EpHH -----END PGP SIGNATURE----- gpg: Invalid passphrase; please try again ... --=-1214321866-936685-99775-3608-6-=--