Introduction to Programmingopenclassroom.stanford.edu/.../04-04-nfa-to-dfa.pdf · Template...
7
Alex Aiken Compilers NFA to DFA
Transcript of Introduction to Programmingopenclassroom.stanford.edu/.../04-04-nfa-to-dfa.pdf · Template...
Alex Aiken
Compilers
NFA to DFA
Alex Aiken
NFA to DFA
Regular expressions
NFA
DFA
Lexical Specification
Table-driven Implementation of DFA
Alex Aiken
NFA to DFA
1
0
1
A B C
D
E
F G H I J
Alex Aiken
NFA to DFA
• An NFA may be in many states at any time
• How many different states?
Alex Aiken
NFA to DFA
Alex Aiken
NFA to DFA
1
0 1
A B C
D
E
F G H I J
FGHIABCD
EJGHIABCD
ABCDHI 0
1
0
1 0 1
Template block2x2-1 Ordering of buttons is: 13 24
NFA to DFA
1
0
0
1
1
0
0
1
1
0
0 0
1
0
0
1
0
Choose the DFA that represents the same language as the given NFA