Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

eliasdaler/lox

Repository files navigation

C++ implementation of Lox (WIP)

I'm reading Crafting Interpreters book by Bob Nystrom and writing Lox interpreter in C++ as I do this (the original code in the book is written in Java and some is in C). It's fun!

Some day I will return to it... Maybe in another language?

Chapters complete

  1. Scanning
  2. Represening code
  3. Parsing Expressions
  4. Evaluating Expressions
  5. Statements and State
  6. Control flow
  7. Functions (in progress)

Building

Just run CMake like this:

# in build dir
cmake <src-dir>

and then

cmake --build . --target lox

To build with tests:

# in build dir
cmake <src-dir> -DBUILD_TESTING=ON

To run tests:

cmake --build . --target check

Alternatively:

ctest .

Usage

Run a simple example:

lox examples/test.lox

TODO

License

This project is licensed under the MIT License, see LICENSE for more information.

About

C++ implementation of Lox interpreter (based on the book Crafting Interpreters by Bob Nystrom)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published