[antlr-interest] Serious doubts on usage of incremental parsing in ides

Torkild Ulvøy Resheim torkildr at resheim.no
Mon Apr 25 01:06:18 PDT 2005


On Sunday 24 April 2005 23:52, Prashant Deva wrote:
> I am seriously begining to doubt the utility of having an incremental
> parser in an ide.
>
> Cause no matter how fast ur lexer/parser is, you still have to run
> them in the background thread cause the amount of work done on each
> 'delta change' can be substantial, ie, updating the tree, semantic
> highlighting, diagrams, search results, etc...
Well it depends I guess. But in my experience the delta is not very large,
a few lines of code at the most. Unless we have a copy, paste. However I only 
update the model, rarely the view that depend on it.
>
> And if you are going to be running in a background thread means that
> you are out of sync with the document that is currently being edited.
> Thus all the current info you have pretty much amounts to zero. You
> can't just query a tree and find out the context of say an offset,
> cause the context might have changed from the last time the tree was
> updated.
>
> You obviously can't use it to do auto formatting wile typing cause
> that would require a completly synced tree.
>
> You try doing highlighting with it and you might find that the offsets
> you got to update have already has their text changed by the time they
> are updated.
>
> Also it makes all your components 10 times more complex cause now they
> have to deal with 'delta changes' instead of just a tree.
>
> Also if you are doing parsing in background, the user won't feel at
> all whether you are doing a full parse each time or just an
> incremental parse.
>
> I agree incremental parse is way faster than a full parse, but then we
> are talking of times in milliseconds, which won't be noticed at all if
> you are parsing in another thread.
>
> So my question is that other than having a little more accuracy with
> auto complete, ehat exaclty is the use of all this incremental stuff,
> if you can't use the info at run time.
I'm currently implementing incremental parsing for my "Visual DataFlex plugin" 
for Eclipse. Since the grammar is fairly large and not very fast I see no 
other option because:

* The outline view should be accurate.
* The "highlight range indicator" should be accurate.
* Automatic indentation should be accurate.
* Content assist should be accurate.
* Templates should be accurate.
* Specialized search should be accurate.
* etc. etc.

>
> Don't say that we can run the parser at real short intervals , ie
> every 50ms instead of 500ms, cause then again you are just playing
> with luck and hoping the user types slow.
>
> PRASHANT

-- 
Med vennlig hilsen / Kind regards                                  ((
Torkild Ulvøy Resheim, Senior Systemutvikler / Software Engineer    ))
Emma EDB AS, Trondheim, Norway. http://www.emmaedb.no             |----|_
Private pages: http://resheim.no - "Any sufficiently advanced     |    | )
bug is indistinguishable from a feature."                         |____|'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20050425/6182283a/attachment.bin


More information about the antlr-interest mailing list