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.
Type de document :
Communication dans un congrès
Czarnecki, K. and Hedin, G. Proceedings of the International Conference on Software Language Engineering (SLE, 2013), 2013, Unknown, Afghanistan. 2013
Liste complète des métadonnées

https://hal.inria.fr/hal-00923391
Contributeur : Tijs Van Der Storm <>
Soumis le : jeudi 2 janvier 2014 - 17:06:15
Dernière modification le : mercredi 20 décembre 2017 - 17:42:01

Identifiants

  • HAL Id : hal-00923391, version 1

Collections

Citation

A. Afroozeh, M. G. J. Van den Brand, A. Johnstone, E. Scott, Jurgen Vinju. Safe Specification Of Operator Precedence Rules. Czarnecki, K. and Hedin, G. Proceedings of the International Conference on Software Language Engineering (SLE, 2013), 2013, Unknown, Afghanistan. 2013. 〈hal-00923391〉

Partager

Métriques

Consultations de la notice

121