编译原理》实验教学大纲

课程代码

045100293

课程名称

编译原理

英文名称

Principlesof Compilers

课程类别

学科基础课

课程性质

必修

学时

总学时:56,上机学时:16

学分

3.0

开课学期

第四学期,第三学期

开课单位

计算机科学与工程学院

适用专业

计算机科学与技术,网络工程,信息安全

授课语言

中文授课

先修课程

计算机科学概论、高级程序设计语言

毕业要求(专业培养能力)

本课程对学生达到如下毕业要求有如下贡献:

1.(思政建设)实现计算机专业知识教学与立德树人教育的有机融合;激发学生“实干兴邦”的爱国奋斗精神。

2.(工程知识)培养学生熟练掌握英语,掌握扎实的计算机科学与技术专业基本原理、方法和手段等方面的基础知识用于解决复杂工程问题,并通过计算机系统分析、建模和计算等方面的先进方法,为将所学基础知识应用到计算机科学与技术研发和工程实践做好准备。

3.(问题分析)培养学生能够创造性地利用计算机科学基本原理解决计算机领域遇到的问题。

4.(设计/开发解决方案)能够设计针对计算机工程复杂问题的解决方案,设计满足特定需求的计算机软硬件系统,并能够在设计环节中体现创新意识,考虑社会、健康、安全、法律、文化以及环境等因素。

5.(研究)培养学生具备计算机系统相关知识并对计算机工程复杂问题进行研究,具有计算机系统研发基本能力、具备问题分析和建模的能力,具有系统级的认知能力和实践能力,掌握自底向上和自顶向下的问题分析方法。

6.(使用现代工具)能够针对计算机工程复杂问题,开发、选择与使用恰当的技术、资源、现代工程工具和信息技术工具。

课程培养学生的能力(教学目标)

完成课程后,学生将具备以下能力:

1)掌握编译器构造的基本原理和实现技术,具有设计、构造、分析和维护编译程序的能力[46

2)掌握将编译器构造的技术和方法应用于解决其他计算机领域的相关问题。[45

3)掌握计算机学科中解决问题的思路、抽象问题和解决问题的方法,具备计算机综合应用的能力,掌握计算思维的方法[45

课程简介

本课程介绍将高级语言源程序翻译成低级语言目标程序的基本原理、方法和技术。课程主要内容包括:编译程序概述,词法分析,上下文无关文法和语法分析,自上而下的语法分析方法,自底向上的语法分析方法,语义分析,目标程序运行时的存储组织,以及代码生成。使学生掌握编译器构造的基本原理和方法,并能将编译器的构造中蕴含的计算机科学中解决问题的思路和方法,应用于一般软件的设计和构造中。

主要仪器设备与软件

PC机,Eclipse

实验报告

1)实验目的

2)实验步骤

3)实验结果

4)总结与思考

考核方式

主要考查程序功能的完备性和实验报告的规范性。实验完成后,提交程序和实验报告。成绩占课程总成绩的30%

教材、实验指导书及教学参考书目

现用教材:《编译原理》,吕映芝,张素琴,蒋维杜等著,清华大学出版社,2015

主要参考资料:

JAlfredV.Aho, Ravi Sethi, Jeffrey D.Ullman著《编译原理技术与工具》(英文版),机械工业出版社,2012

制定人及发布时间

董敏,20194

编译原理》实验教学内容与学时分配

实验项目编号

实验项目名称

实验学时

实验内容提要

实验类型

实验要求

每组人数

主要仪器设备与软件

1

实验一:词法分析程序(4学时)

4

  1. 实验目的:通过为已有的样例语言SAMPLE语言构造词法分析程序,从而掌握词法分析程序的构造方法

  2. 实验内容:了解样例语言SAMPLE语言,用高级程序设计语言(CC++JAVA等语言)构造SAMPLE语言的词法分析程序。


综合性

必做

1

PC机,Eclipse,VisualStudio

2

实验二:语法分析程序(6学时)

6

  1. 实验目的:通过对已有的样例语言SAMPLE语言,构造语法分析程序,从而掌握语法分析程序的构造方法

  2. 实验内容:用自上而下语法分析方法或自下而上的语法分析方法,构造SAMPLE语言的递归下降语法分析器或预测分析器。

  3. 实验要求:将TOKEN序列转换成语法分析树,并能检查一定的语法错误


综合性

必做

1

PC机,Eclipse,VisualStudio

3

实验三:语义分析程序及中间代码生成(6学时)

6

  1. 实验目的:构造SAMPLE语言的语义分析程序并生成中间代码

  2. 实验内容:构造符号表,用高级程序设计语言构造SAMPLE语言的语义分析器,生成中间代码

  3. 实验要求:能检查一定的语义错误,将SAMPLE语言转换成三地址中间代码

设计性

必做

1

PC机,Eclipse,VisualStudio





Principlesof CompilersSyllabus

Course Code

045100293

CourseTitle

Principlesof Compilers

CourseCategory

Specialty Basic Courses

CourseNature

Compulsory Course

Class Hours

Total:56hours, ComputerPractice:16hours

Credits

3.0

Semester

Thefourth semesterThethird semester

Institute

Schoolof computer science and engineering

ProgramOriented

Computer Science and Technology,network engineering, information safety

TeachingLanguage

English

Prerequisites

None

StudentOutcomes (Special Training Ability)

This course can behelpful for students to get the following abilities:

1.Ideological andpolitical construction: realize the organic integration ofcomputer professional knowledge teaching and moraleducation;Inspire the students' patriotic spirit of "makingthe country prosperous by doing".

2.EngineeringKnowledge: An ability to apply knowledge of English, solidknowledge of professional basic principles, methods and means ofcomputer science and technology for solving complex engineeringproblems, to well prepare the required knowledge applied to thecomputer science and technology research & development andengineering practice through computer systems analysis, modelingand calculation and any other aspects of the advanced approach.

3.Problem Analysis:An ability to creatively use the basic principles of computerscience to solve the problems encountered in the computer field.

4.Design /Development Solutions: An ability to design solutions for computerengineering complex problems, to design computer hardware andsoftware systems that meet with specific requirements, and toembody innovation awareness in the design process and take intoaccount social, health, safety, cultural and environmentalfactors.

5.Research: Anability to develop computer system-related knowledge and researchcomputer engineering complex issues, to develop the basic capacityof computer systems research & development, systematiccognitive and practice, master the Bottom-up and top-down problemanalysis methods.

6.Applying Modern Tools: An abilityto develop, select and use appropriate technologies, resources,modern engineering tools and information technology tools forcomplex computer engineering issues.

TeachingObjectives

Upon completion ofthis course, each student should be able to:

  1. Understandthe theoretical foundation of compiler principles. Knowthe basic organization and operation of compilers.

Knowhow to build a compiler for a simplified programming language.[4,6]

  1. Applythe principles and techniques of compiler construction tosoftware design and practice. [4,5]

Learnhow to work on a large software project. Have the ability ofcomputational thinking. [4,5]

CourseDescription

This course introduces thefundamental principles of compiler construction and the basictechniques of realization. It covers lexical analysis, syntaxanalysis, semantic analysis, runtime environments, codegeneration, and optimization.

Instrumentsand Equipments

Personalcomputer; Eclipse

ExperimentReport

(1 ) the purpose of the experiment

(2 ) experimental steps

(3 ) experimental results

(4 ) summary and thinking

Assessment

Thecompleteness of the programand the standardization of the experimental report. After theexperiment is complete, submit the program and the experimentalreport. Results accounted for 30percentof the total curriculum.

TeachingMaterials and Reference Books

Y.Daniel Liang, Introduction to Java Programming, 10th Edition, 2017

BruceEckel, Thinking in Java(4thedition), China MachinePress,2009.

Preparedby Whom and When

DongMin, 2019.4

Principlesof CompilersExperimentalTeaching Arrangements

No.

ExperimentItem

ClassHours

ContentSummary

Category

Requirements

Numberof StudentsEach Group

Instruments,Equipments and Software

1

Lexical Analysis (4Periods)


4

Designthe lexical Analysis of SAMPLE language. The results will be aseries of TOKEN. Lexical errors should be checked out.

Comprehensive

Compulsory

1

PersonalComputer; Eclipse,Visual Studio

2

Syntax directed translation (12 Periods)

6

Syntaxanalysis of SAMPLE language.

Syntaxerrors should be checked out.


Comprehensive

Compulsory

1

PersonalComputer; Eclipse,Visual Studio

3

Intermediatecode generation

6

Intermediatecode generation

Comprehensive

Compulsory

1

PersonalComputer; Eclipse,Visual Studio