# GATE2006-58

2.5k views

Consider the following grammar:

$S\rightarrow FR$

$R\rightarrow * S\mid \varepsilon$

$F\rightarrow id$

In the predictive parser table, M, of the grammar the entries M[S,id] and M[R,\$] respectively are 1.$ \left \{ S\rightarrow FR \right \} $and$ \left \{ R\rightarrow \varepsilon \right \} $2.$ \left \{ S\rightarrow FR \right \} $and$ \left \{ \right \} $3.$ \left \{ S\rightarrow FR \right \} $and$ \left \{ R\rightarrow {*}S\right \} $4.$ \left \{ F\rightarrow id \right \} $and$ \left \{ R\rightarrow \varepsilon \right \} $edited ## 3 Answers 23 votes Best answer First$S = \{ id \}$Follow$R = \{ \$\}$

so $M[S,id] = S \rightarrow FR$
$M[S,\$] = R  \rightarrow \epsilon$So ans is A edited by 0 What is the Follow of S R F ? Please explain how to find follow in this example 7 pls correct me if wrong First Follow S id \$

R      * , ε                   \$F id *$
1
yes your first and follows are correct.
{"ft_lang_label":"__label__en","ft_lang_prob":0.5216275,"math_prob":0.99974984,"size":335,"snap":"2020-34-2020-40","text_gpt3_token_len":108,"char_repetition_ratio":0.17522658,"word_repetition_ratio":0.0,"special_character_ratio":0.34626865,"punctuation_ratio":0.125,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9999852,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-09T21:08:49Z\",\"WARC-Record-ID\":\"<urn:uuid:f68e6745-9be8-42c4-8d8b-b48ece32813b>\",\"Content-Length\":\"92669\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:3c3e89ec-1eeb-4ace-95c4-56ebbedb975c>\",\"WARC-Concurrent-To\":\"<urn:uuid:52727897-a732-4564-979c-1ce2bcda0eb1>\",\"WARC-IP-Address\":\"104.27.188.78\",\"WARC-Target-URI\":\"https://gateoverflow.in/1836/gate2006-58\",\"WARC-Payload-Digest\":\"sha1:2YOBYZM3WCQ3JOYBRECGYAILMADU5OJ2\",\"WARC-Block-Digest\":\"sha1:YH4QXEQLYVACRJJUGZPR5B7K2NCMFISK\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439738573.99_warc_CC-MAIN-20200809192123-20200809222123-00277.warc.gz\"}"}