comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Lack of formal syntax undermines Ada
Date: Tue, 15 Apr 2008 09:08:08 -0700 (PDT)
Date: 2008-04-15T09:08:08-07:00	[thread overview]
Message-ID: <6673d0de-4322-4bfe-9216-5dd491b646e3@s13g2000prd.googlegroups.com> (raw)
In-Reply-To: deb5dcf7-ac00-479a-86f7-6a8d496c7f2f@u12g2000prd.googlegroups.com

On Apr 15, 6:22 am, use...@leapheap.co.uk wrote:
> anon wrote:
> Chris Noonan wrote:
> > >As an example, my parser is having trouble with the fragment:
> > >task type TT is
> > >   pragma priority(12);
> > >end TT;
> > >Is this legal Ada95 syntax or not?
> > As for your code: YES, it is legal!
>
> I'm not so sure.
>
> The relevant section in the LRM boils down to, in this context:
>
> Pragmas are only allowed at any place where the syntax rules
> allow an entry_declaration construct; but not in place of
> an entry_declaration construct.
>
> It looks to me that the pragma is appearing in place of
> an entry_declaration.

I was going to explain why you were wrong, but it appears that there's
a slight hole in the language here.  If task_definition (9.1(4)) were
defined as:

   task_definition ::=
      {entry_declaration}
   [private
      {entry_declaration}]
   end [task_identifier]

then it would be clear that your example is legal, since the pragma is
coming at the place of an entry_declaration, and it's not in place
*of* an entry_declaration because the syntax does not require there to
be any entry_declarations.  But the actual definition is

   task_definition ::=
      {task_item}
   [private
      {task_item}]
   end [task_identifier]

   task_item ::= entry_declaration | aspect_clause

Since a pragma can't occur at the place of a "task_item", the only way
the pragma would be syntactically legal here is if one task_item were
present, and then there would have to be either an entry_declaration
or an aspect_clause since the pragma can't occur in place of either
one.

However, this looks to me like just a small error in the RM, and I
don't think it can be used to make a larger point like "Lack of formal
syntax undermines Ada".  There have been many errors in the RM that
were more serious than that, and they've been fixed as they've been
found, and nothing's been undermined.

                                -- Adam



  reply	other threads:[~2008-04-15 16:08 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-11  9:41 Lack of formal syntax undermines Ada usenet
2008-04-11 11:20 ` Peter C. Chapin
2008-04-15 12:57   ` usenet
2008-04-16  2:26     ` Peter C. Chapin
2008-04-16  3:14       ` Eric Hughes
2008-04-17  6:37     ` Randy Brukardt
2008-04-11 17:27 ` Georg Bauhaus
2008-04-11 18:13   ` Adam Beneschan
2008-04-11 21:25 ` John McCabe
2008-04-11 21:45   ` Robert A Duff
2008-04-11 22:37     ` John McCabe
2008-04-11 23:08       ` Adam Beneschan
2008-04-12  7:16         ` Dirk Craeynest
2008-04-14  7:23         ` Jean-Pierre Rosen
2008-04-12 12:57       ` Robert A Duff
2008-04-12 15:06         ` (see below)
2008-04-12 16:25           ` John McCabe
2008-04-12 17:55             ` (see below)
2008-04-12 22:19               ` John McCabe
2008-04-13  1:13                 ` (see below)
2008-04-13 11:51                   ` John McCabe
2008-04-13 14:13                     ` (see below)
2008-04-13 19:34                       ` John McCabe
2008-04-13 20:51                         ` (see below)
2008-04-13 21:06                           ` John McCabe
2008-04-12 17:16         ` Gary Scott
2008-04-12 18:43           ` Peter C. Chapin
2008-04-12 19:16             ` Gary Scott
2008-04-12 20:04               ` Robert A Duff
2008-04-12 23:32                 ` Gary Scott
2008-04-13  1:16                   ` Robert A Duff
2008-04-12 20:02           ` Robert A Duff
2008-04-12 20:52             ` Pascal Obry
2008-04-13 22:01       ` Florian Weimer
2008-04-13  9:46 ` anon
2008-04-15 13:22   ` usenet
2008-04-15 16:08     ` Adam Beneschan [this message]
2008-04-13 22:04 ` Florian Weimer
replies disabled

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