Lexer and parser generators using CTFE

d coder dlang.coder at gmail.com
Tue Feb 28 18:13:38 PST 2012


>
>
> > On Wednesday, February 29, 2012 02:16:12 Christopher Bergqvist wrote:
> > > I agree that the current direction of D in this area is impressive.
> > > However, I fail to see a killer-feature in generating a lexer-parser
> > > generator at compile-time instead of run-time.
> > >
>

CTFE parsing is especially useful for DSEL (Domain Specific Embedded
Languages) or internal DSLs. The advantages are:

1. Syntactic errors (in the parsed constructs)  are given out at compile
time.
2. D reflections are available only at compile time. Referencing the
variables/identifiers in the parsed subset of DSL with the mainstream D
code is impossible without reflections in place.

Regards
- Puneet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120229/3f2b8225/attachment.html>


More information about the Digitalmars-d mailing list