[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/2892208.2892234acmconferencesArticle/Chapter ViewAbstractPublication PagesccConference Proceedingsconference-collections
short-paper

Iguana: a practical data-dependent parsing framework

Published: 17 March 2016 Publication History

Abstract

Data-dependent grammars extend context-free grammars with arbitrary computation, variable binding, and constraints. These features provide the user with the freedom and power to express syntactic constructs outside the realm of context-free grammars, e.g., indentation rules in Haskell and type definitions in C. Data-dependent grammars have been recently presented by Jim et al. as a grammar formalism that enables construction of parsers from a rich format specification. Although some features of data-dependent grammars are available in current parsing tools, e.g., semantic predicates in ANTLR, data-dependent grammars have not yet fully found their way into practice. In this paper we present Iguana, a data-dependent parsing framework, implemented on top of the GLL parsing algorithm. In addition to basic features of data-dependent grammars, Iguana also provides high-level syntactic constructs, e.g., for operator precedence and indentation rules, which are implemented as desugaring to data-dependent grammars. These high-level constructs enable a concise and declarative way to define the syntax of programming languages. Moreover, Iguana's extensible data-dependent grammar API allows the user to easily add new high-level constructs or modify existing ones. We have used Iguana to parse various real programming languages, such as OCaml, Haskell, Java, and C#. In this paper we describe the architecture and features of Iguana, and report on its current implementation status.

References

[1]
A. Afroozeh and A. Izmaylova. Faster, Practical GLL Parsing. In Compiler Construction, CC’15, pages 89–108. Springer, 2015.
[2]
A. Afroozeh and A. Izmaylova. One Parser to Rule Them All. In Onward! 15, pages 151–170. ACM, 2015.
[3]
A. Afroozeh and A. Izmaylova. Operator Precedence for Data-Dependent Grammars. In PEPM’16, pages 13–24. ACM, 2016.
[4]
T. Jim, Y. Mandelbaum, and D. Walker. Semantics and Algorithms for Data-dependent Grammars. In POPL’10, pages 417–430, 2010.
[5]
L. C. Kats, E. Visser, and G. Wachsmuth. Pure and Declarative Syntax Definition: Paradise Lost and Regained. In OOPSLA’10, pages 918– 932. ACM, 2010.
[6]
E. Scott and A. Johnstone. GLL Parse-tree Generation. Science of Computer Programming, 78(10):1828–1844, Oct. 2013.
[7]
E. R. Van Wyk and A. C. Schwerdfeger. Context-aware Scanning for Parsing Extensible Languages. GPCE ’07, pages 63–72. ACM, 2007.
[8]
E. Visser. Scannerless Generalized-LR Parsing. Technical report, University of Amsterdam, 1997.

Cited By

View all
  • (2023)Automated Ambiguity Detection in Layout-Sensitive GrammarsProceedings of the ACM on Programming Languages10.1145/36228387:OOPSLA2(1150-1175)Online publication date: 16-Oct-2023
  • (2022)A Model and Declarative Language for Specifying Binary Data FormatsProgramming and Computing Software10.1134/S036176882207004048:7(469-483)Online publication date: 1-Dec-2022
  • (2020)Faster general parsing through context-free memoizationProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3386032(1022-1035)Online publication date: 11-Jun-2020
  • Show More Cited By

Index Terms

  1. Iguana: a practical data-dependent parsing framework

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    CC '16: Proceedings of the 25th International Conference on Compiler Construction
    March 2016
    270 pages
    ISBN:9781450342414
    DOI:10.1145/2892208
    • General Chair:
    • Ayal Zaks,
    • Program Chair:
    • Manuel Hermenegildo
    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

    • IEEE-CS: Computer Society

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 17 March 2016

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Data-dependent grammars
    2. GLL
    3. disambiguation

    Qualifiers

    • Short-paper

    Conference

    CGO '16

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)4
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 23 Dec 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2023)Automated Ambiguity Detection in Layout-Sensitive GrammarsProceedings of the ACM on Programming Languages10.1145/36228387:OOPSLA2(1150-1175)Online publication date: 16-Oct-2023
    • (2022)A Model and Declarative Language for Specifying Binary Data FormatsProgramming and Computing Software10.1134/S036176882207004048:7(469-483)Online publication date: 1-Dec-2022
    • (2020)Faster general parsing through context-free memoizationProceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3385412.3386032(1022-1035)Online publication date: 11-Jun-2020
    • (2018)Morbig: a static parser for POSIX shellProceedings of the 11th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3276604.3276615(29-41)Online publication date: 24-Oct-2018

    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