Giter Site home page Giter Site logo

compiler-design-lab's Introduction

This repo contains Lex & Yacc code for lab practicals


Compiler Practical Using Flex & Bison :

1. Procedure step by step for windows :
If you are installing Ubuntu (or any Linux based OS) on your system either through Virtual Box or by making your system Multi-Bootable, just to execute your Lex & Yacc programs; then you might be wasting your HDD space & your valuable time. You can easily skip this annoying process and run your programs in Windows OS without any hassles.

Here’s how you can do it:

2. Installing Softwares :

  1. Download Flex 2.5.4a
  2. Download Bison 2.4.1
  3. Install Flex at “C:\GnuWin32“
  4. Install Bison at “C:\GnuWin32“
  5. Open Environment Variables.
  6. Add “C:\GnuWin32\bin

3. Compilation & Execution of your Program :

Open Command prompt and switch to your working directory where you have stored your lex file (“.l“) and yacc file (“.y“) Let your lex and yacc files be “hello.l” and “hello.y“. Now, follow the preceding steps to compile and run your program.

For Compiling Lex file only :
flex hello.l
gcc lex.yy.c
For Compiling Lex & Yacc file both :
flex hello.l
bison -dy hello.y
gcc lex.yy.c y.tab.c
For Executing the Program
a.exe

IMPORTANT


TUTORIAL LINKS :

DO PROGRAMS TO UNDERSTAND MORE :

REPOS Link :

compiler-design-lab's People

Contributors

nitinkumar3399 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.