Incremental PEG Parsing
Citation
Yedidia, Zachary. 2021. Incremental PEG Parsing. Bachelor's thesis, Harvard College.Abstract
Code analysis software in a text editor or IDE must repeatedly parse source code whenever an edit occurs. In many cases, a user's edit will affect only the parse of nearby characters, meaning a full-document reparse is unnecessary and inefficient. Incremental parsing algorithms support quick reparsing after common-case edits by remembering parse state and only parsing the parts of the document that have changed.This thesis builds on previous work in incremental parsing for parsing expression grammars (PEGs). We develop new methods for incremental parsing that enable reparsing in logarithmic time in the common case for a wide variety of grammar types. These methods are implemented in a practical library called GPeg that supports efficient dynamic incremental parsers and a language-agnostic parser format via a parsing machine. Finally, we use this library to study the performance and usability of our parsing methods for the cases of pattern matching, full grammar parsing, and syntax highlighting.
Terms of Use
This article is made available under the terms and conditions applicable to Other Posted Material, as set forth at http://nrs.harvard.edu/urn-3:HUL.InstRepos:dash.current.terms-of-use#LAACitable link to this page
https://nrs.harvard.edu/URN-3:HUL.INSTREPOS:37368580
Collections
- FAS Theses and Dissertations [7063]
Contact administrator regarding this item (to report mistakes or request changes)