Question: Lecture 1 4 , Exercises for Section 6 . 2 What language is generated by the following CFG ? S aSb | x x c
Lecture Exercises for Section
What language is generated by the following CFG
aSb
aYb
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.
Modify the grammar below to add rules for subtraction division
bitwiseor and bitwiseand & 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 bitwiseor to distinguish it
from the normal alternation symbol.
Draw a derivation tree using your answer in the previous exercise for the string
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 # except write the expression in prefix notation.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
