Skip to content

prams628/MiniPythonCompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniPython Compiler

A very basic compiler for python developed using lex and yacc. All the phases of compiler design have been covered and this compiler can parse basic statements, selection and looping constructs.

Prerequisites

Install flex and bison using the following command which can help interpret .l and .y files.

sudo apt-get update
sudo apt-get install flex
sudo apt-get install bison

Running the code

To parse a program using the mini-compiler, run the following commands in order in the folder of the project.

./compile.sh

This command will build an executable from the lex and yacc files. To run the executable, enter

./exec.sh filepath

This command will print all the outputs right from lexer parsing to assembly code generated for the file passed through filepath.

About

A very basic python compiler that parses for, if and while statements

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •