[fpc-devel] C++ linking questions

2010-03-21 Thread Sven Barth
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.SecondP

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Paul Ishenin
21.03.2010 17:08, Sven Barth wrote: 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")? '&' at the begining of identifer allows to use any identifier name like &location, &platform, etc.

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Marco van de Voort
In our previous episode, Paul Ishenin said: > 21.03.2010 17:08, Sven Barth wrote: > > 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")? > '&' at the begining of identifer allows t

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Paul Ishenin
21.03.2010 17:33, Marco van de Voort wrote: '&' at the begining of identifer allows to use any identifier name like &location,&platform, etc. That doesn't help, since still breaks existing code that might not even use C++ extensions. But I assume this is done in a separate mode (or modeswi

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Marco van de Voort
In our previous episode, Paul Ishenin said: > > That doesn't help, since still breaks existing code that might not even use > > C++ extensions. But I assume this is done in a separate mode (or > > modeswitch?) > > > Sorry? & needs to be placed in the pascal code. So I don't see what > existing

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Sven Barth
Hi again! On 21.03.2010 11:28, Paul Ishenin wrote: > 21.03.2010 17:08, Sven Barth wrote: >> 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")? > '&' at the begining of identifer allo

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Sven Barth
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. Ho

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Paul Ishenin
21.03.2010 20:21, Sven Barth wrote: 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

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Jonas Maebe
On 21 Mar 2010, at 14:28, Paul Ishenin wrote: > 21.03.2010 20:21, Sven Barth wrote: >>> 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 "or

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Florian Klaempfl
>> 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

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Paul Ishenin
21.03.2010 20:30, Jonas Maebe wrote: That should be "m_none" instead of m_all, otherwise every program using "namespace" as identifier will fail to compile afterwards. Sorry. My fault - looked at m_none but copied m_all line instead :( Best regards, Paul Ishenin. ___

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Sven Barth
Hi again! Once I say 'I did it that and that way', all are coming to answer me... Nice :) On 21.03.2010 14:28, Paul Ishenin wrote: 21.03.2010 20:21, Sven Barth wrote: 3. How can I parse a not reserved identifier? Checking "idtoken" for "_ID", using it with "token" and after usage calling "co

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Marco van de Voort
In our previous episode, Sven Barth said: > (besides using m_none instead of m_all as Jonas mentioned). > > I'm talking about the namespace value itself. > > E.g. the C++ code > > namespace Foo::Bar { > class FooBar { > > } > } > > becomes to > > FooBar = cppclass > > end; namesp

Re: [fpc-devel] C++ linking questions

2010-03-21 Thread Sven Barth
Hi again! On 21.03.2010 15:24, Marco van de Voort wrote: In our previous episode, Sven Barth said: (besides using m_none instead of m_all as Jonas mentioned). I'm talking about the namespace value itself. E.g. the C++ code namespace Foo::Bar { class FooBar { } } becomes to

Re: [fpc-devel] RTL and Unicode filenames operations.

2010-03-21 Thread dmitry boyarintsev
On Tue, Mar 21, 2010 at 2:01 PM, Marco van de Voort wrote: > I'll reiterate my opinion that first a decision about what the working > stringtype of the RTL will be. > IMHO there is no decent solution till there is a real utf-8 type (read > cpnewstr)

Re: [fpc-devel] RTL and Unicode filenames operations.

2010-03-21 Thread Marco van de Voort
In our previous episode, dmitry boyarintsev said: > On Tue, Mar 21, 2010 at 2:01 PM, Marco van de Voort > wrote: > > I'll reiterate my opinion that first a decision about what the working > > stringtype of the RTL will be. > > IMHO there is no decent

Re: [fpc-devel] RTL and Unicode filenames operations.

2010-03-21 Thread Martin Schreiber
On Sunday 21 March 2010 16:17:49 dmitry boyarintsev wrote: > On Tue, Mar 21, 2010 at 2:01 PM, Marco van de Voort > > wrote: > > I'll reiterate my opinion that first a decision about what the working > > stringtype of the RTL will be. IMHO there is no d

Re: [fpc-devel] RTL and Unicode filenames operations.

2010-03-21 Thread Marco van de Voort
In our previous episode, Martin Schreiber said: > > Yes, it does so and i see no problems here. The package also converts > > UTF-16 to ansi encoding for Win9x. > > Converting string from UTF16 to UTF8 (or any other encoding) is not > > much time penalty comparing to the time of the file operation

Re: [fpc-devel] RTL and Unicode filenames operations.

2010-03-21 Thread Jonas Maebe
On 21 Mar 2010, at 17:29, Martin Schreiber wrote: > On Windows and Mac utf-16 is then native filename encoding On Mac it's utf-8, not utf-16. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo

Re: [fpc-devel] RTL and Unicode filenames operations.

2010-03-21 Thread dmitry boyarintsev
On Sun, Mar 21, 2010 at 7:53 PM, Jonas Maebe wrote: > On Mac it's utf-8, not utf-16. At least, not as "sequence of bytes", see test1.pas of the ufiles package. thanks, dmitry ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepa