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 702397EE88 for ; Sun, 8 May 2016 16:16:59 +0200 (CEST) IronPort-PHdr: 9a23:ELhX7hKH7QV51RIYSdmcpTZWNBhigK39O0sv0rFitYgULvnxwZ3uMQTl6Ol3ixeRBMOAu6MC0rKd7fqocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWC3oLuj6vsodX6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD86Fpy8kVWqz/e+E8TKdEJDUgKWE8osPx5jfZSg7aynIGU2JerhdJEwXE9hiyCpv4qCr98PZw2TmXPNf/ZbYwVCW+4qEtQxjt3nRUfwUl+X3a35QjxJlQpwis8kRy 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@relay3-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.195; 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.195; 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@relay3-d.mail.gandi.net) identity=helo; client-ip=217.70.183.195; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dario.teixeira@nleyten.com"; x-sender="postmaster@relay3-d.mail.gandi.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DEAADzSC9Xj8O3RtlehRC5EoF2hhACgRs5EwEBAQEBAQEBEQEBAQEHCwsJIS+CLYIVAQEDATgCOgoLBAdGVyGIGwy+M4YghEyFC4UNBZgigVWMQIFwhE+IX485AiIDglOBVoh0fwEBAQ X-IPAS-Result: A0DEAADzSC9Xj8O3RtlehRC5EoF2hhACgRs5EwEBAQEBAQEBEQEBAQEHCwsJIS+CLYIVAQEDATgCOgoLBAdGVyGIGwy+M4YghEyFC4UNBZgigVWMQIFwhE+IX485AiIDglOBVoh0fwEBAQ X-IronPort-AV: E=Sophos;i="5.24,596,1454972400"; d="scan'208";a="217293922" Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-GCM-SHA384; 08 May 2016 16:16:59 +0200 Received: from mfilter23-d.gandi.net (mfilter23-d.gandi.net [217.70.178.151]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id AB8F6A80C7 for ; Sun, 8 May 2016 16:16:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter23-d.gandi.net Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter23-d.gandi.net (mfilter23-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id ZBhGKIr0ijy8 for ; Sun, 8 May 2016 16:16:57 +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 relay3-d.mail.gandi.net (Postfix) with ESMTPA id 38179A80BF for ; Sun, 8 May 2016 16:16:57 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 08 May 2016 15:16:57 +0100 From: Dario Teixeira To: caml-list@inria.fr In-Reply-To: <20160508115742.GA14227@pema> References: <0a49598f1e0c8838fa69cd4d803af83d@nleyten.com> <20160508115742.GA14227@pema> Message-ID: 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, > Jacques-Henri (or anybody else) please correct me if I am wrong. > > Sometimes one way of dealing with such problems is to recognize (at the > syntactic stage) a > language that is a bit bigger than the desired one and then to check, > at > the semantic level, that the real constraints are satisfied. You make a good point, but in this case the reverse actually applies. Trees such as "[Bold [Bold Text]]" are valid according to the AST, and are in fact possible with other markups. Such trees may be nonsensical in practice, but are also harmless, and the "AST sanitiser" (a component that checks for semantic errors in the AST) does not presently complain about them. The longer revised grammar (the one with inline_sans_bold et al) accepts only a *subset* of the valid ASTs, because it excludes such improbable (but valid!) derivations. Therefore, this is a case where the parser deliberately recognises a language that is *smaller* than that accepted by the AST. Best regards, Dario Teixeira