Hello, everybody!
Some features of GPC are beginning to cause serious trouble, so I consider to drop them:
* Multiple compilations in one file.
One source file contains one program and several units, or an interface and an implementation module, or whatever which has more than one `end.' (please note the dot).
Hammering this behaviour of GPC into the GCC/EGCS backend is a nontrivial change which I do not expect the GCC steering committee to accept. (They already rejected much less crucial changes.) Thus, removing this feature would probably be necessary for full integration into GCC/EGCS.
* C-style numbers.
With the --c-numbers switch or the (*$C+*) directive, GPC accepts C-style octal and hexadecimal numbers such as 0755 or 0xdeadbeef. However, this does mess up other parts of the lexical analyzer. Since I do not think that this feature is widely used, I think it is better to remove it rather than "fixing" large parts of the lexical analyzer and thus inviting for more unpleasant errors.
* (Other things may follow.)
Comments welcome,
Peter
On Sun, Jul 25, 1999 at 12:00:32PM +0200, Peter Gerwinski wrote:
Multiple compilations in one file.
One source file contains one program and several units, or an interface and an implementation module, or whatever which has more than one `end.' (please note the dot).
Well the problem is, of course, going to be that extended pascal does allow the interface and implementation of a module in the same file so someone trying to 'port' their extended code to gpc could potentially run into a nest of a problems as they split apart all of their modules and then modify their modules (probably so the implementation IMPORTs the interface) or their actual programs.
On the other hand, extended modules can be written fairly easy without the double 'end.' problem. I'm also not sure that the change will really affect that many people, so perhaps it would be worth it for the sake of integration.
This will also be an issue if anyone ever plans to use gpc (or write their own frontend) to develop say a Modula-2 compiler on top of the gcc/egcc backend. [Actually any later Wirthian language would probably be affected] It is unfortunate that the gpc/egcc people aren't more responsive to these types of changes.
-Kevin
On 25 Jul 99, at 9:35, Kevin A. Foss wrote:
Well the problem is, of course, going to be that extended pascal does allow the interface and implementation of a module in the same file...
Just to amplify, the Extended Pascal standard, section 6.13 (Programs) gives the following syntax:
program = program-block
program-block = program-component { program-component }
program-component = main-program-declaration "." | module-declaration "."
...so a conforming EP program is allowed to have any number of module- declarations in a given source file.
The following additional requirements are present:
"A program-block shall contain exactly one main-program-declaration."
"A processor should be able to accept the program-components of the program-block separately."
The last requirement suggests to me that a conforming EP compiler should be able to accept a given EP program with modules either as separate source files, each containing one component, or as a single source file containing all of the components (although there appears to be no explicit statement in the specification requiring the latter).
-- Dave Bryan
J. David Bryan wrote:
...so a conforming EP program is allowed to have any number of module- declarations in a given source file.
Well, the standard does not seem to know about source files etc. at all, but nevertheless I accept this as a requirement for full standard conformance.
Maybe I just found a method to keep multiple "components" in one source file. If this works, fine; in the worst case a pre-preprocessor will have to split up files.
Peter
On 28 Jul 99, at 3:40, Peter Gerwinski wrote:
J. David Bryan wrote:
...so a conforming EP program is allowed to have any number of module- declarations in a given source file.
Well, the standard does not seem to know about source files etc. at all...
Yes, you are correct; I overstated the case. I should have said, "...so a conforming EP program is allowed to have any number of module- declarations," and left it at that. That's actually what I meant; the part about "in a given source file" slipped in by accident! :-)
-- Dave Bryan