The Gateway to Computer Science Excellence
+1 vote
Consider the following grammar G shown Below :

S → abS | ScS | d | c

The number of terminals in follow set of non-terminal S is ___________________


Is “$” symbol considered terminal?
in Compiler Design by
edited by | 215 views
it is a special terminal which is not belongs to the given input alphabet !

Due to that reason only " we append it at end of input string in input Buffer " and making Follow(start Terminal) consists '$'.
So the answer should be 1 or 2? Do we have to take into account the special terminal?
i am not sure to count it or not
Yes If you look at the LL(1) parsing table, it is considered as a terminal symbol
I am not convinced, because questions some time mention terminal and non terminal explicitly but they never mention dollar as a terminal symbol. I have never seen it anywhere.
A terminal is a symbol that concludes a string expansion.
Whereas a non terminal is a variable that will be replaced by some terminal subsequently.
$ is the terminating symbol for every input string. It surely is a terminal.
it is surely a terminal, but doubt is " Is it COUNT or not "
Yes, that is the doubt.

@vinay chauhan

can you please type the question instead of screen shot ?

It was quick so I took screenshot, didn't think that discuss will go this long. Will take care next time.

1 Answer

0 votes
Answer is 2 because follow(S)={c,$)
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
52,375 questions
60,572 answers
95,388 users