Hi, GPC folks,
Orlando Llanes wrote:
[Qualified identifiers ...]
I think it can be added without much effort. One possibility is to set
the root node to the unit or program name, then create a seperate symbol table for each. When it's necessary to create jump targets/etc, just combine the unit name with the identifier. [...]
Exactly.
BTW, that's about the same way how methods of objects are implemented. Currently, a method "Foo" of a method "Bar" is named "Bar_Foo". (In contrast, if you define your own "procedure Bar_Foo" it becomes "Bar_foo", internally.)
When doing this correctly, we must make sure that there are no name clashes - between units and objects, and in no other way. Thus, at the same time, the OOP naming scheme should be rewritten.
Now becoming more technical ...
Currently, the IDENTIFIER_LIMBO_VALUE slot in the IDENTIFIER_NODE (inherited from the C front-end) is (mis-)used to allow for importing only parts of a module (in Extended Pascal) and such. The correct re-write for Pascal would drop IDENTIFIER_LIMBO_VALUE in favour of a whole TREE_LIST of IDENTIFIER_UNIT_VALUEs for one identifier.
At the same time, we would introduce yet another slot in the IDENTIFIER_NODE in order to preserve the upper nad lower case of the identifier as typed by the Pascal programmer (for error messages and such).
While all this is not _that_ difficult but more or less straightforward, it is time-consuming and must be done very carefully, together with clean-ups at various places in the compiler which have to do with the naming of identifiers. I expect that I would need two full days of concentrated work to reach the goal - plus some period for testing, bug-fixing etc.
Unfortunately, I currently cannot work for a single hour without being interrupted by a phone call, an urgent email, or the next date. And currently I must assign priorities according to the amount of money I get for the job on a short time scale.
BTW, qualified identifiers are one of the top items _after_ the "Urgent" part of the GPC TODO list. And the integration of GPC into gcc-3.0 is still in progress.
To summarize:
I consider qualified identifiers a very important feature - also for my own work -, and I know what has to be done in order to implement them. However I see no possibility to do the actual work on a short time scale. Sorry for that.
If anyone wants to try him/herself on the job I can help.
Peter