Lexer and parser generators using CTFE

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Feb 29 08:45:47 PST 2012


On 2/29/12 3:45 AM, Philippe Sigaud wrote:
> mixin(Grammar!("Doc <- Node*"
> "Node <- OpeningTag (Text / Node)* ClosingTag", NodeAction,
> "OpeningTag <- '<' Identifier '>'", OpeningAction,
> "ClosingTag <-  `</` Identifier '>'", ClosingAction,
> "Text <- (!(OpeningTag / ClosingTag) _)+"));

That looks about right, but still has a fair amount of noise. I think 
the approach of putting the entire grammar in one string is best.

Andrei



More information about the Digitalmars-d mailing list