Regular- or context-free grammars with objects?
Ned Konz
ned at bike-nomad.com
Mon Dec 2 20:34:38 UTC 2002
On Monday 02 December 2002 12:12 pm, Brian T Rice wrote:
> > the code I've seen for parsing regular expressions or
> > context-free grammars seems to pretty much assume that one is
> > dealing with strings (or is it just my impression?). Is anybody
> > aware of, for examle, object-based regex? How about diff?
There has been a lot of work done on "tree matching" algorithms,
especially in the context of optimizing compilers, which have to take
a parse tree and match pieces of it to apply transforms.
In Squeak, you might want to load the RefactoringBrowser and look at
the way it matches patterns in parse strings for its Lint and
refactorings.
XSLT and XPATH let you express paths and transforms in XML.
If you can navigate an object graph, you can search it for patterns at
each node. This probably isn't the most efficient way to do it, but
it can let you get something running quickly.
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|