From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id E30D47EE88 for ; Sun, 8 May 2016 15:43:23 +0200 (CEST) IronPort-PHdr: 9a23:I5w5RRFRr+86IDAJViOCTZ1GYnF86YWxBRYc798ds5kLTJ74p8WwAkXT6L1XgUPTWs2DsrQf27uQ6virBzZIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/nhqbro9aNOU1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4/SXEGCmG7WIBX35TshdOGQmNzhbnRJv4tGOutON2wTSXJoj2QLYuWHKg6LpxRBbuoCEALTsw9GzMl9Q2i7hU9kGPvRt6lqLdeoCSfMZzf7PQfMkTDT5NV9xQUGpdD4KsYooVBsIHOetJs4T74VAJqE3tVkGXGOrzx2oQ1TfN1qog3rFkSFme0Q== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=dario.teixeira@nleyten.com; spf=None smtp.mailfrom=dario.teixeira@nleyten.com; spf=None smtp.helo=postmaster@relay6-d.mail.gandi.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of dario.teixeira@nleyten.com) identity=pra; client-ip=217.70.183.198; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dario.teixeira@nleyten.com"; x-sender="dario.teixeira@nleyten.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of dario.teixeira@nleyten.com) identity=mailfrom; client-ip=217.70.183.198; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dario.teixeira@nleyten.com"; x-sender="dario.teixeira@nleyten.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@relay6-d.mail.gandi.net) identity=helo; client-ip=217.70.183.198; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dario.teixeira@nleyten.com"; x-sender="postmaster@relay6-d.mail.gandi.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BBAQDnQS9XkMa3RtlehRC5EoF2hhACgRs5EwEBAQEBAQEBEQEBAQEHDQkJIS+CLYIVAQEDATgCPwULBAdGVwYbE4gIDL4AAQEIAgEdhiCETIoYBZgigVWMQI8ejzkCIgGCVYFWiCd/AQEB X-IPAS-Result: A0BBAQDnQS9XkMa3RtlehRC5EoF2hhACgRs5EwEBAQEBAQEBEQEBAQEHDQkJIS+CLYIVAQEDATgCPwULBAdGVwYbE4gIDL4AAQEIAgEdhiCETIoYBZgigVWMQI8ejzkCIgGCVYFWiCd/AQEB X-IronPort-AV: E=Sophos;i="5.24,595,1454972400"; d="scan'208";a="217292290" Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-GCM-SHA384; 08 May 2016 15:43:23 +0200 Received: from mfilter30-d.gandi.net (mfilter30-d.gandi.net [217.70.178.161]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id 38C20FB882; Sun, 8 May 2016 15:43:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter30-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter30-d.gandi.net (mfilter30-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id iKKguqWKvlzt; Sun, 8 May 2016 15:43:21 +0200 (CEST) X-Originating-IP: 10.58.1.141 Received: from webmail.gandi.net (webmail1-d.mgt.gandi.net [10.58.1.141]) (Authenticated sender: dario.teixeira@nleyten.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPA id A66F4FB8A1; Sun, 8 May 2016 15:43:21 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 08 May 2016 14:43:21 +0100 From: Dario Teixeira To: Jacques-Henri Jourdan Cc: caml-list@inria.fr In-Reply-To: References: <0a49598f1e0c8838fa69cd4d803af83d@nleyten.com> Message-ID: <43a466d4c7f145b0a6de709185ced949@nleyten.com> X-Sender: dario.teixeira@nleyten.com User-Agent: Roundcube Webmail/1.1.2 Subject: Re: [Caml-list] Menhir grammar with sequences delimited by same token Hi, And thanks for the prompt reply! > The priority mechanism won't help, because the LR1 automaton does not > contain the necessary information for deciding whether to shift or > reduce. Alas... > The solution might be to use parameterized non-terminals, but all the > non-exponential solutions I can think of do not pass the termination > checker for parameterized non-terminals. Hmm, I'll have to take a closer look at that feature of Menhir. > I have, however, another proposition : if you allow markup areas not be > well nested, then you can simply have an environment recording, for > each > style, whether it is currently in use or not. In the old version, the top-most parsing layer (generated via Menhir) would only see tokens such as BEGIN_BOLD/END_BOLD. There was an intermediate layer between the lexer and the parser which had a simple state machine that translated raw BOLD tokens into the BEGIN_BOLD/END_BOLD tokens. I'm now trying to minimise the "magic" in the intermediate layer, which is why I wondered if there was an elegant pure Menhir solution. Best regards, Dario Teixeira