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

**Authors:** Grzegorz Herman

arXiv: 1902.06591 · 2019-02-19

## TL;DR

This paper introduces a new, mathematically elegant parsing algorithm for all context-free languages that is efficient, easy to implement with immutable data structures, and can outperform existing algorithms in practical scenarios.

## Contribution

The paper presents a novel, relation-based parsing algorithm with a clean mathematical formulation applicable to all context-free languages, improving efficiency and implementation simplicity.

## Key findings

- Parsing complexity matches state-of-the-art: cubic, quadratic, or linear.
- Implementation with immutable data structures enables effective memoization.
- Proof-of-concept outperforms common algorithms, sometimes significantly.

## 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.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1902.06591/full.md

## Figures

4 figures with captions in the complete paper: https://tomesphere.com/paper/1902.06591/full.md

## References

25 references — full list in the complete paper: https://tomesphere.com/paper/1902.06591/full.md

---
Source: https://tomesphere.com/paper/1902.06591