Theory of Computation and Compilers MCQ - Syntax Analysis

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

The grammar is
S → AC/CB
C → aCb/ε
A → aA/a
B → Bb/b
and number of derivation step is max(l, m) + 2
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 *

Consider the CFG with {S, A, B} as the non-terminal alphabet, {a, b} as the terminal alphabet, S as the start symbol and the following set of production rules
S → bAS → aB
A → aB → b
A → aSB → bS
A → bAAB → aBB
Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.

S → aB
→ aaBB
→ aabB
→ aabbS
→ aabbaB
→ aabbab
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 *

Consider the CFG with {S, A, B} as the non-terminal alphabet, {a, b} as the terminal alphabet, S as the start symbol and the following set of production rules
S → bAS → aB
A → aB → b
A → aSB → bS
A → bAAB → aBB
Correct AnswerOption 2
Rate difficulty Rate difficulty:
Choose a difficulty.
Share this question
Share:


two parse tree.
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 *

For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. ε is the empty string, $ indicates end of input, and | separates alternate right hand sides of productions.
 S → a A b B|b A a B|ε
 A → S
 B → S
 a        b $
S E1       E2 S → ε
A A → S    A → S error
B B → S    B → S E3
Correct AnswerOption A
Rate difficulty Rate difficulty:
Choose a difficulty.

FIRST(S) = {a, b, ε}
FIRST(A) = FIRST(S) = {a, b, ε}
FIRST(B) = FIRST(S) = {a, b, ε}
FOLLOW (A) = {b, a}
FOLLOW (S) = {$} U FOLLOW (A) = {b, a, $}
FOLLOW (B) = FOLLOW (S) = {b, a, $}
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 *

For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. ε is the empty string, $ indicates end of input, and | separates alternate right hand sides of productions.
 S → a A b B|b A a B|ε
 A → S
 B → S
 a        b $
S E1       E2 S → ε
A A → S    A → S error
B B → S    B → S E3
Correct AnswerOption C
Rate difficulty Rate difficulty:
Choose a difficulty.

E1 : M[S, a] : S → aAbB, S → ε (because first of S contain a and ε)
E2 : M[S, b] : S → bAaB, S → ε (because first of S contain b and ε)
E3 : M[b, $] : B → S (because first of B contain ε)
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 →