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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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 w9mr3684843pbv.0.1331167349201; Wed, 07 Mar 2012 16:42:29 -0800 (PST) MIME-Version: 1.0 Path: h9ni51582pbe.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Verified compilers? Date: Wed, 7 Mar 2012 18:42:23 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <9207716.776.1331054644462.JavaMail.geo-discussion-forums@ynaz38> <4edda5mav3cf$.149pbgyxl1wx5.dlg@40tude.net> <9rplcgF5a2U1@mid.individual.net> <1psd0g0womgxi.1sle7ol12x3d5.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1331167347 11536 69.95.181.76 (8 Mar 2012 00:42:27 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 8 Mar 2012 00:42:27 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-03-07T18:42:23-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1psd0g0womgxi.1sle7ol12x3d5.dlg@40tude.net... ... > Furthermore the merits of formal grammar definitions are debatable, > because > the complexity of grammar descriptions usually make it impossible to judge > if a given string do belong to the formal language or not. Normally BNF is > all one needs to define syntax. This makes no sense at all. BNF is the classic formal definition of a grammar; indeed, I know of no other. Everybody has variations on it (the Ada BNF uses repeat operations not found in many BNFs; the annoted BNF used by our grammar generator is slightly different), but they're all forms of BNF. Perhaps you are talking about grammar generator processessable definitions -- that's a different beast altogether and forms just a tiny portion of "formal grammar definitions". 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. And writing recursive descent code (and error handling) is many times harder than adding a couple of lines to a file and lanuching a batch file: Aspect_Specification ::= WITH Aspect_Item {, Aspect_Item} Aspect_Item ::= IDENTIFIER => Expression [although I admit this is a small portion of the total work; it took me about 4 weeks to add the entire Ada 2005 syntax to Janus/Ada, but probably only about an hour or two on the actual grammar. The rest of the time was spent adding "unimplemented feature" error handlers to the compiler, adjusting existing parts of the compiler to be aware of the changes (new grammar features changing the stack position of old ones), updating the pretty printer to be aware of the new features, and the like.] Randy.