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 条
  • [1] Total Parser Combinators
    Danielsson, Nils Anders
    ICFP 2010: PROCEEDINGS OF THE 2010 ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING, 2010, : 285 - 296
  • [2] Total Parser Combinators
    Danielsson, Nils Anders
    ACM SIGPLAN NOTICES, 2010, 45 (09) : 285 - 296
  • [3] Graph parser combinators
    Mazanek, Steffen
    Minas, Mark
    IMPLEMENTATION AND APPLICATION OF FUNCTIONAL LANGUAGES, 2008, 5083 : 1 - 18
  • [4] Practical, General Parser Combinators
    Izmaylova, Anastasia
    Afroozeh, Ali
    van der Storm, Tijs
    PEPM'16: PROCEEDINGS OF THE 2016 ACM SIGPLAN WORKSHOP ON PARTIAL EVALUATION AND PROGRAM MANIPULATION, 2016, : 1 - 12
  • [5] Efficient parsing with parser combinators
    Kurs, Jan
    Vrany, Jan
    Ghafari, Mohammad
    Lungu, Mircea
    Nierstrasz, Oscar
    SCIENCE OF COMPUTER PROGRAMMING, 2018, 161 : 57 - 88
  • [6] A New View on Parser Combinators
    Koopman, Pieter
    Plasmeijer, Rinus
    PROCEEDINGS OF THE 31ST SYMPOSIUM ON IMPLEMENTATION AND APPLICATION OF FUNCTIONAL LANGUAGES, IFL 2019, 2019,
  • [7] Staged Selective Parser Combinators
    Willis, Jamie
    Wu, Nicolas
    Pickering, Matthew
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (ICFP):
  • [8] Parser combinators for Tigrinya and Oromo morphology
    Littell, Patrick
    McCoy, Tom
    Han, Na-Rae
    Rijhwani, Shruti
    Sheikh, Zaid
    Mortensen, David
    Mitamura, Teruko
    Levin, Lori
    PROCEEDINGS OF THE ELEVENTH INTERNATIONAL CONFERENCE ON LANGUAGE RESOURCES AND EVALUATION (LREC 2018), 2018, : 3867 - 3874
  • [9] Lightweight Multi-Language Syntax Transformation with Parser Parser Combinators
    van Tonder, Rijnard
    Le Goues, Claire
    PROCEEDINGS OF THE 40TH ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION (PLDI '19), 2019, : 363 - 378
  • [10] Staged Parser Combinators for Efficient Data Processing
    Jonnalagedda, Manohar
    Coppey, Thierry
    Stucki, Sandro
    Rompf, Tiark
    Odersky, Martin
    ACM SIGPLAN NOTICES, 2014, 49 (10) : 637 - 653