Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q231: The language accepted by an automaton is a set of ________.
- A: characters
- B: strings
- C: numbers
- D: transitions
View Answer
B
Q232: A FA accepts a string if ________.
- A: Final state is not reached
- B: String is too long
- C: A transition is missing
- D: It ends in an accepting state
View Answer
D
Q233: Each RE can be converted into ________.
- A: A function
- B: A DFA only
- C: A NFA only
- D: An NFA, then DFA
View Answer
D
Q234: The RE a|b accepts which of the following strings?
- A: a
- B: b
- C: c
- D: d
View Answer
A
Q235: Which of the following best describes the structure of a DFA?
- A: Tree
- B: Graph with one transition per input
- C: Stack
- D: Binary search tree
View Answer
B
Q236: The final state in a finite automaton is called the ________.
- A: start state
- B: stop state
- C: accepting state
- D: transition state
View Answer
C
Q237: A regular expression is used to specify ________ in compiler design.
- A: tokens
- B: semantic rules
- C: code generation
- D: errors
View Answer
A
Q238: In regular expression, R+ means ________.
- A: Zero or one R
- B: One or more R
- C: Exactly two R
- D: All possible R strings
View Answer
B
Q239: The RE a(b|c)* denotes strings starting with a followed by ________.
- A: zero or more a's
- B: any characters only
- C: b's or c's zero or more times
- D: b's only
View Answer
C
Q240: The FA transition table helps implement a FA in which way?
- A: Graph drawing
- B: Simulating its execution
- C: Generating syntax
- D: Mapping symbols
View Answer
B