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

Ingo Maier i.maier at gmx.de
Mon Apr 25 07:52:39 PDT 2005


On Sun, 2005-04-24 at 20:50, Scott Stanchfield wrote:
> Ummm... that's what eclipse does, and it's amazingly fast.

Isn't Prashant talking about incremental parsing (as opposed to
incremental compilation)? I guess incremental parsing with all related
semantic checking and stuff is way more complex than eclipse/jdt is
doing incremental compilation. It has no "delta" ASTs/nodes but whole
delta compilation units as far as I know. When a compilation unit has
changed, it parses it from beginning to end and builds a whole new AST,
(not just the lines that changed modifying single nodes). The
synchronization happens on a level above Prashant's talking and should
be much simpler to manage. Please correct me if I am wrong. 

And yes, eclipse java copmpiler/parser is fast. I guess that comes from
it's jikes heritage, whose reputation isn't that bad in terms of
speed...

Regards,
Ingo

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