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.
