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.0 required=5.0 tests=HTML_MESSAGE autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 81BA0BC69 for ; Thu, 29 Mar 2007 00:22:20 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2SMMIZ7020921 for ; Thu, 29 Mar 2007 00:22:19 +0200 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by mga09.intel.com with ESMTP; 28 Mar 2007 15:22:17 -0700 Received: from unknown (HELO orsmsx334.jf.intel.com) ([10.22.226.45]) by fmsmga002.fm.intel.com with ESMTP; 28 Mar 2007 15:22:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,342,1170662400"; d="scan'208,217"; a="65497447:sNHT47772252" Received: from orsmsx419.amr.corp.intel.com ([10.22.226.88]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 28 Mar 2007 15:22:03 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C77187.82F90F3E" Subject: Hacking the lexer in the new camlp4 Date: Wed, 28 Mar 2007 15:22:02 -0700 Message-ID: <509223F0BF55E74FA1247D17207E7A0C01433C3E@orsmsx419.amr.corp.intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Hacking the lexer in the new camlp4 Thread-Index: Acdxh4JWLZZEQDqARJaZytGVnCm0UA== From: "Harrison, John R" To: Cc: "Harrison, John R" X-OriginalArrivalTime: 28 Mar 2007 22:22:03.0753 (UTC) FILETIME=[831C1D90:01C77187] X-j-chkmail-Score: MSGID : 460AEA9A.000 on concorde : j-chkmail score : XX : 5/20 0 0.000 -> 2 X-Miltered: at concorde with ID 460AEA9A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lexer:01 camlp:01 camlp:01 parsing:01 infix:01 lexer:01 parsing:01 infix:01 lexical:01 lexical:01 arial:96 arial:96 seems:03 seems:03 ugly:03 This is a multi-part message in MIME format. ------_=_NextPart_001_01C77187.82F90F3E Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I haven't really been following the discussion about the new camlp4, but it seems quite a lot has changed. =20 I only use some fairly simple extensions to parsing (a few new infix names, and forcing anonymous expressions "..." to become "let it =3D ..."). However I also make two invasive changes to the lexer: =20 * Modify the lexical rules for deciding whether a name is a regular or special identifier (not just based on case of the first letter) =20 * Change the quotation delimiters to be `...` rather than <<...>> =20 In the current camlp4, the only way I found to do this was basically to copy the existing lexer and edit it. Although it works, it's ugly and invariably means that I've had to change something with almost every new version of camlp4. Does the new camlp4 offer a nicer way of changing the lexer? =20 John. =20 ------_=_NextPart_001_01C77187.82F90F3E Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I haven't really been following the discussion about = the new camlp4,

but it seems quite a lot has = changed.

 

I only use some fairly simple extensions to parsing = (a few new infix

names, and forcing anonymous expressions = "..." to become "let it =3D

..."). However I also make two invasive changes = to the lexer:

 

 * Modify the lexical rules for deciding whether = a name is a regular

   or special identifier (not just based on = case of the first letter)

 

 * Change the quotation delimiters to be `...` = rather than <<...>>

 

In the current camlp4, the only way I found to do = this was basically

to copy the existing lexer and edit it. Although it = works, it's ugly

and invariably means that I've had to change = something with almost

every new version of camlp4. Does the new camlp4 = offer a nicer way of

changing the lexer?

 

John.

 

------_=_NextPart_001_01C77187.82F90F3E--