{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ps3 - (e What are the predict sets for each production(f...

This preview shows pages 1–2. Sign up to view the full content.

ECE 468 Problem Set 3: Regular expressions, Finite Automata, Context-free Grammars, Parsers 1. Give the reduced DFA for the following regular expression: (( a * bcd ) | ( bc * d )) 2. For the following sub-problems, consider the following context-free grammar: S AB (1) A xAC (2) A λ (3) B CBy (4) B λ (5) C z (6) (a) What are the terminals and non-terminals of this language? (b) Describe the strings are generated by this language. Is this a regular language ( i.e. , could you write a regular expression that generates this language)? (c) Show the derivation of the string xxzzzy starting from S (specify which produc- tion you used at each step), and give the parse tree according to that derivation. (d) Give the first and follow sets for each of the non-terminals of the grammar.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (e) What are the predict sets for each production? (f) Give the parse table for the grammar. Is this an LL(1) grammar? Why or why not? 3. for the following sub-problems, consider the following grammar: S → AB (7) A → xA (8) A → xyB (9) B → zB (10) B → w (11) (12) (a) Describe the strings generated by this language. (b) Is this language LL(1)? Why or why not? (c) Build the CFSM for this grammar. 1 (d) Build the goto and action tables for this grammar. Is it an LR(0) grammar? Why or why not? (e) If we add the production A → y to the grammar, is it an LR(0) grammar? Why or why not? 2...
View Full Document

{[ snackBarMessage ]}

### 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