Andrew,

So far as I understand it, where incremental parsing comes in really handy
is when you have something continually reparsing a file. In my case, I use
ANTLR to parse a custom programming language, which is then integrated into
the NetBeans platform. The NetBeans parser, by default, continually reparses
the source as the user types to try and determine whether there are errors
in what the user is typing. It then generates visual feedback on the fly
(e.g., little red squiggly lines), depending upon if there are errors.

In practice, even with a non-incremental parser, this generally works fine
for 1 file (the user can only type in one at a time), but since everything
is done in real time, you want to the minimum amount of computation done
while the user is typing so that the visual (and in my case, aural, since my
language is for blind children), feedback to be as fluid and consistent as
possible. Since ANTLR is not incremental, I currently have NetBeans wipe the
build information for the file every time it requests a re-parse (which
happens often!!), and then ask ANTLR to do it from scratch. It would be nice
though, if ANTLR could only update the pieces of code the user was typing
in, as it would, in theory at least, be much faster.

In my case though, there are a few things I'm not sure how I would handle
yet if ANTLR were incremental.

1. How would the different phases of my VM interact (e.g., would the tree
walker also incrementally change?)

2. Would I be able to figure out how to modify my post-ANTLR compiler phases
if ANTLR were incremental?

I'm sure there are solutions to questions like these, and I highly support
incremental parsing for ANTLR, if it's feasible, but so far as I understand
it, it's a pretty tricky technology.

Andreas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to