(j3.2006) resolving grammar ambiguities

Robert Corbett Robert.Corbett
Sat Oct 17 03:56:29 EDT 2009


One of the members of Sun's Fortran team has been reviewing
the Fortran 2008 draft.  I have been able to answer most of
the questions he has raised, but tonight he raised one for
which I could not find an answer.

Consider syntax rule R737 on page 158.  It is

     data-target    is  variable
                    or  expr

The syntax rule for variable is rule R602 on page 117.
It is

     variable       is  designator
                    or  expr

Thus, expr can be generated from data-target in two ways

     data-target  ->  expr

and

     data-target  ->  variable  ->  expr

If the second derivation is used, data-target is subject
to constraint C724, but if the first definition is used,
it is not.

I could find no explanation of how such ambiguities should
be resolved.

Bob Corbett



More information about the J3 mailing list