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 条
  • [41] Termination Combinators Forever
    Bolingbroke, Maximilian
    Jones, Simon Peyton
    Vytiniotis, Dimitrios
    HASKELL 11: PROCEEDINGS OF THE 2011 ACM SIGPLAN HASKELL SYMPOSIUM, 2011, : 23 - 34
  • [42] Distributed Protocol Combinators
    Andersen, Kristoffer Just Arndal
    Sergey, Ilya
    PRACTICAL ASPECTS OF DECLARATIVE LANGUAGES (PADL 2019), 2019, 11372 : 169 - 186
  • [43] FUNCTIONAL PROGRAMMING WITH COMBINATORS
    GIBERT, J
    JOURNAL OF SYMBOLIC COMPUTATION, 1987, 4 (03) : 269 - 293
  • [44] On principal types of combinators
    Broda, S
    Damas, L
    THEORETICAL COMPUTER SCIENCE, 2000, 247 (1-2) : 277 - 290
  • [45] On the word problem for combinators
    Statman, R
    REWRITING TECHNIQUES AND APPLICATIONS, PROCEEDINGS, 2000, 1833 : 203 - 213
  • [46] Termination Combinators Forever
    Bolingbroke, Maximilian
    Jones, Simon Peyton
    Vytiniotis, Dimitrios
    ACM SIGPLAN NOTICES, 2011, 46 (12) : 23 - 34
  • [47] Fair enumeration combinators
    New, Max S.
    Fetscher, Burke
    Findler, Robert Bruce
    Mccarthy, Jay
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2017, 27
  • [48] REPRESENTATION OF MARKOV ALGORITHMS BY COMBINATORS
    CURRY, HB
    NOTICES OF THE AMERICAN MATHEMATICAL SOCIETY, 1973, 20 (06): : A590 - A590
  • [49] CATEGORICAL MULTI-COMBINATORS
    LINS, RD
    LECTURE NOTES IN COMPUTER SCIENCE, 1987, 274 : 60 - 79
  • [50] Lambda terms definable as combinators
    Bunder, MW
    THEORETICAL COMPUTER SCIENCE, 1996, 169 (01) : 3 - 21