Theory of Computation and Compilers MCQ - Syntax Analysis

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

2nd production is
T → T * U (left recursive) so * is left associative.
Similarly
P → Q + P (Right recursion) so + is right associative.
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.
Found this useful?
Follow:

The match are as follows
Lexical analysis – DFA minimization
Parsing – Production Tree
Register allocation – Graph coloring
expression evaluation – Post order traversal
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.

FOLLOW(Q) = {w, y}
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.

left recursion: A → Aα/β
After removing left recursion it can be written as
A → βA’
A' → αA'/ε
So apply above rule for Variable E and T resultant grammar is
E → TX
X → – TX|ε
T → FY
Y → +FY|ε
F → (E) → id
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.

With look ahead, we would prefer to shift because the look ahead has higher precedence than X over + and both operation are left associative. So expression 3 x 2 + 1 = 6 + 1 = 7 will be evaluated.
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 →