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=2.7 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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 6C8EBBBAF; Sun, 8 Mar 2009 11:35:49 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqYBADM8s0nRVdulm2dsb2JhbACUaz8BAQEBAQgJCgkRrWuBB45AAQMBA4QCBoMT X-IronPort-AV: E=Sophos;i="4.38,324,1233529200"; d="scan'208";a="22214417" Received: from mail-ew0-f165.google.com ([209.85.219.165]) by mail2-smtp-roc.national.inria.fr with ESMTP; 08 Mar 2009 11:35:49 +0100 Received: by ewy9 with SMTP id 9so493514ewy.9 for ; Sun, 08 Mar 2009 03:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:cc:x-mailer; bh=4VIvzL8N69np1/Hxv9m5gUWUV0uflE7HaN+Z5kqGKdY=; b=w0XLIxne9mgE5yCbbrJFH1QUGJ1+ypv62XLLg8ul1Df+G6DGCw5udBL2gP0i5zBQUx UngBLQZI4rpw71gDRRLingBaruwX/vksS2aIHJxyN9UHcCmlY41zAwVK3JS9XvWprpzr ok48XMGEczTyLUHOEReLOdZSRIlaSLFXMr0xo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:cc:x-mailer; b=pkzycNMdRQo3VLN8b7MKZ3DEYOtR1P+4qzyo4XuY9C8kPeU7OEEbIiYMQd4GFDCcWI ZBULZMizyp6+nYAvxSgn5FMKhpEQxwAbXQNBJFexxYPtDYXYw3skmypzaVLX/pkM6+CI PPf7lnUqqzrv184O0sCeOQg9pSK54NQAVjKBA= Received: by 10.210.37.16 with SMTP id k16mr1532928ebk.0.1236508549043; Sun, 08 Mar 2009 03:35:49 -0700 (PDT) Received: from ?10.10.30.5? (94.Red-88-6-143.staticIP.rima-tde.net [88.6.143.94]) by mx.google.com with ESMTPS id k10sm5492540nfh.23.2009.03.08.03.35.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 08 Mar 2009 03:35:48 -0700 (PDT) References: <24D11586-4F15-4B6E-8FB7-58651317164D@gmail.com> <46331.52510.qm@web27007.mail.ukl.yahoo.com> <0B508092-FD71-4733-BC95-B6B87A6D3E6B@gmail.com> <154139.25342.qm@web27007.mail.ukl.yahoo.com> <46FCBABD-7E4A-4077-8227-3816FD6D635D@gmail.com> <20090308093756.GB5433@yquem.inria.fr> <046C7516-62FF-4F46-B2D9-CEA1045132CD@gmail.com> <20090308102724.GC5433@yquem.inria.fr> Message-Id: <35E3A172-40D9-4FA8-9C1D-1D7C114ED2D0@gmail.com> From: Joel Reymont To: Daniel de Rauglaudre In-Reply-To: <20090308102724.GC5433@yquem.inria.fr> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Re : [Caml-list] Re: camlp4 stream parser syntax Date: Sun, 8 Mar 2009 10:35:45 +0000 Cc: caml-list@inria.fr X-Mailer: Apple Mail (2.930.3) X-Spam: no; 0.00; camlp:01 parser:01 syntax:01 rauglaudre:01 camlp:01 grammars:01 lexer:01 lexer:01 ocamllex:01 grammars:01 lident:01 tokens:01 ocaml:01 token:01 wrote:01 On Mar 8, 2009, at 10:27 AM, Daniel de Rauglaudre wrote: > Only changing the "tok_match" record field (2nd point) would not work > for keywords (defined by "just a string" in Camlp* grammars), because > the lexer *must* recognize all combinations of the identifier as > keywords, implying a change, anyway, in the lexer. This is precisely what I'm trying to figure out. What do I have to change in my _custom_ lexer generated by ocamllex to recognize keywords defined by just a string in camlp4 grammars. I'm not using LIDENT, etc. as I have my own set of tokens. I understand that I need to downcase the keyword (or upcase) but I don't understand where I need to do this. The filter module nested in the token module seems like a good candidate. What functions of the lexer or filter are accessed when a string keyword (e.g. "delay") is found in the camlp4 grammar? Thanks, Joel --- http://tinyco.de Mac, C++, OCaml