A simple implementation of compiler in python.
- Numerical variables
- Basic arithmetic
- If statements
- While loops
- Print text and numbers
- Input numbers
- Labels and go to
- Comments
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
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