Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.19 KB

README.md

File metadata and controls

38 lines (25 loc) · 1.19 KB

Lox Bytecode Compiler

Lox is an Object Oriented language designed by Bob Nystrom in his book Crafting Interpreters to teach design principals behind language design and data structures used to design compilers.


This version of lox closely follows Bob's book and was aimed at creating an efficient bytecode interpreter to compile lox. The first half of the book demonstrated how a tree-walk interpreter works. His implementation was written in java, known as jlox, you can check out my implementation of the tree-walk interpreter, known as pylox, here.

Requirments

  • cmake: version <= 3.20

To run

You can run a repl with:

$ ./build/apps/main


Or you can run a lox file with:

$ ./build/apps/main nameOfFile

Run a test project

I have included two test projects to see lox running.
To see an example of inheritance in Lox run:

$ ./build/apps/main ./TestProjects/Lox_Inheritance.lox


To see an example of Lox classes run:

$ ./build/apps/main ./TestProjects/Lox_LinkedLists.lox

Author