Главная » Просмотр файлов » K. Cooper, L. Torczon - Engineering a Compiler (2011 - 2nd edition)

K. Cooper, L. Torczon - Engineering a Compiler (2011 - 2nd edition) (798440), страница 8

Файл №798440 K. Cooper, L. Torczon - Engineering a Compiler (2011 - 2nd edition) (K. Cooper, L. Torczon - Engineering a Compiler (2011 - 2nd edition)) 8 страницаK. Cooper, L. Torczon - Engineering a Compiler (2011 - 2nd edition) (798440) страница 82019-09-18СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 8)

That strategy, however, exposes the students to material from Chapter 13before they see Chapter 2.In either scenario, the course should draw material from other classes. Obvious connectionsexist to computer organization, assembly-language programming, operating systems, computerarchitecture, algorithms, and formal languages. Although the connections from compiler construction to other courses may be less obvious, they are no less important. Character copying,as discussed in Chapter 7, plays a critical role in the performance of applications that includenetwork protocols, file servers, and web servers.

The techniques developed in Chapter 2 forscanning have applications that range from text editing through url-filtering. The bottomup local register allocator in Chapter 13 is a cousin of the optimal offline page replacementalgorithm, min.nADDITIONAL MATERIALSAdditional resources are available that can help you adapt the material presented in eac2e toyour course. These include a complete set of lectures from the authors’ version of the course atRice University and a set of solutions to the exercises.

Your Elsevier representative can provideyou with access.AcknowledgmentsMany people were involved in the preparation of the first edition of eac. Their contributionshave carried forward into this second edition. Many people pointed out problems in the firstedition, including Amit Saha, Andrew Waters, Anna Youssefi, Ayal Zachs, Daniel Salce, DavidPeixotto, Fengmei Zhao, Greg Malecha, Hwansoo Han, Jason Eckhardt, Jeffrey Sandoval, JohnElliot, Kamal Sharma, Kim Hazelwood, Max Hailperin, Peter Froehlich, Ryan Stinnett, SachinRehki, Sağnak Taşırlar, Timothy Harvey, and Xipeng Shen.

We also want to thank the reviewersof the second edition, who were Jeffery von Ronne, Carl Offner, David Orleans, K. StuartSmith, John Mallozzi, Elizabeth White, and Paul C. Anagnostopoulos. The production teamat Elsevier, in particular, Alisa Andreola, Andre Cuello, and Megan Guiney, played a criticalrole in converting the a rough manuscript into its final form. All of these people improved thisvolume in significant ways with their insights and their help.Finally, many people have provided us with intellectual and emotional support over the lastfive years.

First and foremost, our families and our colleagues at Rice have encouraged us atevery step of the way. Christine and Carolyn, in particular, tolerated myriad long discussions ontopics in compiler construction. Nate McFadden guided this edition from its inception throughits publication with patience and good humor. Penny Anderson provided administrative andorganizational support that was critical to finishing the second edition. To all these people goour heartfelt thanks.This page intentionally left blankChapter1Overview of CompilationnCHAPTER OVERVIEWCompilers are computer programs that translate a program written in onelanguage into a program written in another language. At the same time, acompiler is a large software system, with many internal components andalgorithms and complex interactions between them.

Thus, the study of compiler construction is an introduction to techniques for the translation andimprovement of programs, and a practical exercise in software engineering.This chapter provides a conceptual overview of all the major components ofa modern compiler.Keywords: Compiler, Interpreter, Automatic Translation1.1 INTRODUCTIONThe role of the computer in daily life grows each year. With the rise of theInternet, computers and the software that runs on them provide communications, news, entertainment, and security. Embedded computers have changedthe ways that we build automobiles, airplanes, telephones, televisions, andradios. Computation has created entirely new categories of activity, fromvideo games to social networks. Supercomputers predict daily weather andthe course of violent storms.

Embedded computers synchronize traffic lightsand deliver e-mail to your pocket.All of these computer applications rely on software computer programsthat build virtual tools on top of the low-level abstractions provided by theunderlying hardware. Almost all of that software is translated by a toolcalled a compiler. A compiler is simply a computer program that translates other computer programs to prepare them for execution. This bookpresents the fundamental techniques of automatic translation that are usedEngineering a Compiler.

DOI: 10.1016/B978-0-12-088478-0.00001-3c 2012, Elsevier Inc. All rights reserved.Copyright Compilera computer program that translates othercomputer programs12 CHAPTER 1 Overview of Compilationto build compilers. It describes many of the challenges that arise in compilerconstruction and the algorithms that compiler writers use to address them.Conceptual RoadmapA compiler is a tool that translates software written in one language intoanother language.

To translate text from one language to another, the toolmust understand both the form, or syntax, and content, or meaning, of theinput language. It needs to understand the rules that govern syntax and meaning in the output language. Finally, it needs a scheme for mapping contentfrom the source language to the target language.The structure of a typical compiler derives from these simple observations.The compiler has a front end to deal with the source language. It has a backend to deal with the target language. Connecting the front end and the backend, it has a formal structure for representing the program in an intermediate form whose meaning is largely independent of either language.

Toimprove the translation, a compiler often includes an optimizer that analyzesand rewrites that intermediate form.OverviewComputer programs are simply sequences of abstract operations written ina programming language—a formal language designed for expressing computation. Programming languages have rigid properties and meanings—asopposed to natural languages, such as Chinese or Portuguese. Programminglanguages are designed for expressiveness, conciseness, and clarity. Naturallanguages allow ambiguity.

Programming languages are designed to avoidambiguity; an ambiguous program has no meaning. Programming languagesare designed to specify computations—to record the sequence of actions thatperform some task or produce some results.Programming languages are, in general, designed to allow humans to expresscomputations as sequences of operations. Computer processors, hereafterreferred to as processors, microprocessors, or machines, are designed to execute sequences of operations. The operations that a processor implementsare, for the most part, at a much lower level of abstraction than those specified in a programming language. For example, a programming language typically includes a concise way to print some number to a file.

That singleprogramming language statement must be translated into literally hundredsof machine operations before it can execute.The tool that performs such translations is called a compiler. The compilertakes as input a program written in some language and produces as its output an equivalent program. In the classic notion of a compiler, the output1.1 Introduction 3program is expressed in the operations available on some specific processor,often called the target machine.

Viewed as a black box, a compiler mightlook like this:SourceProgramCompilerTargetProgramTypical “source” languages might be c, c++, fortran, Java, or ml. The“target” language is usually the instruction set of some processor.Some compilers produce a target program written in a human-oriented programming language rather than the assembly language of some computer.The programs that these compilers produce require further translation beforethey can execute directly on a computer. Many research compilers produceC programs as their output. Because compilers for C are available on mostcomputers, this makes the target program executable on all those systems,at the cost of an extra compilation for the final target.

Compilers that target programming languages rather than the instruction set of a computer areoften called source-to-source translators.Instruction setThe set of operations supported by a processor;the overall design of an instruction set is oftencalled an instruction set architecture or ISA.Many other systems qualify as compilers. For example, a typesetting program that produces PostScript can be considered a compiler. It takes asinput a specification for how the document should look on the printed pageand it produces as output a PostScript file.

PostScript is simply a languagefor describing images. Because the typesetting program takes an executablespecification and produces another executable specification, it is a compiler.The code that turns PostScript into pixels is typically an interpreter, nota compiler. An interpreter takes as input an executable specification andproduces as output the result of executing the specification.SourceProgramInterpreterResultsSome languages, such as Perl, Scheme, and apl, are more often implementedwith interpreters than with compilers.Some languages adopt translation schemes that include both compilationand interpretation.

Характеристики

Тип файла
PDF-файл
Размер
8,27 Mb
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6566
Авторов
на СтудИзбе
298
Средний доход
с одного платного файла
Обучение Подробнее