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

Prashant Deva prashant.deva at gmail.com
Sun Apr 24 14:52:15 PDT 2005


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...

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.

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


More information about the antlr-interest mailing list