haifenghuang / clox

My interpretation of lox

Home Page:http://craftinginterpreters.com/contents.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clox

This repository is for educatinoal purposes and is my implementation of the clox language described in the crafting interpreters book.

Each branch represents each chapter in the book so you can see how the book builds up the interpreter.

Syntax is similar to C and is intended to work as an object oriented language

message = "Hello world!";
isTrue = true;

if (message && isTrue) {
  print message; // "Hello World!" 
}

Usage

make

// run as script file
main [file]

// repl mode
main

Planned implementations

After I have finished the book I plan to build on the lox language and add the following features

  • Dictionaries/hash tables
  • Switch statements
  • Python style f-string interpretation e.g. print(f"Hello {your_name}");
  • static class functions
  • abstract class functions

About

My interpretation of lox

http://craftinginterpreters.com/contents.html


Languages

Language:C 97.1%Language:Python 2.3%Language:Makefile 0.6%Language:Shell 0.0%