Ken Fox wrote:

> I'm messing around with regex code generation by
> converting first to a grammar. The modifiers seem
> to need intimate knowledge of regex -> grammar
> conversion. This may be a quirk of my approach.
> People using tree traversal or generating code
> directly from the regex might see something else.
> I suspect modifiers will still be deeply connected
> with the internals.

I would imagine that modifiers would be passed some
kind of hierarchical representation of the rule
they're modifying (i.e. a parse tree of it), and
would be expected to manipulate that structure
representation. The final state of the representation
would be used as the (post-modified) rule.

For example, perhaps the modifier would be passed the
$0 from the parser rule that parsed the rule contents.

Damian


Reply via email to