Parsing


Q21.

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

Q22.

A top-down parser generates
GateOverflow

Q23.

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

Q24.

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

Q25.

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

Q26.

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

Q27.

Consider the following grammar S \rightarrow F|H F \rightarrow p|c H \rightarrow 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
GateOverflow

Q28.

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

Q29.

Consider the grammar defined by the following production rules, with two operators * and + S \rightarrowT *P T \rightarrowU| T*U P \rightarrow Q +P |Q Q \rightarrow Id U \rightarrow Id Which one of the following is TRUE?
GateOverflow

Q30.

Which of the following productions eliminate left recursion in the productions given below: S \rightarrow Aa \mid b A \rightarrow Ac \mid Sd \mid \epsilon
GateOverflow