The Gateway to Computer Science Excellence
+1 vote
110 views

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.
in Compiler Design by (263 points) | 110 views

1 Answer

+1 vote
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
by Boss (10.6k points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,741 questions
57,232 answers
197,993 comments
104,578 users