Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider the grammar shown below S → i ... Start Learning for Free
Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively are
  • a)
    {S' → e S} and {S' → e}
  • b)
    {S' → e S} and {}
  • c)
    {S' → ε} and {S' → ε}
  • d)
    {S' → e S, S'→ ε} and {S' → ε}
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Consider the grammar shown below S → i E t S S' | a S' &...
Here representing the parsing table as M[ X , Y], where X represents rows(Non terminals) and Y represents columns(terminals). Here are the rules to fill the parsing table. For each distinct production rule A->α, of the grammar, we need to apply the given rules:
Rule 1: if A –> α is a production, for each terminal ‘a’ in FIRST(α), add A–>α to M[ A , a]
 Rule 2 : if ‘ ε ‘ is in FIRST(α), add A –> α to M [A , b] for each ‘b’ in FOLLOW(A). As Entries have been asked corresponding to Non-Terminal S', hence we only need to consider its productions to get the answer. For S' → eS, according to rule 1, this production rule should be placed at the entry M[ S', FIRST(eS)], and from the given grammar, FIRST(eS) ={e}, hence S'->eS is placed in the parsing table at entry M[S' , e]. Similarly, For S'->ε, as FIRST(ε) = {ε}, hence rule 2 should be applied, therefore, this production rule should be placed in the parsing table at entry M[S',FOLLOW(S')], and FOLLOW(S') = FOLLOW(S) = {e, $}, hence R->ε is placed at entry M[S', e] and M[S' , $]. Therefore Answer is option D. Visit the Following links to Learn how to find First and Follow sets.
View all questions of this test
Most Upvoted Answer
Consider the grammar shown below S → i E t S S' | a S' &...
Explanation:



This is a grammar for which we have to find the predictive parse table. Predictive parsing is a top-down parsing technique that uses a look-ahead symbol to predict which production rule to use to derive the string. The predictive parse table is a table that stores the production rules based on the current non-terminal symbol and the input symbol.



The given grammar is:



S → i E t S S | a S e S | E b



We have to find the entries M[S, e] and M[S, $] in the predictive parse table M.



Solution:

  • M[S, e]: This entry represents the production rule to be used when the current symbol is S and the input symbol is e.


    • The production rules that derive S are:


      1. S → i E t S S

      2. S → a S e S


    • Since e is the input symbol, we need to consider the second production rule as it has e in it.

    • So, M[S, e] = S → a S e S


  • M[S, $]: This entry represents the production rule to be used when the current symbol is S and the input symbol is $.


    • The production rules that derive S are:


      1. S → i E t S S

      2. S → a S e S

      3. S → E b


    • Since $ is the input symbol, we cannot use any of the above production rules as none of them derive $.

    • So, M[S, $] = {S → ε} (where ε is the empty string)


  • Therefore, the correct option is (D) {S → e S, S → ε}

Free Test
Community Answer
Consider the grammar shown below S → i E t S S' | a S' &...
C
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Question Description
Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively area){S' → e S} and {S' → e}b){S' → e S} and {}c){S' → ε} and {S' → ε}d){S' → e S, S'→ ε} and {S' → ε}Correct answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively area){S' → e S} and {S' → e}b){S' → e S} and {}c){S' → ε} and {S' → ε}d){S' → e S, S'→ ε} and {S' → ε}Correct answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2025 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively area){S' → e S} and {S' → e}b){S' → e S} and {}c){S' → ε} and {S' → ε}d){S' → e S, S'→ ε} and {S' → ε}Correct answer is option 'D'. Can you explain this answer?.
Solutions for Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively area){S' → e S} and {S' → e}b){S' → e S} and {}c){S' → ε} and {S' → ε}d){S' → e S, S'→ ε} and {S' → ε}Correct answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively area){S' → e S} and {S' → e}b){S' → e S} and {}c){S' → ε} and {S' → ε}d){S' → e S, S'→ ε} and {S' → ε}Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively area){S' → e S} and {S' → e}b){S' → e S} and {}c){S' → ε} and {S' → ε}d){S' → e S, S'→ ε} and {S' → ε}Correct answer is option 'D'. Can you explain this answer?, a detailed solution for Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively area){S' → e S} and {S' → e}b){S' → e S} and {}c){S' → ε} and {S' → ε}d){S' → e S, S'→ ε} and {S' → ε}Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively area){S' → e S} and {S' → e}b){S' → e S} and {}c){S' → ε} and {S' → ε}d){S' → e S, S'→ ε} and {S' → ε}Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the grammar shown below S → i E t S S' | a S' → e S | ε E → b In the predictive parse table. M, of this grammar, the entries M[S', e] and M[S', $] respectively area){S' → e S} and {S' → e}b){S' → e S} and {}c){S' → ε} and {S' → ε}d){S' → e S, S'→ ε} and {S' → ε}Correct answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev