Skip to content

GATE CS Parsing (LL, LR) questions

Practise Parsing (LL, LR) questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ2003Compiler DesignParsing (LL, LR)MCQ · 1 mark
Consider the grammar shown below. S→C CS \rightarrow C \ C C→c C∣dC \rightarrow c \ C \mid d This grammar is
Official PYQ2003Compiler DesignParsing (LL, LR)MCQ · 1 mark
Assume that the SLR parser for a grammar G has n1n_1 states and the LALR parser for G has n2n_2 states. The relationship between n1n_1 and n2n_2 is
Official PYQ2003Compiler DesignParsing (LL, LR)MCQ · 1 mark
Which of the following suffices to convert an arbitrary CFG to an LL(1) grammar?
Official PYQ2002Compiler DesignParsing (LL, LR)MCQ · 1 mark
To evaluate an expression without any embedded function calls
Official PYQ2001Compiler DesignParsing (LL, LR)MCQ · 1 mark
Which of the following statements is false?
Official PYQ2000Compiler DesignParsing (LL, LR)MCQ · 1 mark
Given the following expression grammar: E→E∗F∣F+E∣FF→F−F∣id\begin{align} E &\to E * F \mid F + E \mid F \\[1em] F &\to F - F \mid id \end{align} Which of the following is true?
Official PYQ2000Compiler DesignParsing (LL, LR)MCQ · 1 mark
Which of the following derivations does a top-down parser use while parsing an input string? The input is scanned from left to right.
Official PYQ1999Compiler DesignParsing (LL, LR)MCQ · 1 mark
A grammar that is both left and right recursive for a non-terminal, is
Official PYQ1999Compiler DesignParsing (LL, LR)MCQ · 1 mark
Which of the following is the most powerful parsing method?
Official PYQ1998Compiler DesignParsing (LL, LR)MCQ · 1 mark
Type checking is normally done during
Official PYQ1998Compiler DesignParsing (LL, LR)MCQ · 1 mark
Which of the following statements is true?
Official PYQ1997Compiler DesignParsing (LL, LR)MCQ · 1 mark
In the following grammar X::=X⊕Y∣YX ::= X \oplus Y \mid Y Y::=Z∗Y∣ZY::= Z * Y \mid Z Z::=idZ::= id Which of the following is true?
Official PYQ1996Compiler DesignParsing (LL, LR)MCQ · 1 mark
The grammar whose productions are ⟨stmt⟩→ if id then ⟨stmt⟩\langle\text{stmt}\rangle \to\text{ if id then } \langle\text{stmt}\rangle ⟨stmt⟩→ if id then ⟨stmt⟩ else ⟨stmt⟩\langle\text{stmt}\rangle\to\text{ if id then } \langle\text{stmt}\rangle\text{ else } \langle\text{stmt}\rangle ⟨stmt⟩→ id := id\langle\text{stmt}\rangle \to\text{ id }:=\text{ id} is ambiguous because if a then if b then c:= d has more than two parse …
Official PYQ1995Compiler DesignParsing (LL, LR)MCQ · 1 mark
Consider a grammar with the following productions S→aαb∣bαc∣aBS \rightarrow a \alpha b \mid b \alpha c \mid aB S→αS∣bS \rightarrow \alpha S\mid b S→αbb∣abS \rightarrow \alpha b b\mid ab Sα→bdb∣bS \alpha \rightarrow bd b\mid b The above grammar is:
Official PYQ1994Compiler DesignParsing (LL, LR)MCQ · 1 mark
Which of the following features cannot be captured by context-free grammars?
Official PYQ1992Compiler DesignParsing (LL, LR)MCQ · 1 mark
If GG is a context free grammar and ww is a string of length ll in L(G)L(G), how long is a derivation of ww in GG, if GG is in Chomsky normal form?
Official PYQ1992Compiler DesignParsing (LL, LR)MSQ · 1 mark
Consider the SLR(1)\text{SLR(1)} and LALR (1)\text{LALR (1)} parsing tables for a context free grammar. Which of the following statement is/are true?
Official PYQ1992Compiler DesignParsing (LL, LR)MSQ · 1 mark
For a context free grammar, FOLLOW(A) is the set of terminals that can appear immediately to the right of non-terminal AA in some "sentential" form. We define two sets LFOLLOW(A) and RFOLLOW(A) by replacing the word "sentential" by "left sentential" and "right most sentential" respectively in the definition of FOLLOW (A).
Official PYQ1987Compiler DesignParsing (LL, LR)MCQ · 1 mark
An operator precedence parser is a
Official PYQ1987Compiler DesignParsing (LL, LR)MCQ · 1 mark
A context-free grammar is ambiguous if: