Ada-Rapporteur-Group / User-Community-Input

Ada User Community Input Working Group - Github Mirror Prototype
27 stars 1 forks source link

Include pragmas in Ada BNF? #7

Closed sttaft closed 1 year ago

sttaft commented 2 years ago

Pragmas are allowed at various places in Ada programs, but generally don't appear explicitly in the BNF. Instead, there are various rules allowing pragmas to appear "at the place of" statements, declarations, etc., but not (in some cases) in place of them. It is all a bit of a muddle, and it might be worth adding them explicitly to the BNF. For statements and declarations at least, it would seem reasonable to simply include them in the BNF, as we keep bumping into wording where including them in the BNF would simplify things (e.g. for a label on a pragma, or a pragma with execution semantics, ...).

ARG-Editor commented 2 years ago

This issue is included in AI22-0045-1.

Lucretia commented 2 years ago

I asked for this on CLA years ago. It's too open to error to not have them in the bnf.

Lucretia commented 1 year ago

Is there a draft 36 coming with this change in it? Where can I find this?

ARG-Editor commented 1 year ago

This is a post Ada 2022 change, so it won't appear in any version of the Ada 2022 RM. The lengthy delay in finalizing Ada 2022 has prevented moving on to the future versions. (I won't go into any of the reasons for that, you can read them in the various ARG minutes of the last year and a half.)

Once Ada 2022 is formally standardized, then we will make a new "bleeding edge" version RM with all of the approved AIs in it (there are already more than 40 with a wide variety of fixes).

                    Randy. 
sttaft commented 1 year ago

Is there a draft 36 coming with this change in it? Where can I find this?

Here is the Google Doc for AI22-0045:

https://docs.google.com/document/d/11R7GrnZqEuHc4JA23yhfnyNO8FglV0OO8fCb2lyOYn4/edit?usp=share_link

Here is the HTML-ized version:

http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai22s/ai22-0045-1.html?rev=1.4

The full set of "working" AIs in Google Doc format can be found here:

https://arg.adaic.org/ada-interpretations

The set of AIs that have been discussed at at least one ARG meeting can be found here:

http://ada-auth.org/AI22-VOTING.HTML

Lucretia commented 1 year ago

Thanks for the links.

You use a term that is only used in the case of tasking in the rm, master. I've searched the rm for master and it doesn't mention statements, what do you mean re "master statement?"

sttaft commented 1 year ago

The notions of master and master construct are defined in Ada RM 7.6.1, paragraph (3/5):

After execution of a construct or entity is complete, it is left, meaning that execution continues with the next action, as defined for the execution that is taking place. Leaving an execution happens immediately after its completion, except in the case of the execution of a master construct: a body other than a package_body; a statement; or an expression, function_call, or range that is not part of an enclosing expression, function_call, range, or simple_statement other than a simple_return_statement. The term master by itself refers to the execution of a master construct. A master is finalized after it is complete, and before it is left.

As implied above, a simple_statement can be a master construct. When an executable pragma appears in the place of a simple_statement, it too can be a master construct. Later in 7.6.1 the RM indicates that the finalization of a master includes waiting for any tasks dependent on the master, and then performing any other finalization actions associated with objects dependent on the master, such as calling various Finalize procedures.