[antlr-interest] Re: View update management (was: Serious doubts on usage of incremental parsinginides)

John D. Mitchell johnm-antlr at non.net
Tue Apr 26 11:31:27 PDT 2005


>>>>> "Jean" == Jean Bovet <antlr-list at arizona-software.ch> writes:
[...]

>> Add a level of indirection in the input flow so that you disconnect the
>> source code snapshot as of when the parse started from any editing done
>> while the parse is happening.

> I am not sure to understand exactly... Currently, the colorization
> happens only when the parser is done. And the parser is launched only
> when the user pauses. Where would you put another level of indirection ?

Your question was about the views getting out of sync because of user
activity while all of the view processing was in-flight.  I'm saying to
disconnect the editing view from everything else so that all of the other
views can be safely updated while the user is still editing.  At worst, the
other views are a few seconds behind the editing view.


[...]
>> That reminds me, another trick to help manage when to do updates is
>> immediately after separator and terminator tokens have been inserted.
>> I.e., it's less disruptive for the flow if these background threads are
>> invoked after a '}' or ';' or between "words" (i.e., after whitespace).

> Interesting... I'll think about.

>> This can be nicer than using the timer approach because you can
>> basically always have at most a single update in progress (e.g., don't
>> launch any updates while an update is in progress).

> What kind of single update ? At some point I can have multiple thread
> running to update different components: do you suggest that I launch each
> thread in serial rather than in parallel ?

Ah, sorry for the confusion.  I'm talking about one launch of the parse
followed by all of the updating of the dependent views as a "single update"
bundle.

I'm basically agnostic about whether you do the view updates serially or in
parallel.

> I would probably combines both approach because if the user pauses in the
> middle of a string or a comment, he wants to see the correct color.

Actually, I'd want to see the last, unfinished token still in the neutral,
unfinished color as a clean bit of feedback that things are still in an
unfinished state.

Personally, I'd hook into the view refresh command (i.e., Ctrl-L in Emacs,
Ctrl-R in most browsers) to manually force a complete refresh at any
point.  I'd also hook the refresh into the auto-save feature.

Hope this helps,
		John


More information about the antlr-interest mailing list