Skip to content
Early access — you're among the first to try PYQLabs. Share feedback
Concept drill

grammar

GATE CSE & IT · Theory of Computation - Context-Free Grammars · 1987-2026

35
PYQs
97%
keyed
0
elite explanations
18
years appeared

Study anchor

Source-book anchor pending for this concept.

Practice action

Start latest PYQ

PYQs in this concept

All concepts →
2026 PYQ

Which of the following grammars is/are ambiguous?

easyanswer keybasic explanation
2025 Q1

Ravi had _______ younger brother who taught at _______ university. He was widely regarded as _______ honorable man. Select the option with the correct sequence of articles to fill...

easyanswer key
2025 Q19

Consider the following context-free grammar G, where S, A, and B are the variables (non-terminals), a and b are the terminal symbols, S is the start variable, and the rules of G ar...

mediumanswer key
2025 Q51

Consider two grammars G₁ and G₂ with the production rules given below: G₁: S → if E then S | if E then S else S | a E → b G₂: S → if E then S | M M → if E then M else S | c E → b w...

mediumanswer key
2025 PYQ

Ravi had __________ younger brother who taught at __________ university. He was widely regarded as _________ honorable man. Select the option with the correct sequence of articles...

easyanswer keybasic explanation
2024 Q38

Consider the following grammar G, with S as the start symbol. The grammar G has three incomplete productions denoted by (1), (2), and (3). S → daT | ____ (1) T → aS | bT | ____ (2)...

mediumanswer key
2024 Q65

Consider the following augmented grammar, which is to be parsed with a SLR parser. The set of terminals is {a,b,c,d,#,@} S' → S S → SS | Aa | bAc | Bc | bBa A → d# B → @ Let I₀ = C...

mediumanswer key
2024 PYQ

In the given text, the blanks are numbered (i)–(iv). Select the best match for all the blanks. Steve was advised to keep his head _____ (i) _____ before heading _____ (ii) _____ to...

mediumanswer keybasic explanation
2024 PYQ

Consider the following grammar $G$, with $S$ as the start symbol. The grammar $G$ has three incomplete productions denoted by (1), (2), and (3). $$S \rightarrow d a T \mid \underli...

mediumanswer keybasic explanation
2023 PYQ

We reached the station late, and ___________ missed the train.

easyanswer keybasic explanation
2021 PYQ

Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) actions, given as pseudo-code: P...

mediumanswer keybasic explanation
2021 PYQ

Gauri said that she can play keyboard _______ her sister.

easyanswer keybasic explanation
2021 PYQ

Consider the following sentences : (i) Everybody in the class is prepared for the exam. (ii) Babu invited Danish to his home because he enjoys playing chess, Which of the following...

easyanswer keybasic explanation
2020 PYQ

Raman is confident of speaking English _____ six months as he has been practising regularly_____the last three weeks.

easyanswer keybasic explanation
2020 PYQ

Consider the following grammar. S $$ \to $$ aSB| d B $$ \to $$ b The number of reduction steps taken by a bottom-up parser while accepting the string aaadbbb is _______.

easybasic explanation
2018 PYQ

“From where are they bringing their books? ________ bringing _______ books from _____.” The words that best fill the blanks in the above sentence are

easyanswer key
2017 Q16

Identify the language generated by the following grammar, where S is the start variable. S → XY X → aX | a Y → aYb | ε

mediumanswer key
2017 Q32

Consider the following expression grammar G: E -> E - T | T T -> T + F | F F -> (E) | id Which of the following grammars is not left recursive, but is equivalent to G?

mediumanswer key
2017 Q57

Saturn is __________ to be seen on a clear night with the naked eye.

easyanswer key
2017 PYQ

After Rajendra Chola returned from his voyage to Indonesia, he ______ to visit the temple in Thanjavur.

easyanswer keybasic explanation
2017 PYQ

Research in the workplace reveals that people work for many reasons ___________.

easyanswer keybasic explanation
2016 PYQ

Which one of the following grammars is free from $$left$$ $$recursion$$?

mediumanswer key
2016 PYQ

Language $${L_1}$$ is defined by the grammar: $$S{}_1 \to a{S_1}b|\varepsilon $$ Language $${L_2}$$ is defined by the grammar: $$S{}_2 \to ab{S_2}|\varepsilon $$ Consider the follo...

easyanswer key
2016 PYQ

Which of the following languages is generated by the given grammar? $$$S \to aS|bS|\varepsilon $$$

easyanswer keybasic explanation
2016 PYQ

Out of the following four sentences, select the most suitable sentence with respect to grammar and usage.

easyanswer key
2016 PYQ

The man who is now Municipal Commissioner worked as ____________________.

easyanswer key
2015 PYQ

Didn't you buy _________ when you went shopping?

easyanswer key
2014 PYQ

Consider the grammar defined by the following production rules, with two operators * and + $$\eqalign{ & S \to T*P \cr & T \to U\,|\,T*U \cr & P \to Q + P\,|\,Q \cr & Q \to id \cr...

easyanswer key
2010 PYQ

The grammar $$S \to aSa\,|\,\,bS\,|\,\,c$$ is

easyanswer key
2005 PYQ

The grammar $$A \to AA\,|\,\left( A \right)\,|\,\varepsilon $$ is not suitable for predictive-parsing because the grammar is

easyanswer key
2004 PYQ

Consider the following grammar $$G:$$ $$\eqalign{ & S \to bS\,\left| {\,aA\,\left| {\,b} \right.} \right. \cr & A \to bA\,\left| {\,aB} \right. \cr & B \to bB\,\left| {\,aS\,\left|...

mediumanswer key
2003 PYQ

Consider the grammar shown below. $$\eqalign{ & S \to CC \cr & C \to cC\,|\,d \cr} $$ This grammar is

easyanswer key
2000 PYQ

Let $$L$$ denote the language generated by the grammar $$S \to 0S\left. 0 \right|00.$$ Which one of the following is true?

easyanswer keybasic explanation
1997 PYQ

In the following grammar: $$\eqalign{ & X:: = X \oplus {Y \over Y} \cr & Y:: = Z*{Y \over Z} \cr & Z:: = id \cr} $$ Which of the following is true?

easyanswer key
1987 PYQ

A context-free grammar is ambiguous if:

easyanswer key