Compiler Design MCQ Questions And Answers - Regular Expressions

This section focuses on "Regular Expressions" in Compiler Design. These Multiple Choice Questions (MCQ) should be practiced to improve the Compiler Design skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. The grammar defined by regular expressions is known as?

A. regular language
B. regular grammar
C. regular notations
D. regular operation

View Answer


2. The language defined by regular grammar is known as?

A. regular language
B. regular grammar
C. regular notations
D. regular operation

View Answer


3. Union of two languages L and M is written as?

A. LM = {st | s is in L and t is in M}
B. L+M
C. L*M
D. L U M = {s | s is in L or s is in M}

View Answer


4. Concatenation (.) has the ________ highest precedence

A. first
B. second
C. third
D. fourth

View Answer


5. Which of them are not left associative?

A. *
B. |
C. plus(+)
D. .

View Answer


6. The RE in which any number of 0′s is followed by any number of 1′s followed by any number of 2′s is?

A. (0+1+2)*
B. 0*1*2*
C. 0* + 1 + 2
D. (0+1)*2*

View Answer


7. Which of the following is NOT the set of regular expression R = (ab + abb)* bbab?

A. ababbbbab
B. abbbab
C. ababbabbbab
D. abababab

View Answer


8. Consider the production of the grammar S->AA A->aa A->bb Describe the language specified by the production grammar.

A. L = {aaaa,aabb,bbaa,bbbb}
B. L = {abab,abaa,aaab,baaa}
C. L = {aaab,baba,bbaa,bbbb}
D. L = {aaaa,abab,bbaa,aaab}

View Answer


9. If R is regular language and Q is any language (regular/ non regular), then Pref (Q in R) is _____________

A. Non-regular
B. Equal
C. Infinite
D. Regular

View Answer


10. The non terminal that gives null will said to have a null production

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer





Discussion



* You must be logged in to add comment.