Refactoring Browser Rewrite Editor plans

Daniel Vainsencher danielv at netvision.net.il
Wed Aug 13 19:54:20 UTC 2003


[RRE UI improvements]
Last ESUG Niall Ross, a few others and myself have worked on some ideas
to improve the UI. The two I remember are -
1. An option to invoke the rewrite tool from the RB by marking some code
and choosing "search for it" in a context menu. This should make it more
visible, and thus help people remember that it even exists.
2. An option to refine parts of query using a menu driven, rather than
syntax driven UI. So instead of figuring out that to search for
"SearchFiles at: <anything>" you actually need to write "SearchFiles at:
`@bla", you would start with "SearchFiles at: 1", mark the 1, get a menu
with options for "replace it with literal", "replace it with a variable"
"replace it with any legal expression". Choosing an option replaces the
search text, teaching the programmer the right syntax for next time.

[writing a full RRE interface]
I propose you become familiar with the FinderTool. One way to invoke it
on a class is to select a class, go to the RB-class menu, and choose the
"find code like.." option. The Finder is actually more powerful the the
original RRE in that it allows you to write blocks limiting the matches,
so you can express things like "SearchTool at: <an even numeric
literal>". This simply exposes more of the parse tree matchers power
than the original.

It'll get you most of the way to being anle to do rewrites from the
workspace, which is most of the way to extending the UI to handle them.
The search* methods in the Finder are the key, of course. Let me know if
I can help.

Daniel

Ned Konz <ned at bike-nomad.com> wrote:
> On Wednesday 13 August 2003 11:43 am, Daniel Vainsencher wrote:
> > I am somewhat interested, though I haven't worked on it much
> > lately. If you look at the FinderTool in the *UserInterface
> > category, you'll see that it is already possible to do some basic
> > searches (now that I think of it, one example is patterns such as
> > "SourceFiles at: <anything>".
> >
> > The reasons I worked on the FinderTool, and not the full rewrite
> > rule editor are two:
> > A. The rewrite rule editor is usually quite hard for people to get
> > used to.
> > B. A "find" is easier to use, but a good prelude, to a rewrite.
> >
> > But it might be nice to complete the tool set. What did you have in
> > mind? the usual UI? something smarter?
> 
> I understand that there is some work being done (or has been done?) on 
> improving the Rewrite Editor for VW and other Smalltalks. I'd thought 
> that even a simple/usual UI would be an improvment.
> 
> Being able to do a "dry run" of the resultant code is of course 
> necessary (though as I recall the standard editor provided this).
> 
> I find myself wanting to do wholesale rewrites, and am not too sure 
> how to do it with Smalltalk expressions in a Workspace.
> -- 
> Ned Konz
> http://bike-nomad.com
> GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list