Flex is a good tool. When you fully master this tool, you will find that you are greatly improving your level.
This tool is available at http://sourceforge.net. I use this tool as a beginner. Writing this tool is to reduce the number of detours.
I will not talk about how to use flex in Linux. This is very simple. Follow the steps to make your own makefile. I want to talk about it on the win platform.
How is the compilation successful.
First, download the mingw version of Dev-C ++ (I personally prefer this tool because it is GNU after all ). Install.
Then, add the following content to a TXT file.
%
. |/N echo; (Note that there is a space between/N and echo)
%
The above content is a very simple syntax analyzer, which is to print the characters I entered to the screen intact.
It is like storing the above content in a flex.txt file.
Run
Flex.exe flex.txt
A file Lex. yy. C will be generated under the Directory, which is the file of our syntax analyzer.Source code.
Then, create a new console project in Dev-C ++. Copy the content in lex. yy. C to main. C.
Note that flex requires a libfl. A library. If you do not add this library,ProgramThere is no way to connect successfully.
This library can be downloaded directly at http://sourceforge.net/, so you can choose dev-c000000because it also supports gnu.
(I have never tried vsplatform)