•
Input:
Source program
•
Output:
String of tokens
•
Method:
•
Source program is broken into
lexemes
=
logically cohesive lexical entities
–
(identifiers, numbers, key-words, operators
,
…
)
•
Lexemes are represented by uniform
tokens
•
Some tokens have
attributes
Lexical analyzer
(
Scanner
)
6/17