A translational BNF grammar notation (TBNF)
Autor: | Paul B Mann |
---|---|
Rok vydání: | 2006 |
Předmět: |
Computer science
media_common.quotation_subject Attribute grammar Operator-precedence grammar Mildly context-sensitive grammar formalism computer.software_genre Notation Grammar-based code Regular tree grammar Regular expression media_common Parsing Grammar business.industry Programming language Engineering notation Computer Graphics and Computer-Aided Design Extended Backus–Naur Form TheoryofComputation_MATHEMATICALLOGICANDFORMALLANGUAGES Polish notation Affix grammar Artificial intelligence Regular grammar business computer Software Natural language processing |
Zdroj: | ACM SIGPLAN Notices. 41:16-23 |
ISSN: | 1558-1160 0362-1340 |
Popis: | 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. |
Databáze: | OpenAIRE |
Externí odkaz: |