Affiliation:
1. Delft University of Technology, Delft, Netherlands
2. Lund University, Lund, Sweden
Abstract
Integrated development environments (IDEs) increase programmer productivity, providing rapid, interactive feedback based on the syntax and semantics of a language. A heavy burden lies on developers of new languages to provide adequate IDE support. Code generation techniques provide a viable, efficient approach to semi-automatically produce IDE plugins. Key components for the realization of plugins are the language's grammar and parser. For embedded languages and language extensions, constituent IDE plugin modules and their grammars can be combined. Unlike conventional parsing algorithms, scannerless generalized-LR parsing supports the full set of context-free grammars, which is closed under composition, and hence can parse language embeddings and extensions composed from separate grammar modules. To apply this algorithm in an interactive environment, this paper introduces a novel error recovery mechanism, which allows it to be used with files with syntax errors -- common in interactive editing. Error recovery is vital for providing rapid feedback in case of syntax errors, as most IDE services depend on the parser from syntax highlighting to semantic analysis and cross-referencing. We base our approach on the principles of island grammars, and derive permissive grammars with error recovery productions from normal SDF grammars. To cope with the added complexity of these grammars, we adapt the parser to support backtracking. We evaluate the recovery quality and performance of our approach using a set of composed languages, based on Java and Stratego.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
11 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Live Pattern Matching with Typed Holes;Proceedings of the ACM on Programming Languages;2023-04-06
2. Multi-purpose Syntax Definition with SDF3;Software Engineering and Formal Methods;2020
3. Live functional programming with typed holes;Proceedings of the ACM on Programming Languages;2019-01-02
4. Scalable framework for parsing: from Fortress to JavaScript;Software: Practice and Experience;2015-12-02
5. An Evaluation of Domain-Specific Language Technologies for Code Generation;2014 14th International Conference on Computational Science and Its Applications;2014-06