z-logo
open-access-imgOpen Access
Red Shift: procedural shift-reduce parsing (vision paper)
Author(s) -
Nicolas Laurent
Publication year - 2017
Publication title -
digital access to libraries (université catholique de louvain (ucl), l'université de namur (unamur) and the université saint-louis (usl-b))
Language(s) - English
Resource type - Conference proceedings
ISBN - 978-1-4503-5525-4
DOI - 10.1145/3136014.3136036
Subject(s) - computer science , parsing , lr parser , context (archaeology) , parser combinator , artificial intelligence , ambiguity , natural language processing , paradigm shift , programming language , philosophy , epistemology , paleontology , biology
Red Shift is a new design pattern for implementing parsers. The pattern draws ideas from traditional shift-reduce parsing as well as procedural PEG parsers. Red Shift parsers behaves like shift-reduce parsers, but eliminate ambiguity by always prioritizing reductions over shifts. To compensate the resulting lack of expressivity, reducers are not simple reduction rules but full-blown procedures written in a general-purpose host language. I found many advantages to this style of parser. In particular, we can generate high-quality error messages more easily; and compose different style of parsers. I also speculate about how Red Shift parsers may improve partial compilation in the context of an IDE.

The content you want is available to Zendy users.

Already have an account? Click here to sign in.
Having issues? You can contact us here
Accelerating Research

Address

John Eccles House
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom