skip to main content
article

A translational BNF grammar notation (TBNF)

Published:01 April 2006Publication History
Skip Abstract Section

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. Ford, B. "Parsing Expression Grammars: A Recognition-Based Syntactic Foundation." POPL'04, January 14-16, 2004, Venice, Italy, Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. Ledgard, H. F. "A Human Engineered Variant of BNF." ACM SIGPLAN Notices, Vol. 15, Issue 10 (Oct 1980), pages 57--62. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A translational BNF grammar notation (TBNF)

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!