Flex is a nice tool. When you completely master this tool, you will find that you have a tiger, Level increases. This tool is in http://sourceforge.net/. I use this tool, just a beginner, write this thing, is to let everyone walk less. How do I use me in Linux? This is very simple. You follow the steps, you make your makefile. I would like to talk about how it is successful on the WIN platform. First, you go to download the MingW version of DEV-C (individuals like this tool, because after all, is a gnu thing). installation. Then, add the following content to a TXT file %%. | / N echo; (note, space between / n and echo) %% The above content is a very simple syntax, just put me The input characters are in touch to print onto the screen. It is like a flex.txt that stores the above content into a flex.txt. Execute flex.exe flex.txt will generate a lex.yy.c file below the directory, this file is the source code of our syntax analyzer. Then, a console project is now created in DEV-C . Copy the contents of lex.yy.c to main.c. However, pay attention to it, that is, Flex requires a libfl.a library. If this library is not added, the program is no way to connect success. This library can go directly to http://sourceforge.net/ upload, and the selection of DEV-C is also because he supports GNU library. (I have never experimented in the VS platform)