Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q311: A minimized DFA accepts the ______ language as the original DFA.
- A: Smaller
- B: Different
- C: Same
- D: Larger
View Answer
C
Q312: Each group of equivalent states in DFA minimization is represented by
- A: One transition
- B: One input
- C: One merged state
- D: One path
View Answer
C
Q313: States in group G1 must transition to
- A: Any state
- B: Other groups
- C: The same group G2
- D: Random states
View Answer
C
Q314: The symbol “%%” in Flex input file separates
- A: Functions
- B: Classes
- C: Sections
- D: Tokens
View Answer
C
Q315: In Flex, user code is written in which section?
- A: First
- B: Second
- C: Third
- D: None
View Answer
C
Q316: The header file included in lex.l is
- A:
- B: tokdefs.h
- C: defs.h
- D:
View Answer
B
Q317: The lexical analyzer returns _______ matching token.
- A: First
- B: Longest
- C: Shortest
- D: Random
View Answer
B
Q318: In lexical analyzer, “while” is returned as
- A: TOK_IF
- B: TOK_LOOP
- C: TOK_WHILE
- D: TOK_REPEAT
View Answer
C
Q319: The FlexLexer class is used to
- A: Generate parser
- B: Simulate DFA
- C: Invoke scanner
- D: Write tokens
View Answer
C
Q320: DFA Minimization results in a DFA with
- A: More states
- B: Same states
- C: Fewer states
- D: No states
View Answer
C