- 1、本文档共11页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
编译原本科试卷A
姓名 学号
姓名 学号 学院 班级 座位号
( 密 封 线 内 不 答 题 )
……………………………………………………密………………………………………………封………………………………………线……………………………………线………………………………………
_____________ ________
…
华南理工大学期末考试
《 编译原理 》试卷A
注意事项:1. 考前请将密封线内填写清楚;
2. 所有答案请直接答在试卷上;
3.考试形式:闭卷;
4. 本试卷共 大题,满分100分, 考试时间120分钟。
题 号
一
二
三
四
五
总分
得 分
评卷人
Note: Whether English or Chinese doesn’t impact your score.
Fill in the blanks (18%)
a. Normally, A complier consists of a number of phases. They are Scanner Grammar parser, ____Semantic analyzer_____, ___Source Code Optimizer___, Code Generator, and __target code optimizer _________________.
b. The logical units the scanner generates are called Tokens. For a modern programming language, there are five types of token. They are __Identifier__, _______Reserved Words________, _____Number_____________, ____________________, ________________.
c. Based on the following C source code fragment
int gets(char *s)
int gets(char *s)
{
if (s == NULL)
{
printf(“illegal point parameter \n”);
return -1;
}
return 0;
}
Please answer:
a) “int” is a ___________________
b) “printf” is a _________________
c) “s” is a (an) _________________
d) “= =” is a ____________________
e) “0” is a _____________________
d. A grammar G usually includes four components, they are _______________, __________________, _______________, and _____________________.
(Terms Translation, 12%)Please give a brief explanation to the following terms in compiler science domain
Compiler ——
Source code ——
Scanner ——
Tokens ——
Terminal symbol ——
Ambiguous Grammar ——
(Scanning; 20%)
(a) (10%) Construct an NFA that recognizes the same language as defined by the following regular expression:
(a*ba*b)*ba*
(b) (10%) Using the subset construction, convert the NFA into a DFA.
a
b
A={0,1,2,5}
B
C
B={2}
B
D
C={3,6, 7,8}
E
F
D={3}
D
F
E={3,7, 8}
E
F
F={1,2,4,5}
B
C
4. (LL parsing; 25%) Consider the followi
您可能关注的文档
- 系统的试与运行.doc
- 红外光信装置(F题).doc
- 系统显语言更改为简体中文的方法.doc
- 索尼大好?你未必知道的索尼黑科技历史!.doc
- 红利计软件的应用技巧(二).doc
- 系统光镜像下载大合集.doc
- 红外遥信号的解码.doc
- 红外解1602显示键码16进制值.doc
- 红米手程序装在外置SD卡EXT2分区详细教程和软件.doc
- 红外遥电风扇.doc
- 2024年江西省寻乌县九上数学开学复习检测模拟试题【含答案】.doc
- 2024年江西省省宜春市袁州区数学九上开学学业水平测试模拟试题【含答案】.doc
- 《GB/T 44275.2-2024工业自动化系统与集成 开放技术字典及其在主数据中的应用 第2部分:术语》.pdf
- 中国国家标准 GB/T 44275.2-2024工业自动化系统与集成 开放技术字典及其在主数据中的应用 第2部分:术语.pdf
- GB/T 44285.1-2024卡及身份识别安全设备 通过移动设备进行身份管理的构件 第1部分:移动电子身份系统的通用系统架构.pdf
- 《GB/T 44285.1-2024卡及身份识别安全设备 通过移动设备进行身份管理的构件 第1部分:移动电子身份系统的通用系统架构》.pdf
- 中国国家标准 GB/T 44285.1-2024卡及身份识别安全设备 通过移动设备进行身份管理的构件 第1部分:移动电子身份系统的通用系统架构.pdf
- GB/T 44275.11-2024工业自动化系统与集成 开放技术字典及其在主数据中的应用 第11部分:术语制定指南.pdf
- 中国国家标准 GB/T 44275.11-2024工业自动化系统与集成 开放技术字典及其在主数据中的应用 第11部分:术语制定指南.pdf
- 《GB/T 44275.11-2024工业自动化系统与集成 开放技术字典及其在主数据中的应用 第11部分:术语制定指南》.pdf
文档评论(0)