Projects per year
Abstract
In this paper we present an approach to specifying operator precedence based on declarative disambiguation constructs and an implementation mechanism based on grammar rewriting. We identify a problem with existing generalized context-free parsing and disambiguation technology: generating a correct parser for a language such as OCaml using declarative precedence specification is not possible without resorting to some manual grammar transformation. Our approach provides a fully declarative solution to operator precedence specification for context-free grammars, is independent of any parsing technology, and is safe in that it guarantees that the language of the resulting grammar will be the same as the language of the specification grammar. We evaluate our new approach by specifying the precedence rules from the OCaml reference manual against the highly ambiguous reference grammar and validate the output of our generated parser.
Original language | English |
---|---|
Title of host publication | Software Language Engineering Lecture Notes in Computer Science |
Pages | 137-156 |
Number of pages | 20 |
Volume | 8225 |
ISBN (Electronic) | 978-3-319-02654-1 |
DOIs | |
Publication status | Published - 2013 |
Projects
- 1 Finished
-
PLanCompS: PLanCompS: Programming Language Components and Specifications
Johnstone, A. (PI), Scott, E. (CoI), Reddington, J. (CoI) & Walsh, R. (CoI)
Eng & Phys Sci Res Council EPSRC
1/06/11 → 31/05/15
Project: Research