From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5412c98a3943e746 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.74.201 with SMTP id w9mr5988464pbv.0.1331230223716; Thu, 08 Mar 2012 10:10:23 -0800 (PST) Path: h9ni3260pbe.0!nntp.google.com!news1.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Verified compilers? Date: Thu, 08 Mar 2012 20:10:21 +0200 Organization: Tidorum Ltd Message-ID: <9rsb0eFqfrU1@mid.individual.net> References: <9207716.776.1331054644462.JavaMail.geo-discussion-forums@ynaz38> <4edda5mav3cf$.149pbgyxl1wx5.dlg@40tude.net> <9rplcgF5a2U1@mid.individual.net> <1psd0g0womgxi.1sle7ol12x3d5.dlg@40tude.net> <1d576lv10h3ax$.lkh58yfbl5dy$.dlg@40tude.net> Mime-Version: 1.0 X-Trace: individual.net bD2MaCZZG7VxyMAaoVR8dQKUHrU6hDxjYmsV1NcMmDKnMfHJSv Cancel-Lock: sha1:pw29kRcUpgV6BoOVeFWwkfs9qUQ= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <1d576lv10h3ax$.lkh58yfbl5dy$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-03-08T20:10:21+02:00 List-Id: On 12-03-08 11:25 , Dmitry A. Kazakov wrote: > On Wed, 7 Mar 2012 18:42:23 -0600, Randy Brukardt wrote: > >> As far as LR parsing is concerned, that's the most general practical parsing >> scheme. There are many legitmate BNFs that cannot be parsed using recursive >> descent. > > There are also ambiguous BNFs, which means that BNF is not so formal as it > may appear. Ambiguity has nothing to do with formality. If you think of a grammar only as defining a language (a set of strings), ambiguity is irrelevant; it only means that some sentence can be derived in more than one way from the start symbol, but that has no effect on the language, as a set of strings. Ambiguity is only harmful when you want to use the grammar to parse a sentence into a parse/derivation tree, and then want to use the tree for something, for example to evaluate the meaning of the sentence. If you define (as one always does) the meaning of a sentence as a mathematical function of the sentence's parse tree, and if (because of ambiguity) the sentence has several parse trees, the meaning also becomes ambiguous -- unless you can prove that the "meaning function" has the same value for all the parse trees for the same sentence. > The point is that I don't care about that or about restricting > it to a certain class etc. Because there is no value in such activity at > all. BNF is good for *informal* description of the language syntax. There is nothing informal about BNF, if it is used correctly. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .