What term describes the following? a sequence of characters in source code that matches the pattern for a token.
Difficulty: Medium
About this MCQ
This Medium Compiler Design MCQ checks one syllabus fact.
The question is: “What term describes the following? a sequence of characters in source code that matches the pattern for a token.”
The accepted answer is A. Lexeme. Lexeme is the fact required by “What term describes the following? a sequence of characters in source code that matches the pattern for a token.” (option A). Option B (“Compiler”) does not match the stem; it is a near-miss used to catch incomplete recall of Lexeme. Option C (“Lexical analysis”) does not match the stem; it is a near-miss used to catch incomplete recall of Lexeme. Remaining alternatives (Token) fall outside the same rule and should be eliminated once Lexeme is identified. Compiler Design questions of this type reward precise definitions rather than approximate associations. Compiler Design recall of this distinction is a regular item in FPSC, PPSC, NTS, and CSS papers.
- A. Lexeme ✓
- B. Compiler
Why not B: “Compiler” is not correct. The accepted answer is A. Lexeme. Lexeme is the fact required by “What term describes the following? a sequence of characters in source code that matches the pattern for a token.” (option A). Option B (“Compiler”)
- C. Lexical analysis
Why not C: “Lexical analysis” is not correct. The accepted answer is A. Lexeme. Lexeme is the fact required by “What term describes the following? a sequence of characters in source code that matches the pattern for a token.” (option A). Option B (“Compiler”)
- D. Token
Why not D: “Token” is not correct. The accepted answer is A. Lexeme. Lexeme is the fact required by “What term describes the following? a sequence of characters in source code that matches the pattern for a token.” (option A). Option B (“Compiler”)
Correct answer
A. Lexeme
Explanation
Lexeme is the fact required by “What term describes the following? a sequence of characters in source code that matches the pattern for a token.” (option A). Option B (“Compiler”) does not match the stem; it is a near-miss used to catch incomplete recall of Lexeme. Option C (“Lexical analysis”) does not match the stem; it is a near-miss used to catch incomplete recall of Lexeme. Remaining alternatives (Token) fall outside the same rule and should be eliminated once Lexeme is identified. Compiler Design questions of this type reward precise definitions rather than approximate associations. Compiler Design recall of this distinction is a regular item in FPSC, PPSC, NTS, and CSS papers.
Source: Compiler Design Official Reference Guide
Tags: computer science, compiler design, compilers, programming languages
Submitted by: MCQsHub Editorial
Related MCQs
- The concept in which the compiler phase that improves intermediate or final code to make it run faster or use...
- Select the correct name for: a tree representation showing the syntactic structure of source code according to...
- What is the function or purpose of Intermediate code generation?
- Which statement correctly explains Parse tree?
- Which of the following best names the concept in which the compiler phase that translates source code into an...
- Which concept is defined as follows: a categorized unit of meaning, such as a keyword or identifier, produced...