没有合适的资源?快使用搜索试试~ 我知道了~
编译课件 名师 东北师范大学
需积分: 0 3 下载量 93 浏览量
2009-05-16
16:36:30
上传
评论
收藏 327KB PPT 举报
温馨提示
试读
29页
编译 课件 东北师范大学 郑晓娟 编译课件 名师 东北师范大学
资源详情
资源评论
资源推荐
Software College of Northeast Normal University
Compiler Construction Principles & Implementation Techniques
-1-
Compiler Construction Principles &
Implementation Techniques
Dr. Zheng Xiaojuan
Associate Professor
Software College of Northeast Normal University
March. 2009
Software College of Northeast Normal University
Compiler Construction Principles & Implementation Techniques
-2-
What were introduced in Last
Lecture
•
Application of DFA
•
Formal Definition of NFA
•
Differences between NFA & DFA
•
From NFA to DFA
•
Minimizing DFA
Software College of Northeast Normal University
Compiler Construction Principles & Implementation Techniques
-3-
Simple Example
S
0
a
S1
S4
*
b
d
S3
*
S2
d
a b d
S
0
S1 S2 ⊥
S1 ⊥ ⊥ S3
*
S2 ⊥ ⊥ S4
*
S3
*
⊥ ⊥ ⊥
S4
*
⊥ ⊥ ⊥
Software College of Northeast Normal University
Compiler Construction Principles & Implementation Techniques
-4-
Summary of Homework
•
(1) Define data structure for Token
–
Be familiar with Data Structure
–
Be familiar with what a token is composed of;
Struct Token {TkType type;
char sema[40];}
enum TkType {ID, Num,
if, else, while, int, real, ……
colon, comma, semi, ……}
Software College of Northeast Normal University
Compiler Construction Principles & Implementation Techniques
-5-
Summary of Homework
•
(2) Find out token types of C programming language, and
give their DFA definition.
–
Token Type: identifier, keywords, constant, special symbols;
–
How to deal with keyword?
•
Keywords are part of identifier --- do not need to define a separate DFA
for keywords;
•
Establish keyword table;
•
Whenever an identifier is recognized, search for the keyword table at first
to decide whether the identifier is a keyword;
–
DFA definition for each token type
•
Know how is a token of the token type is structured;
•
Lexical rules
剩余28页未读,继续阅读
shinan007
- 粉丝: 1
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 海尔H42E10 6i981BTA DH1PY600000 MBOOT usb.bin 程序.zip
- 网盘的功能实现之数据库搭建笔记
- 软件工程与软件测试阶段作业三.doc
- 软件工程中的人工智能辅助设计研究.pptx
- 海尔智能电视刷机数据 H42E07 机编DH1QR000H07 务必确认机编一致 强制刷机 整机USB升级主程序
- 4444444444444444444
- 基于PHP实现响应式创业园区管委会网站.zip
- 安卓手机用作电脑网络摄像头的工具文件
- 海尔智能电视刷机数据 H32E10 机编DH1QX000805 务必确认机编一致 强制刷机 整机USB升级主程序
- ComfyUI AI老照片修复上色工作流
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0