Question: (5+5=10 points) Write a regular expression to denote the set of all strings of letters that contain the five vowels in order. Assume that letters
- (5+5=10 points) Write a regular expression to denote the set of all strings of letters that contain the five vowels in order. Assume that letters can only be lower case. Then, re-state the regular expression in terms of a context free grammar.
- (5 points) What language does this grammar generate?
where epsilon is the empty symbol, a terminal.
3. (10 points) The following grammar for if-then-else is proposed to remedy the dangling else ambiguity:
Show that this grammar is still ambiguous.
4. (10 points) Consider the language given by Strings of 0s and 1s of the form xx, i.e., consisting of sentences such as 0000, 0101, 11, 010010, and so on. Is this language regular? (i.e., can it be defined by a regular expression?) If yes, give a regular expression. If no, state why not.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
