A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

 11. Which one of the following is a top-down parser? a. Recursive descent parser b. Operator precedence parser c. An LR(k) parser d. An LALR(k) parser

 12. Consider the grammar with non-terminals N = {S,C,S1 },terminals T={a,b,i,t,e}, with S as the start symbol, and the following set of rules: S --> iCtSS1|a S1 --> eS|ϵ C --> b The grammar is NOT LL(1) because: a. it is left recursive b. it is right recursive c. it is ambiguous d. It is not context-free

 13. Consider the following two statements: P: Every regular grammar is LL(1) Q: Every regular set has a LR(1) grammar Which of the following is TRUE? a. Both P and Q are true b. P is true and Q is false c. P is false and Q is true d. Both P and Q are false

 14. Consider the following grammar. S -> S * E S -> E E -> F + E E -> F F -> id Consider the following LR(0) items corresponding to the grammar above. (i) S -> S * .E (ii) E -> F. + E (iii) E -> F + .E Given the items above, which two of them will appear in the same set in the canonical sets-of-items for the grammar? a. (i) and (ii) b. (ii) and (iii) c. (i) and (iii) d. None of the above

 15. A canonical set of items is given below S --> L. > R Q --> R. On input symbol < the set has a. a shift-reduce conflict and a reduce-reduce conflict b. a shift-reduce conflict but not a reduce-reduce conflict c. a reduce-reduce conflict but not a shift-reduce conflict d. neither a shift-reduce nor a reduce-reduce conflict

 16. Consider the grammar defined by the following production rules, with two operators ∗ and + S --> T * P T --> U | T * U P --> Q + P | Q Q --> Id U --> Id Which one of the following is TRUE? a. + is left associative, while ∗ is right associative b. + is right associative, while ∗ is left associative c. Both + and ∗ are right associative d. Both + and ∗ are left associative

 17. Consider the following grammar: S → FR R → S | ε F → id In the predictive parser table, M, of the grammar the entries M[S, id] and M[R, \$] respectively a. {S → FR} and {R → ε } b. {S → FR} and { } c. {S → FR} and {R → *S} d. {F → id} and {R → ε}