Regular- or context-free grammars with objects?

Colin Putney cputney at whistler.com
Mon Dec 2 20:50:32 UTC 2002


On Monday, December 2, 2002, at 11:56  AM, Marcel Weiher wrote:

> Hi folks,
>
> 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?

Avi and I have been hacking on this *kind* of thing for Monticello. It 
uses a declarative model to represent Smalltalk source code - you have 
classes like ClassDeclaration, MethodDeclaration etc. A cluster of 
these decarations, representing, say,  the source code for a package, 
can be diffed or patched along the same lines as CVS does with text 
files.

This works by having declarations know how to compare themselves with 
other declarations, so it's maybe not the best example of how to do 
this in a generic way.

Cheers,

Colin


Colin Putney
Whistler.com




More information about the Squeak-dev mailing list