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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 6242FBC37 for ; Sat, 14 Nov 2009 19:19:33 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArkAAGOD/kpDww/NmWdsb2JhbACEco0hgQaJBQEBAQEBCAsKBxOmEiiBOYVhiGsBBgQBgSuCOFQE X-IronPort-AV: E=Sophos;i="4.44,742,1249250400"; d="scan'208";a="40113687" Received: from web111513.mail.gq1.yahoo.com ([67.195.15.205]) by mail1-smtp-roc.national.inria.fr with SMTP; 14 Nov 2009 19:19:32 +0100 Received: (qmail 15078 invoked by uid 60001); 14 Nov 2009 18:19:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1258222771; bh=NdcntGBfRAAoH51VhETbAlFcgKn0L4+Js5asPABdBbw=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=zrHv6slGyoJtWO4n0WdjYPs8agIe08rIO1aheundKT/CcHbh4PlGkcoOf9MqFML7YQBkZBC6bKjxe7s+fsO8fHqHfzbt/G91jVfagu+pWjkX2wkjdKGfsuN1Y9je9Y6PrJI+qkp59ZSF6NYZb4P9fzbKKChuARWQI4q4pvPjBqw= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=HrKa1hsTAQS/WeljgdbDxHtquCQ0J0u9jEjyHzQiTOEzMtlBcl+ZU6S77IX5cqhBi4hoEdOWUXN3RWH06rmlh6jfDajt5XR2keRCnA8MmaYx464mn2+SSGL7MvTBcPotSE/tkMGsbODeOunKfc+eSZBn2NKzDvpp9pBI7HY7dgE=; Message-ID: <485324.14144.qm@web111513.mail.gq1.yahoo.com> X-YMail-OSG: kE5SMsoVM1kYYqrZTH2cO9sryD6vs2bhRM6wDptreJd.mC4UdbmBKT7U8w9dxdVkl9Sl1I8ZxJsqsxjYDaA1YrISd6F88lBdXfcFq.cPKXGBqQHcvEQWNQTLsfBapXw3VT77JkiPe._qr84.mqE3mQorC8IyghklpBDpFGH23Bht2zVb5qbJbYUo4IUqYGWlbuoSxrkfcg_NO34yuILmf13OqWLZpLFM2ZaL.vzVUwREJADaDrD_7HufFYxT4w7yESwt9Sd.YaTeQH1bNzZP1BD3fGpeJHkgthVBoQQN8sOmsrmwqbNeY0tRS2Ltl.znrC14lEwfX2Rs9OMWZB.nsmk- Received: from [213.205.71.58] by web111513.mail.gq1.yahoo.com via HTTP; Sat, 14 Nov 2009 10:19:31 PST X-Mailer: YahooMailClassic/8.1.6 YahooMailWebService/0.7.361.4 Date: Sat, 14 Nov 2009 10:19:31 -0800 (PST) From: Dario Teixeira Subject: Re: [Caml-list] Re: The lexer hack To: Martin Jambon Cc: caml-list@inria.fr In-Reply-To: <4AFA9A1A.1040808@ens-lyon.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; lexer:01 lexer:01 parser:01 cheers:01 token:01 verb:01 caml-list:01 hack:04 context:06 context:06 interpreted:06 uses:07 delimiters:09 whereas:10 contexts:10 Hi,=0A=0A> If the lexer to use can be determined by only one token=0A> (BEG= IN_VERB), I think you can change the state in the lexer=0A> like this:=0A= =0AUnfortunately the language features some verbatim-like environments=0Awh= ere choosing the right scanner entails knowing more about the=0Acontext tha= n what is available to the lexer. As an example, in=0Athe command \link{ur= l}{text}, the "url" should be interpreted=0Averbatim, whereas the "text" po= rtion uses the general scanner.=0AThe parser is fully aware of the context,= of course, which is=0Awhy the "dummy action" solution worked fine.=0A=0A(A= nd yes, I thought of having different delimiters for different=0Ascanning c= ontexts, but in many ways it would make the language=0Amore cumbersome for = the user).=0A=0ACheers,=0ADario Teixeira=0A=0A=0A=0A