grammar
GATE CSE & IT · Theory of Computation - Context-Free Grammars · 1987-2026
Study anchor
Source-book anchor pending for this concept.
Practice action
Start latest PYQPYQs in this concept
All concepts →Which of the following grammars is/are ambiguous?
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...
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...
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...
Ravi had __________ younger brother who taught at __________ university. He was widely regarded as _________ honorable man. Select the option with the correct sequence of articles...
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)...
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...
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...
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...
We reached the station late, and ___________ missed the train.
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...
Gauri said that she can play keyboard _______ her sister.
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...
Raman is confident of speaking English _____ six months as he has been practising regularly_____the last three weeks.
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 _______.
“From where are they bringing their books? ________ bringing _______ books from _____.” The words that best fill the blanks in the above sentence are
Identify the language generated by the following grammar, where S is the start variable. S → XY X → aX | a Y → aYb | ε
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?
Saturn is __________ to be seen on a clear night with the naked eye.
After Rajendra Chola returned from his voyage to Indonesia, he ______ to visit the temple in Thanjavur.
Research in the workplace reveals that people work for many reasons ___________.
Which one of the following grammars is free from $$left$$ $$recursion$$?
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...
Which of the following languages is generated by the given grammar? $$$S \to aS|bS|\varepsilon $$$
Out of the following four sentences, select the most suitable sentence with respect to grammar and usage.
The man who is now Municipal Commissioner worked as ____________________.
Didn't you buy _________ when you went shopping?
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...
The grammar $$S \to aSa\,|\,\,bS\,|\,\,c$$ is
The grammar $$A \to AA\,|\,\left( A \right)\,|\,\varepsilon $$ is not suitable for predictive-parsing because the grammar is
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|...
Consider the grammar shown below. $$\eqalign{ & S \to CC \cr & C \to cC\,|\,d \cr} $$ This grammar is
Let $$L$$ denote the language generated by the grammar $$S \to 0S\left. 0 \right|00.$$ Which one of the following is true?
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?
A context-free grammar is ambiguous if: