Flex Compilation Guide on the dev-C ++ Platform

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.