Principles of Compiler

Course Nature

Course Positioning

The Compilation Principle Course is a compulsory course for computer science and technology majors, through the description of high-level language and its grammar, lexical analysis, grammar The study of analysis, attribute grammar and grammar-guided translation, semantic analysis and intermediate code generation enables learners to master the ability to analyze, design, implement and maintain the compilation system, understand the programming language and program execution process, and improve the overall computer system Recognize.

Adapt to majors

The course of compilation principles is suitable for computer majors such as computer science and technology.

Course Introduction

There are 25 chapters in the Compiler Principles course. The first chapter introduces the structure of the compiler, the generation of the compiler and other knowledge points; the second chapter describes the high-level programming language The generality of grammar and other content; Chapter 3 introduces knowledge points such as grammar trees and ambiguity; Chapters 4 to 6 describe the design of lexical analyzers, the formalization of lexical rules, the equivalence of formal and finite automata, etc. Content; Chapters 7 to 9 introduce knowledge points such as FIRST and FOLLOW set construction, construction of recursive descent analyzers, predictive analysis table construction, etc.; Chapters 10 to 13 describe operator priority analysis algorithms, handles and canonical reductions , Living prefix, LR analysis method, etc.; Chapter 14 to Chapter 15 introduce knowledge points such as attribute calculation and recursive descent translator design; Chapter 16 to Chapter 19 describe commonly used intermediate language forms and array elements Reference translation, optimized translation Boolean expressions, attribute calculations of control statements, etc.; Chapter 20 introduces knowledge points such as the organization and operation of symbol tables; Chapters 21 to 22 describe static storage management and embedding Dynamic storage management of a set of procedural languages; Chapter 23 to Chapter 24 introduces knowledge points such as local optimization and code extraction; Chapter 25 describes unused information and active information, code generation and register allocation Algorithms and other content.

Course outline

p>

The second unit test

Chapter 14 Attribute Grammar and Grammar Guided Translation 1

14.1 Attribute Grammar

< p>14.2 Attribute Calculation

Chapter 15 Attribute Grammar and Grammar Guided Translation 2

15.1S-Attribute Grammar

15.2 L-attribute grammar

15.3 Translation Mode

15.4 Design of Recursive Descent Translator

15.5 Summary

Sixteenth Chapter Semantic Analysis and Intermediate Code Generation 1

16.1 Intermediate Language

16.2 Common Intermediate Language Forms

16.3 Summary

The third unit test

Chapter 17 Semantic Analysis and Intermediate Code Generation 2

17.1 Translation of Assignment Statements

17.2 Translation of Array Element Reference

17.3 Type Conversion

17.4 Summary

Chapter 18 Semantic Analysis and Intermediate Code Generation 3

18.1 Boolean expressions and their calculations

18.2 Translate Boolean expressions by numerical representation

18.3 Boolean expressions with optimized translation

18.4 Summary

Chapter 19 Semantic Analysis and Intermediate Code Generation 4

19.1 Commonly Used Control Statements

19.2 Control Statements Attribute Grammar

19.3 Attribute Calculation of Control Statement

p>

19.4 One-pass scanning of translation control sentences

19.5 One-pass scanning of translation control sentences example

19.6 Summary

The 4th unit test

Chapter 20 Symbol Table

20.1 Organization and Operation of Symbol Table

20.2 Contents of Symbol Table

20.3 Use the symbol table to analyze the scope of names

20.4 Summary

Chapter 21 Runtime Storage Space Organization 1

21.1 Parameter passing

21.2 Activities during runtime of the target program

21.3 Static storage management

Chapter 22 Runtime Storage Space Organization 2

b>

22.1 Overview of dynamic storage management

22.2 Dynamic storage management of non-nested procedural languages

22.3 Dynamic storage management of nested procedural languages-static chain Method

22.4 Dynamic storage management of nested procedural language-Display table method

22.5 Summary

Chapter 23 Optimization 1

23.1 Overview of optimization

23.2 Partial optimization-basic block division

23.3 Partial optimization-basic block optimization

Chapter 24 Optimization 2

24.1 Overview of loop optimization

24.2 Code outsourcing

24.3 Strength weakening

24.4 Summary

Chapter 25 Target Code Generation

25.1 Overview of Target Code Generation

25.2 Target Machine Model

25.3 Simple code generator

25.4 Standby information and active information

25.5 Variable address description and register description

25.6 Code generation and register allocation Algorithm

25.7 Summary

The fifth unit test

Chapter One Introduction

1.1 What is a compiler

1.2 Why should I learn the principles of compilation

1.3 The compilation process

1.4 The structure of the compiler

1.5 Generation of Compiler

1.6 Summary

Chapter Two Overview of Advanced Programming Language

2.1 Common Advanced Programming Language

2.2 Definition of programming language

2.3 General characteristics of high-level programming language

2.4 Summary

Third Chapter Syntax Description of Advanced Programming Language

3.1 Context-free grammar

3.2 Grammar and language

3.3 Syntax tree and ambiguity

p>

3.4 Aerial view of formal language

3.5 Summary

Chapter IV Lexical Analysis 1

4.1 Overview of Lexical Analysis< /p>

4.2 Design of Lexical Analyzer

4.3 Summary

Chapter 5 Lexical Analysis 2

5.1 Lexical Formalization of Rules-Normal Sets and Normal Forms

5.2 Deterministic Finite Automata

5.3 Non-deterministic Finite Automata

5.4 Summary

Chapter VI Lexical Analysis 3

6.1 Equivalence of Finite Automata

6.2 Equivalence of Regular Forms and Finite Automata

6.3 Automatic generation of lexical analysis program

The first unit test

Chapter Seven Syntax Analysis-Top-down Analysis 1< /p>

7.1 Basic issues of top-down analysis

7.2LL grammar—eliminate left recursion in grammar

7.3LL grammar—eliminate backtracking

7.4 The construction of FIRST and FOLLOW collections

7.5 Summary

Chapter 8 Syntax Analysis-Top-down Analysis 2

8.1 Constructing a recursive descent analyzer

8.2 Expanded Backus paradigm and syntax diagram

8.3 Introduction to JavaCC

8.4 Summary

Chapter 9 Syntax Analysis-Top-down Analysis 3

9.1 Predictive Analysis Program

9.2 The Construction of Predictive Analysis Table

< p>9.3 Summary

Chapter Ten Syntax Analysis-Bottom-up Analysis 1

10.1 Bottom-up analysis

10.2 Phrases and direct phrases

10.3 Analysis process description

10.4 Operator-first grammar

10.5 Construction Priority relationship table

10.6 Operator Priority Analysis Algorithm

10.7 Summary

Chapter 11 Syntax Analysis-Bottom-up Analysis 2< /b>

11.1 Handle and specification reduction

11.2LR analysis method

11.3 summary

Chapter 12 Syntax analysis-bottom-up analysis 3

12.1 Live Prefix

12.2 Construct a DFA that recognizes live prefix

12.3 Construct LR analysis table

12.4 Summary

Chapter 13 Syntax Analysis-Bottom-up Analysis 4

13.1SLR Analysis Method

p>

13.2LR analysis method

13.3LR analyzer generation tool

13.4 summary

(Note: the syllabus layout Arranged from left to right )

Class opening information

th>
< p>Number of classes started

Class start time

Teacher

Class hour arrangement

Number of participants p>

First start of class

October 08, 2018-January 28, 2019

Wang Ting, Tang Jintao, Huang Chun, Li Shasha, Liu Chunlin, Zhou Huiping

3-5 hours per week

10036

The second class starts

March 04, 2019-July 1, 2019

8753

The third start of class

2019 September 02-January 19, 2020

9505

The 4th class starts

February 10, 2020 Day-July 20, 2020

Wang Ting, Tang Jintao, Huang Chun, Li Shasha, Zhou Huiping

20030

5 classes start

August 31, 2020-January 25, 2021

Wang Ting, Tang Jintao, Huang Chun, Li Shasha, Liu Chunlin, Zhou Huiping

11952

The 6th class starts

March 01, 2021-July 26, 2021

13052

The seventh class starts

August 30, 2021-2022 January 24

To be determined

(Note: Table content reference material)

Teaching goals

Through the study of the compilation principle course, learners can achieve the following goals:

1. Understanding the structure, workflow and On the basis of the design principles and implementation technologies of the various components of the compiler, the preliminary ability to analyze, design, implement and maintain the compilation system is obtained.

2. Deeply understand the program language and program execution process, and improve the overall understanding of the computer system.

3. Computational thinking methods such as abstraction, automation, and recursion can be embodied in the compilation process, and it can be applied to natural language processing, program verification, network information processing and other fields for problem solving.

Preliminary study

Preliminary knowledge

The course of compiling principles requires computer programming language and programming knowledge, as well as knowledge of data structures and algorithms, computer principles, and discrete Have a certain understanding of mathematics and other knowledge.

Learning materials

Book title

th>

Author

Publication date

Press

"Program design language compilation principle"

Chen Huowang, Liu Chunlin

2000

National Defense Industry Press

《Compilers: Principles, Techniques and Tools (Second Edition)"

Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman

2006

Pearson Education

p>

(Note: Table content reference material )

Evaluation criteria h2>

Applicants can apply for a "certificate" if the evaluation of the course of compilation principles is "passed" (reached 60 points) or "excellent" (reached 85 points).

Honors Won

On November 27, 2007, the Course of Translation Principles was recognized as a "National Excellent Course" by the Ministry of Education of the People's Republic of China.

On June 28, 2016, the Course of Compilation Principles was recognized by the Ministry of Education of the People's Republic of China as the "First Batch of National Excellent Resource Sharing Courses".

In 2019, the Course of Compilation Principles was recognized by the Ministry of Education of the People’s Republic of China as a “National Excellent Online Open Course”.

On November 24, 2020, the Course of Compilation Principles was recognized by the Ministry of Education of the People’s Republic of China as "the first batch of national first-class undergraduate courses".

Teacher profile

Wang Ting is a professor at the National University of Defense Technology of the Chinese People’s Liberation Army. He is responsible for the teaching of compilation principles, introduction to artificial intelligence, and natural language processing.

Tang Jintao is an associate professor at the National University of Defense Technology of the Chinese People’s Liberation Army.

Huang Chun, a researcher at the National University of Defense Technology of the Chinese People’s Liberation Army, is engaged in the teaching and scientific research of computer system software.

Li Shasha is a lecturer in the School of Computer Science, National University of Defense Technology of the Chinese People's Liberation Army. He is engaged in teaching and research in artificial intelligence and data mining.

Liu Chunlin is a professor at the National University of Defense Technology of the Chinese People's Liberation Army. He is engaged in research work in the fields of programming language and compilation and digital library.

Zhou Huiping is an associate professor at the National University of Defense Technology of the Chinese People’s Liberation Army. He is responsible for the teaching of compiling principles, computer programming, data structure and other courses.

Related Articles
TOP