in Compiler Design
3,402 views
0 votes
0 votes
S -> AS | b

A -> SA | a

Find First and Follow set for folowing grammar
in Compiler Design
3.4k views

2 Answers

2 votes
2 votes
First (s)=a,b

First (A)=a,b

Follow (s)=$,a,b

Follow (A)=a,b
0 votes
0 votes
  First Follow
S->AS | b a, b a, b, $
A->SA | a a, b a,b,$

Few observations: 

Follow of Starting symbol always contains $ since, input is followed by $ and 

if Start symbol is present in RHS of any production then follow of that production also contains $. 

1 comment

How Follow of A contain $
0
0