|
Mathematical Foundations of Informatics and Programming
Effective translation for LL(1)-grammar in the example of a programming language
Yu. L. Kostyuk Tomsk State University, Tomsk, Russia
Abstract:
Top-down analysis algorithms are the most useful for implementing translators for programming languages. The analysis methods based on the LL(1)-grammar assume that the generating rules of the grammar are previously transformed into a non-strict normal Greibach form. The transformed generating rules are written in an analyzer table. To convert an input string of characters to an object language, a special program for generating individual elements of the object language should be created for each generating rule. The development of the set of such programs is rather a complex and voluminous task when a translator is created. In this article, we propose a method for constructing semantic programs implementing the generation of elements of the object language when each semantic program is associated with the separate symbols in the generating rule but not with the generating rule as a whole. As a result, the semantic programs are extremely simple and convenient to be implemented. The method is described for an exemplifying programming language which is translated into a reverse Polish notation.
Keywords:
translation, LL(1) grammar, reverse Polish notation, programming language.
Citation:
Yu. L. Kostyuk, “Effective translation for LL(1)-grammar in the example of a programming language”, Prikl. Diskr. Mat., 2017, no. 37, 90–99
Linking options:
https://www.mathnet.ru/eng/pdm592 https://www.mathnet.ru/eng/pdm/y2017/i3/p90
|
Statistics & downloads: |
Abstract page: | 240 | Full-text PDF : | 141 | References: | 40 |
|