+ 1
Maybe you can begin here
https://www.tutorialspoint.com/compiler_design/compiler_design_lexical_analysis.htm
I remembered in my university years I did something about that, I cant find it and I don't remember compiler which we used, of course, in these time, it was in DOS jejeje