How To Use Flex on Windows

14,235

Solution 1

It's possible to set up a Visual Studio project that uses flex as a custom build step in order to automatically invoke flex and then compile the generated file. I taught a compilers course last summer and we have instructions on how to get flex and a sample project file available on the archived course website. You should look under the announcement labeled "Visual Studio Starter Files for PP1."

Hope this helps!

Solution 2

Using Win flex-bison with visual studio is quite easier and straightforward. You can find it at Win Flex-Bison.

Share:
14,235
John Roberts
Author by

John Roberts

Updated on August 01, 2022

Comments

  • John Roberts
    John Roberts almost 2 years

    I apologize if this is a dumb question, but I have 0 experience with this tool and wanted to know if I'm going about using it properly. I've downloaded flex which, upon compiling my lex file, produces a C file which then needs to be compiled separately. Is this the best way to do it?