CSCI 3136 Principles of Programming Languages
Lexical Analysis and Automata Theory - 4
Summer 2013 Faculty of Computer Science Dalhousie University
1 / 11
CSCI 3136 Principles of Programming Languages Lexical Analysis and - - PowerPoint PPT Presentation
CSCI 3136 Principles of Programming Languages Lexical Analysis and Automata Theory - 4 Summer 2013 Faculty of Computer Science Dalhousie University 1 / 11 Regular Expression to NFA (Example) d ( . d | d . )d . d d
1 / 11
2 / 11
3 / 11
{1} {2, 3, 4, 5, 8, 9} {6} {7, 11, 12, 14} {6, 10, 11, 12, 14} {7, 11, 12, 13, 14} {12, 13, 14} d . . d d d d d d
4 / 11
◮ If p is final and q is not, or vice versa,
◮ For each pair of states (p,q) and each symbol a in the
◮ If DISTINCT(p,q) is empty and DISTINCT( δ(p, a), δ(q, a) )
5 / 11
6 / 11
◮ L = anbn, (n)n (parenthesis languages) ◮ L ={set of all syntactically valid C programs} ◮ L ={ap: where p is a prime number} ◮ . . .
7 / 11
8 / 11
9 / 11
10 / 11
11 / 11