Practical, general parser combinators

Practical, general parser combinators
复制标题

实用的通用解析器组合器

DOI:
--
复制
发表时间:
2016
期刊:
ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation
影响因子:
--
通讯作者:
T. Storm
T. Storm
中科院分区:
--
文献类型:
--
作者:
Anastasia Izmaylova;A. Afroozeh;T. Storm

文献摘要

参考文献

被引文献

相似文献

Parser combinators are a popular approach to parsing where context-free grammars are represented as executable code. However, conventional parser combinators do not support left recursion, and can have worst-case exponential runtime. These limitations hinder the expressivity and performance predictability of parser combinators when constructing parsers for programming languages. In this paper we present general parser combinators that support all context-free grammars and construct a parse forest in cubic time and space in the worst case, while behaving nearly linearly on grammars of real programming languages. Our general parser combinators are based on earlier work on memoized Continuation-Passing Style (CPS) recognizers. First, we extend this work to achieve recognition in cubic time. Second, we extend the resulting cubic CPS recognizers to parsers that construct a binarized Shared Packed Parse Forest (SPPF). Our general parser combinators bring the best of both worlds: the flexibility and extensibility of conventional parser combinators and the expressivity and performance guarantees of general parsing algorithms. We used the approach presented in this paper as the basis for Meerkat, a general parser combinator library for Scala.
DOI: 10.1016/j.scico.2012.03.005
发表时间: 2013-10
期刊: Sci. Comput. Program.
影响因子: --
作者:
E. Scott;A. Johnstone
通讯作者: E. Scott;A. Johnstone