Affiliation:
1. University of Califonia, Berkeley
Abstract
Previously published algorithms for LR (
k
) incremental parsing are inefficient, unnecessarily restrictive, and in some cases incorrect. We present a simple algorithm based on parsing LR(
k
) sentential forms that can incrementally parse an arbitrary number of textual and/or structural modifications in optimal time and with no storage overhead. The central role of
balanced sequences
in achieving truly incremental behavior from analysis algorithms is described, along with automated methods to support balancing during parse table generation and parsing. Our approach extends the theory of sentential-form parsing to allow for
ambiguity
in the grammar, exploiting it for notational convenience, to denote sequences, and to construct compact (“abstract”) syntax trees directly. Combined, these techniques make the use of automatically generated incremental parsers in interactive software development environments both practical and effective. In addition, we address
information preservation
in these environments: Optimal node reuse is defined; previous definitions are shown to be insufficient; and a method for detecting node reuse is provided that is both simpler and faster than existing techniques. A program representation based on
self-versioning documents
is used to detect changes in the program, generate efficient change reports for subsequent analyses, and allow the parsing transformation itself to be treated as a reversible modification in the edit log.
Publisher
Association for Computing Machinery (ACM)
Cited by
31 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Incremental Computation: What Is the Essence? (Invited Contribution);Proceedings of the 2024 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation;2024-01-11
2. UMLsecRT: Reactive Security Monitoring of Java Applications With Round-Trip Engineering;IEEE Transactions on Software Engineering;2024-01
3. Gradual Structure Editing with Obligations;2023 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC);2023-10-03
4. A text-based syntax completion method using LR parsing and its evaluation;Science of Computer Programming;2023-06
5. Partial Parsing for Structured Editors;Proceedings of the 15th ACM SIGPLAN International Conference on Software Language Engineering;2022-11-29