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
Consider the following grammar: stmt if expr then expr else expr; stmt | expr term relop term | term term id | number id a | b | c number where relop is a relational operator e.g., refers to the empty statement, and if, then, else …
Consider the following expression grammar : Which of the following grammars is not left recursive, but is equivalent to ?
Which of the following statements about parser is/are CORRECT? is more powerful than is more powerful than is more powerful than
The attribute of three arithmetic operators in some programming language are given below. …
A student wrote two context-free grammars G1 and G2 for generating a single C-like array declaration. The dimension of the array is at least one. For example, int a[10] [3]; The grammars use D as the start symbol, and use six terminal symbols int ; id [ ] num. …
Which one of the following grammars is free from left recursion?
Which one of the following is TRUE at any valid state in shift-reduce parsing?
Consider the following grammar G Where , , and are non-terminal symbols, , and are terminal symbols. Which of the following statement(s) is/are correct? S1: LL(1) can parse all strings that are generated using grammar G S2: LR(1) can parse all …
Among simple LR (SLR), canonical LR, and look-ahead LR (LALR), which of the following pairs identify the method that is very easy to implement and the method that is the most powerful, in that order?
A canonical set of items is given below On input symbol the set has
Consider the grammar defined by the following production rules, with two operators and Which one of the following is TRUE?
Consider the following two sets of items of an grammar.Which of the following statements related to merging of the two sets in the corresponding …
What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon and unit-production (i.e., of type and ) to parse a string with tokens?
For the grammar below, a partial parsing table is also presented along with the grammar. Entries that need to be filled are indicated as and . is the empty string, \$ indicates end of input, and, separates alternate right hand sides of productions. …
Consider two binary operators and with the precedence of operator being lower than that of the operator . Operator is right associative while operator is left associative. Which one of the following represents the parse tree for expression …
The grammar is
Which of the following statements are TRUE? There exist parsing algorithms for some programming languages whose complexities are less than A programming language which allows recursion can be implemented with static storage allocation. No L-attributed definition can be evaluated in the framework of bottom-up parsing. Code improving …
An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if
Which of the following describes a handle (as applicable to LR-parsing) appropriately?
Which of the following statements are true? Every left-recursive grammar can be converted to a right-recursive grammar and vice-versa All -productions can be removed from any context-free grammar by suitable transformations The language generated by a context-free grammar all of whose productions are of the form or …
