I use Lexer and Parser classes generated by ANTLR tool (targeting C#). Assume I have parsed some code and got an AST tree for it. What if part of my initial code has changed and I want to update just the corresponding parts of the tree? Is there a common way to do that? For example a line of code was inserted inside some functions body. And I want to rebuild just the part of the tree representing this function and update positions of subsequent functions tokens
There are a few projects out there which do what you might want to accomplish. But I don't know if ANTLR supports this. You might take a look at: http://en.wikipedia.org/wiki/Incremental_compiler
For syntax highlighting propose only, I suggest using regular expression for the different token in your syntax. (If you update just the line you're working on you should not get any performance problems.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With