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

Scott Stanchfield scott at javadude.com
Sun Apr 24 17:50:09 PDT 2005


Ummm... that's what eclipse does, and it's amazingly fast.

First, there are two concepts here:

1) incremental compilation
2) editor parsing for decoration & "instant errors"

Have you tried running a full build of anything recently? Most large
projects take several minutes (3-5 at least) or more. The incremental
building in eclipse has probably saved me a good year of development time
since it came out... (And I'm not kidding... If I had to go back to
rebuilding by hand every once in a while, then figure out the context of
each error, I'd go nuts...)

Incremental compilation is not about syntax highlighting (though the java
editor updates an AST every time you pause). It's about:

1) shorter build times
2) instantly seeing what's wrong
3) keeping in the context of the problems when they appear (you know what
you just changed)
4) ensuring you only have a few errors to wrestle with at a time (instead of
compiling every hour or two to find several and not remember what you were
doing)

Worst case, the entire workspace is rebuilt, and that's incredibly rare. (If
you were able to edit the "Object" class in java it would cause it, but
there are very few classes that just about everything needs, though you can
cause a chain reaction. I've rarely seen a long incremental build in eclipse
unless the tools are messed up -- the web tools, for example, have some
problems that trigger massive recompilation.)

Incremental compilation is usually triggered on save (that's what eclipse
does), at which point all impacted classes in a workspace are recompiled.

Editor parsing only affects the file you're editing, not the potentially
impacted code outside that file. It usually triggers this when the user
pauses. (If you notice you can type several words and they'll stay black,
then when you pause they get highlighted). The editor parsing is
significantly faster b/c it only affects a single file.

Incremental compilation is a good thing, but yes, it's quite complex to
implement...

Later,
-- Scott




More information about the antlr-interest mailing list