Re: Hierarchical query
Date: Thu, 14 Jun 2007 09:41:42 -0700
On Jun 14, 2:47 am, Jan Hidders <hidd..._at_gmail.com> wrote:
> Are you saying that anything for
> which one would typically use XPath can be done just as well with
> regular expressions assuming that the tree is somehow encoded in a
A set of strings
> This is clearly not the case for the encoding you gave. Or are
> you going to extend that? Perhaps also extend the regular expressions
> a little?
I was going to define tree query in pure language settings, be it regular languges, context free grammars, or else.
Let's start from scratch again with simpler example. Given a grammar
expr '+' expr
| '(' expr ')'
and derivation tree find all the '1's that are nested within a pair of brackets. In the example
1.1 expr 1.1.1 ( 1.1.2 expr 220.127.116.11 expr 18.104.22.168.1 1 22.214.171.124 + 126.96.36.199 expr 188.8.131.52.1 1 1.1.3 ) 1.2 + 1.2 expr 1.2.1 1
the query should return nodes 184.108.40.206.1 and 220.127.116.11.1 Received on Thu Jun 14 2007 - 18:41:42 CEST