sh your_program.sh run filename.lox # if you want to run code
sh your_program.sh tokenize filename.lox # if you want to get all tokens
sh your_program.sh parse filename.lox # if you want to parse expression
sh your_program.sh evaluate filename.lox # if you want to evaluate expression
-
expressions
-
statements
-
control flow (branches, loops)
-
functions
-
classes, methods
-
inheritance
-
arrays (partly, they're immutable, no helpfull builtins, only declaration and subscription)
class Base {
method() {
print "Base.method()";
}
}
class Parent < Base {
method() {
super.method();
}
}
class Child < Parent {
method() {
super.method();
}
}
var parent = Parent();
parent.method();
var child = Child();
child.method();
Base.method()
Base.method()