Hello together!

I've found some time (and inspiration) to work on the C++ linking feature again.

Currently I'm trying to implement namespace support, but I've got some questions about implementation details.

My current idea is this:

MyClass=cppclass
  (...)
end; namespace FirstPart.SecondPart;

Where FirstPart and SecondPart are identifiers.

1. What do you think about this syntax?

2. What about the order of namespace and external? Should it be "namespace (...); external (...);" or "external (...); namespace (...);"? Or shall both orders be accepted?

3. How can I parse a not reserved identifier? Checking "idtoken" for "_ID", using it with "token" and after usage calling "consume(_ID);"?

4. What about reserved identifiers being used in the namespace which might be valid in C++ (e.g. "location", "platform", "register", "object" or even "begin")?

5. What's the best way to save the namespace in the tobjectdef class? As a string containing 'FirstPart.SecondPart'? Or as C++ mangled string '9FirstPart10SecondPart'? Or something else (e.g. a list containing the parts)?

6. If I add a field to e.g. tobjectdef that's written to and loaded from ppu files, I need to increase the ppu version, right?

Regards,
Sven

PS: Please CC me, because I'm using Digest Mode and I don't want to mess up the thread view. :)
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to