View demo & docs here
A simple programming language built from scratch in Python.
Includes full lexer (tokenizer), parser, and interpreter (no real-world senario, just educational)
This version supports basic features like:
- Variable declarations (with
int
andstring
types) - Printing output using
say()
- Comment support (
#
for single-line comments) - Debug Mode to see tokenizing and parsing happen in real time
# Print
say("Hello, world!")
# Define a string
myname = string("Alex")
# Define an integer
mynumber = int(42)
# Output the values
say(myname)
say(mynumber)
- have Python 3.x installed
- clone the repository
- add your code to a
.txt
file - run the python file and add your source code's path as an argument
python run.py sourcecode.txt
- Integer & string variables
- Print with
say()
- Comments (
#
) - Tokenizer and AST
- Error handling (improved)
- Expressions / math
- Control flow (
if
,while
, etc.)
- Arithmetic operations (
+
,-
, etc.) - Conditionals (
if
,else
) - Loops (
while
,for
) - Functions
- Type checking
- Custom runtime errors
This is a learning project to understand how programming languages work (tokenizing, parsing, interpreting)
View demo & docs here