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=1.8 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 41C4EBB84 for ; Thu, 29 Jan 2009 10:18:25 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: An8BABcDgUlIDtybimdsb2JhbACTUz8BAQEKCQwHDwWnWIEFjVQBAwEDhAsG X-IronPort-AV: E=Sophos;i="4.37,343,1231110000"; d="scan'208";a="22186507" Received: from fg-out-1718.google.com ([72.14.220.155]) by mail3-smtp-sop.national.inria.fr with ESMTP; 29 Jan 2009 10:18:24 +0100 Received: by fg-out-1718.google.com with SMTP id e12so842644fga.43 for ; Thu, 29 Jan 2009 01:18:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:cc:subject:from :to:references:in-reply-to:date:message-id:user-agent; bh=A+umS5AQP2u9ttgxp8WBadR3H0A703qzRo1ijKHo4Xo=; b=O3yjM0ZrWN0UVFRXQbfxKi7rs10gu82stX8BD+VQmZ5RK1aedcL+6DiPyF0+g9BB9T o8Z/kocIne4h4S63is1Ma21LwbX+FGOocQMaY8LFE344rUmO0MJdNJwxcSK9MHGHaQDA i987BATnYQOQtYiZjnNRykpP7Th3A7iJwKQaU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:cc:subject:from:to:references:in-reply-to:date :message-id:user-agent; b=cKnQdmO53ecKLtFds9pRwC/+L8JUvP/I/RnjjngsIrWaql/tQHIVWqY4TpwqLr8q76 y32biVUXZbZ93IA5S9cfva/K+x6J6QaewAf3u7C3/DcuEm5xfAzkb5NpRKGakjGMdAQN 5/CuDUVZVoWRotWzERaVV+1gxVHvKo8NNFqeQ= Received: by 10.86.63.19 with SMTP id l19mr306792fga.56.1233220704699; Thu, 29 Jan 2009 01:18:24 -0800 (PST) Received: from localhost (home.feydakins.org [82.229.164.236]) by mx.google.com with ESMTPS id 12sm1691698fgg.46.2009.01.29.01.18.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Jan 2009 01:18:23 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Cc: "caml-list@yquem.inria.fr" Subject: RE: [Caml-list] Ampersand in camlp4 grammar extension From: nicolas.pouillard To: Paul Steckler References: <2EB36A07AAE8C44BBB1986425E7A22D0034D5BEF2D@atp-mbx1.in.nicta.com.au> <1233174458-sup-6393@ausone.local> <2EB36A07AAE8C44BBB1986425E7A22D0034D5BEF2F@atp-mbx1.in.nicta.com.au> In-Reply-To: <2EB36A07AAE8C44BBB1986425E7A22D0034D5BEF2F@atp-mbx1.in.nicta.com.au> Date: Thu, 29 Jan 2009 10:17:20 +0100 Message-Id: <1233220464-sup-8447@ausone.local> User-Agent: Sup/git X-Spam: no; 0.00; camlp:01 syntax:01 camlp:01 parsers:01 expr:01 2009:98 caml-list:01 grammar:02 grammar:02 binary:02 seems:03 lid:03 guess:04 thu:05 debug:05 Excerpts from Paul Steckler's message of Thu Jan 29 05:36:44 +0100 2009: > Hi Nicolas, > > > However I can guess in your question that you don't really want to change the > syntax of the binary operator "&", but rather to change it's meaning. In > camlp4 there is a much more sane and easier way to do this using filters. > By the way there is an example in the camlp4 sources that does exactly this. > > Yes, this seems to work -- but it would be simpler, in fact, if I could just use > a rule in my grammar extension. > Do you know if there's a way to debug grammar extensions? I don't think there is a nice way do to it. > Maybe I need to > DELETE a rule from the original grammar, though it's not clear to me which > rule that is. Look at Camlp4Parsers/Camlp4OCamlRevisedParser.ml The rule is: infixop5: [ [ x = [ "&" | "&&" ] -> <:expr< $lid:x$ >> ] ] ; -- Nicolas Pouillard