Compiler Design


Q71.

Which one of the following is a top-down parser?
GateOverflow

Q72.

Consider the following Syntax Directed Translation Scheme(SDTS),with non-terminals {S, A} and terminals {a, b}. S \rightarrow aA {print 1} S \rightarrow a { print 2} A \rightarrow Sb { print 3} Using the above SDTS, the output printed by a bottom-up parser, for the input aab is:
GateOverflow

Q73.

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?
GateOverflow

Q74.

Which statement is true?
GateOverflow

Q75.

Given the following expression grammar:E \rightarrow E * F|F+E| FF \rightarrow F-F \mid i dWhich of the following is true?
GateOverflow

Q76.

Which grammar rules violate the requirement of the operator grammar? A, B, C are variables and a, b, c are terminals1. A \rightarrow B C2. A \rightarrow C c B b3. A \rightarrow B a C4. A \rightarrow \epsilon
GateOverflow

Q77.

Which one of the following is TRUE at any valid state in shift-reduce parsing?
GateOverflow

Q78.

Consider the following grammar.\mathrm{S} \rightarrow \mathrm{AB}\mathrm{A} \rightarrow \mathrm{a}\mathrm{A} \rightarrow \mathrm{BaB}\mathrm{B} \rightarrow \mathrm{bbA}Which of the following statements is FALSE?
GateOverflow

Q79.

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?
GateOverflow

Q80.

What is the number of steps required to derive the string ((() ()) ()) for the following grammar? S \rightarrow S SS \rightarrow(S)S \rightarrow \varepsilon
GateOverflow