Jean Vezina wrote:
> I would like to know if the two following programs are
> standard conforming
...
> integer,parameter::x(3)=(/1,2,3/)
> character(*),parameter::p='1234'
> character*2 a,b
> data i,j,k/x(1),x(2),x(3)/
This could be argued either way. These are obviously not in the
syntax category <scalar-constant>. An array element is a subobject.
But, could these be considered <scalar-constant-subobjects>?
I don't know. The syntax rules involving <scalar-xyz> are not
explicitly specified, but are "assumed syntax rules". Do you
interpret this name as subobjects of scalar constants (in which
case, your example is illegal: they are subobjects an array constant),
or as scalar subobjects of a constant (in which case your example
is legal)? It is hard to tell the intent of the standard document here.
> data a,b/p(1:2),p(3:4)/
This should be legal regardless of the way you interpret
<scalar-constant-subobject>. This is because a character string
is a scalar. A substring is a subobject of a scalar.
> TYPE(DT), PARAMETER, DIMENSION(3) :: SPARM = DT ( (/3,5/) )
> >
> > INTEGER :: A(5)
> >
> > DATA A /SPARM(2)%COUNT(2) * 10/
This suffers from the same ambiguity as the first part of the first
example. Is this repeat count a <scalar-int-constant-subobject>?
It's a subobject of a constant no doubt. But the constant it's a
subobject of is not a scalar. Again, how do you interpret the
name of the syntax token <scalar-int-constant-subobject>? Must it
be a integer subobject of a <scalar-constant>? Or must it be an
integer subobject that is a itself a scalar?
--
J. Giles
|