Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: Lack of for...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 37 of 38 Topic 5649 of 5931
Post > Topic >>

Re: Lack of formal syntax undermines Ada

by Adam Beneschan <adam@[EMAIL PROTECTED] > Apr 15, 2008 at 09:08 AM

On Apr 15, 6:22 am, use...@[EMAIL PROTECTED]
 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
 




 38 Posts in Topic:
Lack of formal syntax undermines Ada
usenet@[EMAIL PROTECTED]   2008-04-11 02:41:28 
Re: Lack of formal syntax undermines Ada
"Peter C. Chapin&quo  2008-04-11 07:20:15 
Re: Lack of formal syntax undermines Ada
Georg Bauhaus <rm.tsoh  2008-04-11 19:27:17 
Re: Lack of formal syntax undermines Ada
Adam Beneschan <adam@[  2008-04-11 11:13:16 
Re: Lack of formal syntax undermines Ada
John McCabe <john@[EMA  2008-04-11 22:25:50 
Re: Lack of formal syntax undermines Ada
Robert A Duff <bobduff  2008-04-11 17:45:07 
Re: Lack of formal syntax undermines Ada
John McCabe <john@[EMA  2008-04-11 23:37:53 
Re: Lack of formal syntax undermines Ada
Robert A Duff <bobduff  2008-04-12 08:57:02 
Re: Lack of formal syntax undermines Ada
"(see below)" &  2008-04-12 16:06:45 
Re: Lack of formal syntax undermines Ada
John McCabe <john@[EMA  2008-04-12 17:25:53 
Re: Lack of formal syntax undermines Ada
"(see below)" &  2008-04-12 18:55:14 
Re: Lack of formal syntax undermines Ada
John McCabe <john@[EMA  2008-04-12 23:19:38 
Re: Lack of formal syntax undermines Ada
"(see below)" &  2008-04-13 02:13:07 
Re: Lack of formal syntax undermines Ada
John McCabe <john@[EMA  2008-04-13 12:51:01 
Re: Lack of formal syntax undermines Ada
"(see below)" &  2008-04-13 15:13:45 
Re: Lack of formal syntax undermines Ada
John McCabe <john@[EMA  2008-04-13 20:34:09 
Re: Lack of formal syntax undermines Ada
"(see below)" &  2008-04-13 21:51:59 
Re: Lack of formal syntax undermines Ada
John McCabe <john@[EMA  2008-04-13 22:06:51 
Re: Lack of formal syntax undermines Ada
Gary Scott <garylscott  2008-04-12 17:16:55 
Re: Lack of formal syntax undermines Ada
"Peter C. Chapin&quo  2008-04-12 14:43:33 
Re: Lack of formal syntax undermines Ada
Gary Scott <garylscott  2008-04-12 14:16:55 
Re: Lack of formal syntax undermines Ada
Robert A Duff <bobduff  2008-04-12 16:04:45 
Re: Lack of formal syntax undermines Ada
Gary Scott <garylscott  2008-04-12 23:32:45 
Re: Lack of formal syntax undermines Ada
Robert A Duff <bobduff  2008-04-12 21:16:25 
Re: Lack of formal syntax undermines Ada
Robert A Duff <bobduff  2008-04-12 16:02:30 
Re: Lack of formal syntax undermines Ada
Pascal Obry <pascal@[E  2008-04-12 22:52:13 
Re: Lack of formal syntax undermines Ada
Adam Beneschan <adam@[  2008-04-11 16:08:12 
Re: Lack of formal syntax undermines Ada
dirk@[EMAIL PROTECTED] (  2008-04-12 07:16:43 
Re: Lack of formal syntax undermines Ada
Jean-Pierre Rosen <ros  2008-04-14 09:23:10 
Re: Lack of formal syntax undermines Ada
anon@[EMAIL PROTECTED] (  2008-04-13 09:46:01 
Re: Lack of formal syntax undermines Ada
Florian Weimer <fw@[EM  2008-04-14 00:01:34 
Re: Lack of formal syntax undermines Ada
Florian Weimer <fw@[EM  2008-04-14 00:04:01 
Re: Lack of formal syntax undermines Ada
usenet@[EMAIL PROTECTED]   2008-04-15 05:57:42 
Re: Lack of formal syntax undermines Ada
"Peter C. Chapin&quo  2008-04-15 22:26:23 
Re: Lack of formal syntax undermines Ada
"Randy Brukardt"  2008-04-17 01:37:08 
Re: Lack of formal syntax undermines Ada
usenet@[EMAIL PROTECTED]   2008-04-15 06:22:11 
Re: Lack of formal syntax undermines Ada
Adam Beneschan <adam@[  2008-04-15 09:08:08 
Re: Lack of formal syntax undermines Ada
Eric Hughes <eric.eh9@  2008-04-15 20:14:45 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 11:20:22 CDT 2008.