Skip to content

The front-end of a compiler that converts python code to Three-Address-Code(TAC)

Notifications You must be signed in to change notification settings

ali-asnaashari/Yet_Another_Python_Compiler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yet Another Python Compiler

The front-end of a compiler that converts python code to Three-Address-Code(TAC).

Installation

To install Flex and Bison run the below commands in a terminal

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

To Run

After installing Flex and Bison follow the below commands:

$ bison -d  parser.y
$ flex lexical.l
$ gcc lex.yy.c parser.tab.c -o compiler
$ ./compiler < ./data/input/input1.txt | cat > ./data/output/output1.txt


Alternately, you can use the commands in the makefile. To build the program, execute the command below:

$ make all

To run the tests, execute the command:

$ make test

About

The front-end of a compiler that converts python code to Three-Address-Code(TAC)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Yacc 72.0%
  • Lex 25.1%
  • Makefile 2.9%