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.
- G. Bracha. Executable grammars in Newspeak. Electronic Notes in Theoretical Computer Science, 193: 3–18, 2007. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- G. Bracha et al. Modules as objects in Newspeak. In Proc. ECOOP, pages 405–428. Springer, 2010. Google Scholar
Digital Library
- Ecma International. ECMAScript 2015 Language Specification. Geneva, 6th edition, June 2015.Google Scholar
- B. Ford. Parsing expression grammars: A recognition-based syntactic foundation. In Proc. POPL, pages 111–122. ACM, 2004. Google Scholar
Digital Library
- E. Gamma et al. Design Patterns: Elements of Reusable Object-oriented Software. Addison-Wesley, 1995. Google Scholar
Digital Library
- R. Grimm. Better extensibility through modular syntax. In Proc. PLDI, pages 38–51. ACM, 2006. Google Scholar
Digital Library
- S. C. Johnson. Yacc: Yet another compiler-compiler. In Technical Report CSTR 32. Bell Laboratories, 1975.Google Scholar
- J. Kurˇs, M. Lungu, and O. Nierstrasz. Top-down parsing with parsing contexts. In Proc. IWST, 2014.Google Scholar
- D. Leijen and E. Meijer. Parsec: Direct style monadic parser combinators for the real world. 2002.Google Scholar
- 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 Scholar
Digital Library
- J. Palsberg, K. Tao, and W. Wang. Java Tree Builder website, 1997.Google Scholar
- T. Parr and R. Quong. ANTLR: A predicated LL(k) parser generator. Software—Practice and Experience, 25(7):789–810, 1995. Google Scholar
Digital Library
- P. Rein, R. Hirschfeld, and M. Taeumel. Gramada: Immediacy in programming language development. In Proc. Onward! ACM, 2016. Google Scholar
Digital Library
- D. V. Schorre. META II: a syntax-oriented compiler writing language. In Proc. ACM Nat. Conf. ACM, 1964. Google Scholar
Digital Library
- S. Viswanadha and S. Sankar. JavaCC website.Google Scholar
- A. Warth. Experimenting with Programming Languages. ProQuest, 2009. Google Scholar
Digital Library
- A. Warth and I. Piumarta. OMeta: an object-oriented language for pattern matching. In Proc. DLS, pages 11–19. ACM, 2007. Google Scholar
Digital Library
- A. Warth, P. Dubroy, and T. Garnock-Jones. Ohm/JS repository, 2014.Google Scholar
Index Terms
Modular semantic actions
Recommendations
Modular semantic actions
DLS 2016: Proceedings of the 12th Symposium on Dynamic LanguagesParser 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 ...
Nez: practical open grammar language
Onward! 2016: Proceedings of the 2016 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming and SoftwareNez is a PEG(Parsing Expressing Grammar)-based open grammar language that allows us to describe complex syntax constructs without action code. Since open grammars are declarative and free from a host programming language of parsers, software ...
On the use of extended grammars
ACM-SE 20: Proceedings of the 20th annual Southeast regional conferenceExtended context free grammars (ECFG) are context free grammars (CFG) in which the right side or each production may be an arbitrary finite state machine. There are ECFG subsets, ELR(k) and ELALR(k) which correspond to the context free subsets, LR(k) ...







Comments