Windows Flex + GCC lexical analysis experiment Toolkit

Source: Internet
Author: User

Lexical analysis is an essential part of compilation principles. This part of the experiment generally uses flex and GCC tools. I like protable apps. After reading some documents, I sorted out this Toolkit myself. In fact, this Toolkit only collects and organizes some existing programs, and only has one original BAT file. If the entire toolkit is less than 3 MB, it can be used as long as it is decompressed. Of course, there is not much test done. Release it first and accept feedback. For more information, see the read me.txt file. : Http://files.cnblogs.com/tt-0411/flex_gcc_tools.zip.

The content of the read me.txt file is attached:

Flex + GCC lexical analysis experiment Toolkit

About

This is a simple toolkit for Flex + GCC lexical analysis experiments.

Flex program, from the gnuwin32 project flex for Windows on SourceForge, http://goo.gl/wqynl.

GCC program, blog post from "code first", "GCC compiler under Windows command line", article address: http://goo.gl/vb1ok. The description in this article is that GCC is extracted from Dev-CPP, and the library files may be incomplete.

Start file start. bat, which is created by myself. The function is to add the bin directory of flex and GCC to the system variable path. (This path will only be valid in the current process and will not be added to the actual system variables, and the path setting will not expire when the CMD window exits ).

Sample. l in the test file. The code is from http://goo.gl/xyvme. The usage is slightly different. See the following operations.
Generation:Flex sample. L
After the command is executed, a C code file Lex. yy. C is generated.
Compile:Gcc-G Lex. yy. C-o Sample
An executable file sample.exe is generated after the command is executed, and a warning can be ignored.
Run:Sample
Run the command and wrap the line. Enter any letters or numbers. Press enter to display the type judgment prompt. Press Ctrl + Z to end the input. Type statistics are collected. Then the sample program exits.

Double-click Start. BAT to start the command line, which can be used in the same way as the test file.

This toolkit is only used for learning. All files and programs are copyrighted by the original author.
Welcome to my blog http://www.cnblogs.com/tt-0411

Related Article

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.