How to debug FLEX/LEX codes on Linux and Windows?

I am having a hard time in understanding FLEX/LEX codes because I don’t know how to debug them.
Could someone show the procedure for debugging FLEX/LEX programs on Linux and Windows?

Thanks.