skip to main content
article

Modular semantic actions

Published:01 November 2016Publication History
Skip Abstract Section

Abstract

Parser generators give programmers a convenient and declarative way to write parsers and other language-processing applications, but their mechanisms for extension and code reuse often leave something to be desired. We introduce Ohm, a parser generator in which both grammars and their interpretations can be extended in safe and modular ways. Unlike many similar tools, Ohm completely separates grammars and semantic actions, avoiding the problems that arise when these two concerns are mixed. This paper describes the particular way in which Ohm achieves this separation, and discusses the resulting benefits to modularity and extensibility.

References

  1. G. Bracha. Executable grammars in Newspeak. Electronic Notes in Theoretical Computer Science, 193: 3–18, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. G. Bracha and D. Ungar. Mirrors: design principles for meta-level facilities of object-oriented programming languages. In Proc. OOPSLA, pages 331–344, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. G. Bracha et al. Modules as objects in Newspeak. In Proc. ECOOP, pages 405–428. Springer, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Ecma International. ECMAScript 2015 Language Specification. Geneva, 6th edition, June 2015.Google ScholarGoogle Scholar
  5. B. Ford. Parsing expression grammars: A recognition-based syntactic foundation. In Proc. POPL, pages 111–122. ACM, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. Gamma et al. Design Patterns: Elements of Reusable Object-oriented Software. Addison-Wesley, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. Grimm. Better extensibility through modular syntax. In Proc. PLDI, pages 38–51. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. C. Johnson. Yacc: Yet another compiler-compiler. In Technical Report CSTR 32. Bell Laboratories, 1975.Google ScholarGoogle Scholar
  9. J. Kurˇs, M. Lungu, and O. Nierstrasz. Top-down parsing with parsing contexts. In Proc. IWST, 2014.Google ScholarGoogle Scholar
  10. D. Leijen and E. Meijer. Parsec: Direct style monadic parser combinators for the real world. 2002.Google ScholarGoogle Scholar
  11. B. C. d. S. Oliveira and W. R. Cook. Extensibility for the masses: Practical extensibility with object algebras. In Proc. ECOOP, pages 2–27. Springer, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Palsberg, K. Tao, and W. Wang. Java Tree Builder website, 1997.Google ScholarGoogle Scholar
  13. T. Parr and R. Quong. ANTLR: A predicated LL(k) parser generator. Software—Practice and Experience, 25(7):789–810, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. P. Rein, R. Hirschfeld, and M. Taeumel. Gramada: Immediacy in programming language development. In Proc. Onward! ACM, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. V. Schorre. META II: a syntax-oriented compiler writing language. In Proc. ACM Nat. Conf. ACM, 1964. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. S. Viswanadha and S. Sankar. JavaCC website.Google ScholarGoogle Scholar
  17. A. Warth. Experimenting with Programming Languages. ProQuest, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Warth and I. Piumarta. OMeta: an object-oriented language for pattern matching. In Proc. DLS, pages 11–19. ACM, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. Warth, P. Dubroy, and T. Garnock-Jones. Ohm/JS repository, 2014.Google ScholarGoogle Scholar

Index Terms

  1. Modular semantic actions

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 52, Issue 2
        DLS '16
        February 2017
        131 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/3093334
        Issue’s Table of Contents
        • cover image ACM Conferences
          DLS 2016: Proceedings of the 12th Symposium on Dynamic Languages
          November 2016
          131 pages
          ISBN:9781450344456
          DOI:10.1145/2989225

        Copyright © 2016 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 November 2016

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!