I wanted to learn about programming languages, so I created a very simple toy language using python which tokenizes some text, turns the list of tokens into an AST, then evaluates it. The code is written to be a bit verbose in places for clarity’s sake. It also has been minimally tested.
Language features:
- Three whole types! Numbers, Strings, and Booleans!
- Lists!
- Functions!
- Operator Overriding!
- Set and Get Variables!
- If and Else!
- Math!
- True and False!
- Printing!
- While Loops!
- Classes!
- Importing!
Files:
tokenizer.py
- The tokenizer codeast_parser.py
- The parser/AST codelang_value.py
- The values/types codelang.py
- The evaluator and code which runs the codetest_code/*
- The test codes