Grammars A-What is the fundamental question of computer science? B - What is the identity element for the addition opera
Posted: Sat May 14, 2022 7:18 pm
Grammars A-What is the fundamental question of computer science? B - What is the identity element for the addition operation on integers? What is the identity element for the OR operation on Booleans? C-Derive the following string with the grammar of Figure 7.2 and draw the corresponding syntax tree: d D - Derive the following string with the grammar of Figure 7.3: aabbcc
Figure 7.2 = N = {I, F, M} T = {+,-,d} P = the productions 1.1 FM 2. F + 3. F. 4. F E 5.MdM 6.M → S = I
= а - N = {A,B,C} T= {a,b,c} P= the productions 1. A aABC 2. A → abc 3. CB > BC 4. bB → bb 5. bC + bc 6. CC5 cc S = A
Figure 7.2 = N = {I, F, M} T = {+,-,d} P = the productions 1.1 FM 2. F + 3. F. 4. F E 5.MdM 6.M → S = I
= а - N = {A,B,C} T= {a,b,c} P= the productions 1. A aABC 2. A → abc 3. CB > BC 4. bB → bb 5. bC + bc 6. CC5 cc S = A