
QuickReview
sourcecodepartsofspeechwords
Scanner
code
specificationsScannerand
Generatortables
Previousclass:
→ Thescanneristhefirststageinthefrontend
→ Specificationscanbeexpressedusingregularexpressions
→ BuildtablesandcodefromaDFA
Goal
• Wewillshowhowtoconstructafinitestateautomatonto
recognizeanyRE
• ThisLecture
→ ConvertREtoannondeterministicfiniteautomaton(NFA)
Requiresε-transitionstocombineregularsubexpressions
→ ConvertanNFAtoadeterministicfiniteautomaton(DFA)
UseSubsetconstruction
NextLecture
→ Minimizethenumberofstates
Hopcroftstateminimizationalgorithm
→ Generatethescannercode
Additionalcodecanbeinserted
MoreRegularExpressions
• Allstringsof1sand0sendingina1
(0|1)*1
• Allstringsoverlowercaseletterswherethevowels(a,e,i,o,u)
occurexactlyonce,inascendingorder
Cons→(b|c|d|f|g|h|j|k|l|m|n|p|q|r|s|t|v|)
******
ConsaConseConsiConsoConsuCons
• Allstringsof1sand0sthatdonotcontainthree0sinarow:
MoreRegularExpressions
• Allstringsof1sand0sendingina1
(0|1)*1
• Allstringsoverlowercaseletterswherethevowels(a,e,i,o,u)
occurexactlyonce,inascendingorder
Cons→(b|c|d|f|g|h|j|k|l|m|n|p|q|r|s|t|v|)
******
ConsaConseConsiConsoConsuCons
• Allstringsof1sand0sthatdonotcontainthree0sinarow:
***
免费下载链接
飞猫云链接地址:https://jmj.cc/s/98wsjj
压缩包解压密码:res.99hah.com_4PLiUu8Wtu
下载方法:如果您不是飞猫云会员,请在下载页面滚动到最下方,点击“非会员下载”,网页跳转后再次滚动到最下方,点击“非会员下载”。
解压软件:Bandizip
- 打开飞猫云链接地址的页面,拖动到最下方,找到“非会员下载”的按钮并点击
- 此时,如果没登录,可能会提醒您注册帐号,随便注册一个帐号并登录
- 再在新打开的下载页面,再次拖动到最下方,找到“网页端 非会员下载”的按钮并点击。
版权声明:本文为转载文章,版权归原作者所有,转载请保留出处!