pith. sign in

arxiv: 1902.06591 · v1 · pith:Y5WI4KGQnew · submitted 2019-02-18 · 💻 cs.FL

Relational parsing: a clean, fast parsing strategy for all context-free languages

classification 💻 cs.FL
keywords parsinglanguagesalgorithmcleancontext-freeoperationsstructuresalgorithms
0
0 comments X
read the original abstract

We present a novel parsing algorithm for all context-free languages, based on computing the relation between configurations and reaching transitions in a recursive transition network. Parsing complexity w.r.t. input length matches the state of the art: it is worst-case cubic, quadratic for unambiguous grammars, and linear for LR-regular ones. What distinguishes our algorithm is its clean mathematical formulation: parsing is expressed as a composition of simple operations on languages and relations, and can therefore be implemented using only immutable data structures. With a proper choice of these structures, a vast majority of operations performed during parsing typical programming languages can be memoized, which allows our proof-of-concept implementation to outperform common generalized parsing algorithms, in some cases by orders of magnitude.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.