Construction
1
,The Role of the Lexical Analyzer
The main task of the lexical analyzer is to:
Read the input characters of the source
program, group them into lexemes, and
Produce as output a sequence of tokens for
each lexeme in the source program
The stream of tokens is sent to the parser for
syntax analysis
2
, The Role of the Lexical Analyzer
Interaction with the symbol table:
When the lexical analyzer discovers a lexeme
representing an identifier, it needs to enter
that lexeme into the symbol table.
3