Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/3136014.3136036acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Red Shift: procedural shift-reduce parsing (vision paper)

Published: 23 October 2017 Publication History

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.

References

[1]
Sebastian Erdweg, Tijs van der Storm, Markus Völter, Meinte Boersma, Remi Bosman, William R. Cook, Albert Gerritsen, Angelo Hulshout, Steven Kelly, Alex Loh, Gabriël D. P. Konat, Pedro J. Molina, Martin Palatnik, Risto Pohjonen, Eugen Schindler, Klemens Schindler, Riccardo Solmi, Vlad A. Vergu, Eelco Visser, Kevin van der Vlist, Guido H. Wachsmuth, and Jimi van der Woning. 2013. The State of the Art in Language Workbenches . Springer International Publishing, Cham, 197–217.
[2]
Bryan Ford. 2004. Parsing Expression Grammars: A Recognition-based Syntactic Foundation. SIGPLAN Notices 39, 1 (Jan. 2004), 111–122.
[3]
Graham Hutton. 1992. Higher-order Functions for Parsing. Journal of Functional Programming 2, 3 (July 1992), 323–343.
[4]
Nicolas Laurent and Kim Mens. 2015. Parsing Expression Grammars Made Practical. In Proceedings of the ACM SIGPLAN International Conference on Software Language Engineering (SLE 2015) . ACM, 167–172.
[5]
Nicolas Laurent and Kim Mens. 2016. Taming context-sensitive languages with principled stateful parsing. In Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering, Amsterdam, The Netherlands, October 31 - November 1, 2016 . 15–27. http://dl.acm.org/citation.cfm?id=2997370
[6]
André Murbach Maidl, Fabio Mascarenhas, Sérgio Medeiros, and Roberto Ierusalimschy. 2016. Error reporting in Parsing Expression Grammars. Science of Computer Programming 132 (2016), 129 – 140.
[7]
Theodore Norvell. 2001. Parsing expressions by recursive descent. (2001). https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm

Cited By

View all

Index Terms

  1. Red Shift: procedural shift-reduce parsing (vision paper)

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    SLE 2017: Proceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering
    October 2017
    267 pages
    ISBN:9781450355254
    DOI:10.1145/3136014
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Sponsors

    In-Cooperation

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 23 October 2017

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. parsers
    2. parsing
    3. pattern

    Qualifiers

    • Research-article

    Conference

    SPLASH '17
    Sponsor:

    Upcoming Conference

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 84
      Total Downloads
    • Downloads (Last 12 months)1
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 24 Nov 2024

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media