May 23, 2012 ... Data Structure and Algorithms”. Textbook. 《Compiler Construction Principles and
Practice》,Kenneth C. Louden, China Machine Press,. 2005.8 ...
College of Software Engineering
Undergraduate Course Syllabus Course ID
311004030
Course Name
Compiler Principles
Course □Compulsory Attribute
Selective
Credit Hour
Course Language
3
Semester
Instructors Instructors
Period
Chinese
□English
48
□First Fall
□First Spring
□Second Fall
□Second Spring
Third Fall
□Third Spring
□Fourth Fall
□Fourth Spring
Qiuhui Yang, Zhonghua Yu
Background: Background:
Compiler Principles is an important course for Computer Science students. It is necessary for source programs in advanced language to be compiled before they can run. The main content of this course is to study the principles and techniques of a compiler. Through the study, students can know how to complete a compiler, the programming ability of students can be improved. Contents: Contents: The course introduces the whole contents of a compiler, includes six parts: 1.The background and concepts of a compiler; 2. The principles and implementation of lexical analysis; 3. The Description
principles and implementation of top-down syntax analysis; 4. The principles and implementation of bottom-up syntax analysis; 5. The concepts of semantic analysis; 6. The concepts of runtime environment. Goal
Let students know the basic principles and structure of a compiler, master the basic principles and techniques of each phases of a compiler. The important parts are lexical analysis and syntax analysis. Require
Attend course, complete homework.
Prerequisites
Textbook
“Advanced Language Programming” “ Data Structure and Algorithms” 《Compiler Construction Principles and Practice》,Kenneth C. Louden, China Machine Press, 2005.8
(1)Compiler Principles, Alfred V.Aho, etc. Li Jianzhong, China Machine Press, 2004.8 (2)Modern Compiler Implementation in C, Andrew W.Appel, 人民邮电出版社, 2005.9 (3)Compilers, Alfred V.Aho, Zhao Jianhua, China Machine Press, 2009.1
Resource
(4)Compiler Principles and Practice, Feng Boqin, China Machine Press, 2002.6 (5)Compiler Principles, Chen Huowang, 国防工业出版社, 2001.2 (6)Compiler Principles, Lv Yingzhi, Tsinghua University Press
Grading
Peacetime (30%), final exam (70%)
1. INTRODUCTION
5hrs
1.1 Why Compilers? A Brief History 1.2 Programs Related to Compilers *1.3 The Translation Process *1.4 Major Data Structures in a Compiler 1.5 Other Issues in Compiler Structure 1.7 The TINY Sample Language and Compiler
2. SCANNING
9 hrs
2.1 The Scanning Process *2.2 Regular Expression *2.3 Finite Automata *2.4 From Regular Expressions to DFAs 2.5 Implementation of a TINY Scanner 2.6 Use of Lex to Generate a Scanner Automatically
3. CONTEXT-FREE GRMMARS AND PARSING Topics
7 hrs
3.1 The Parsing Process *3.2 Context-Free Grammars *3.3 Parse Trees and Abstract Syntax Trees *3.4 Ambiguity *3.5 Extended Notations: EBNF and Syntax Diagrams 3.6 Formal Properties of Context-Free Languages 3.7 Syntax of the TINY Language
4. TOP-DOWN PARSING
9 hrs
*4.1 Top-Down Parsing by Recursive-Descent *4.2 LL(1) Parsing *4.3 First and Follow Sets 4.4 A Recursive-Descent Parser for the TINY Language
5. BOTTOM-UP PARSING
12 hrs
5.1 Overview of Bottom-Up Parsing *5.2 Finite Automata of LR(0) Items and LR(0) Parsing *5.3 SLR(1) Parsing *5.4 General LR(1) and LALR(1) Parsing 5.5 Yacc: An LALR(1) Parser Generator 2
5.6 Generation of a TINY Parser Using Yacc
6. SEMANTIC ANALYSIS
3 hrs
*6.1 Attributes and Attribute Grammars 6.2 Algorithms for Attribute Computation *6.3 The Symbol Table
7. RUNTIME ENVIRONMENT
3 hrs
*7.1 Memory Organization During Program Execution 7.2 Fully Static Runtime Environments *7.3 Stack-Based Runtime Environments
* indicates this part is the important and difficult part. Tools & None Environment Projects
None
3