Red Shift: Procedural Shift-Reduce Parsing

Laurent, Nicolas
(2017) The 10th ACM SIGPLAN International Conference on Software Language Engineering - SLE 2017 — Location: Vancouver, BC, Canada (23.October.2017)

Files

redshift_sle2017.pdf
  • Open Access
  • Adobe PDF
  • 377.09 KB

Details

Authors
  • Laurent, Nicolasorcid-logoUCLouvain
    Author
Abstract
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.
Affiliations

Citations

Laurent, N. (2017). Red Shift: Procedural Shift-Reduce Parsing. Proceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering. Published. The 10th ACM SIGPLAN International Conference on Software Language Engineering - SLE 2017, Vancouver, BC, Canada. https://doi.org/10.1145/3136014.3136036