comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Select + Accept syntax question
Date: Sat, 27 Aug 2016 12:36:31 -0700
Date: 2016-08-27T12:36:31-07:00	[thread overview]
Message-ID: <npsq41$7or$1@dont-email.me> (raw)
In-Reply-To: <60637c3a-c699-4e4c-9fd3-1a081cb6152c@googlegroups.com>

On 08/27/2016 11:26 AM, Andrew Shvets wrote:
> 
> Why does this happen?  Why can't I have code right before the accept?  I can
> see a compilation error if there is no accept...

The definition of a selective accept doesn't allow this. This definition is in
ARM 9.7.1(2-7)

http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-9-7-1.html

2
selective_accept ::=
  select
   [guard]
     select_alternative
{ or
   [guard]
     select_alternative }
[ else
   sequence_of_statements ]
  end select;
3
guard ::= when condition =>
4
select_alternative ::=
   accept_alternative
  | delay_alternative
  | terminate_alternative
5
accept_alternative ::=
  accept_statement [sequence_of_statements]
6
delay_alternative ::=
  delay_statement [sequence_of_statements]
7
terminate_alternative ::= terminate;

So the 1st thing after "select [guard]" or "or [guard]" has to be an accept,
delay, or terminate statement.

-- 
Jeff Carter
"Monsieur Arthur King, who has the brain of a duck, you know."
Monty Python & the Holy Grail
09


  parent reply	other threads:[~2016-08-27 19:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-27 18:26 Select + Accept syntax question Andrew Shvets
2016-08-27 19:20 ` Niklas Holsti
2016-08-27 19:47   ` Andrew Shvets
2016-08-28  6:52     ` Niklas Holsti
2016-08-27 19:36 ` Jeffrey R. Carter [this message]
2016-08-27 19:48   ` Andrew Shvets
2016-08-27 23:22     ` Jeffrey R. Carter
replies disabled

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