[fpc-devel] C++ linking questions

Sven Barth svenmauren at vr-web.de
Sun Mar 21 14:21:45 CET 2010

Hi again!

I'll answer some of my questions myself:

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

For now I've decided to use "namespace(...); external(...);"

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

Usage is with "pattern" (all letters uppercase) or "orgpattern" 
(original casing) instead of "token"... the rest works as expected.

> 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")?

Answered by Paul Ishenin (thanks to the recently added escaping feature ^^)

> 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)?

I've decided to save the mangled name in the objectdef. It's mangled 
directly when parsing it.

Once I can access the svn server and the bugtracker again, I'll post my 
patch including some tests. And then you can post your objections there, 
if any. :P


More information about the fpc-devel mailing list