Skip to content

Compiler Design

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.

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

More Compiler Design MCQs