Home Technique Compilation Principle (MOC provided by Harbin Institute of Technology)

Compilation Principle (MOC provided by Harbin Institute of Technology)



Course Nature

Course Background

World Computer Scientist Alfred V.Aho wrote in the first sentence of Chapter 1 of "Compiler": "Write Compiler The principle and technology of the computer have universal significance, so that in the research career of every computer scientist, the principle and technology in this book will be used repeatedly.” This sentence points out the principle of compilation in the course of computer science. Important position. Learners who have used high-level programming languages ​​to write programs know that when a program is input to the computer, the computer can work according to people's intentions. The machine code composed of 0 and 1 is the language that can be directly understood by the computer. Therefore, a program written in a high-level language must eventually be "translated" into a machine code composed of 0 and 1 before it can be executed on the computer. This translation process is called compilation.

Targets of adaptation

The principles of compilation are mainly aimed at college students majoring in computer science and practitioners of related technologies.

Class start information

< td width="311" height="30">

February 24, 2020 ~ July 31, 2020

Number of classes started

Starting time

Teacher

Number of participants

The first class starts

September 04, 2017 ~ December 31, 2017

Chen Yin, Guo Yong

10399

The second start of class

March 05, 2018~2018-07 31st of the month

16424

The third start of class

September 03, 2018 ~ December 31, 2018

Chen Yin, Guo Yong, Tu Zhiying, Huang Cheng

11272

The 4th class starts

td>

February 18, 2019~July 31, 2019

Chen Yin, Guo Yong 、Tu Zhiying

17757

The 5th class starts

td>

September 02, 2019~December 31, 2019

14153

The 6th class starts

< p>14168

The 7th class starts

August 31, 2020 ~ January 31, 2021

To be determined

According to the official website of China University's MOOC, the schedule for the first to the seventh start of the course is 3~5 hours per week.

Course Introduction

There are 20 lectures on compilation principles, which mainly teach the main theories and technologies of compiler design and implementation. Among them, the first lecture introduces the conceptual knowledge of compilation principles; the second and third lectures introduce the programming language and its grammar and lexical analysis content; the fourth to the 14th lectures introduce grammatical analysis (parts 1 to 4) and grammatical guided translation ( Part 1~3), intermediate code generation (parts 1~4); Lecture 15 introduces the knowledge of computer operation and storage allocation; Lectures 16 to 20 introduce the advanced content of code optimization (Parts 1 to 4) and the realization of code generation.

Course outline

< td height="30">

4-14LALR analysis method

td>< td height="30">

Lecture 2 Programming Language and Its Grammar

< td height="30">

Lecture notes of this lecture (PDF file)

< td height="30">

Lecture notes for this lecture (PPT document)

tr>< /tr> tr>< td height="30">

8-15 Deletion of Inductive Variables

tr>

Lecture 1 Introduction

6-9 backfilling of control flow statements

1-1 What is compilation

4-15 Ambiguous grammar LR analysis

Translation of 6-10switch statement

1-2 The structure of the compilation system

Lecture notes for this lecture (PPT document)

Translation of 6-11 procedure call sentences

1-3 Overview of Lexical Analysis

Error handling in 4-16LR analysis

Simulation exercises in this lecture (not counting Points)

1-4 Syntax Analysis Overview

Simulation exercises for this lecture (not scoring)

Lecture notes for this lecture (PDF file)

1-5 Overview of Semantic Analysis

Lecture notes (PDF file)

p>

Lecture 14 Quiz (Scoring)

1-6 Overview of intermediate code generation and compiler backend

[Discussion 7-1] Why merge concentric item sets does not produce shift-in-return About conflict?

Lecture notes for this lecture (PPT document)

Simulation exercises in this lecture (not scoring)

[Discussion 7-2] Why does the LALR analysis method do not make the wrong move operation?

Lecture 15 Running Storage Allocation

Lecture notes (PDF file)

Lecture 7 Quiz (scoring)

7-1 Overview of running storage allocation

【Discussion 1-1 】The relationship between the compilation process and the manual translation process

Lecture 8 Grammar Guided Translation 1

7-2 Static storage allocation

【Discussion 1-2 】The design of the NAME field in the symbol table

5-1 Overview of grammar-guided translation

7-3 Stacked storage allocation

Lecture 1 Quiz (scoring)

td>

5-2 Syntax guidance definition SDD

7-4 Call sequence and return sequence

Lecture notes (PPT document)

5-3 SDD evaluation order

7-5 Access to non-local data

5-4S-Attribute Definition and L-attribute definition

7-6 symbol table

2-1 Basic Concepts

Simulation exercises in this lecture (not scoring)

The establishment of 7-7 symbol table

2-2 Definition of Law

Lecture notes of this lecture (PDF file)

This Talk about simulation exercises (not scored)

2-3 definition of language

[Discussion 8-1] How to represent semantic information?

Lecture notes for this lecture (PDF file)

2-4 Classification of grammar

[Discussion 8-2] How to calculate semantic attributes?

[Discussion 15-1] How to construct an access chain based on the symbol table?

Analysis tree of 2-5CFG

[Discussion 8-3] How to determine whether an attribute is a comprehensive attribute or an inherited attribute?

[Discussion 15-2] How to access non-local data based on the symbol table?

Simulation exercises for this lecture (not scoring)

[Discussion 8-4] What kind of SDD can guarantee the order in which its attributes are calculated?

Lecture 15 Quiz (Scoring)

Lecture notes of this lecture (PDF document)

Lecture notes of this lecture (PPT document)

Lecture notes for this lecture (PPT document)

[Discussion 2-1] Yes in the computer How to express language?

[Discussion 8-5] Why can S-SDD and L-SDD guarantee the existence of attribute calculation order?

Lesson 16 Code Optimization 1

[Discussion 2-2] Can each type of word be regarded as a language?

Lecture 8 Quiz (scoring)

Lecture notes (PPT document)

Lecture 2 Quiz (scoring)

Lecture 9 Grammar Guided Translation 2

8-1 Flow Chart

< /td>

Lecture notes for this lecture (PPT document)

This lecture Course notes (PPT document)

8-2 Commonly used code optimization methods (1)

Lesson 3 Lexical Analysis

5-5 Grammar Guided Translation Project SDT

8-3 Commonly used code optimization methods (2)

3-1 regular expression

5-6 translation in the process of non-recursive predictive analysis

< /td>

8-4 Optimization of basic blocks

3-2 Regular definition

Simulation exercises for this lecture (not scoring)

This Talk about simulation exercises (not scored)

3-3 finite automata

Lecture notes of this lecture (PDF file)

< /td>

Classification of 3-4 finite automata

【 Discussion 9-1] Why can the SDT of S-SDD be implemented at the same time in the process of syntactic analysis?

Lecture 16 Quiz (scoring)

3-5 From regular expressions to finite automata

[Discussion 9-2] Extension of non-recursive predictive analyzer

Lecture 17 Code Optimization 2

3-6 Conversion from NFA to DFA

Lecture 9 Quiz (Scoring)

3-7 Word recognition DFA

Lecture 10 Grammar Guided Translation 3

8-5 data flow analysis

This lecture is a simulation exercise (not scored)

td>

Lecture notes for this lecture (PPT document)

8-6 Arrival Definite Value Analysis

Lecture notes (PDF file)

5-7 Translate in the process of recursive predictive analysis

8-7 Calculation of reaching fixed value equation

Lesson 3 Quiz (scoring)

5-8L-attribute defined Bottom-up translation

Simulation exercises for this lecture (not scoring)

Lecture notes (PPT document)

Simulation exercises for this lecture (not scored)

td>

Lecture notes for this lecture (PDF file)

< p>Lecture 4 Syntax Analysis 1

Lecture Notes (PDF file)

Lesson 17 Quiz (Scoring)

4-1 from the top Downward analysis overview

[Discussion 10-1] Extension of the recursive predictive analyzer

Lesson 18 Code Optimization 3

4-2 Grammar Conversion p>

[Discussion 10-2] Modification of grammar and translation plan

This lecture Course notes (PPT document)

4-3LL(1) Grammar

Lesson 10 Quiz (Scoring)

8-8 Active Variable Analysis

Simulation exercises for this lecture (not scoring)

No. 11 Talk about intermediate code generation 1

8-9 available expression analysis

Lecture notes for this lecture (PDF file)

6-1 type expression

td>

Simulation exercises for this lecture (not scoring)

4- 4 Calculation of FIRST set and FOLLOW set

6-2 Translation of statement sentences

< p>Lecture notes (PDF document)

Lecture notes (PPT document)

td>

Simulation exercises for this lecture (not scoring)

Lecture 18 Quiz (Scoring)

Lecture 4 Quiz (Scoring)

< /td>

Lecture notes for this lecture (PDF document)

Lecture 19: Code Optimization 4

Lecture 5 Syntax Analysis 2

[Discussion 11-1] How to calculate the type expression and width of an array?

Lecture notes for this lecture (PPT document)

4-5 Recursive Predictive Analysis Method

Lecture 11 Quiz (scoring)

8-10 Domination Nodes and Back Edges

4-6 Non-recursive predictive analysis Method

This lecture course handout (PPT document)

8-11 Natural circulation and its recognition

4-7 Error handling in predictive analysis

Lesson 12 Intermediate code generation 2

8-12 Delete global common sub-expressions And copy sentences

This lecture is a simulation exercise (not scored)

6-3 translation of simple assignment sentences

8-13 code movement

Lecture notes for this lecture (PDF document)

6-4 Translation of array references

8-14 The weakening of the intensity acting on the inductive change

Lesson 5 Quiz (scoring)

Simulation exercises for this lecture (not scoring)

Lecture notes for this lecture (PPT document )

Lecture notes of this lecture (PDF file)

Simulation of this lecture Practice questions (not scored)

Lecture 6: Grammatical Analysis 3

[Discussion 12-1] Translation of array element addressing

Lecture notes (PDF document)

Lecture notes (PPT document)

Lecture 12 Quiz (Scoring)

Lecture 19 Quiz (Scoring) )

4-8 bottom-up analysis overview

Lecture notes (PPT document)

Lecture 20 Code Generation

Overview of 4-9LR analysis method

Lecture 13 Intermediate code generation 3

Lecture notes for this lecture (PPT document)

4-10LR(0) analysis

Lecture notes for this lecture (PPT document)

< /td>

The main tasks of the 9-1 code generator

4 -11LR (0) analysis table construction algorithm

6-5 control flow statement and its SDT

9-2 A simple target machine model

Simulation exercises for this lecture (not scored)

6-6 Boolean expression and its SDT

9-3 Command selection

Lecture notes (PDF file)

6-7 control flow translation example

9-4 register selection Choose

[Discussion 6-1] The relationship between push-down automata and finite automata

Simulation exercises for this lecture (not scoring)

9-5 register selection function getReg Design

[Discussion 6-2] The relationship between the status information and the grammar symbol information in the LR grammar analysis stack< /p>

Lecture notes for this lecture (PDF file)

9-6 peephole Optimization

Lecture 6 Quiz (scoring)

Lesson 13 Quiz (scoring)

Simulation exercises for this lecture (not scoring)

Lecture 7 Syntax Analysis 4

Lecture 14 Intermediate Code Generation 4

Lecture notes (PDF document)

4-12SLR analysis

Backfilling of 6-8 Boolean expressions

Lecture 20 Quiz (Scoring)

4 -13LR (1) analysis

(Note: the syllabus layout is from left to right column)

Pre-class preparation

Preliminary knowledge

Before learning the principles of compilation, you need to prepare advanced programming languages, data structures, collections and Professional knowledge such as graph theory.

Learning materials

The learning materials of the principles of compilation include "Principles of Compilation (2nd Edition): Undergraduate Teaching Edition" and "Principles of Compilation".

< td width="261" height="30">

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

Book title

< p>Author

ISBN

< p>Publication time

Publisher

"Principles of Compilation (Second Edition): Undergraduate Teaching Edition"

(US ) Alfred V.Aho

9787111269298

2009

Machinery Industry Press

Alfred V. Aho etc.

------

td>

2006

Pearson Education, Inc p>

"Compilation Principles"

Jiang Zongli et al.

9787040290585

2010

Higher Education Press

Table content reference materials

Honors won

In 2018, the compilation principle was approved by the People’s Republic of China Recognized by the Ministry of Education as "National Excellent Online Open Course".

Teacher profile

Chen Yin, female, associate professor and master tutor of the Department of Computing, Harbin Institute of Technology.

Guo Yong, male, lecturer at Harbin Institute of Technology.

Tu Zhiying, male, Han nationality, born in 1983, doctor of engineering, associate professor and master tutor of the School of Computer Science and Technology, Harbin Institute of Technology (Weihai).

This article is from the network, does not represent the position of this station. Please indicate the origin of reprint
TOP