Theory of Computation and Compilers MCQ - Syntax Analysis

Correct AnswerOption B
Rate difficulty Rate difficulty:
Choose a difficulty.

An LALR(1) parser for a grammar G can have shift reduce S – R conflict if and only if the LR(1) parser for G has S – R conflicts.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.
Share this question
Share:

t is LL(1) and LR(1)
because in S → aSa
S → bS
S → c

no mult iple ent r ies for 1 iteration, so it is LL(1) grammer mean by LR(1) that it is Left shift
Reduced grammer and so it is also LR(1).
Hence it is both LL(1) and LR(1)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption B
Rate difficulty Rate difficulty:
Choose a difficulty.

As per given question, a grammar with no epsilon and unit -production (i.e., of type A → ε and A → a).
So To Reduce input string of n tokens, first Reduce n – 2 tokens using n – 2 reduce moves and then Reduce last 2 tokens using production which has. So total of n – 2 + 1 = n – 1 Reduce moves
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.

(1) false, as merging has been done because lookahead were different.
(2) false, Shift-Reduce conflict never occur at the time of merging.
(3) false, In the merged set, we can’t see any Reduce-Reduce conflict (no reduction even possible, so no chances of R-R conflict )
(4) false, because goto is carried on Non-Terminals symbols, not on terminal symbols, and c is a terminal symbol.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Correct AnswerOption D
Rate difficulty Rate difficulty:
Choose a difficulty.


Form above diagram, we can see that there is no shift -reduce or reduce-reduce conflict .
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *

Why Practice with Avatto?
High Quality MCQsExam-focused questions with accurate answers
Detailed ExplanationsStep-by-step explanations to enhance learning
Latest Exam PatternBased on updated syllabus and pattern
Performance AnalyticsTrack performance and improve weak areas
100% Free PracticePractice unlimited questions for free
Boost Your PreparationAttempt mock tests, previous year papers and topic-wise quizzes.Explore All Tests →