or some equivalent representation of the regular expression itself.
(The trouble is, when you google for 'ruby regular expression parser'
you get all sorts of parsers written *using* regular expressions, not
parsers *for* regular expressions!)
If I were you I'd use the Perl one as a starting point for writing a
Treetop grammar for Ruby regexes. Or ask around on the Treetop list
and see if someone's already done that.
or some equivalent representation of the regular expression itself.
(The trouble is, when you google for 'ruby regular expression parser'
you get all sorts of parsers written *using* regular expressions, not
parsers *for* regular expressions!)
I wrote one a while ago. It doesn't exactly produce a tree like you
described, but it does provide outputs that I think can be easily used to
create such a tree.
or some equivalent representation of the regular expression itself.
(The trouble is, when you google for 'ruby regular expression parser'
you get all sorts of parsers written *using* regular expressions, not
parsers *for* regular expressions!)
I wrote one a while ago. It doesn't exactly produce a tree like you
described, but it does provide outputs that I think can be easily used
to
create such a tree.