On 2012-03-01 18:21, Philippe Sigaud wrote:
> > But how to associate actions with a rule, in that case? I mean, some
> > rules will have actions, some not.
>
> You could maybe just put D code in the grammar string, which gets
> compiled as a string mixin by CTFE?
I could, but one of my driving goals while beginning this project a
month ao was to use the shiny new lambda syntax directly :)
"rule1", o => o
"rule2", o => o
etc.
Maybe we can take some ideas from the CoffeeScript compiler (written in
CoffeeScript) :
Grammar:
http://jashkenas.github.com/coffee-script/documentation/docs/grammar.html
Lexer:
http://jashkenas.github.com/coffee-script/documentation/docs/lexer.html
--
/Jacob Carlborg