Abstract
BNF grammar notation came into existence about 1960 for the specification of programming languages. It was first used for the automatic generation of parsers about 1972. BNF was later replaced with EBNF offering regular expression notation in the right side of grammar rules. EBNF is powerful, however, it describes only the recognition phase, which is only 1/3 of the process of language translation. The second phase is the construction of an abstract-syntax tree and the third phase is the creation of an instruction code sequence. Some parser generators automate the construction of an AST, but none, that I know of, automate the output of instruction codes. Certainly if these second and third phases are to be automated, a suitable notation is required in the grammar. This paper proposes a notation that permits the construction of the AST in the correct order and the creation of instruction codes. In effect, the complete translation process can be described in the grammar and correct translators generated automatically. A working system has been implemented and tested with good results. The generator is called LRgen and the new grammar notation is called TBNF.
- Klint, P., Lammel, R., Verhoef, C. "Toward an Engineering Discipline for Grammarware." ACM Transactions on Software Engineering and Methodology, Vol. 14, No. 3, July 2005, Pages 331--380. Google Scholar
Digital Library
- Ford, B. "Parsing Expression Grammars: A Recognition-Based Syntactic Foundation." POPL'04, January 14-16, 2004, Venice, Italy, Google Scholar
Digital Library
- Derk, M. D. "Toward a Simpler Method of Operational Semantics for Language Definition." ACM SIGPLAN Notices, Vol. 40, Issue 5 (May 2005), pages 39--44. Google Scholar
Digital Library
- Ledgard, H. F. "A Human Engineered Variant of BNF." ACM SIGPLAN Notices, Vol. 15, Issue 10 (Oct 1980), pages 57--62. Google Scholar
Digital Library
Index Terms
A translational BNF grammar notation (TBNF)
Recommendations
BNF converter
Haskell '04: Proceedings of the 2004 ACM SIGPLAN workshop on HaskellWe will demonstrate BNFC (the BNF Converter) [7, 6], a multi-lingual compiler tool. BNFC takes as its input a grammar written in LBNF (Labelled BNF) notation, and generates a compiler front-end (an abstract syntax, a lexer, and a parser). Furthermore, ...
IELR(1): practical LR(1) parser tables for non-LR(1) grammars with conflict resolution
SAC '08: Proceedings of the 2008 ACM symposium on Applied computingThere has been a recent effort in the literature to reconsider grammar-dependent software development from an engineering point of view. As part of that effort, we examine a deficiency in the state of the art of practical LR parser table generation. ...
The IELR(1) algorithm for generating minimal LR(1) parser tables for non-LR(1) grammars with conflict resolution
There has been a recent effort in the literature to reconsider grammar-dependent software development from an engineering point of view. As part of that effort, we examine a deficiency in the state of the art of practical LR parser table generation. ...






Comments