U2-6 RE to DFA Directly.pptx - Converting a RE Directly to a DFA Construct a syntax tree for(r Traverse the tree to construct functions nullable

# U2-6 RE to DFA Directly.pptx - Converting a RE Directly to...

• Notes
• 9

This preview shows page 1 - 4 out of 9 pages.

Slide 1 Converting a RE Directly to a DFA Construct a syntax tree for ( r ) # Traverse the tree to construct functions nullable , firstpos , lastpos , and followpos Construct DFA D by algorithm
Slide 2 Function Computed From the Syntax Tree nullable(n) The subtree at node n generates languages including the empty string firstpos(n) The set of positions that can match the first symbol of a string generated by the subtree at node n lastpos(n) The set of positions that can match the last symbol of a string generated be the subtree at node n followpos(i) The set of positions that can follow position i in the tree
Slide 3 Rules for Computing the Function Node n nullable ( n ) firstpos ( n ) lastpos ( n ) A leaf labeled by true A leaf with position i false { i } { i } n = c 1 | c 2 nullable ( c 1 ) or nullable ( c 2 ) firstpos ( c 1 ) firstpos ( c 2 ) lastpos ( c 1 ) lastpos ( c 2 ) n = c 1 c 2 nullable ( c 1 ) and nullable ( c 2 ) if ( nullable ( c 1 ) ) firstpos ( c 1 ) firstpos ( c 2 ) else firstpos ( c 1 ) if (

#### You've reached the end of your free preview.

Want to read all 9 pages?

• Winter '17
• sathya raja shekaran

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern