Meta / CTFE library

Robert Fraser fraserofthenight at gmail.com
Mon Jun 23 07:01:26 PDT 2008


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).



More information about the Digitalmars-d mailing list