《编译原理》实验教学大纲
《编译原理》实验教学内容与学时分配
实验项目编号 | 实验项目名称 | 实验学时 | 实验内容提要 | 实验类型 | 实验要求 | 每组人数 | 主要仪器设备与软件 |
搭建实验虚拟环境,熟悉COOL程序设计语言 | 4 |
| 设计性 | 必做 | 1 | PC机:硬件:PIII500以上;操作系统:WindowsXP,Windows8,Windows10 编程语言:C,C++ | |
构造COOL语言的词法分析器 | 4 | 使用词法分析器的自动生成器flex,构造COOL语言的词法分析器
| 设计性 | 必做 | 1 | PC机:硬件:PIII500以上;操作系统:Windows8,Windows10 VirtualBox 6或以上 | |
构造COOL语言的语法分析器 | 4 | 用词法分析器的自动生成器,bison,构造COOL语言的词法分析器
| 设计性 | 必做 | 1 | PC机:硬件:PIII500以上;操作系统:Windows8,Windows10 VirtualBox 6或以上 | |
构造COOL语言语法分析器的输出,抽象语法树 | 4 | 构造COOL语言语法分析器的输出,抽象语法树
| 设计性 | 必做 | 1 | PC机:硬件:PIII500以上;操作系统:Windows8,Windows10 VirtualBox 6或以上 |
“Principlesof Compiler” Experiment Syllabus
Course Code | 045100293 |
Course Title | Principles ofCompiler |
Course Category | Elective Courses |
Course Nature | Elective Course |
Class Hours | Class Hours: 48, ExperimentHours:16, Other:16 |
Credits | 2.5 |
Semester | The Fourth Semester |
Institute | School ofComputer Science & Engineering, Laboratory of ComputerTeaching |
Program Oriented | Computer Scienceand Technology Full English Creative Class, Computer Science andTechnology Full English Union Class |
Teaching Language | English |
Prerequisites | AdvancedLanguage Programmer, Data Structure, Computer Organization andArchitecture |
Student Outcomes (SpecialTraining Ability) | 1.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. 2.ProblemAnalysis: An ability to creatively use the basic principles ofcomputer science to solve the problems encountered in the computerfield. 3.Design/ Development Solutions: An ability to design solutions forcomputer engineering complex problems, to design computer hardwareand software systems that meet with specific requirements, and toembody innovation awareness in the design process and take intoaccount social, health, safety, cultural and environmentalfactors. 4.Research:An ability to develop computer system-related knowledge andresearch computer engineering complex issues, to develop the basiccapacity of computer systems research & development,systematic cognitive and practice, master the Bottom-up andtop-down problem analysis methods. 5.ApplyingModern Tools: An ability to develop, select and use appropriatetechnologies, resources, modern engineering tools and informationtechnology tools for complex computer engineering issues. |
Teaching Objectives | 1.Through the construction of a compiler, students will reallyappreciate the theory, apply the important algorithms for eachstep in the compilation process and understand how all the partsof a compiler fit together. [3,4,5] 2.Understanding the basic techniques of compiler construction,especially the construction of scanner, parser, semantic analyzerand intermediate code generator. [3,4] 3.Familiar with the source language to be compiled, including itslexical, syntax and semantic regulation. Design the structure ofcompiler basing on the source language and the properties thecompiler wants to have. Determine the operations done by each passof compiling. [3,4] 4. Develop thecode for each phase of the compiler using the important algorithmsdesigned for scanning, parsing, semantic analyzing and codegenerating. [3,5] |
Course Description | Experimentof compiler construction is an important part of the coursePrinciples of Compiler. It plays a key role in helping students tounderstand the underlying theory and training students’abilities to programming an actual compiler. Students are asked todo a compiler project for designing and implementing a compilerfor a small language. Having traced through and implemented thevarious phases of compilation, you will gain a clear understandingof how a compiler works. You will learn standard techniques thatcan be applied to a variety of compilation problems. Exposure toprogramming language implementation will strengthen yourdevelopment and debugging skills and generally aid yourunderstanding of language and programming issues. |
Instruments and Equipments | PC:Hardware: PIII500 or above; Operating System:Windows8,Windows10 VirtualBox 6 orabove |
Experiment Report | Yes |
Assessment | Sourcecodes and reports must be submitted for the experiment. Gradingwill be based on both the quality of report and the organizationand correctness of the source codes. Theoverall grade of the experiment will be assigned using thefollowing weights: 40%:experiment is completed and submitted before the due date. Programwritten works correctly; 30%:quality of the experiment report; 30%:organization and correctness of the submitted code。 |
Teaching Materials andReference Books | NoTextbook for the experiments Instructionfor the experiments is provide by MOOC: AlexAiken, Compilers, Stanford Online Lagunita,https://lagunita.stanford.edu/courses/Engineering/Compilers/Fall2014/about |
Prepared by Whomand When | Xinxin Liu, 8thApril, 2019 |
“Principlesof Compiler” ExperimentalTeaching Arrangements
No. | ExperimentItem | Class Hours | ContentSummary | Category | Requirements | Number ofStudentsEach Group | Instruments,Equipments and Software |
1 | Getting started with thevirtual machine and COOL programming language. | 4 |
| Design | Compulsory | 1 | PC:Hardware: PIII500 or above; Operating System:Windows8,Windows10 VirtualBox 6 or above |
2 | Writea lexical analyzer of COOL programming language | 4 | Usinga lexical analyzer generator, flex, to build the COOL lexicalanalyzer
Returninga token Recordingthe value of a lexeme Reportingan error when an error is encountered | Design | Compulsory | 1 | PC:Hardware: PIII500 or above; Operating System:Windows8,Windows10 VirtualBox 6 or above |
3 | Writea parser for COOL programming language | 4 | Usinga parser generator, bison, to build the COOL parser
| Design | Compulsory | 1 | PC:Hardware: PIII500 or above; Operating System:Windows8,Windows10 VirtualBox 6 or above |
4 | Generate the output of theparser, that is an abstract syntax tree(AST) | 4 | Buildthe output of the parser, that is an abstract syntax tree(AST)
| Design | Compulsory | 1 | PC:Hardware: PIII500 or above; Operating System:Windows8,Windows10 VirtualBox 6 or above |