FLEX

Get Started with FLEX Programming

If you want to know on how to get started with FLEX/LEX programming then scroll down.I have kept a video on how to install FLEX and run your first FLEX program on Windows 7/8/10 as well as step as step guide to those who want to read it.

Step by Step Guide to Install FLEX and Run FLEX Program using Command Prompt(cmd)

Step 1

                /*For downloading CODEBLOCKS */

- Open your Browser and type in "codeblocks"

- Goto to Code Blocks and go to downloads section

- Click on "Download the binary release"

- Download codeblocks-16.01mingw-setup.exe or just click below to download

- Click here to download codeblocks-16.01mingw-setup

- Install the software keep clicking on next

                /*For downloading FLEX GnuWin32 */

- Open your Browser and type in "download flex gnuwin32"

- Goto to "Download GnuWin from SourceForge.net" or just click below to download

Click here to download flex-2.5.4a-1

- Downloading will start automatically

- Install the software keep clicking on next

/*SAVE IT INSIDE C FOLDER*/

Step 2  /*PATH SETUP FOR CODEBLOCKS*/

- After successful installation Goto program files

- Goto CodeBlocks-->MinGW-->Bin

- Copy the address of bin it should somewhat look like this

C:\Program Files (x86)\CodeBlocks\MinGW\bin

- Open Control Panel-->Goto System-->Advance System Settings-->Environment Variables

- Environment Variables--> Click on Path which is inside System variables

- Click on edit

- Click on New and paste the copied path to it:-

- C:\Program Files (x86)\CodeBlocks\MinGW\bin

- Press Ok!

Step 3  /*PATH SETUP FOR GnuWin32*/

- After successful installation Goto C folder

- Goto GnuWin32-->Bin

- Copy the address of bin it should somewhat look like this

C:\GnuWin32\bin

- Open Control Panel-->Goto System-->Advance System Settings-->Environment Variables

- Environment Variables--> Click on Path which is inside System variables

- Click on edit

- Click on New and paste the copied path to it:-

- C:\GnuWin32\bin

- Press Ok!

/*WARNING!!! PLEASE MAKE SURE THAT PATH OF CODEBLOCKS IS BEFORE GNUWIN32---THE ORDER MATTERS*/

Step 4  

- Create a folder on Desktop flex_programs or whichever name you like

- Open notepad type in a flex program

- Save it inside the folder like filename.l

/*Make sure while saving save it as all files rather than as a text document*/

Step 5   /*To RUN FLEX PROGRAM*/

- Goto to Command Prompt(cmd)

- Goto the directory where you have saved the program

- Type in command :-  flex filename.l

- Type in command :- gcc lex.yy.c

- Execute/Run for windows command promt :-     a.exe          

Step 6
- Finished

Flex programs have been added and you all can also request for a program or code and we would love to help you all with programming or any other related queries.

Share Me!
  •  
  •  
  •  
  •  
  •  
  •