Pliant icon indicating copy to clipboard operation
Pliant copied to clipboard

add incremental reparse to avoid reparsing the entire doc

Open patrickhuber opened this issue 10 years ago • 5 comments

Incremental reparsing reduces the time to compile changes into a document.

more information here (dead link) more information here also: here

patrickhuber avatar Apr 30 '15 19:04 patrickhuber

the link is no longer valid

An error occurred while processing your request.
Reference #50.9584dd58.1499694555.1cf3c26f

or

Access Denied
You don't have permission to access "http://delivery.acm.org/10.1145/1700000/1697247/p61-kallmeyer.pdf" on this server.
Reference #18.9584dd58.1499703476.1d2db9d8 

full list of publications: https://user.phil.hhu.de/~kallmeyer/publications.html

probably it was Laura Kallmeyer and Wolfgang Maier (2009): An Incremental Earley Parser for Simple Range Concatenation Grammar. In Proceedings of IWPT 2009, Paris, 61-64.

ArsenShnurkov avatar Jul 10 '17 13:07 ArsenShnurkov

Thanks, I added an additional link and updated the link to the one you supplied.

patrickhuber avatar Jul 10 '17 18:07 patrickhuber

Please also consider bidirectional parsing (from end to start) in addition to incremental parsing. Syntax tree doesn't have direction. So it is possible to perform scanning from the end of document (and from the start of document at the same time). This will simplify syntax highlighting implementation for the use case of small changes in text editor.

ArsenShnurkov avatar Aug 26 '17 06:08 ArsenShnurkov

Reading from the stream backwards should be a trivial implementation, but does something special need to be done to the grammar for this to work with the earley algorithm?

patrickhuber avatar Aug 26 '17 15:08 patrickhuber

reading backwards alone is not enough. Image source text like "#include int main() { return 0;}". When you read it backwards it starts from } and not from #. So definitely the grammar should be processed differently. And it's the algorithm what should be created, not grammar (the same grammar will be used for both the forward and the backward parsings).

ArsenShnurkov avatar Aug 26 '17 15:08 ArsenShnurkov