Meta / CTFE library

BCS ao at pathlink.com
Mon Jun 23 10:34:27 PDT 2008


Reply to Robert,

> Matthias Walter wrote:
> 
>> Hello,
>> 
>> as I'm doing much stuff with CTFE / Template Metaprogramming, I
>> thought about collecting important stuff in a library. I already
>> found the following interesting:
>> 
>> 1. parsing routines for compile-time; although every standard lib has
>> their parsing routines, but sometimes they don't work at compile time
>> (e.g. using some libc-stuff), or at least are not optimized for this
>> use. This includes parsing / printing numbers as well, because at
>> least for dumping some numbers, while debugging a CT-program, one
>> needs these quiet often. Everyone, who read Dons BLADE library, will
>> know his enquote() function. This one is very important if you like
>> to do some recursive mixin programming, like he did there.
>> 
> I'd love to see a compile-time language parser infrastructure. There's
> already code (BCS's) that takes an EBNF grammar and generates a
> runtime code parser, but what about something that can create a (semi)
> efficient compile-time parser (that is, given an EBNF grammar and a
> code string, create some compile-time structs of the syntax of the
> code string, which can then be used to generate other compile-time
> code).
> 

And I thought *I* was nuts (OTOH I've considered that myself :)

Feel free to steal stuff from dparse (It'll be getting a few more things 
as soon as my current reworking is done.





More information about the Digitalmars-d mailing list