Optimizing Parser Combinators

被引:1
|
作者
Kurs, Jan [1 ]
Vrany, Jan [2 ]
Ghafari, Mohammad [1 ]
Lungu, Mircea [3 ]
Nierstrasz, Oscar [1 ]
机构
[1] Univ Bern, Software Composit Grp, CH-3012 Bern, Switzerland
[2] Czech Tech Univ, Software Engn Grp, Prague, Czech Republic
[3] Univ Groningen, Software Engn & Architecture Grp, NL-9700 AB Groningen, Netherlands
关键词
D O I
10.1145/2991041.2991042
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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 combinator-specific 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.
引用
收藏
页数:13
相关论文
共 50 条
  • [21] Nom, a byte oriented, streaming, zero copy, parser combinators library in Rust
    Couprie, Geoffoy
    2015 IEEE SECURITY AND PRIVACY WORKSHOPS (SPW), 2015, : 142 - 148
  • [22] OPG - AN OPTIMIZING PARSER GENERATOR
    ROBERTS, GH
    SIGPLAN NOTICES, 1988, 23 (06): : 80 - 90
  • [23] Hard combinators
    Bechet, Denis
    Lippi, Sylvain
    ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2008, 203 (01) : 31 - 48
  • [24] LINEARIZING COMBINATORS
    Cockett, Robin
    Lemay, Jean-Simon Pacaud
    THEORY AND APPLICATIONS OF CATEGORIES, 2022, 38
  • [25] Storage Combinators
    Weiher, Marcel
    Hirschfeld, Robert
    PROCEEDINGS OF THE 2019 ACM SIGPLAN INTERNATIONAL SYMPOSIUM ON NEW IDEAS, NEW PARADIGMS, AND REFLECTIONS ON PROGRAMMING AND SOFTWARE (ONWARD!' 19), 2019, : 111 - 127
  • [26] SPACES WITH COMBINATORS
    GEORGIEVA, N
    ARCHIVE FOR MATHEMATICAL LOGIC, 1993, 32 (05) : 321 - 339
  • [27] CATEGORICAL COMBINATORS
    CURIEN, PL
    INFORMATION AND CONTROL, 1986, 69 (1-3): : 188 - 254
  • [28] ALGEBRAS AND COMBINATORS
    ENGELER, E
    ALGEBRA UNIVERSALIS, 1981, 13 (03) : 389 - 392
  • [29] Evolving combinators
    Fuchs, M
    AUTOMATED DEDUCTION - CADE-14, 1997, 1249 : 416 - 430
  • [30] Pickler combinators
    Kennedy, AJ
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2004, 14 : 727 - 739