894 views
1 votes
1 votes

To compute FOLLOW(A) for any grammar symbol A

 

a) We must compute FIRST of some grammar symbols.

b) No need of computing FIRST of some symbols.

c) Maybe compute FIRST of some symbols.

d) None of the above.

 

The answer is given as option (A) but if we take start symbol(say S), we know that $ will definitely in FOLLOW(S) and we didn't computed FIRST of any symbol for it. So option (C) should be the answer.

1 Answer

2 votes
2 votes
lets take a grammer   S->a   so to compute follow of S no need to compute the first of any symbol because follow of S  is  $ and S is not present anywhere in the right side

now take another geammer S->SA/a , A->b  so now to compute follow of S we have to compute the first of A

so C answer is right

Related questions

4 votes
4 votes
1 answer
2
Kapil asked Dec 27, 2016
19,612 views
Consider a Grammar G as follows :$S\rightarrow W$$W \rightarrow ZXY / XY$$Y\rightarrow c/\epsilon$$Z\rightarrow a/d$$X\rightarrow Xb/\epsilon$Draw the LL(1) parsing table...
2 votes
2 votes
1 answer
3
sripo asked Nov 10, 2018
3,238 views
Can you give an example which is not LL(1) but is CLR(1)
0 votes
0 votes
1 answer
4
Rahul Ranjan 1 asked Mar 19, 2018
4,956 views
Given a grammar :$E \rightarrow E + T / T$$T \rightarrow i$Can I directly say that grammar is not $LL(1)$ because $LL(1)$ can't parse Left Recursive Grammar, without dra...