Professional Documents
Culture Documents
Student Commitment: Course Number: 311126030 Course Title: Compiler Construction Principles and Practice
Student Commitment: Course Number: 311126030 Course Title: Compiler Construction Principles and Practice
Signature:
题 号 一(20%) 二(20%) 三(20%) 四(40%)
得 分
卷面总分 教师签名 阅卷时间
注意事项:1. 请务必将本人所在学院、姓名、学号、任课教师姓名等信息准确填写在试题纸和添卷纸上;
2. 请将答案全部填写在本试题纸上;
3. 考试结束,请将试题纸、添卷纸和草稿纸一并交给监考老师。
N o ti c e : 1 . P l e a s e w r i t e y o u r s t u d e n t I D a n d y o u r n a m e i n b o t h e x a m p a p e r s a n d a d d e d a n
precisely;
2.Please write all your answers on this exam paper;
3.Aft er the exam, please hand in exam paper, added answer sheet and scratch papers to examiners all
together.
1 2 3 4
1. The scanner usually computes possibly several attributes for each token. It is often helpful
to collect all the attributes into a single structured data type. Please define such a structured
data type for a token.
1 2 3 4 5
评阅教师 得分
Part III Lexical-Directed Translations. (20 points, 10 points for each)
1 2
2. Use Thompson's construction to convert the following regular expressions into NFAs
respectively.
(1) a(a|b|c)
(2) (a|b|)*a
1 2 3
S → a S b S|a S|a