January 05, 2015 Re: DMD's lexer available on code.dlang.org | ||||
---|---|---|---|---|
| ||||
Posted in reply to Laeeth Isharc | "Laeeth Isharc" wrote in message news:yzmwemaevaltcmkywmgk@forum.dlang.org... > on a related note, have you considered sharing your translation tool (c++ -> D)? I completely understand if you would rather not of course. The translation tool is available on github and is boost licensed. This pull request contains the latest version in src/magicport - https://github.com/D-Programming-Language/dmd/pull/3410 Please keep in mind that the tool makes a lot of assumptions about the C++ source that may not be valid for projects other than dmd. It's fairly easy to adapt to other projects, but it won't work on them out of the box. |
January 05, 2015 Re: DMD's lexer available on code.dlang.org | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Murphy | "Daniel Murphy" wrote in message news:m8bdul$1dke$1@digitalmars.com... > I've created a dub package for the D version of DMD's lexer, generated automatically from the C++ source. > > github: https://github.com/yebblies/ddmd > dub: http://code.dlang.org/packages/ddmd I've pushed a new version which should fix the 64-bit build errors. |
January 05, 2015 Re: DMD's lexer available on code.dlang.org | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Murphy | On Monday, 5 January 2015 at 02:51:17 UTC, Daniel Murphy wrote:
> "Laeeth Isharc" wrote in message news:yzmwemaevaltcmkywmgk@forum.dlang.org...
>
>> on a related note, have you considered sharing your translation tool (c++ -> D)? I completely understand if you would rather not of course.
>
> The translation tool is available on github and is boost licensed.
>
> This pull request contains the latest version in src/magicport - https://github.com/D-Programming-Language/dmd/pull/3410
>
> Please keep in mind that the tool makes a lot of assumptions about the C++ source that may not be valid for projects other than dmd. It's fairly easy to adapt to other projects, but it won't work on them out of the box.
Thanks v much - this will be very helpful indeed.
|
January 05, 2015 Re: DMD's lexer available on code.dlang.org | ||||
---|---|---|---|---|
| ||||
Posted in reply to Laeeth Isharc | "Laeeth Isharc" wrote in message news:vtgirvyjsalkzjvlzdws@forum.dlang.org... > Thanks v much - this will be very helpful indeed. Let me know if you have any questions about it. |
January 06, 2015 Re: DMD's lexer available on code.dlang.org | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rikki Cattermole | On Sunday, 4 January 2015 at 13:09:42 UTC, Rikki Cattermole wrote: > On 5/01/2015 2:07 a.m., Daniel Murphy wrote: >> I've created a dub package for the D version of DMD's lexer, generated >> automatically from the C++ source. >> >> github: https://github.com/yebblies/ddmd >> dub: http://code.dlang.org/packages/ddmd >> >> There are a few annoying limitations, such that it uses dmd's error >> printing and allocation functions, and requires configuration through >> 'global'. >> >> Here is an example program that uses the lexer: >> >> ====================== >> >> import std.stdio; >> import std.file; >> >> import ddmd.tokens; >> import ddmd.lexer; >> >> ///////////////////////// >> >> void main() >> { >> Lexer.initLexer(); >> >> string data = "void blah() {} // stuff"; >> auto l = new Lexer("myfile", data.ptr, 0, data.length, 0, 0); >> l.nextToken(); >> do >> { >> printf("token: %s\n", l.token.toChars()); >> } >> while (l.nextToken() != TOKeof); >> } >> >> ====================== >> >> Prints: >> >> token: void >> token: blah >> token: ( >> token: ) >> token: { >> token: } > > I saw that. I'm really looking forward to getting my teeth into it and doing some good old refactoring. Although that will be a while because of the auto generated thing. I have a bit similar project - lexer for D written in D. Written just based on "Lexical" documentation page. https://github.com/buggins/ddc Trying make it fast and to do as few memory allocations as possible. |
January 06, 2015 Re: DMD's lexer available on code.dlang.org | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Murphy | It will be really cool when same package will be reused by DMD itself :P |
January 06, 2015 Re: DMD's lexer available on code.dlang.org | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Tuesday, 6 January 2015 at 14:38:21 UTC, Dicebot wrote:
> It will be really cool when same package will be reused by DMD itself :P
I believe ddmd has passed all tests on most platforms for a long time now, so there is nothing stopping those building from source from using ddmd now. :)
|
January 06, 2015 Re: DMD's lexer available on code.dlang.org | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vadim Lopatin | On 1/6/2015 1:37 AM, Vadim Lopatin wrote:
> I have a bit similar project - lexer for D written in D.
> Written just based on "Lexical" documentation page.
>
> https://github.com/buggins/ddc
>
> Trying make it fast and to do as few memory allocations as possible.
Should also make it available on code.dlang.org
|
Copyright © 1999-2021 by the D Language Foundation