Consider the canonical parsing of the grammar below using terminals and non-terminals with as the start symbol.
Which one of the following options gives the number of shift-reduce conflicts that will occur in the ACTION table?
GATE CSE · Compiler Design
Master topic for Parsing. Includes Syntax Analysis, Top-Down Parsing, Bottom-Up Parsing, Error Detection & Recovery.
143 questions · 20 PYQs · 0 AI practice · GATE CSE 2027
🎯 These are sample questions
Just sign in to unlock everything. Free for all students.
Consider the canonical parsing of the grammar below using terminals and non-terminals with as the start symbol.
Which one of the following options gives the number of shift-reduce conflicts that will occur in the ACTION table?
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?
Which of the following statements is/are true?
Which of the following grammars is/are ambiguous?
Which of the following statement(s) is/are TRUE while computing and during top-down parsing by a compiler?
Which of the following is/are Bottom-Up Parser(s)?
Consider the following grammar , with as the start symbol. The grammar has three incomplete productions denoted by (1), (2), and (3).
The set of terminals is . The FIRST and FOLLOW sets of the different non-terminals are as follows.
Which one of the following options CORRECTLY fills in the incomplete productions?
Consider the following grammar along with translation rules.
Here and are operators and is a token that represents an integer and represents the corresponding integer value. The set of non-terminals is and a subscripted non-terminal indicates an instance of the non-terminal. Using this translation scheme, the computed value of for root of the parse tree for the expression is
Consider the augmented grammar with as the set of terminals.
If is the set of two items , then contains exactly ______ items.
Which one of the following statements is TRUE?
Consider the following statements. S1: Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1). S2: For any context-free grammar, there is a parser that takes at most time to parse a string of length n. Which one of the following options is correct?
Consider the following augmented grammar with as the set of terminals.
Let . The number of items in the set is ___________
Consider the following C code segment: a = b + c; e = a + 1; d = b + c; f = d + 1; g = e + f; In a compiler, this code segment is represented internally as a directed acyclic graph (DAG). The number of nodes in the DAG is _____________
A given grammar is called ambiguous if
A grammar is defined as The non terminal alphabet of the grammar is
Given the grammar Which of the following statements is wrong?
Consider the following grammar. The number of reduction steps taken by a bottom-up parser while accepting the string is___________.
Consider the augmented grammar given below: Let . The number of items in the set is __________.
Consider the following given grammar: S -> Aa A -> BD B -> b| ε D -> d| ε Let a, b, d and be indexed as follows: Compute the FOLLOW set of the non-terminal B and write the index values for the symbols \in the FOLLOW set \in the descending order. (For example, if the FOLLOW set is {a, b, d,}, then the answer should be 3210). Answer:_____

Which one of the following kinds of derivation is used by LR parsers?
Want unlimited AI-generated Parsing questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →