Compiler Principles and Solutions to Exercises

Author: He Yanxiang
Publisher:
Publish Date: 2004-07-01
Features: Compilers are important system software in computers and the foundation supporting high-level programming languages. The book consists of 14 chapters, introducing topics such as formal languages, solution analysis, top-down syntax analysis, and storage organization and management. Chapter 1 discusses the functions, structure, working process, organizational methods, the relationship between compilers and high-level languages, and basic knowledge of compiler automation. Chapter 2 introduces language theory, providing a formal language theory that is easy to understand and helpful for studying various analysis methods and design techniques for compilers, with a focus on context-free methods. Finite automata are effective tools for describing syntax and the main theoretical foundation for lexical analysis. Therefore, Chapter 3 is dedicated to finite automata, covering their correspondence with regular expressions, determinization, and minimization, while omitting topics like Turing machines and computability theory. Chapter 4 discusses the functions of lexical analysis and the design methods for lexical analysis programs. Context-free methods can be used to describe the syntax of most modern high-level programming languages and are the main theoretical support for syntax analysis. For this reason, the following chapters focus on various syntax analysis methods related to context-free methods. Chapter 5 introduces top-down syntax analysis. Chapter 6 discusses the general principles of bottom-up syntax analysis and priority analysis methods, including simple priority analysis techniques and operator priority analysis methods. Chapter 7 is dedicated to bottom-up syntax analysis. Chapter 8 introduces syntax-directed translation methods, primarily discussing the basic principles of SDTS, attribute translation methods, and their applications in intermediate code generation. Chapter 9 discusses runtime storage organization and management, considering some important language features. Chapter 10 discusses the organization of symbol tables and various methods for accessing symbol tables. Chapter 11 introduces commonly used optimization methods. Chapter 12 briefly discusses the principles of code generation. Chapters 13 and 14, respectively, introduce the lexical analyzer generator LEX and the syntax analyzer generator YACC, facilitating teaching practice and course design.

📌 Related Posts