Proceedings Article10.1145/2991041.2991042
Optimizing Parser Combinators
Jan Kurs,Jan Vraný,Mohammad Ghafari,Mircea Lungu,Oscar Nierstrasz +4 more
- 23 Aug 2016
- pp 1
5
TL;DR: This work presents a more traditional approach to optimization --- a compiler --- applied to the domain of parser combinators, and presents an equivalent high-performance top-down parser generated by this compiler.
read more
Abstract: Parser combinators are a popular approach to parsing. Parser combinators follow the structure of an underlying grammar, are modular, well-structured, easy to maintain, and can recognize a large variety of languages including context-sensitive ones. However, their universality and flexibility introduces a noticeable performance overhead. Time-wise, parser combinators cannot compete with parsers generated by well-performing parser generators or optimized handwritten code. Techniques exist to achieve a linear asymptotic performance of parser combinators, yet there is still a significant constant multiplier. This can be further lowered using meta-programming techniques. In this work we present a more traditional approach to optimization --- a compiler --- applied to the domain of parser combinators. A parser combinator compiler (pc-compiler) analyzes a parser combinator, applies parser combinatorspecific optimizations and, generates an equivalent high-performance top-down parser. Such a compiler preserves the advantages of parser combinators while complementing them with better performance.
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
Parsing for agile modeling
Oscar Nierstrasz,Jan Kurs +1 more
TL;DR: This paper proposes an approach to "agile modeling" that exploits island grammars to extract initial coarse-grained models, parser combinators to enable gradual refinement of model importers, and various heuristics to recognize language structure, keywords and other language artifacts.
11
Efficient parsing with parser combinators
TL;DR: This work optimize the performance of parsing combinators with specializations of parsing strategies, and achieves performance comparable to that of hand-written or optimized parsers while preserving the advantages of parsers combinators.
4
Syntax Error Search Using Parser Combinators
Mikhail Kuznetsov,Georgii Firsov +1 more
- 26 Jan 2021
TL;DR: In this paper, the authors compared a parser combinator with a parser generator and found that the parser generator takes less time on average to find a syntax error in the source code.
2
An Innovative Approach to Syntax-Free Interpretation in Functional Programming Languages
Omar Alaqeeli
TL;DR: Researchers propose a syntax-free interpretation method for functional programming languages, leveraging graph-based representations and type inference to enable efficient and flexible evaluation of programs, improving expressiveness and modularity in language design.
Parsing for agile modeling
Jan Kurs
TL;DR: This thesis introduces a novel approach to specify and build parsers based on a context-sensitive extension of parsing expression grammars that allows a grammar engineer to specify complex language restrictions.
References
•Book
The Theory of Parsing, Translation, and Compiling
Alfred V. Aho,Jeffrey D. Ullman +1 more
- 01 Jan 1972
TL;DR: It is the hope that the algorithms and concepts presented in this book will survive the next generation of computers and programming languages, and that at least some of them will be applicable to fields other than compiler writing.
2K
ANTLR: a predicated- LL(k) parser generator
Terence Parr,Russell W. Quong +1 more
TL;DR: ANTLR is introduced, a public‐domain parser generator that combines the flexibility of hand‐coded parsing with the convenience of a parser generator, which is a component of PCCTS.
753
Monads for Functional Programming
Philip Wadler
- 24 May 1995
TL;DR: Three case studies are looked at in detail: how monads ease the modication of a simple evaluator;How monads act as the basis of a datatype of arrays subject to in-place update; and how monad can be used to build parsers.
•Book
Parsing Techniques: A Practical Guide
Dick Grune,Ceriel J. H. Jacobs +1 more
- 29 Oct 2007
TL;DR: This second edition of Grune and Jacobs brilliant work presents new developments and discoveries that have been made in the field of parsing, also referred to as syntax analysis, and is used extensively in linguistics.
398
Monads for functional programming.
Philip Wadler
- 01 Jan 1992
TL;DR: The use of monads to structure functional programs is described and three case studies are looked at in detail how monads ease the modi cation of a simple evaluator,How monads act as the basis of a datatype of arrays subject to in place update and how monad can be used to build parsers.
281
Related Papers (5)
Doaitse Swierstra,Atze Dijkstra +1 more
- 01 Jun 2001
Jamie Willis,Nicolas Wu +1 more
- 18 Aug 2021
Eric Beguet,Manohar Jonnalagedda +1 more
- 28 Jul 2014