Thanks to everyone who responded.
I am trying to write a compliant 7185 compiler from 7185 compliant source.
The problem arose because my compiler produced an error on the construct
described when it compiled itself.
I think that ( b )^.Field1 is a compliant work around because the
expression will be treated as a variable access.
I am using the 7185 spec rather than 10206 because it is much smaller
and within a single person's scope. Also the compiler is intended for
embedded systems …
[View More]where there is less need for advanced features.
Using the 7185 spec as a base grammar will allow for grammar additions,
such a interrupt directives, to be added to a well specified grammar as
small tweaks.
As well, 7185 is specified as a single source file so there is no need
for a link editor to stitch together various pieces of object code to
produce an executable. Without need for a linker, the complier becomes
much more portable. There are many more embedded CPU chips than larger
scale CPUs with operating systems.
Regards,
Paul Isaacs
[View Less]
Hello:
gpc --classic-pascal compiles the following without error:
procedure test;
type
 xHandle            = ^xRecord;
 xRecord            = record
                       field1  : …
[View More]integer;
                      end;
var
 a                  : integer;
 function b         : xHandle;
 var
 c                 : xHandle;
 begin
 b                 := c;
 end;
begin
 a                  := b^.field1;
end;
Is this 7185 compliant?
The right hand side of the assignment is a 6.7.3 function-designator rule :
     function-designator = function-identifier [ actual-parameter-list
] .
followed by "^."
I can not see how the grammar permits the following pointer and record
accesses.
Thank you,
Paul Isaacs
[View Less]