Identify the language generated by the following grammar, where S is start variable. S XY X aX|a Y aYb|
GATE CSE · Theory Of Computation
Master topic for Context Free Grammar. Includes Context-Free Grammars (CFG), Normal Forms (CNF & GNF).
44 questions · 20 PYQs · 0 AI practice · GATE CSE 2027
Identify the language generated by the following grammar, where S is start variable. S XY X aX|a Y aYb|
Consider the following statements about the context free grammar I. G is ambiguous II. G produces all strings with equal number of a's and b's III. G can be accepted by a deterministic PDA. Which combination below expresses all the true statements about G?
Which one of the following grammars is free from left recursion?
Consider the following context-free grammars: G1: S aS|B, B b|bB G2: S aA|bB, A aA|B| , B bB| Which one of the following pair of languages is generated by G1 and G2, respectively?
Which of the following languages is generated by the given grammar?
A CFG G is given with the following productions where S is the start symbol, A is a non-terminal and a and b are terminals.
For the string "aabbaab" how many steps are required to derive the string and how many parse trees are there?
Consider a CFG with the following productions. S is the start symbol, A and B are non-terminals and 0 and 1 are the terminals. The language generated by this grammar is:
Which of the following statements are true? I. Every left-recursive grammar can be converted to a right-recursive grammar and vice-versa II. All -productions can be removed from any context-free grammar by suitable transformations III. The language generated by a context-free grammar all of whose productions are of the form x w or x wY (where, w is a string of terminals and Y is a non-terminal), is always regular IV. The derivation trees of strings generated by a context-free grammar in Chomsky Normal Form are always binary trees
A CFG G is given with the following productions where S is the start symbol, A is a non-terminal and a and b are terminals.
Which of the following strings is generated by the grammar above?
In the context-free grammar below, S is the start symbol, a and b are terminals, and denotes the empty string. The grammar generates the language
Consider the following statements about the context-free grammer 1. G is ambiguous 2. G produces all strings with equal number of a's and b's 3. G can be accepted by a deterministic PDA. Which combination below expresses all the true statements about G?
In the context-free grammar below, S is the start symbol, a and b are terminals, and denotes the empty string Which of the following strings is NOT generated by the grammar?
Which of the following grammar rules violate the requirements of an operator grammar? P, Q, R are nonterminals, and r,s,t are terminals.
Which one of the following statements is FALSE?
Let G = ({S}, {a, b} R, S) be a context free grammar where the rule set R is Which of the following statements is true?
Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?
Consider the grammar shown below. S C C C cC | d The grammar is
Consider the following decision problems: (P1): Does a given finite state machine accept a given string? (P2): Does a given context free grammar generate an infinite number of strings? Which of the following statements is true?
Consider a grammar with the following productions The above grammar is:
Which of the following features cannot be captured by context-free grammars?
Want unlimited AI-generated Context Free Grammar questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →