This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Error Handling – 2”.

1. Can Left Linear grammar be converted to Right Linear grammar

a) Yes

b) No

View Answer

Explanation: Since right-linear grammars are regular, it follows that left-linear grammars are also regular.

2. CFG is

a) Compiler

b) A language expression

c) Regular Expression

d) None of the mentioned

View Answer

Explanation: They are defined by rule A->b where A is non terminal and b is terminal.

3. The idea of an automation with a stack as auxiliary storage

a) Finite automata

b) Push Down Automata

c) Deterministic Automata

d) None of the mentioned

View Answer

Explanation: Push Down Automata manipulate the Stack as a part of performing a transition.

4. Transition of finite automata is

a) Finite Diagram

b) State Diagram

c) Node Diagram

d) E-R Diagram

View Answer

Explanation: Transition of finite automata is Finite Diagram.

5. A context free language is called ambiguous if

a) It has 2 or more than 2 left derivations for some terminal string ѡ є L (G)

b) It has 2 or more than 2 left derivations for some terminal string ѡ є L (G)

c) Both (a) and (b)

d) None of the mentioned

View Answer

Explanation: When two or more Left and right most derivative occur the grammar turn ambiguous.

6. Which of the following statement is true?

a) Every language that is defined by regular expression can also be defined by finite automata

b) Every language defined by finite automata can also be defined by regular expression

c) We can convert regular expressions into finite automata

d) All of the mentioned

View Answer

Explanation: All these statements are true w.r.t regular expression.

7. Which of the following identity is wrong?

a) R + R = R

b) (R*)* = R*

c) ɛR = Rɛ = R

d) ØR = RØ = RR*

View Answer

Explanation: Regular grammar combined with empty does not give R* instead gives empty.

8. Grammars that can be translated to DFAs

a) Left linear grammar

b) Right linear grammar

c) Generic grammar

d) All of the mentioned

View Answer

Explanation: Right Linear grammar can be translate to DFA.

9. A language is regular if and only if it is accepted by finite automata

a) The given statement statement is true

b) Given statement is false

c) Statement is partially true

d) None of the mentioned

View Answer

Explanation: Regular Language is accepted by Finite Automata. Every regular language is Context free.

10. A Push Down Automata is if there is at most one transition applicable to each configuration

a) Deterministic

b) Non deterministic

c) Finite

d) Non finite

View Answer

Explanation: In every situation only one transition is available as continuation then the result is deterministic push down automata.

**Sanfoundry Global Education & Learning Series – Compilers.**

To practice all areas of Compilers, __here is complete set of 1000+ Multiple Choice Questions and Answers__.