Skip to Main content Skip to Navigation
Conference papers

Safe Specification Of Operator Precedence Rules

Abstract : In this paper we present an approach to specifying opera- tor 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 disambigua- tion 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.
Document type :
Conference papers
Complete list of metadata

https://hal.inria.fr/hal-00923391
Contributor : Tijs van der Storm <>
Submitted on : Thursday, January 2, 2014 - 5:06:15 PM
Last modification on : Monday, May 31, 2021 - 9:24:01 AM

Links full text

Identifiers

Collections

Citation

Ali Afroozeh, Mark van den Brand, Adrian Johnstone, Elizabeth Scott, Jurgen Vinju. Safe Specification Of Operator Precedence Rules. SLE 2013 - 6th International Conference on Software Language Engineering, 2013, Indianapolis, United States. ⟨10.1007/978-3-319-02654-1_8⟩. ⟨hal-00923391⟩

Share

Metrics

Record views

193