-
Python Interpreter for a toy language build in Python3 based on concepts of Object Oriented Programming.Both versions have their own code.imp files to showcase different functionalities.
-
Functionalities added
-
Version1
- If-Else Statement:
Conditionin betweenifandthen- Statements in between
thenandfi fishould be followed by a;if-elseblock can be inside anotherif-elseblock orwhileloop as well.
- While Statement:
Conditionin betweenwhileanddo- Statements in between
doanddone doneshould be followed by a;- Similarly even the
whileloop can be inside anif-elseblock or anotherwhileloop.
- Print Statement:
- Works same as
python3print statement and can print multiple arguments at once as well.
- Works same as
- Println Statement:
printlnstatement can be used to print a new line character just like in Java
- If-Else Statement:
-
Version2
- Error and Exception Handling:
Syntax Errorssuch as missing semicolon,missing fi and done at end of if-else block and while loop respectively,printing or evaluation of variables which have not been assigned yet have been included.Runtime Errorssuch as division by zero have been included using raise keyword inside Errors class
- Error and Exception Handling:
-
ojasvin/Toy-Language-Interpreter
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|