(j3.2006) (SC22WG5.5690) RE: [ukfortran] AW: RE: F08/C201

erik at forcheck.nl erik
Thu Mar 17 05:00:40 EDT 2016


Thanks! This is what I expected.
Cheers,

-----Oorspronkelijk bericht-----
Van: owner-sc22wg5 at open-std.org [mailto:owner-sc22wg5 at open-std.org] Namens
Cohen Malcolm
Verzonden: donderdag 17 maart 2016 06:54
Aan: WG5 <sc22wg5 at open-std.org>
Onderwerp: (SC22WG5.5689) [ukfortran] (j3.2006) AW: RE: F08/C201

The way that the end statements are counted in <action-stmt> and C201
excludes them from appearing as executable constructs is at best confusing,
whether it is technically wrong or not.

FWIW, on close examination I do think it probably is technically wrong, as
the end statement (does not need "subroutine" - that is an optional keyword
in this context) in the interface body in the BLOCK construct is indeed
reached via executable-construct.

Not that a compiler is likely to take that interpretation.

This could be patched by modifying C201, but since this looks like a very
confusing way of describing the grammer anyway, I would be more in favour of
getting the end statements out of action-stmt and inserting them as
necessary elsewhere, unless that turns out to be more difficult than it
looks.  We would certainly want to be very careful how we change this
otherwise the chance of incidental BNF breakage would be quite high.

Cheers,

-----Original Message-----
From: Robert Corbett
Sent: Wednesday, March 16, 2016 9:04 PM
To: fortran standards email list for J3
Cc: Forcheck ; Bader, Reinhold ; 'WG5'
Subject: [ukfortran] (SC22WG5.5686) (j3.2006) AW: RE: F08/C201

On 03/16/16 00:46, Bader, Reinhold wrote:
> Hi Erik,
>
> my impression is that C201 only closes a hole that would otherwise 
> permit improper nesting of statements with respect to executable 
> constructs, e.g.,
>
> block
>     ...
>     end subroutine
> end block
>
> Cheers
> Reinhold
>

You and Erik raise a fair point.  Constraint C201 has the same effect on the
syntax as would be achieved by deleting the alternatives
/end-function-stmt/, /end-mp-subprogram-stmt/, /end-program-stmt/, and
/end-subroutine-stmt/ from rule R214 (rule R215 of 16-007), which is the
syntax definition of an /action-stmt/.  I suspect that the intended purpose
of including those alternatives is to indicate that those forms of END
statements are executable constructs.  That does not work, because none of
the cases where one of those forms of END statements is produced by the
grammar are derived (indirectly) from the syntax term /executable-construct/
because of the constraint.

Robert Corbett

_______________________________________________
ukfortran mailing list
http://lists.accu.org/mailman/listinfo/ukfortran

--
........................Malcolm Cohen, Nihon NAG, Tokyo. 






More information about the J3 mailing list