► Reads characters in the source program and groups them into meaningful sequences called lexemes.
► Produces as output a token of the form <token_name, attribute_value> and passes it to the next phase syntax analysis.
► Token class - The symbol for this token to be used during syntax analysis.
► Attribute points to symbol table entry for this token.
► Role of lexical analyzer
-Remove comments & white spaces
-Macros expansion
-Read input characters from source program & group them into lexemes.
-Produce as output a source of tokens, interact with symbol table.