publications: - title: "Towards Zero-Overhead Disambiguation of Deep Priority Conflicts" author: - name: "Luis Eduardo de Souza Amorim" link: "https://www.linkedin.com/profile/view?id=136481548" - name: "Michael J. Steindorfer" link: "http://michael.steindorfer.name" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2018" doi: "https://doi.org/10.22152/programming-journal.org/2018/2/13" abstract: "Context Context-free grammars are widely used for language prototyping and implementation. They allow formalizing the syntax of domain-specific or general-purpose programming languages concisely and declaratively. However, the natural and concise way of writing a context-free grammar is often ambiguous. Therefore, grammar formalisms support extensions in the form of declarative disambiguation rules to specify operator precedence and associativity, solving ambiguities that are caused by the subset of the grammar that corresponds to expressions. Inquiry Implementing support for declarative disambiguation within a parser typically comes with one or more of the following limitations in practice: a lack of parsing performance, or a lack of modularity (i.e., disallowing the composition of grammar fragments of potentially different languages). The latter subject is generally addressed by scannerless generalized parsers. We aim to equip scannerless generalized parsers with novel disambiguation methods that are inherently performant, without compromising the concerns of modularity and language composition. Approach In this paper, we present a novel low-overhead implementation technique for disambiguating deep associativity and priority conflicts in scannerless generalized parsers with lightweight data-dependency. Knowledge Ambiguities with respect to operator precedence and associativity arise from combining the various operators of a language. While shallow conflicts can be resolved efficiently by one-level tree patterns, deep conflicts require more elaborate techniques, because they can occur arbitrarily nested in a tree. Current state-of-the-art approaches to solving deep priority conflicts come with a severe performance overhead. Grounding We evaluated our new approach against state-of-the-art declarative disambiguation mechanisms. By parsing a corpus of popular open-source repositories written in Java and OCaml, we found that our approach yields speedups of up to 1.73x over a grammar rewriting technique when parsing programs with deep priority conflicts—with a modest overhead of 1–2 % when parsing programs without deep conflicts. Importance A recent empirical study shows that deep priority conflicts are indeed wide-spread in real-world programs. The study shows that in a corpus of popular OCaml projects on Github, up to 17 % of the source files contain deep priority conflicts. However, there is no solution in the literature that addresses efficient disambiguation of deep priority conflicts, with support for modular and composable syntax definitions." links: doi: "https://doi.org/10.22152/programming-journal.org/2018/2/13" dblp: "http://dblp.uni-trier.de/rec/bibtex/journals/programming/AmorimSV18" "pdf": "https://arxiv.org/pdf/1803.10215v1" researchr: "https://researchr.org/publication/AmorimSV18" cites: 0 citedby: 0 journal: "Programming Journal" volume: "2" number: "3" pages: "13" kind: "article" key: "AmorimSV18" - title: "The formalization and implementation of Adaptable Parsing Expression Grammars" author: - name: "Leonardo Vieira dos Santos Reis" link: "https://researchr.org/alias/leonardo-vieira-dos-santos-reis" - name: "Roberto da Silva Bigonha" link: "https://researchr.org/alias/roberto-da-silva-bigonha" - name: "Vladimir Oliveira Di Iorio" link: "https://researchr.org/alias/vladimir-oliveira-di-iorio" - name: "Luis Eduardo de Souza Amorim" link: "https://www.linkedin.com/profile/view?id=136481548" year: "2014" doi: "http://dx.doi.org/10.1016/j.scico.2014.02.020" links: doi: "http://dx.doi.org/10.1016/j.scico.2014.02.020" dblp: "http://dblp.uni-trier.de/rec/bibtex/journals/scp/ReisBIA14" researchr: "https://researchr.org/publication/ReisBIA14" cites: 0 citedby: 0 journal: "Science of Computer Programming" volume: "96" pages: "191-210" kind: "article" key: "ReisBIA14" - title: "Deep priority conflicts in the wild: a pilot study" author: - name: "Luis Eduardo de Souza Amorim" link: "https://www.linkedin.com/profile/view?id=136481548" - name: "Michael J. Steindorfer" link: "http://michael.steindorfer.name" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2017" doi: "http://doi.acm.org/10.1145/3136014.3136020" abstract: " Context-free grammars are suitable for formalizing the syntax of programming languages concisely and declaratively. Thus, such grammars are often found in reference manuals of programming languages, and used in language workbenches for language prototyping. However, the natural and concise way of writing a context-free grammar is often ambiguous. Safe and complete declarative disambiguation of operator precedence and associativity conflicts guarantees that all ambiguities arising from combining the operators of the language are resolved. Ambiguities can occur due to shallow conflicts, which can be captured by one-level tree patterns, and deep conflicts, which require more elaborate techniques. Approaches to solve deep priority conflicts include grammar transformations, which may result in large unambiguous grammars, or may require adapted parser technologies to include data-dependency tracking at parse time. In this paper we study deep priority conflicts \"in the wild\". We investigate the efficiency of grammar transformations to solve deep priority conflicts by using a lazy parse table generation technique. On top of lazily-generated parse tables, we define metrics, aiming to answer how often deep priority conflicts occur in real-world programs and to what extent programmers explicitly disambiguate programs themselves. By applying our metrics to a small corpus of popular open-source repositories we found that in OCaml, up to 17% of the source files contain deep priority conflicts. " links: doi: "http://doi.acm.org/10.1145/3136014.3136020" dblp: "http://dblp.uni-trier.de/rec/bibtex/conf/sle/AmorimSV17" researchr: "https://researchr.org/publication/AmorimSV17" cites: 0 citedby: 0 pages: "55-66" booktitle: "Proceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2017, Vancouver, BC, Canada, October 23-24, 2017" editor: - name: "Benoît Combemale" link: "https://researchr.org/alias/beno%C3%AEt-combemale" - name: "Marjan Mernik" link: "https://researchr.org/alias/marjan-mernik" - name: "Bernhard Rumpe" link: "http://www.se-rwth.de/~rumpe/" publisher: "ACM" isbn: "978-1-4503-5525-4" kind: "inproceedings" key: "AmorimSV17" - title: "Bootstrapping, Default Formatting, and Skeleton Editing in the Spoofax Language Workbench" author: - name: "Gabriël Konat" link: "http://nl.linkedin.com/in/gabrielkonat" - name: "Luis Eduardo de Souza Amorim" link: "https://www.linkedin.com/profile/view?id=136481548" - name: "Sebastian Erdweg" link: "http://www.informatik.uni-marburg.de/~seba/" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2016" abstract: "Language workbenches are tools that help language designers to design and implement (domain-specific) programming languages, aiming to produce a full featured programming environment from a high-level language description. A recent paper, resulting from a series of language workbench challenge workshops, describes a collection of benchmark problems for language workbench research [5]. In this paper, we describe solutions to two of these benchmark problems in the Spoofax Language Workbench [6], i.e. default formatting in Section 3 and skeleton editing in Section 4. In addition, we introduce a new benchmark problem — bootstrapping of meta-languages in a workbench — and describe the support for bootstrapping we developed for Spoofax in Section 2." researchr: "https://researchr.org/publication/KonatAEV16" cites: 0 citedby: 0 howpublished: "Language Workbench Challenge (LWC@SLE)" kind: "misc" key: "KonatAEV16" - title: "Declarative Syntax Definition for Modern Language Workbenches" author: - name: "Luis Eduardo de Souza Amorim" link: "https://www.linkedin.com/profile/view?id=136481548" year: "2019" doi: "https://www.base-search.net/Record/261b6c9463c1d4fe309e3c6104cd4d80fbc9d3cc8fbc66006f34130f481b506f" note: "base-search.net (fttudelft:oai:tudelft.nl:uuid:43d7992a-7077-47ba-b38f-113f5011d07f)" links: doi: "https://www.base-search.net/Record/261b6c9463c1d4fe309e3c6104cd4d80fbc9d3cc8fbc66006f34130f481b506f" dblp: "http://dblp.uni-trier.de/rec/bibtex/phd/basesearch/Amorim19" researchr: "https://researchr.org/publication/Amorim2019" cites: 0 citedby: 0 school: "Delft University of Technology, Netherlands" advisor: - name: "Eelco Visser" link: "http://eelcovisser.org" - name: "Sebastian Erdweg" link: "http://www.informatik.uni-marburg.de/~seba/" kind: "phdthesis" key: "Amorim2019" - title: "Multi-purpose Syntax Definition with SDF3" author: - name: "Luis Eduardo de Souza Amorim" link: "https://www.linkedin.com/profile/view?id=136481548" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2020" doi: "https://doi.org/10.1007/978-3-030-58768-0_1" abstract: "SDF3 is a syntax definition formalism that extends plain context-free grammars with features such as constructor declarations, declarative disambiguation rules, character-level grammars, permissive syntax, layout constraints, formatting templates, placeholder syntax, and modular composition. These features support the multi-purpose interpretation of syntax definitions, including derivation of type schemas for abstract syntax tree representations, scannerless generalized parsing of the full class of context-free grammars, error recovery, layout-sensitive parsing, parenthesization and formatting, and syntactic completion. This paper gives a high level overview of SDF3 by means of examples and provides a guide to the literature for further details." links: doi: "https://doi.org/10.1007/978-3-030-58768-0_1" dblp: "http://dblp.uni-trier.de/rec/bibtex/conf/sefm/AmorimV20" researchr: "https://researchr.org/publication/AmorimV20" cites: 0 citedby: 0 pages: "1-23" booktitle: "Software Engineering and Formal Methods - 18th International Conference, SEFM 2020, Amsterdam, The Netherlands, September 14-18, 2020, Proceedings" editor: - name: "Frank S. de Boer" link: "https://researchr.org/alias/frank-s.-de-boer" - name: "Antonio Cerone" link: "https://researchr.org/alias/antonio-cerone" volume: "12310" series: "Lecture Notes in Computer Science" publisher: "Springer" isbn: "978-3-030-58768-0" kind: "inproceedings" key: "AmorimV20" - title: "Declarative specification of indentation rules: a tooling perspective on parsing and pretty-printing layout-sensitive languages" author: - name: "Luis Eduardo de Souza Amorim" link: "https://www.linkedin.com/profile/view?id=136481548" - name: "Michael J. Steindorfer" link: "http://michael.steindorfer.name" - name: "Sebastian Erdweg" link: "http://www.informatik.uni-marburg.de/~seba/" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2018" doi: "https://doi.org/10.1145/3276604.3276607" abstract: " In layout-sensitive languages, the indentation of an expression or statement can influence how a program is parsed. While some of these languages (e.g., Haskell and Python) have been widely adopted, there is little support for software language engineers in building tools for layout-sensitive languages. As a result, parsers, pretty-printers, program analyses, and refactoring tools often need to be handwritten, which decreases the maintainability and extensibility of these tools. Even state-of-the-art language workbenches have little support for layout-sensitive languages, restricting the development and prototyping of such languages. In this paper, we introduce a novel approach to declarative specification of layout-sensitive languages using layout declarations. Layout declarations are high-level specifications of indentation rules that abstract from low-level technicalities. We show how to derive an efficient layout-sensitive generalized parser and a corresponding pretty-printer automatically from a language specification with layout declarations. We validate our approach in a case-study using a syntax definition for the Haskell programming language, investigating the performance of the generated parser and the correctness of the generated pretty-printer against 22191 Haskell files. " links: doi: "https://doi.org/10.1145/3276604.3276607" dblp: "http://dblp.uni-trier.de/rec/bibtex/conf/sle/AmorimSEV18" researchr: "https://researchr.org/publication/AmorimSEV18" cites: 0 citedby: 0 pages: "3-15" booktitle: "Proceedings of the 11th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2018, Boston, MA, USA, November 05-06, 2018" editor: - name: "David Pearce 0005" link: "https://researchr.org/alias/david-pearce-0005" - name: "Tanja Mayerhofer" link: "https://researchr.org/alias/tanja-mayerhofer" - name: "Friedrich Steimann" link: "http://www.fernuni-hagen.de/ps/team/friedrich.steimann.shtml" publisher: "ACM" isbn: "978-1-4503-6029-6" kind: "inproceedings" key: "AmorimSEV18" - title: "Principled syntactic code completion using placeholders" author: - name: "Luis Eduardo de Souza Amorim" link: "https://www.linkedin.com/profile/view?id=136481548" - name: "Sebastian Erdweg" link: "http://www.informatik.uni-marburg.de/~seba/" - name: "Guido Wachsmuth" link: "https://www.linkedin.com/in/guidowachsmuth/" - name: "Eelco Visser" link: "http://eelcovisser.org" year: "2016" doi: "http://dx.doi.org/10.1145/2997364.2997374" abstract: "Principled syntactic code completion enables developers to change source code by inserting code templates, thus increasing developer efficiency and supporting language exploration. However, existing code completion systems are ad-hoc and neither complete nor sound. They are not complete and only provide few code templates for selected programming languages. They also are not sound and propose code templates that yield invalid programs when inserted.This paper presents a generic framework that automatically derives complete and sound syntactic code completion from the syntax definition of arbitrary languages. A key insight of our work is to provide an explicit syntactic representation for incomplete programs using placeholders. This enables us to address the following challenges for code completion separately: (i) completing incomplete programs by replacing placeholders with code templates, (ii) injecting placeholders into complete programs to make them incomplete, and (iii) introducing lexemes and placeholders into incorrect programs through error-recovery parsing to make them correct so we can apply one of the previous strategies. We formalize our framework and provide an implementation in the Spoofax Language Workbench. " links: doi: "http://dx.doi.org/10.1145/2997364.2997374" dblp: "http://dblp.uni-trier.de/rec/bibtex/conf/sle/AmorimEWV16" researchr: "https://researchr.org/publication/AmorimEWV16" cites: 0 citedby: 0 pages: "163-175" booktitle: "Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering, Amsterdam, The Netherlands, October 31 - November 1, 2016" editor: - name: "Tijs van der Storm" link: "https://researchr.org/alias/tijs-van-der-storm" - name: "Emilie Balland" link: "https://researchr.org/alias/emilie-balland" - name: "Dániel Varró" link: "https://researchr.org/alias/d%C3%A1niel-varr%C3%B3" publisher: "ACM" isbn: "978-1-4503-4447-0" kind: "inproceedings" key: "AmorimEWV16" - title: "Multiagent Systems Modeling Using GPUs - A Case Study of the Human Immune System" author: - name: "Oberlan Christo Romao" link: "https://researchr.org/alias/oberlan-christo-romao" - name: "Luis Eduardo de Souza Amorim" link: "https://www.linkedin.com/profile/view?id=136481548" - name: "Ricardo dos Santos Ferreira" link: "https://researchr.org/alias/ricardo-dos-santos-ferreira" - name: "Maurilio De Araujo Possi" link: "https://researchr.org/alias/maurilio-de-araujo-possi" - name: "Alcione de Paiva Oliveira" link: "https://researchr.org/alias/alcione-de-paiva-oliveira" year: "2012" doi: "http://doi.ieeecomputersociety.org/10.1109/WSCAD-SSC.2012.31" links: doi: "http://doi.ieeecomputersociety.org/10.1109/WSCAD-SSC.2012.31" dblp: "http://dblp.uni-trier.de/rec/bibtex/conf/wscad/RomaoAFPO12" researchr: "https://researchr.org/publication/RomaoAFPO12" cites: 0 citedby: 0 pages: "234-241" booktitle: "13th Symposium on Computer Systems, WSCAD-SSC 2012, Petropolis, Brazil, October 17-19, 2012" publisher: "IEEE Computer Society" isbn: "978-1-4673-4468-5" kind: "inproceedings" key: "RomaoAFPO12" - title: "Adaptable Parsing Expression Grammars" author: - name: "Leonardo Vieira dos Santos Reis" link: "https://researchr.org/alias/leonardo-vieira-dos-santos-reis" - name: "Roberto da Silva Bigonha" link: "https://researchr.org/alias/roberto-da-silva-bigonha" - name: "Vladimir Oliveira Di Iorio" link: "https://researchr.org/alias/vladimir-oliveira-di-iorio" - name: "Luis Eduardo de Souza Amorim" link: "https://www.linkedin.com/profile/view?id=136481548" year: "2012" doi: "http://dx.doi.org/10.1007/978-3-642-33182-4_7" links: doi: "http://dx.doi.org/10.1007/978-3-642-33182-4_7" dblp: "http://dblp.uni-trier.de/rec/bibtex/conf/sblp/ReisBIA12" researchr: "https://researchr.org/publication/ReisBIA12" cites: 0 citedby: 0 pages: "72-86" booktitle: "Programming Languages - 16th Brazilian Symposium, SBLP 2012, Natal, Brazil, September 23-28, 2012. Proceedings" editor: - name: "Francisco Heron de Carvalho Junior" link: "https://researchr.org/alias/francisco-heron-de-carvalho-junior" - name: "Luís Soares Barbosa" link: "https://researchr.org/alias/lu%C3%ADs-soares-barbosa" volume: "7554" series: "Lecture Notes in Computer Science" publisher: "Springer" isbn: "978-3-642-33181-7" kind: "inproceedings" key: "ReisBIA12"