Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

19. (p. 124 - 125) Which of the following grammars is NOT ambiguous? a. E->E+E E->E*E E->(E) E->id b. E->E+T T ->T*FF F->(E) | id

image text in transcribed

image text in transcribed

image text in transcribed

19. (p. 124 - 125) Which of the following grammars is NOT ambiguous? a. E->E+E E->E*E E->(E) E->id b. E->E+T T ->T*FF F->(E) | id C. E->E A E (E) | id A-> + * d. E->E+E | E*E (E) | id 23. (p. 196) Consider the grammar shown in Figure 23.1, a sentential form in the grammar shown in Figure 23.2, and a parse tree of the sentence in Figure 23.3. How many phrases are shown in the parse tree? 1 1 1 1 ttf f (e) f ID Figure 23.1 e+tID Figure 23.2 Figure 23.3 duo 24. Find the FIRST sets for the grammar shown below. +++ E E T T T F F TE + +TE + E + FT + *FT + E + (E) + id Figure 24 + Nonterminal Nonterminal FIRST set {T} {+,; {F} FIRST set {(id) {+,} {l,id} {(id) {(,id} Figure 24 a. Nonterminal Figure 24 b. Nonterminal FIRST set FIRST set {(id) TE'} IT') {(,id) " 7 {T} {),id) F {id} Figure 24 c. Figure 24 d. 19. (p. 124 - 125) Which of the following grammars is NOT ambiguous? a. E->E+E E->E*E E->(E) E->id b. E->E+T T ->T*FF F->(E) | id C. E->E A E (E) | id A-> + * d. E->E+E | E*E (E) | id 23. (p. 196) Consider the grammar shown in Figure 23.1, a sentential form in the grammar shown in Figure 23.2, and a parse tree of the sentence in Figure 23.3. How many phrases are shown in the parse tree? 1 1 1 1 ttf f (e) f ID Figure 23.1 e+tID Figure 23.2 Figure 23.3 duo 24. Find the FIRST sets for the grammar shown below. +++ E E T T T F F TE + +TE + E + FT + *FT + E + (E) + id Figure 24 + Nonterminal Nonterminal FIRST set {T} {+,; {F} FIRST set {(id) {+,} {l,id} {(id) {(,id} Figure 24 a. Nonterminal Figure 24 b. Nonterminal FIRST set FIRST set {(id) TE'} IT') {(,id) " 7 {T} {),id) F {id} Figure 24 c. Figure 24 d

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

Step: 3

blur-text-image

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

Identify the three parties to a surety bond.

Answered: 1 week ago