digitalmars.D.learn - lexer/parser library for D
- Jonathan (8/8) Dec 29 2013 Are there any good lexer and parser libraries (like flex/bison)
- John Colvin (7/15) Dec 29 2013 A POD struct in D is interchangeable with C structs, both ways.
- FreeSlave (4/12) Dec 29 2013 See http://dlang.org/htomodule.html
- Mike Parker (5/7) Dec 29 2013 Better to go to [1], where I combined that series of posts into a single...
- FreeSlave (2/2) Dec 29 2013 There is also http://www.semitwist.com/goldie/ but I did not use
- "Casper =?UTF-8?B?RsOmcmdlbWFuZCI=?= <shorttail hotmail.com> (2/2) Dec 29 2013 If you like Parser Expression Grammar there's Pegged:
Are there any good lexer and parser libraries (like flex/bison) for D? If not, how much work would be involved in using flex and bison and wrapping it to D? How straightforward is it to pass a struct from C to D (the documentation http://dlang.org/struct.html just says that D structs go directly to C -- the other way holds too if the C side is written in a certain way, but gives no examples of what is needed on both sides)?
Dec 29 2013
On Sunday, 29 December 2013 at 19:25:46 UTC, Jonathan wrote:Are there any good lexer and parser libraries (like flex/bison) for D? If not, how much work would be involved in using flex and bison and wrapping it to D? How straightforward is it to pass a struct from C to D (the documentation http://dlang.org/struct.html just says that D structs go directly to C -- the other way holds too if the C side is written in a certain way, but gives no examples of what is needed on both sides)?A POD struct in D is interchangeable with C structs, both ways. You just have to make the declaration of the struct in both languages. Lexers/Parsers: https://github.com/PhilippeSigaud/Pegged and https://github.com/Hackerpilot/Dscanner
Dec 29 2013
On Sunday, 29 December 2013 at 19:25:46 UTC, Jonathan wrote:Are there any good lexer and parser libraries (like flex/bison) for D? If not, how much work would be involved in using flex and bison and wrapping it to D? How straightforward is it to pass a struct from C to D (the documentation http://dlang.org/struct.html just says that D structs go directly to C -- the other way holds too if the C side is written in a certain way, but gives no examples of what is needed on both sides)?See http://dlang.org/htomodule.html Also you may read http://www.gamedev.net/blog/1140/entry-2254003-binding-d-to-c/
Dec 29 2013
On 12/30/2013 5:36 AM, FreeSlave wrote:Also you may read http://www.gamedev.net/blog/1140/entry-2254003-binding-d-to-c/Better to go to [1], where I combined that series of posts into a single article and updated a few things, too. [1] http://www.gamedev.net/page/resources/_/technical/game-programming/binding-d-to-c-r3122
Dec 29 2013
There is also http://www.semitwist.com/goldie/ but I did not use it.
Dec 29 2013
If you like Parser Expression Grammar there's Pegged: https://github.com/PhilippeSigaud/Pegged
Dec 29 2013