[antlr-interest] Serious doubts on usage of
incrementalparsinginides
Scott Stanchfield
scott at javadude.com
Tue Apr 26 17:17:42 PDT 2005
> The syntax diagram is an "analysis" pane rather than an
> editing pane, so it need not be updated as the user
> types--when I'm typing, I'm not concerned with analysis.
Many people are. As long as it can be updated w/o disruption, I'd say do it.
There will be points where you can't update (syntax is incomplete), but if
there are two views on a single model, the user shouldn't have to guess if
they're in sync...
If the diagram is meant as "once in a while analysis", it should be a
separate dialog, not a view. Views (as in model VIEW controller) are meant
to stay in sync with a model.
> I'd
> suggest update on events which change the editing screen
> significantly--navigating to another part of the text, for
> example, or mouse events in general (one hand off of the
> keyboard).
Those are a good start; I'd suggest adding rule completion (semicolon) as
well.
HOWEVER, what if someone removes a rule ref:
old:
foo: fee fie fo;
new:
foo: fee fo;
If they don't jump somewhere else, this should still update the diagram. The
question is, when.
Using a timeout is quite reasonable.
> John Mitchell's comment on separators is a good
> one--I like having the editor flash matching parentheses and
> braces if you pause after hitting a close parenthesis or
> brace. Pause after semicolon is another good update
> point--when I do that, I have usually paused to think.
BTW: check out what Eclipse does with parens. It draws a little box around
matching parens, no flashing. Not distracting, but also the visualization is
right there if you need it.
> I also find it unsettling when an application decides to
> update the screen with a very slow update operation just
> because I've paused for a few seconds--all too often I have
> just gotten my hands back in a typing position when that happens.
Agreed, but that's no reason not to do updates; that's reason to do highly
optimized or incremental updates, which of course leads us right back to the
initial question...
And my answer is they are useful. I and pretty much everyone I work with
really appreciate the instant feedback. (The one exception is a VI
dinosaur... If any of you are VI users, too bad. Nyah... ;)
Later,
-- Scott
More information about the antlr-interest
mailing list