comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Ada95 BNF
Date: Tue, 08 May 2001 10:53:59 -0400
Date: 2001-05-08T14:53:57+00:00	[thread overview]
Message-ID: <3AF80887.F8942BE3@averstar.com> (raw)
In-Reply-To: 99iI6.18964$Kt2.2053818@news6-win.server.ntlworld.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)



  parent reply	other threads:[~2001-05-08 14:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-03 12:23 Ada95 BNF Martin Dowie
2001-05-03 16:24 ` Stephen Leake
2001-05-03 19:18   ` Martin Dowie
2001-05-04  9:27     ` Marius Amado Alves
2001-05-08 14:53     ` Tucker Taft [this message]
2001-05-09  6:18       ` Martin Dowie
2001-05-09 13:47         ` Ted Dennison
  -- strict thread matches above, loose matches on Subject: below --
2001-05-04  5:48 Christoph Grein
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox