Consider the following context-free grammar: S → TT | U T → 0T | T0 | # U → 0U00 | # a. Give a parse tree for the string: 0#0#0 b. Give a leftmost derivation for the string: 00#0000
Solution:
Given grammar,
S -> TT | U
T -> 0T | T0 | #
U -> 0U00 | #
Explanation:
I have explained each and every part with the help of image attached to the answer above.
Get Answers For Free
Most questions answered within 1 hours.