10206 productions re-write

Paul Isaacs <[email protected]> Wed, 22 Feb 2017 23:12:50 -0500
Newsgroups gmane.comp.compilers.gpc
Message-ID <[email protected]>
Hello,

Is the following rewrite correct?

variable-access           = entire-variable
                                       | component-variable
                                       | identified-variable
                                       | buffer-variable

entire-variable             = variable-identifier

component-variable    = indexed-variable
                                       | field-designator

identified-variable       = pointer-variable, '^'

buffer-variable            = file-variable, '^'

indexed-variable        = array-variable, `,', index-expression,
                                                            < `,', 
index-expression > `]'

field-designator           = record-variable, ` .',  field-specifier
                                       | field-designator-identifier

array-variable               = variable-access
record-variable            = variable-access
pointer-variable           = variable-access
file-variable                  = variable-access
field-specifier              = field-identifier

REWRITTEN

variable access                       = entire variable
                                       | (   array variable, '[' index 
expression,
                                                                < ',', 
index expression > ']'
                                           | record variable, '.' field 
specifier
                                           | field designator identifier
                                           | pointer variable, '^'
                                           | file variable, '^'
                                           | field specifier
                                         ),
                                         {   '^'
                                           | '[' index expression, { 
',', index expression }, ']'
                                           | '.', field specifier
                                           | field designator identifier
                                         }

Thanks,

Paul Isaacs



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