Update the Ada parser
The WisiToken error recovering parser was not hard to update to use the new syntax tree; once that was working, I started updating the Ada parser to use it. I took a detour here; Ada 2020 is almost out, so I added the new syntax to the Ada parser. Along the way I found a better way to implement the indent engine. That's all working now; the ada-mode tests all pass. So back to incremental parse.
Lahav 2004 describes an "incremental scanner"; only the tokens that actually require scanning due to text changes are scanned. The other tokens following any change are adjusted to reflect the change in position. WisiToken uses the term "lexer" instead of "scanner"; it uses the re2c lexer. The lexing process must modify the existing terminal stream in the syntax tree, rather than creating a new one; so it makes sense to also modify the parse tree at the same time, breaking it down where it must change.
Comments
Post a Comment