GATE CS 2016, set 1 · Question 56 · Compiler Design · Multiple choice (MCQ) · 2 marks · −2/3 for a wrong answer
Consider the following Syntax Directed Translation Scheme (SDTS), with non-terminals {S, A} and terminals {a, b}.
S, →, aA, { print 1 }; S, →, a, { print 2 }; A, →, Sb, { print 3 }
Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:
- (A) 1 3 2
- (B) 2 2 3
- (C) 2 3 1
- (D) syntax error
Answer
Answer (C)
Answer from the official GATE CS 2016 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes