How To Install Flex And Bison
Step 1: Go to http://gnuwin32.sourceforge.net/packages/flex.htm this website and download flex 2.5.4a-1.
Step 3: After this install both of this exe files. one things you note for installation chose those folder or directory of your preference without spaces in the name. i suggest install on c drive directly like c:\Gnuwin32.
Go to https://sourceforge.net/projects/orwelldevcpp/ this link and download dev-cpp.
Step 5: After this installation set Environment Variables for dev-cpp if you follow my path for installation then your Environment Variable path for dev-cpp is c:\dev-cpp\bin and for flex and bison c:\Gnuwin32\bin.set this two path to your environment variable.
Step 6: Open a command prompt, cd to the directory/folder where your ".l" and ".y" are save.
if you don't know how to open folder/directory on cmd(Command Prompt) then read this
How to run lex file ?
First open folder in cmd. like in D drive you create one folder lexprogram in this folder save this lex file with .l extension. then in cmd you type d: + enter then type cd D:\lexprogram.
Now we compile file by following steps.
- flex filename.l
- bison -dy filename.y
- gcc lex.yy.c y.tab.c
- a.exe
You will be able to run your program.
i give you one sample file for checking flex and bison tool.
Comments
Post a Comment