编译原理编译原理编译原理 (18).ppt
《编译原理编译原理编译原理 (18).ppt》由会员分享,可在线阅读,更多相关《编译原理编译原理编译原理 (18).ppt(9页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、compiler1Chapter 2Scanning From Regular Expression to DFAcompilerS2From Regular Expression to DFARegular expressionNFADFAProgramcompilerS3From a Regular Expression to NFAThe construction we will describe is know as Thompsons construction.It uses-transitions to“glue together”the machines of each piec
2、e of a regular pilerS4Basic Regular ExpressionaacompilerS5ConcatenationClearly,this machine accepts L(rs)=L(r)L(s)and corresponds to the regular expression rsrrsNFA for a regular expression rsNFA for a regular expression sNFA for a regular expression rscompilerS6Choice among AlternativesWe added a n
3、ew start state and a new accepting state using-transitions.This machine accepts L(r|s)=L(r)L(s).rscompilerS7RepetitionThis machine corresponds to r*.r compilerS8Example 2.12Translate the regular expression ab|a into a NFA.ababaabcompilerS9Example 2.13letter(letter|digit)*letterdigitletterdigitletter
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 编译原理编译原理编译原理 18 编译 原理 18
限制150内