Lexer and parser generators using CTFE
deadalnix
deadalnix at gmail.com
Thu Mar 1 01:02:49 PST 2012
Le 29/02/2012 17:45, Andrei Alexandrescu a écrit :
> 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
>
It make sense so an external file can be imported as string and
processed at compile time.
More information about the Digitalmars-d
mailing list