Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Use Flex on Windows

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?

like image 341
John Roberts Avatar asked Feb 02 '13 19:02

John Roberts


People also ask

How do I install flex and yacc?

Type the password for your Linux Account and press Enter, if ask for your password. Type “y” and press Enter, ifask for your permissions to update. To install Lex tool, type the following command in terminal : sudo apt-get install flex • Type “y” and press Enter, if ask for confirmation.


2 Answers

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!

like image 146
templatetypedef Avatar answered Sep 23 '22 07:09

templatetypedef


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

like image 42
Hello W Avatar answered Sep 23 '22 07:09

Hello W