Re: strict productions
Paul Isaacs <[email protected]> Wed, 15 Feb 2017 12:10:57 -0500
| Newsgroups | gmane.comp.compilers.gpc |
|---|---|
| Message-ID | <[email protected]> |
On 15/02/17 03:06 AM, Bastiaan Veelo wrote: > >> On 15 Feb 2017, at 08:10, Paul Isaacs <[email protected] >> <mailto:[email protected]>> wrote: >> >> x( a,b,c)[ 6,7,8 ] being valid and it is not. > > I think it is. This compiles and runs: > Bastiaan, Thanks! You're right. I'm finding it hard to go from the productions to code when the productions are recursive through intermediates. Interesting: function-access1 = record-function1.field1 => using function-access|record-function record-function1 = function-access2 => using record-function production function-access2 = record-function2.field2 => using function-access|record-function record-function2 = x( a ) => using function-access|entire-function function-access2 = x( a ).field2 => reducing function-access2 record-function1 = x( a ).field2 => reducing record-function1 function-access1 = x( a ).field2.field1 => reducing function-access1 x( a ).field2 compiles and executes x( a ).field2.field1 of course does not compile unless field1 is a field of field2. But is it a syntacticly correct result of these productions? If so is it an ambiguity in the grammar? Do the productions have precedence rules? e.g. variable-access has higher precedence than function-access Regards, Paul Isaacs _______________________________________________ Gpc mailing list [email protected] https://www.g-n-u.de/mailman/listinfo/gpc