清华大学:《编译原理》课程教学资源_(英文译文)Chapter 2.4 From Regular Expression To DFAs

COMPILER CONSTRUCTION Principles and practice Kenneth C. Louden
COMPILER CONSTRUCTION Principles and Practice Kenneth C. Louden

2. Scanning Lexical Analysis) PART TWO
2. Scanning (Lexical Analysis) PART TWO

Contents PART ONE 2. 1 The Scanning Process 2.2 Regular Expression 2.3 Finite automata PART TWO 2. 4 From Regular expressions to dFas Open 2.5 Implementation of a TINY Scanner Open 2.6 Use of Lex to Generate a Scanner Automatically Openl
Contents PART ONE 2.1 The Scanning Process 2.2 Regular Expression 2.3 Finite Automata PART TWO 2.4 From Regular Expressions to DFAs [Open] 2.5 Implementation of a TINY Scanner [Open] 2.6 Use of Lex to Generate a Scanner Automatically [Open]

2. 4 From Regular expression To DFAS
2.4 From Regular Expression To DFAs

Main purpose Study an algorithm Translating a regular expression into a dfa via NFA Regular NFA DFA Program Expression
Main Purpose • Study an algorithm: – Translating a regular expression into a DFA via NFA. Regular Expression NFA DFA Program

Contents From a regular expression to an NFA more From an nfa to a dfa more Simulating an NFA using Subset Construction ore Minimizing the number of states in a dFa more
Contents • From a Regular Expression to an NFA [More] • From an NFA to a DFA [More] • Simulating an NFA using Subset Construction [More] • Minimizing the Number of States in a DFA [More]

2.4.1 From a Regular expression to an nfa
2.4.1 From a Regular Expression to an NFA

The Idea of Thompson’s Construction Use£- transitions to"glue together" the machine of each piece of a regular expression to form a machine that corresponds to the whole expression Basic regular expression The NFAs for basic regular expression of the form a, c, or (p
The Idea of Thompson’s Construction • Use ε-transitions – to “glue together” the machine of each piece of a regular expression – to form a machine that corresponds to the whole expression • Basic regular expression – The NFAs for basic regular expression of the form a, ε,or φ a

The Idea of Thompson’s Construction Concatenation: to construct an nfa equal to rs To connect the accepting state of the machine of r to the start state of the machine of s by ane-transition The start state of the machine of r as its start state and the accepting state of the machine of s as its accepting state This machine accepts L(rs)=l(rl(s)and so corresponds to the regular expression rs
The Idea of Thompson’s Construction • Concatenation: to construct an NFA equal to rs – To connect the accepting state of the machine of r to the start state of the machine of s by anε-transition. – The start state of the machine of r as its start state and the accepting state of the machine of s as its accepting state. – This machine accepts L(rs) = L(r)L(s) and so corresponds to the regular expression rs. … r … s

The Idea of Thompson’s Construction Choice among alternatives: To construct an nfa equal to rIs To add a new start state and a new accepting state and connected them as shown usinge-transitions Clearly, this machine accepts the language L(rs FL(TUL (s), and so corresponds to the regular expression rls
The Idea of Thompson’s Construction • Choice among alternatives: To construct an NFA equal to r | s – To add a new start state and a new accepting state and connected them as shown usingε-transitions. – Clearly, this machine accepts the language L(r|s) =L(r )UL ( s), and so corresponds to the regular expression r|s. … r … s
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 2.1 The Scanning Process.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 3.1 The Parsing Process.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 6.3 The Symbol Table.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 6.1 Attributes and AttributeGrammars.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 7.4 Dynamic Memory.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 7.1 Memory Organization During Program Execution.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 1.1 Why? A Brief History.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 4.1 Top-Down Parsing byRecursive-Descent.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 4.1 Top-Down Parsing by Recursive-Descent.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 5.3 SLR(1)Parsing.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 5.1 Overview of Bottom-UpParsing.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 8.6 Code Generation in Commercial Compilers:Two Case Studies.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 8.1 Intermediate Code and Data.ppt
- 清华大学:《编译原理》课程教学资源_(英文译文)Chapter 8 Code Generation.ppt
- 《NFS报文分析》讲义.doc
- 华中科技大学:《IT项目管理》(本科)(英文版)What makes a good manager.doc
- 华中科技大学:《IT项目管理》(本科)(英文版)Ten attributes of a good employee.doc
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:9 Project Procurement Management.ppt
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:8 Project Risk Management.ppt
- 华中科技大学:《IT项目管理》(本科)(英文版)Topic:7 Project Communication Management.ppt
- 《多媒体技术》课程教学资源(PPT课件讲稿).ppt
- 《JAVA基础实例200题》Java例题(一).pdf
- 《JAVA基础实例200题》Java例题(二).pdf
- 《JAVA基础实例200题》Java例题(三).pdf
- 《JAVA基础实例200题》Java例题(四).pdf
- 《JAVA基础实例200题》Java例题(五).pdf
- 《JAVA基础实例200题》练习题.pdf
- 长江大学:《微型计算机技术及应用课件》第一章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第七章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第三章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第九章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第二章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第五章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第八章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第六章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第十章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第四章习题答案(李华贵).doc
- 长江大学:《微型计算机技术及应用课件》第10章 模数转换(李华贵).ppt
- 长江大学:《微型计算机技术及应用课件》第11章 总线与接口标准(李华贵).ppt
- 长江大学:《微型计算机技术及应用课件》第1章 微型计算机概述(李华贵).ppt