Git Product home page Git Product logo

compiler-design's Introduction

Compiler-Design

I am using FLEX tool to design a simple Compiler

How to install Flex on Linux?

Just type in cmd:

sudo apt-get install flex
sudo apt-get update

How to install Flex on Windows?

Just go to this Official Site Download the complete package After Downloading,install it. Then in searchBar , Type:

edit the system environment variables

Go to Environment Variable, Under System Variables , Choose Path
Now it will pop up Edit Environment Variable. Then add Two path one is bin folder of MinGW and another is bin folder of GnuWin32

How to run?

Flex file's extensions are .l or .lex run command prompt, where your .l or .lex file is located

First approach

In cmd Type :

flex filename.l
gcc lex.yy.c
./a.out

Disadvantage of this approach:

you have to create one folder to execute one .lex file
So if you have multiple .l or .lex file, have to create different different folder
why? The reason is: for each .l or .lex file , everytime a.out file will be created
Now windows doesn't support duplicate file in same folder,so it will try to merge & the previous a.out file will be lost

Second approach/Best approach

generally Flex programme is designed with default a.out file But if You can change the name of Object file
Then automatically the executable file name will be changed.

In CMD Type:

flex fileName.l
gcc lex.yy.c -o Anything
./Anything.exe

Abdullah Al Masum's github stats

compiler-design's People

Contributors

masum035 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.