<p>>> mixin(Grammar!("Doc <- Node*"<br>
>> "Node <- OpeningTag (Text / Node)* ClosingTag", NodeAction,<br>
>> "OpeningTag <- '<' Identifier '>'", OpeningAction,<br>
>> "ClosingTag <-  `</` Identifier '>'", ClosingAction,<br>
>> "Text <- (!(OpeningTag / ClosingTag) _)+"));<br>
><br>
><br>
> 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.</p>
<p>Yes, using one string is indeed better. That won't be too difficult to code.</p>
<p>But how to associate actions with a rule, in that case? I mean, some rules will have actions, some not.</p>
<p>In my case, a parse tree is automatically generated (indeed, it's almost the only thing returned by a parse call, that with recognized string and named captures). I have some additional syntax to 'drop' a node ans such, similar to what you proposed a few posts ago.<br>
</p>