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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5df086f5b450f5c4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-08 23:17:28 PST From: "Martin Dowie" Newsgroups: comp.lang.ada References: <3af1541f$1@pull.gecm.com> <99iI6.18964$Kt2.2053818@news6-win.server.ntlworld.com> <3AF80887.F8942BE3@averstar.com> Subject: Re: Ada95 BNF Date: Wed, 9 May 2001 07:18:53 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: sg2c11210.dsge.edinbr.gmav.gecm.com Message-ID: <3af8ded6$1@pull.gecm.com> X-Trace: 9 May 2001 07:08:22 GMT, sg2c11210.dsge.edinbr.gmav.gecm.com Path: newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!demon!btnet-peer0!btnet-feed5!btnet!newreader.ukcore.bt.net!pull.gecm.com!sg2c11210.dsge.edinbr.gmav.gecm.com Xref: newsfeed.google.com comp.lang.ada:7353 Date: 2001-05-09T07:18:53+01:00 List-Id: Fair enough, but I still thnk it is strange that it wasn't defined along the lines of: defining_program_unit_name ::= [ parent_unit_name "." ] defining_identifier parent_unit_name ::= identifier given that "identifier" already exists and can be navigated to through the existing definitions in about 2 clicks and by-passing all the 'invalid' options anyway... :-) Tucker Taft wrote in message news:3AF80887.F8942BE3@averstar.com... > Martin Dowie wrote: > > > > Ok... this seems a little strange to me - but if those are the rules! :-) > > > > Is it really that hard to come up with a BNF that does actually match > > what the language does allow? > > In many cases it is preferable to make the BNF somewhat > "looser" than the "official" grammar, and then do the > checking as part of semantic checking, because the errors > tend to be handled a bit more gracefully. In addition, > in Ada, there are constructs which look identical > syntactically but which are distinct semantically, such > as a type conversion and an array indexing. The grammar > in the LRM distinguishes these, whereas the grammar used > for an LR parser can't, since an LR parser requires that > the grammar be context-free (i.e. independent of the > "meaning" of particular identifiers). > > -- > -Tucker Taft stt@avercom.net http://www.averstar.com/~stt/ > Chief Technology Officer, AverCom Corporation (A Titan Company) > Burlington, MA USA (AverCom was formerly the Commercial Division of AverStar: > http://www.averstar.com/services/ebusiness_applications.html)