ABSTRACT
In this paper, we report our experience with parsing the syntax of the Fortress programming language. Fortress is a new programming language designed for scientific and high-performance computing. Features include: implicit parallelism, transactions, and concrete syntax that emulates mathematical notation. Fortress is intended to grow over time to accommodate the changing needs of its users.
Parsing the Fortress syntax is nontrivial due to its support for mathematical syntax and growable syntax. Mathematical syntax is highly ambiguous and growable syntax allows a program itself to define how it is parsed. Fortress currently runs entirely on the JVM, which requires internal representation of Fortress as Java classes. We describe our trials to parse the entire Fortress syntax, in the presence of constant changes of the language syntax and its internal representation. and the lessons we learned from the experience.
- CUP - LALR Parser Generator for Java#8482;. http://www2.cs.tum.edu/projects/cup/.Google Scholar
- Java Compiler Compiler#8482; (JavaCC#8482;) - The Java Parser Generator. https://javacc.dev.java.net/.Google Scholar
- Eric Allen, David Chase, Christine Flood, Victor Luchangco, Jan-Willem Maessen, Sukyoung Ryu, and Guy L. Steele Jr. Project Fortress Community website. http://www.projectfortress.sun.com.Google Scholar
- Eric Allen, David Chase, Joe Hallett, Victor Luchangco, Jan-Willem Maessen, Sukyoung Ryu, Guy L. Steele Jr., and Sam Tobin-Hochstadt. The Fortress Language Specification Version 1.0. http://research.sun.com/projects/plrg/fortress.pdf, March 2008.Google Scholar
- Eric Allen, Ryan Culpepper, Janus Dam Nielsen, Jon Rafkind, and Sukyoung Ryu. Growing a syntax. In Foundations of Object-Oriented Languages, 2009.Google Scholar
- D. H. Bailey, E. Barszcz, J. T. Barton, D. S. Browning, R. L. Carter, R. A. Fatoohi, P. O. Frederickson, T. A. Lasinski, H. D. Simon, V. Venkatakrishnan, and S. K. Weeratunga. The NAS parallel benchmarks. Technical report, The International Journal of Supercomputer Applications, 1991.Google Scholar
- Gilad Bracha, Guy Steele, Bill Joy, and James Gosling. Java(TM) Language Specification, The (3rd Edition) (Java Series). Addison-Wesley Professional, July 2005. Google ScholarDigital Library
- Bryan Ford. Parsing expression grammars: a recognition-based syntactic foundation. In POPL '04: Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 111--122, New York, NY, USA, 2004. ACM. Google ScholarDigital Library
- Robert Grimm. Rats! -- an easily extensible parser generator. http://cs.nyu.edu/~rgrimm/xtc/rats.html.Google Scholar
- James W. Cooper. Java#8482;Design Patterns: A Tutorial. Addison-Wesley, 2000. Google ScholarDigital Library
- Stephen C. Johnson. Yacc: Yet another compiler-compiler, 1979.Google Scholar
- Xavier Leroy, Damien Doligez, Jacques Garrigue, Didier Rémy, and Jérôme Vouillon. The Objective Caml System, release 3.08. http://caml.inria.fr/distrib/ocaml-3.08/ocaml-3.08-refman.pdf, 2004.Google Scholar
- Scott McPeak and G. C. Necula. Elkhound: A fast, practical GLR parser generator. In Compiler Construction, pages 73--88, 2004.Google ScholarCross Ref
- Martin Odersky, Philippe Altherr, Vincent Cremet, Burak Emir, Stéphane Micheloud, Nikolay Mihaylov, Michel Schinz, Erik Stenman, and Matthias Zenger. The Scala Language Specification. http://scala.epfl.ch/docu/files/ScalaReference.pdf, 2004.Google Scholar
- Brian R. Stoler, Eric Allen, and Dan Smith. ASTGen. http://sourceforge.net/projects/astgen.Google Scholar
- Bjarne Stroustrup. The C++ Programming Language (Special Edition ed.). Addison-Wesley, 2000. Google ScholarDigital Library
- The Unicode Consortium. The Unicode Standard, Version 5.0. Addison-Wesley, 2006.Google Scholar
Index Terms
- Parsing Fortress syntax
Recommendations
Left recursion in Parsing Expression Grammars
Parsing Expression Grammars (PEGs) are a formalism that can describe all deterministic context-free languages through a set of rules that specify a top-down parser for some language. PEGs are easy to use, and there are efficient implementations of PEG ...
Syntax error recovery in parsing expression grammars
SAC '18: Proceedings of the 33rd Annual ACM Symposium on Applied ComputingParsing Expression Grammars (PEGs) are a formalism used to describe top-down parsers with backtracking. As PEGs do not provide a good error recovery mechanism, PEG-based parsers usually do not recover from syntax errors in the input, or recover from ...
Principled parsing for indentation-sensitive languages: revisiting landin's offside rule
POPL '13: Proceedings of the 40th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesSeveral popular languages, such as Haskell, Python, and F#, use the indentation and layout of code as part of their syntax. Because context-free grammars cannot express the rules of indentation, parsers for these languages currently use ad hoc ...
Comments