Effective translation for LL(1)-grammar in the example of a programming language | Prikladnaya Diskretnaya Matematika - Applied Discrete Mathematics. 2017. № 37. DOI: 10.17223/20710410/37/7

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.
Download file
Counter downloads: 231
  • Title Effective translation for LL(1)-grammar in the example of a programming language
  • Headline Effective translation for LL(1)-grammar in the example of a programming language
  • Publesher Tomask State UniversityTomsk State University
  • Issue Prikladnaya Diskretnaya Matematika - Applied Discrete Mathematics 37
  • Date:
  • DOI 10.17223/20710410/37/7
Keywords
трансляция, LL(1)-грамматика, обратная польская строка, язык программирования, translation, LL(1) grammar, reverse Polish notation, programming language
Authors
References
Ахо А. В., Лам М. С., Сети Р., Ульман Дж. Д. Компиляторы: принципы, технологии и инструментарий. 2-е изд. М.: Вильямс, 2008. 1184с.
Mogensen T.A. Introduction to Compiler Design. Springer, 2011. 225 p.
Вирт Н. Построение компиляторов. М.: ДМК Пресс, 2010. 192 с.
Костюк Ю.Л. Табличный способ генерации обратной польской строки для LL(1)-грамматики // Информационные технологии и математическое моделирование (ИТММ-2015). Материалы XIV Междунар. конф. им. А. Ф. Терпугова, 18-22 ноября 2015. Ч. 1. Томск: Изд-во Том. ун-та, 2015. С. 190-195.
 Effective translation for LL(1)-grammar in the example of a programming language | Prikladnaya Diskretnaya Matematika - Applied Discrete Mathematics. 2017. № 37. DOI: 10.17223/20710410/37/7
Effective translation for LL(1)-grammar in the example of a programming language | Prikladnaya Diskretnaya Matematika - Applied Discrete Mathematics. 2017. № 37. DOI: 10.17223/20710410/37/7
Download full-text version
Counter downloads: 615