publications: - title: "Providing rapid feedback in generated modular language environments: adding error recovery to scannerless generalized-LR parsing" author: - name: "Lennart C. L. Kats" link: "http://www.lclnet.nl/" - name: "Maartje de Jonge" link: "https://researchr.org/profile/maartjedejonge/publications" - name: "Emma Nilsson-Nyman" link: "http://www.cs.lth.se/home/Emma.Nilsson_Nyman/" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2009" doi: "http://doi.acm.org/10.1145/1640089.1640122" 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. " links: doi: "http://doi.acm.org/10.1145/1640089.1640122" successor: "https://researchr.org/publication/JongeKVS12" "technical report (pdf)": "http://www.lclnet.nl/publications/error-recovery.pdf" tags: - "parsing algorithm" - "semantics" - "rule-based" - "Java" - "SDF" - "composition" - "analysis" - "principles" - "C++" - "code generation" - "context-aware" - "Meta-Environment" - "parsing" - "scannerless parsing" - "systematic-approach" - "island grammars" - "ASF+SDF" - "grammar" - "Stratego" researchr: "https://researchr.org/publication/KatsJNV09" cites: 0 citedby: 1 pages: "445-464" booktitle: "Proceedings of the 24th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2009, October 25-29, 2009, Orlando, Florida, USA" editor: - name: "Shail Arora" link: "https://researchr.org/alias/shail-arora" - name: "Gary T. Leavens" link: "https://researchr.org/alias/gary-t.-leavens" publisher: "ACM" isbn: "978-1-60558-766-0" kind: "inproceedings" key: "KatsJNV09" - title: "Natural and Flexible Error Recovery for Generated Parsers" author: - name: "Maartje de Jonge" link: "https://researchr.org/profile/maartjedejonge/publications" - name: "Emma Nilsson-Nyman" link: "http://www.cs.lth.se/home/Emma.Nilsson_Nyman/" - name: "Lennart C. L. Kats" link: "http://www.lclnet.nl/" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2009" doi: "http://dx.doi.org/10.1007/978-3-642-12107-4_16" abstract: "Parser generators are an indispensable tool for rapid language development. However, they often fall short of the finesse of a hand-crafted parser, built with the language semantics in mind. One area where generated parsers have provided unsatisfactory results is that of error recovery. Good error recovery is both natural, giving recovery suggestions in line with the intention of the programmer; and flexible, allowing it to be adapted according to language insights and language changes. This paper describes a novel approach to error recovery, taking into account not only the context-free grammar, but also indentation usage. We base our approach on an extension of the SGLR parser that supports fine-grained error recovery rules and can be used to parse complex, composed languages. We take a divide-and-conquer approach to error recovery: using indentation, erroneous regions of code are identified. These regions constrain the search space for applying recovery rules, improving performance and ensuring recovery suggestions local to the error. As a last resort, erroneous regions can be discarded. Our approach also integrates bridge parsing to provide more accurate suggestions for indentation-sensitive language constructs such as scopes. We evaluate our approach by comparison with the JDT Java parser used in Eclipse. " links: doi: "http://dx.doi.org/10.1007/978-3-642-12107-4_16" successor: "https://researchr.org/publication/JongeKVS12" tags: - "semantics" - "rule-based" - "Java" - "Eclipse" - "rules" - "C++" - "search suggestions" - "context-aware" - "search" - "parsing" - "error recovery" - "systematic-approach" - "SGLR" - "grammar" researchr: "https://researchr.org/publication/JongeNKV09" cites: 0 citedby: 0 pages: "204-223" booktitle: "Software Language Engineering, Second International Conference, SLE 2009, Denver, CO, USA, October 5-6, 2009, Revised Selected Papers" editor: - name: "Mark G. J. van den Brand" link: "http://www.win.tue.nl/~mvdbrand/" - name: "Dragan Gasevic" link: "http://www.sfu.ca/~dgasevic/" - name: "Jeffrey G. Gray" link: "http://www.gray-area.org/" volume: "5969" series: "Lecture Notes in Computer Science" publisher: "Springer" isbn: "978-3-642-12106-7" kind: "inproceedings" key: "JongeNKV09" - title: "Mixing source and bytecode: a case for compilation by normalization" author: - name: "Lennart C. L. Kats" link: "http://www.lclnet.nl/" - name: "Martin Bravenboer" link: "http://martin.bravenboer.name/" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2008" doi: "http://doi.acm.org/10.1145/1449764.1449772" abstract: "Language extensions increase programmer productivity by providing concise, often domain-specific syntax, and support for static verification of correctness, security, and style constraints. Language extensions can often be realized through translation to the base language, supported by preprocessors and extensible compilers. However, various kinds of extensions require further adaptation of a base compiler's internal stages and components, for example to support separate compilation or to make use of low-level primitives of the platform (e.g., jump instructions or unbalanced synchronization). To allow for a more loosely coupled approach, we propose an open compiler model based on normalization steps from a high-level language to a subset of it, the core language. We developed such a compiler for a mixed Java and (core) bytecode language, and evaluate its effectiveness for composition mechanisms such as traits, as well as statement-level and expression-level language extensions. " links: doi: "http://doi.acm.org/10.1145/1449764.1449772" "technical report (pdf)": "http://www.lclnet.nl/publications/TUD-SERG-2008-030.pdf" "project home page": "http://www.strategoxt.org/Stratego/TheDryadCompiler" tags: - "compilation by normalization" - "rule-based" - "Java" - "synchronization" - "translation" - "meta-model" - "modeling language" - "Stratego/XT" - "language modeling" - "composition" - "constraints" - "source-to-source" - "C++" - "Dryad" - "security" - "compiler" - "Meta-Environment" - "extensible language" - "systematic-approach" - "open-source" - "Stratego" - "JavaFront" - "domain-specific language" researchr: "https://researchr.org/publication/KatsBV08" cites: 44 citedby: 3 pages: "91-108" booktitle: "Proceedings of the 23rd Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2008, October 19-23, 2008, Nashville, TN, USA" editor: - name: "Gail E. Harris" link: "https://researchr.org/alias/gail-e.-harris" publisher: "ACM" isbn: "978-1-60558-215-3" kind: "inproceedings" key: "KatsBV08" - title: "The Spoofax language workbench: rules for declarative specification of languages and IDEs" author: - name: "Lennart C. L. Kats" link: "http://www.lclnet.nl/" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2010" doi: "https://doi.org/10.1145/1869459.1869497" abstract: "Spoofax is a language workbench for efficient, agile development of textual domain-specific languages with state-of-the-art IDE support. Spoofax integrates language processing techniques for parser generation, meta-programming, and IDE development into a single environment. It uses concise, declarative specifications for languages and IDE services. In this paper we describe the architecture of Spoofax and introduce idioms for high-level specifications of language semantics using rewrite rules, showing how analyses can be reused for transformations, code generation, and editor services such as error marking, reference resolving, and content completion. The implementation of these services is supported by language-parametric editor service classes that can be dynamically loaded by the Eclipse IDE, allowing new languages to be developed and used side-by-side in the same Eclipse environment." links: doi: "https://doi.org/10.1145/1869459.1869497" dblp: "http://dblp.uni-trier.de/rec/bibtex/conf/oopsla/KatsV10" "acm dl": "https://doi.org/10.1145/1932682.1869497" tags: - "programming languages" - "model-to-model transformation" - "workbench" - "semantics" - "rule-based" - "Eclipse" - "meta programming" - "model editor" - "graph transformation" - "meta-model" - "transformation language" - "architecture" - "reuse" - "model-driven development" - "graph-rewriting" - "rules" - "C++" - "code completion" - "code generation" - "model transformation" - "programming" - "language workbench" - "Spoofax" - "Meta-Environment" - "rewriting" - "parsing" - "meta-objects" - "transformation" - "program transformation" - "domain-specific language" researchr: "https://researchr.org/publication/KatsV10" cites: 0 citedby: 2 pages: "444-463" booktitle: "Proceedings of the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2010, October 17-21, 2010, Reno/Tahoe, Nevada, USA" editor: - name: "William R. Cook" link: "http://www.cs.utexas.edu/~wcook/" - name: "Siobhán Clarke" link: "https://www.cs.tcd.ie/Siobhan.Clarke/" - name: "Martin C. Rinard" link: "https://researchr.org/alias/martin-c.-rinard" address: "Reno/Tahoe, Nevada" publisher: "ACM" isbn: "978-1-4503-0203-6" kind: "inproceedings" key: "KatsV10" - title: "Decorated Attribute Grammars: Attribute Evaluation Meets Strategic Programming" author: - name: "Lennart C. L. Kats" link: "http://www.lclnet.nl/" - name: "Anthony M. Sloane" link: "http://www.comp.mq.edu.au/~asloane" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2009" doi: "http://dx.doi.org/10.1007/978-3-642-00722-4_11" abstract: "Attribute grammars are a powerful specification formalism for tree-based computation, particularly for software language processing. Various extensions have been proposed to abstract over common patterns in attribute grammar specifications. These include various forms of copy rules to support non-local dependencies, collection attributes, and expressing dependencies that are evaluated to a fixed point. Rather than implementing extensions natively in an attribute evaluator, we propose attribute decorators that describe an abstract evaluation mechanism for attributes, making it possible to provide such extensions as part of a library of decorators. Inspired by strategic programming, decorators are specified using generic traversal operators. To demonstrate their effectiveness, we describe how to employ decorators in name, type, and flow analysis. " links: doi: "http://dx.doi.org/10.1007/978-3-642-00722-4_11" "technical report (pdf)": "http://www.lclnet.nl/publications/TUD-SERG-2008-038a.pdf" "project home page": "http://strategoxt.org/Stratego/Aster" tags: - "programming languages" - "rule-based" - "attribute grammars" - "program analysis" - "etaps" - "data-flow language" - "pattern language" - "generic programming" - "Stratego/XT" - "traversal" - "analysis" - "data-flow programming" - "data-flow" - "graph-rewriting" - "rules" - "C++" - "strategic programming" - "programming" - "rewriting" - "data-flow analysis" - "Aster" - "grammar" - "Stratego" researchr: "https://researchr.org/publication/KatsSV09" cites: 36 citedby: 1 pages: "142-157" booktitle: "Compiler Construction, 18th International Conference, CC 2009, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2009, York, UK, March 22-29, 2009. Proceedings" editor: - name: "Oege de Moor" link: "http://progtools.comlab.ox.ac.uk/members/oege" - name: "Michael I. Schwartzbach" link: "http://www.brics.dk/~mis/" volume: "5501" series: "Lecture Notes in Computer Science" publisher: "Springer" isbn: "978-3-642-00721-7" kind: "inproceedings" key: "KatsSV09"