Question: a ) Give a context - free grammar for the language A of strings over { x , y } that are formed from a
a Give a contextfree grammar for the language of strings over that are formed from a sequence of s followed by a sequence of s such that there are always the same number of s as s or else one more than Examples: xxyy Is your grammar ambiguous? Why or why not?
b Give a contextfree grammar for the language of strings over that are formed from at most one occurrence of and any number of Examples: Is your grammar ambiguous? Why or why not?
c Give a contextfree grammar for the language over in which the string is a concatenation for two strings such that the first string is in from Part a and the second string is in from Part b Is your grammar ambiguous? Why or why not
d Draw all possible parse trees for the strings xxxyyy and xxyyxx using your grammar from Part c
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
