This repo contains the implementation of a tree-walking interpreter for Lox, a general-purpose object-oriented language from Crafting Interpreters.
It can run programs like:
class Vehicle {
init(brand) {
this.brand = brand;
}
describe() {
return "This is a " + this.brand;
}
}
class Car < Vehicle {
init(brand, model) {
super.init(brand);
this.model = model;
}
describe() {
return super.describe() + " " + this.model;
}
}
var myCar = Car("Toyota", "Camry");
print myCar.describe();