Compilers Questions and Answers – Right Left Linear Grammar – 2

This set of Compilers Mcqs focuses on “Right Left Linear Grammar – 2”.

1. Left Linear grammar can be converted to Right Linear grammar.
a) Yes
b) No
View Answer

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

2. What is CFG?
a) Compiler
b) A language expression
c) Regular Expression
d) None of the mentioned
View Answer

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

3. What is the idea of automation with a stack as auxiliary storage?
a) Finite automata
b) Push Down Automata
c) Deterministic Automata
d) None of the mentioned
View Answer

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

4. Transition of finite automata is ___________
a) Finite Diagram
b) State Diagram
c) Node Diagram
d) E-R Diagram
View Answer

Answer: b
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 right derivations for some terminal string ѡ є L (G)
c) It has 2 or more than 2 left and right derivations for some terminal string ѡ є L (G)
d) None of the mentioned
View Answer

Answer: c
Explanation: When two or more Left and right most derivative occur the grammar turn ambiguous .
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Answer: d
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

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

8. Grammars that can be translated to DFAs is __________
a) Left linear grammar
b) Right linear grammar
c) Generic grammar
d) All of the mentioned
View Answer

Answer: b
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

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

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

Answer: a
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 MCQs on all areas of Compilers, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.