Skip to content

A custom programming language built from scratch, includes full tokenizer, parser, interpeter in Python, variables, loops and more

Notifications You must be signed in to change notification settings

jimmydin7/custom-programming-language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Programming Language

A simple programming language built from scratch in Python.
Includes full lexer (tokenizer), parser, and interpreter This version supports basic features like:

  • Variable declarations (with int and string types)
  • Printing output using say()
  • Comment support (# for single-line comments)
  • Debug Mode to see tokenizing and parsing happen in real time

Example Code

# Define a string myname = string("Alex") # Define an integer mynumber = int(42) # Output the values say(myname) say(mynumber) 

How to Run

  1. have Python 3.x installed
  2. clone the repository
  3. add your code to a .txt file and specify it's path on main.py source_code_path variable
    python main.py

Features

  • Integer & string variables
  • Print with say()
  • Comments (#)
  • Tokenizer and AST
  • Error handling (improved)
  • Expressions / math
  • Control flow (if, while, etc.)

Planned for Future Versions

  • Arithmetic operations (+, -, etc.)
  • Conditionals (if, else)
  • Loops (while, for)
  • Functions
  • Type checking
  • Custom runtime errors

Why?

This is a learning project to understand how programming languages work (tokenizing, parsing, interpreting)


About

A custom programming language built from scratch, includes full tokenizer, parser, interpeter in Python, variables, loops and more

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages