• Input: DFA  M for the source-program lexemes
• Output: determination of the lexeme type
• Method:
• while a is the next symbol (character) in SP
   and M can make a move with a do:
• read a
• make the move with a
• if M is in a final state then
  determine the corresponding lexeme type
  else handle the lexical error (write message etc)
Algorithm: Type of Lexeme
8/35