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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 2FA41BC4E for ; Fri, 18 Aug 2006 19:32:26 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7IHWPOl011218 for ; Fri, 18 Aug 2006 19:32:25 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA30219 for ; Fri, 18 Aug 2006 19:32:25 +0200 (MET DST) Received: from smtp.cegetel.net (mf00.sitadelle.com [212.94.174.67]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7IHWPWk011199 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 18 Aug 2006 19:32:25 +0200 Received: from [192.168.144.230] (84-4-120-42.adslgp.cegetel.net [84.4.120.42]) by smtp.cegetel.net (Postfix) with ESMTP id 63F411A418B; Fri, 18 Aug 2006 19:32:10 +0200 (CEST) Message-ID: <44E5F99A.7000009@univ-savoie.fr> Date: Fri, 18 Aug 2006 19:32:10 +0200 From: Christophe Raffalli User-Agent: Thunderbird 1.5.0.5 (Macintosh/20060719) MIME-Version: 1.0 To: caml-list@inria.fr Subject: question about camlp4 and lexer Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; christophe:01 raffalli:01 raffalli:01 univ-savoie:01 camlp:01 lexer:01 camlp:01 makefile:01 compilation:01 lexer:01 cmo:01 -pp:01 ocaml:01 cmo:01 -pp:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=FORGED_RCVD_HELO,HOT_NASTY autolearn=disabled version=3.0.3 Hello, For a camlp4 extension, I want to add some delimiters: (^ ^) [^ ^] {^ ^} [|^ ^|]. It does not break anything and it works quite well ... my problem is that I find it a bit hard to compile the camlp4 extension. Here is a part of my Makefile: # compilation of the lexer mylexer.cmo: mylexer.ml $(CAMLC) -pp "camlp4r -loc _loc" -I +camlp4 -c mylexer.ml # recompilation of pa_o.ml (unmodified and directly copied from the source of ocaml) pa_o.cmo: pa_o.ml mylexer.cmo $(CAMLC) -pp "camlp4r pa_extend.cmo q_MLast.cmo -loc _loc" -I +camlp4 -c pa_o.ml # my syntax extension pa_bindlib.cmo: bindlib.cmi pa_bindlib.ml pa_o.cmo $(CAMLC) -pp "camlp4 ./mylexer.cmo ./pa_o.cmo pa_extend.cmo q_MLast.cmo pr_dump.cmo -loc _loc" -I +camlp4 -c pa_bindlib.ml # linking of a camlp4 preprocessor camlp4bo: pa_bindlib.cmo $(CAMLC) -linkall -I +camlp4 odyl.cma camlp4.cma ./mylexer.cmo ./pa_o.cmo pa_bindlib.cmo pr_dump.cmo odyl.cmo -o camlp4bo I do not understand why I need to recompile pa_o.ml and cannot use pa_o.cmo in "ocaml/camlp4" (I tried but it uses the original lexer and not mine) ... This is a bit annoying and I am probably doing something wrong ... Thanks in advance for you help, Christophe Raffalli By the way, I think the default lexer should consider (xxx xxx) [xxx xxx] {xxx xxx} as delimiters whenever xxx is an infix keyword ... so camlp4 user would have a big choice of delimiters ...