C onsider the following parse tree for the expression a#bd#e#f, involving two binary operators $ and #. Which one of the following is correct for the given parse tree?

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
C onsider the following parse tree for the expression a#bd#e#f, involving two binary operators $ and #. Which one of the following is correct for the given parse tree?

Consider the following grammar: stmt if expr then expr else expr; stmt| expr term relop term|term term id|number if a|b|c number [0-9] where relop is a relational operate (e.g ,...), refers to the empty statement, and if ,then, else are terminals. Consider a program P following the above grammar containing ten if terminals. The number of control flows paths in P is ____________. For example the program if then else has 2 controls flow paths and .
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 of the grammars correctly generate the declaration mentioned above?

A top-down parser generates
Consider the following Syntax Directed Translation Scheme(SDTS),with non-terminals {S, A} and terminals {a, b}. S aA {print 1} S a { print 2} A Sb { print 3} Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:
Recursive descent parsing is an example of
Consider the following grammar S F|H F p|c H d|c where S,F, and H are non-terminal symbols, p,d, and c 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 strings that are generated using grammar G
Which one of the following is TRUE at any valid state in shift-reduce parsing?
Which statement is true?
Which one of the following is a top-down parser?
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?
Which grammar rules violate the requirement of the operator grammar? A, B, C are variables and a, b, c are terminals 1. 2. 3. 4.
Given the following expression grammar: Which of the following is true?
Consider the grammar defined by the following production rules, with two operators * and + S T P T U| TU P Q +P |Q Q Id U Id Which one of the following is TRUE?
Consider the following grammar. Which of the following statements is FALSE?
A canonical set of items is given below S Q R. On input symbol the set has
What is the number of steps required to derive the string ((() ()) ()) for the following grammar?
Shift reduce parsing belongs to a class of
Consider the following two sets of LR(1) items of an LR(1) grammar.
Which of the following statements related to merging of the two sets in the corresponding LALR parser is/are FALSE? 1. Cannot be merged since look aheads are different. 2. Can be merged but will result in S-R conflict. 3. Can be merged but will result in R-R conflict. 4. Cannot be merged since goto on c will lead to two different sets.
Which of the following productions eliminate left recursion in the productions given below:
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 →