Question: Lecture 1 4 , Exercises for Section 6 . 2 What language is generated by the following CFG ? S aSb | x x c

Lecture 14, Exercises for Section 6.2
What language is generated by the following CFG?
SaSb|x
xcxd|cYd
YaYb|ab
Derive the string aacabdbb using the grammar in the previous exercise.
Draw the derivation tree for the derivation in the previous exercise.
Show that the following grammar for balanced parentheses is ambiguous.
SSS|(S)|
Modify the grammar below to add rules for subtraction (-), division (/),
bitwise-or (|) and bitwise-and ( & ). The bitwise operations have the same
precedence and are the lowest precedence operators. Subtraction is the same
precedence as addition, and division is the same precedence as multiplication.
You may want to put quotes around the "|" for the bitwise-or to distinguish it
from the normal alternation symbol.
EE+M|M
MM**R|R
R(E)|a|b|c
Draw a derivation tree using your answer in the previous exercise for the string
a|bb&c**(a-c). Make sure the last operation to execute at runtime is
the first operator that appears at the top of the tree.
Draw the expression tree for your derivation tree in the previous problem.
Using your result from the previous problem, write the expression in postfix
notation.
Repeat #8, except write the expression in prefix notation.
 Lecture 14, Exercises for Section 6.2 What language is generated by

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!