Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer all the questions Consider the following grammar. S AcB . A Aa I c

ID: 3727934 • Letter: P

Question

Please answer all the questions

Consider the following grammar. S AcB . A Aa I caa , B bB | , calculate First(S) O a b. (a) d. All of the answers above are incorrect Consider the following grammar: S AcB , A Aa l caa , B bB | , calculate First(A) a. (a) b. (c) c. (bj d. All of the answers above are incorrect Consider the following grammar: S aAbB | Bc , A aAa l a , B Bb | Ab | cc | AC , C c , calculate First(C) a. (a] c. (a, c) d. All of the answers above are incorrect Consider the following grammar: S A-B), A B I a) , B aB I a , calculate Follow(S) a. "S) d. All of the answers above are incorrect

Explanation / Answer

Question 1: FIRST(S) = {c}

First(S) means finding the starting terminal symbol for S.
S -> AcB
So, First(A) is now First(S)
A -> Aa | caa
First(A) is c. So, First(S) = c

Question 2: FIRST(A) = {c}
Explanation is given above

Question 3: FIRST(C) = {c}
C -> c
So, first(c) is just c

Question 4: FOLLOW(S) = {$}
Follow(S) means finding what comes after S. S is the starting part of Grammar. So, we don't have anything as follow for S