Question

3 points) Question Three Consider the context-free grammar S >SS+1 SS 1a and the string aa Give a leftmost derivation for the
0 0
Add a comment Improve this question Transcribed image text
Answer #1

question 3 :

Given

SSSSS a

and the String is aa+a*

a (answer): GIve the Leftmost Derivation for the String

The following is the leftmost derivative of the String

S\RightarrowSS*

\Rightarrow SS+S*

  \RightarrowaS+S*

\Rightarrowaa+a*

b.(answer) Give the Right most derivation for the String

The rightmost derivation for the String is

S\RightarrowSS*

  \RightarrowSa*

  \RightarrowSS+a*

  \RightarrowSa+a*

  \Rightarrow aa+a*

c.(answer)Give the Phase Tree for the String

S

                                   S       S         *

                                                                                                                                                                                                            

                                                                                                                                                                                                             S S +   a

                            

                                         a     a

d(answer).

here the grammer is unambiguous, the postfix expression consists of all plus and multiply symbols i.e., addition and multiplication language.

Add a comment
Know the answer?
Add Answer to:
3 points) Question Three Consider the context-free grammar S >SS+1 SS 1a and the string aa...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT