[antlr-interest] Incremental parsing?

Sebastian Mies sebastian.mies at gmx.net
Tue Aug 30 12:53:09 PDT 2005

Hi Dave,

DD> Hi.  I have a shiny new language which is parsed by antlr,
DD> trying to integrate with Visual Studio so I can have an IDE for
DD> said language.  When VS loads a file, it first requests a full
DD> parse of the file.  Subsequent edits to the file also generate
DD> parse requests, providing info on the “dirty” source code region.
DD> I’m currently taking the brute-force approach, which involves
DD> creating a new lexer/parser and doing a full reparse on every
DD> parse request, regardless of the specified dirty region.  That
DD> seems really inefficient.  Any suggestions on better approaches? 
DD> Is there a way to do an incremental parse?  I’m currently using
DD> the automatic AST generation facility.  Maybe incremental parsing
DD> requires custom AST generation???
I'm currently working on incremental parsing with ANTLR Gramars.
It is not so trivial one might think (Lookaheads, State tracking and
matching). My approach will be a simple interpreted incremental parser,
and hopefully ready soon (prototype works actually).
Anyway, it will only update a simple parse tree in it's first version,
since automatic AST construction makes incremental parsing a lot more
complicated and no semantic predicates/scopes/actions are supported.



More information about the antlr-interest mailing list