Lexical analyzer implementation in c++

How to implement dfa for identifier,number and space in c++?