开发者

gppg/gplex equivalent in D?

When I was working in C#, I found the gppg and gplex parser/lexer generators to be perfect for my needs. I'm wondering if there's so开发者_JAVA技巧mething similar for the D programming language (i.e. a utility that, given a grammar in BNF or EBNF, outputs D code that lexes/parses that language into a abstract syntax tree).

The closest I've found is Goldie, but I'm having so much trouble understanding it that I'm not able to get anything up and running.


I have found Goldie pretty awesome for context-insensitive grammars, are you sure about it? Also, http://www.wikiservice.at/d/wiki.cgi?GrammarParsers lists some, no idea which are still developed. If ANTLR-D still works, it is probably on of the best choices.


Goldie is probably your best bet, but there's also ragel which can emit D. It's not exactly what you asked for (composable state machines) though it might suffice for many cases and it's really nice.

Trunk version can compile to D2 code with the undocumented -E switch, I'm not sure yet how mature that is.

http://www.complang.org/ragel/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜