Parsing: GATE CS Previous Year Questions

Parsing · Compiler Design

58 questions · asked in 25 of 27 years (2000–2026)

MCQ 46 · MSQ 5 · NAT 71-mark 39 · 2-mark 19

2000Questions per year2026

Questions 1–5 of 58

Q1GATE 2026 (Session 1)1 markMSQ
Consider the following C statements:

char *str1 = "Hello; /* Statement S1 */
char *str2 = "Hello;"; /* Statement S2 */
int *str3 = "Hello"; /* Statement S3 */

Which of the following options is/are correct?

One or more options are correct.

Q2GATE 2026 (Session 1)1 markMSQ
Which of the following statements is/are true?

One or more options are correct.

Q3GATE 2026 (Session 2)1 markMSQ
Which of the following grammars is/are ambiguous?

One or more options are correct.

Q4GATE 2026 (Session 2)2 marksMCQ−0.67 if wrong
Consider the canonical LR(0)L R(0) parsing of the grammar below using terminals {a,b,c}\{a, b, c\} and non-terminals {A,B,C,S}\{A, B, C, S\} with SS as the start symbol.

S→ACBA→aA∣ϵC→cC∣ϵB→bB∣b\begin{array}{l} S \rightarrow A C B \\ A \rightarrow a A \mid \epsilon \\ C \rightarrow c C \mid \epsilon \\ B \rightarrow b B \mid b \end{array}

Which one of the following options gives the number of shift-reduce conflicts that will occur in the LR(0)L R(0) ACTION table?

Q5GATE 2025 (Session 1)2 marksMSQ
Which of the following statement(s) is/are TRUE while computing FirstFirst and FollowFollow during top-down parsing by a compiler?

One or more options are correct.

Keep practising

Topics in Compiler Design

All CS topics ›