BNF WAS HERE: What Have We Done About the Unnecessary Diversity of Notation for Syntactic Definitions
Reusing existing grammar knowledge residing in standards, specifications and manuals for programming languages, faces several challenges. One of the most significant of them is the diversity of syntactic notations: without loss of generality, we can state that every single language document uses its own notation, which is more often than not, a dialect of the (Extended) Backus-Naur Form. In this paper we report on an approach to solve the diversity problem by providing a way to quickly and concisely specify all the parameters of a syntactic notation. The resulting ``meta-ebnf'' language was used to successfully recover many grammars from sources that use different syntactic notations. Instead of adding another syntactic notation and arguing about its excellence, we propose to retain the diversity and to cope with it by formally defining syntactic notations and using such definitions to import existing grammars to grammar engineering frameworks and to export (pretty-print) existing grammars to any desired syntactic notation. This result effectively bridges programming language standards and parser generators. The conclusions presented in the paper, were drawn based on analysis of a large corpus of language documents, as well as on the success of its application in practice.
|Keywords||design, documentation, languages, reliability|
|ACM||Formal Definitions and Theory (acm D.3.1), Processors (acm D.3.4)|
|THEME||Software (theme 1)|
|Editor||M. Mernik (Marjan) , B. Bryant|
|Project||GrammarLab: Foundations of a Grammar Laboratory|
|Conference||ACM Symposium on Applied Computing|
|Grant||This work was funded by the The Netherlands Organisation for Scientific Research (NWO); grant id nwo/612.001.007 - GrammarLab: Foundations of a Grammar Laboratory|
Zaytsev, V. (2012). BNF WAS HERE: What Have We Done About the Unnecessary Diversity of Notation for Syntactic Definitions. In M Mernik & B Bryant (Eds.), Programming Languages Track, Volume II of the Proceedings of the 27th ACM Symposium on Applied Computing (SAC 2012) (pp. 1910–1915). ACM.