English

Linear Parsing Expression Grammars

Formal Languages and Automata Theory 2017-09-12 v2

Abstract

PEGs were formalized by Ford in 2004, and have several pragmatic operators (such as ordered choice and unlimited lookahead) for better expressing modern programming language syntax. Since these operators are not explicitly defined in the classic formal language theory, it is significant and still challenging to argue PEGs' expressiveness in the context of formal language theory.Since PEGs are relatively new, there are several unsolved problems.One of the problems is revealing a subclass of PEGs that is equivalent to DFAs. This allows application of some techniques from the theory of regular grammar to PEGs. In this paper, we define Linear PEGs (LPEGs), a subclass of PEGs that is equivalent to DFAs. Surprisingly, LPEGs are formalized by only excluding some patterns of recursive nonterminal in PEGs, and include the full set of ordered choice, unlimited lookahead, and greedy repetition, which are characteristic of PEGs. Although the conversion judgement of parsing expressions into DFAs is undecidable in general, the formalism of LPEGs allows for a syntactical judgement of parsing expressions.

Cite

@article{arxiv.1707.01814,
  title  = {Linear Parsing Expression Grammars},
  author = {Nariyoshi Chida and Kimio Kuramitsu},
  journal= {arXiv preprint arXiv:1707.01814},
  year   = {2017}
}

Comments

Parsing expression grammars, Boolean finite automata, Packrat parsing

R2 v1 2026-06-22T20:39:44.078Z