Beginner
Compilers & Programming Language Theory
Q3 / 100
What is a token in compiler design?
Correct! Well done.
Incorrect.
The correct answer is B) A classified unit of source code — a (token-type, value) pair produced by the lexer
B
Correct Answer
A classified unit of source code — a (token-type, value) pair produced by the lexer
Explanation
Tokens: keyword (if, while), identifier (x, myVar), literal (42, "hello"), operator (+, ==), delimiter (;, {). The token stream abstracts away whitespace and enables grammar-based parsing.
Progress
3/100