Saved in:
Bibliographic Details
Main Author: Smith, James
Format: Preprint
Published: 2019
Subjects:
Online Access:https://arxiv.org/abs/1908.10888
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917831671545856
author Smith, James
author_facet Smith, James
contents The standard algorithm to eliminate indirect left recursion takes a preventative approach, rewriting a grammar's rules so that indirect left recursion is no longer possible, rather than eliminating it only as and when it occurs. This approach results in many of the rules being lost, so that the parse trees that result are often devoid of the detail that the BNF was supposed to capture in the first place. Furthermore, the standard algorithm results in exponential blow-up as the BNF is rewritten, making it wholly unworkable in practice. To avoid these pitfalls, we revise the standard algorithm to eliminate direct left recursion and then take a graph-theoretic approach to eliminating indirect left recursion. We also extend the algorithm to rewrite the resultant parse trees in order to recover the parse trees that would have resulted if left recursion had not had to be eliminated in the first place. Therefore, aside from a couple of caveats, our algorithm works not just in theory but also in practice.
format Preprint
id arxiv_https___arxiv_org_abs_1908_10888
institution arXiv
publishDate 2019
record_format arxiv
spellingShingle Eliminating Left Recursion without the Epsilon
Smith, James
Data Structures and Algorithms
The standard algorithm to eliminate indirect left recursion takes a preventative approach, rewriting a grammar's rules so that indirect left recursion is no longer possible, rather than eliminating it only as and when it occurs. This approach results in many of the rules being lost, so that the parse trees that result are often devoid of the detail that the BNF was supposed to capture in the first place. Furthermore, the standard algorithm results in exponential blow-up as the BNF is rewritten, making it wholly unworkable in practice. To avoid these pitfalls, we revise the standard algorithm to eliminate direct left recursion and then take a graph-theoretic approach to eliminating indirect left recursion. We also extend the algorithm to rewrite the resultant parse trees in order to recover the parse trees that would have resulted if left recursion had not had to be eliminated in the first place. Therefore, aside from a couple of caveats, our algorithm works not just in theory but also in practice.
title Eliminating Left Recursion without the Epsilon
topic Data Structures and Algorithms
url https://arxiv.org/abs/1908.10888