Question

1.a    Consider  the following Grammar,                               

1.a    Consider  the following Grammar,                                                            

     <assign> à   <id> = <expr>

    <id> à A | B |C

   <expr> à < expr> + <expr>

        | <expr> * <expr>

                  | ( <expr> )

                  | <id>

Derive the following statement using leftmost derivation.

  A = A * (B*(C+ A))

b.

2 a}.    Consider the following grammar that expresses parenthesized expressions of digits, including both addition and multiplication.

<expr> := <expr> + <expr> | <expr> * <expr> | (expr>) | <digit>

<digit> :=   0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

Prove that this grammar is capable of representing the following expression

3 + (4*4+(2*7))

b.    Draw the pares tree for the statement  3+(4*4+(2*7)) using the grammar presented for question 2

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
1.a    Consider  the following Grammar,                               
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