[antlr-interest] Re: View update management (was: Serious doubts on
usage of incremental parsinginides)
Jean Bovet
antlr-list at arizona-software.ch
Tue Apr 26 10:43:14 PDT 2005
>
> 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
?
> While you're inserting the in-flight characters into the editing
> buffer,
> use a neutral color. That helps give the user some feedback as the
> typing
> progresses that the system hasn't fully caught up with them yet.
>
Yes, that's what I'm doing now.
>
> 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 ?
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.
> Check out Sun's JDC TechTips for J2SE. Jaz (um, er, John Zukowski) has
> written some tips on doing separating updates and mainline processing,
> dealing with the Swing event queue, double-buffering, etc.
>
Thanks a lot! I will have a look.
Jean
More information about the antlr-interest
mailing list