The Gateway to Computer Science Excellence
+1 vote
103 views
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 Active (1.2k points)
edited by | 103 views
0
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 '$'.
0
So the answer should be 1 or 2? Do we have to take into account the special terminal?
0
i am not sure to count it or not
0
Yes If you look at the LL(1) parsing table, it is considered as a terminal symbol
0
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.
+1
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.
0
it is surely a terminal, but doubt is " Is it COUNT or not "
0
Yes, that is the doubt.
0

@vinay chauhan

can you please type the question instead of screen shot ?

0
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,$)
by (195 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,647 questions
56,508 answers
195,533 comments
100,972 users