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 条
  • [31] Combinators as presheaves
    Gangle, Rocco
    Tohme, Fernando
    Caterina, Gianluca
    LOGIC JOURNAL OF THE IGPL, 2024,
  • [32] Search combinators
    Tom Schrijvers
    Guido Tack
    Pieter Wuille
    Horst Samulowitz
    Peter J. Stuckey
    Constraints, 2013, 18 : 269 - 305
  • [33] Constraint combinators
    不详
    PROGRAMMING CONSTRAINT SERVICES, 2002, 2302 : 105 - 116
  • [34] Search combinators
    Schrijvers, Tom
    Tack, Guido
    Wuille, Pieter
    Samulowitz, Horst
    Stuckey, Peter J.
    CONSTRAINTS, 2013, 18 (02) : 269 - 305
  • [35] STRICT COMBINATORS
    MEIRA, SRD
    INFORMATION PROCESSING LETTERS, 1987, 24 (04) : 255 - 258
  • [36] Spaces for combinators
    不详
    PROGRAMMING CONSTRAINT SERVICES, 2002, 2302 : 93 - 104
  • [37] Interaction combinators
    Lafont, Y
    INFORMATION AND COMPUTATION, 1997, 137 (01) : 69 - 101
  • [38] Diagram Combinators in MMT
    Rabe, Florian
    Sharoda, Yasmine
    INTELLIGENT COMPUTER MATHEMATICS, CICM 2019, 2019, 11617 : 211 - 226
  • [39] ITERATIVE SEQUENCES OF COMBINATORS
    ROBINET, B
    COMPTES RENDUS DE L ACADEMIE DES SCIENCES SERIE I-MATHEMATIQUE, 1982, 295 (01): : 29 - 30
  • [40] DIRECTOR STRINGS AS COMBINATORS
    KENNAWAY, R
    SLEEP, R
    ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1988, 10 (04): : 602 - 626