Skip to content

veerreshr/Simple-Compiler

Repository files navigation

Simple Compiler

A simple implementation of compiler in python.

Features

  • Numerical variables
  • Basic arithmetic
  • If statements
  • While loops
  • Print text and numbers
  • Input numbers
  • Labels and go to
  • Comments

Examples

Program to Add 2 numbers taken from Input and output the Result

PRINT "Enter number 1"
INPUT a
PRINT "Enter number 2"
INPUT b
PRINT "Sum of 2 numbers is"
PRINT a+b

Run Locally

Clone the project

  git clone https://github.com/veerreshr/Simple-Compiler

Go to the project directory

  cd Simple-Compiler

Run Program (format : python main.py sourcefilepath)

  python main.py sum.dsce

Compile the generated c code

  gcc a.out

Execute executable output file

./a.out

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages