strict productions

Paul Isaacs <[email protected]> Wed, 15 Feb 2017 02:10:26 -0500
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
Hello,

Is the 10206 spec not strict?

6.8.6.2 Indexed-function-accesses

An indexed-function-access shall denote a component of the value of a 
function-access possessing an
array-type or a string-type.

       indexed-function-access = array-function `[' index-expression {  
`,' index-expression } `]'
                               j string-function `[' index-expression `]' .

       array-function = function-access .

But:

6.8.6 Function accesses

function-access = entire-function-access
                  | component-function-access
                  | substring-function-access .

component-function-access = indexed-function-access
                            | record-function-access .

entire-function-access = function-designator .

And:

6.8.5 Function-designators

function-designator = function-name [ actual-parameter-list ]

According to the productions an indexed-function-access => 
array-function => function-access=>indexed-function -access

Therefore, the only exit is via entire-function-access. But this would 
lead to a sentence of the form:

x( a,b,c)[ 6,7,8 ] being valid and it is not.

From:

6.8.6.2 Indexed-function-accesses

  An indexed-function-access shall denote a component of the value of a 
function-access possessing an
array-type or a string-type.

But this would be an identifier and the function-access productions do 
not indicate identifiers.

Are the productions not strict? Does function-access include identifiers?

Regards,

Paul Isaacs



_______________________________________________
Gpc mailing list
[email protected]
https://www.g-n-u.de/mailman/listinfo/gpc