Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (a) Consider the following grammar: E + E+TE-TT T + T F T/FF F (E) | id Why is this grammar not LL? Give

image text in transcribed

1. (a) Consider the following grammar: E + E+TE-TT T + T F T/FF F (E) | id Why is this grammar not LL? Give a rightmost derivation and parse tree for the following expression: 7-8* (3 + 2) / 4 + 11 Note that all the numbers are ids, as in class, and I'm asking for BOTH the derivation and the parse tree (which are not always identical). (b) Now consider an equivalent LL grammar: E T T' F + TE + +TE' -TE' + FT' *FT' /FT' E + (E) id Give a leftmost derivation and parse tree for the same expression: 7-8 * (3 + 2) / 4 + 11 Again, note that all the numbers are ids, as in class, and I'm asking for BOTH the derivation and the parse tree (which are not always identical)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions