Compilers and Compiler Generators an introduction with C++
Số trang: 427
Loại file: pdf
Dung lượng: 1.06 MB
Lượt xem: 11
Lượt tải: 0
Xem trước 10 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
This book has been written to support a practically oriented course in programming languagetranslation for senior undergraduates in Computer Science. More specifically, it is aimed at studentswho are probably quite competent in the art of imperative programming (for example, in C++,Pascal, or Modula-2), but whose mathematics may be a little weak; students who require only asolid introduction to the subject, so as to provide them with insight into areas of language designand implementation, rather than a deluge of theory which they will probably never use again...
Nội dung trích xuất từ tài liệu:
Compilers and Compiler Generators an introduction with C++ Compilers and Compiler Generators an introduction with C++ © P.D. Terry, Rhodes University, 1996 p.terry@ru.ac.zaThis is a set of Postcript® files of the text of my book Compilers and Compiler Generators - anintroduction with C++, published in 1997 by International Thomson Computer Press. The originaledition is now out of print, and the copyright has reverted to me.The book is also available in other formats. The latest versions of the distribution and details ofhow to download up-to-date compressed versions of the text and its supporting software andcourseware can be found at http://www.scifac.ru.ac.za/compilers/The text of the book is Copyright © PD Terry. Although you are free to make use of the materialfor academic purposes, the material may not be redistributed without my knowledge or permission.File List The 18 chapters of the book are filed as chap01.ps through chap18.ps The 4 appendices to the book are filed as appa.ps through appd.ps The original appendix A of the book is filed as appa0.ps The contents of the book is filed as contents.ps The preface of the book is filed as preface.ps An index for the book is filed as index.ps. Currently (January 2000) the page numbers refer to an A4 version in PCL® format available at http://www.scifac.ru.ac.za/compilers/longpcl.zip. However, software tools like GhostView may be used to search the files for specific text. The bibliography for the book is filed as biblio.psChange List 18-October-1999 - Pre-release 12-November-1999 - First official on-line release 16-January-2000 - First release of Postscript version (incorporates minor corrections to chapter 12) Compilers and Compiler Generators © P.D. Terry, 2000PREFACEThis book has been written to support a practically oriented course in programming languagetranslation for senior undergraduates in Computer Science. More specifically, it is aimed at studentswho are probably quite competent in the art of imperative programming (for example, in C++,Pascal, or Modula-2), but whose mathematics may be a little weak; students who require only asolid introduction to the subject, so as to provide them with insight into areas of language designand implementation, rather than a deluge of theory which they will probably never use again;students who will enjoy fairly extensive case studies of translators for the sorts of languages withwhich they are most familiar; students who need to be made aware of compiler writing tools, and tocome to appreciate and know how to use them. It will hopefully also appeal to a certain class ofhobbyist who wishes to know more about how translators work.The reader is expected to have a good knowledge of programming in an imperative language and,preferably, a knowledge of data structures. The book is practically oriented, and the reader whocannot read and write code will have difficulty following quite a lot of the discussion. However, itis difficult to imagine that students taking courses in compiler construction will not have that sort ofbackground!There are several excellent books already extant in this field. What is intended to distinguish thisone from the others is that it attempts to mix theory and practice in a disciplined way, introducingthe use of attribute grammars and compiler writing tools, at the same time giving a highly practicaland pragmatic development of translators of only moderate size, yet large enough to provideconsiderable challenge in the many exercises that are suggested.OverviewThe book starts with a fairly simple overview of the translation process, of the constituent parts of acompiler, and of the concepts of porting and bootstrapping compilers. This is followed by a chapteron machine architecture and machine emulation, as later case studies make extensive use of codegeneration for emulated machines, a very common strategy in introductory courses. The nextchapter introduces the student to the notions of regular expressions, grammars, BNF and EBNF,and the value of being able to specify languages concisely and accurately.Two chapters follow that discuss simple features of assembler language, accompanied by thedevelopment of an assembler/interpreter system which allows not only for very simple assembly,but also for conditional assembly, macro-assembly, error detection, and so on. Complete code forsuch an assembler is presented in a highly modularized form, but with deliberate scope left forextensions, ranging from the trivial to the extensive.Three chapters follow on formal syntax theory, parsing, and the manual construction of scannersand parsers. The usual classifications of grammars and restric ...
Nội dung trích xuất từ tài liệu:
Compilers and Compiler Generators an introduction with C++ Compilers and Compiler Generators an introduction with C++ © P.D. Terry, Rhodes University, 1996 p.terry@ru.ac.zaThis is a set of Postcript® files of the text of my book Compilers and Compiler Generators - anintroduction with C++, published in 1997 by International Thomson Computer Press. The originaledition is now out of print, and the copyright has reverted to me.The book is also available in other formats. The latest versions of the distribution and details ofhow to download up-to-date compressed versions of the text and its supporting software andcourseware can be found at http://www.scifac.ru.ac.za/compilers/The text of the book is Copyright © PD Terry. Although you are free to make use of the materialfor academic purposes, the material may not be redistributed without my knowledge or permission.File List The 18 chapters of the book are filed as chap01.ps through chap18.ps The 4 appendices to the book are filed as appa.ps through appd.ps The original appendix A of the book is filed as appa0.ps The contents of the book is filed as contents.ps The preface of the book is filed as preface.ps An index for the book is filed as index.ps. Currently (January 2000) the page numbers refer to an A4 version in PCL® format available at http://www.scifac.ru.ac.za/compilers/longpcl.zip. However, software tools like GhostView may be used to search the files for specific text. The bibliography for the book is filed as biblio.psChange List 18-October-1999 - Pre-release 12-November-1999 - First official on-line release 16-January-2000 - First release of Postscript version (incorporates minor corrections to chapter 12) Compilers and Compiler Generators © P.D. Terry, 2000PREFACEThis book has been written to support a practically oriented course in programming languagetranslation for senior undergraduates in Computer Science. More specifically, it is aimed at studentswho are probably quite competent in the art of imperative programming (for example, in C++,Pascal, or Modula-2), but whose mathematics may be a little weak; students who require only asolid introduction to the subject, so as to provide them with insight into areas of language designand implementation, rather than a deluge of theory which they will probably never use again;students who will enjoy fairly extensive case studies of translators for the sorts of languages withwhich they are most familiar; students who need to be made aware of compiler writing tools, and tocome to appreciate and know how to use them. It will hopefully also appeal to a certain class ofhobbyist who wishes to know more about how translators work.The reader is expected to have a good knowledge of programming in an imperative language and,preferably, a knowledge of data structures. The book is practically oriented, and the reader whocannot read and write code will have difficulty following quite a lot of the discussion. However, itis difficult to imagine that students taking courses in compiler construction will not have that sort ofbackground!There are several excellent books already extant in this field. What is intended to distinguish thisone from the others is that it attempts to mix theory and practice in a disciplined way, introducingthe use of attribute grammars and compiler writing tools, at the same time giving a highly practicaland pragmatic development of translators of only moderate size, yet large enough to provideconsiderable challenge in the many exercises that are suggested.OverviewThe book starts with a fairly simple overview of the translation process, of the constituent parts of acompiler, and of the concepts of porting and bootstrapping compilers. This is followed by a chapteron machine architecture and machine emulation, as later case studies make extensive use of codegeneration for emulated machines, a very common strategy in introductory courses. The nextchapter introduces the student to the notions of regular expressions, grammars, BNF and EBNF,and the value of being able to specify languages concisely and accurately.Two chapters follow that discuss simple features of assembler language, accompanied by thedevelopment of an assembler/interpreter system which allows not only for very simple assembly,but also for conditional assembly, macro-assembly, error detection, and so on. Complete code forsuch an assembler is presented in a highly modularized form, but with deliberate scope left forextensions, ranging from the trivial to the extensive.Three chapters follow on formal syntax theory, parsing, and the manual construction of scannersand parsers. The usual classifications of grammars and restric ...
Tìm kiếm theo từ khóa liên quan:
thủ thuật máy tính công nghệ thông tin tin học quản trị mạng computer networkGợi ý tài liệu liên quan:
-
52 trang 430 1 0
-
24 trang 355 1 0
-
Top 10 mẹo 'đơn giản nhưng hữu ích' trong nhiếp ảnh
11 trang 314 0 0 -
Làm việc với Read Only Domain Controllers
20 trang 303 0 0 -
74 trang 299 0 0
-
96 trang 293 0 0
-
Báo cáo thực tập thực tế: Nghiên cứu và xây dựng website bằng Wordpress
24 trang 289 0 0 -
Đồ án tốt nghiệp: Xây dựng ứng dụng di động android quản lý khách hàng cắt tóc
81 trang 281 0 0 -
EBay - Internet và câu chuyện thần kỳ: Phần 1
143 trang 275 0 0 -
Tài liệu dạy học môn Tin học trong chương trình đào tạo trình độ cao đẳng
348 trang 269 1 0