Lox interpreter written in C# (.NET 7)
This is my 2nd attempt. First one can be found here: https://github.com/h2oboi89/lox.archive
Based on Bob Nystrom's Lox book
- website: Crafting Interpreters
- github: munificent/craftinginterpreters
Links are organized as [online book link] : [source code tag link].
NOTE: some sections do not contain a tag link as they only represent a partial section of code that did not lend itself to testing.
- Scanning : Scanning
- Representing Code
- Parsing Expressions : Parsing
- this tag fixes some missing code that should have been in Scanning tag.
- Evaluating Expressions : EvaluatingExpressions
- Statements and State : Statements
- Control Flow : ControlFlow
- Functions : Functions
- Resolving and Binding : ResolveAndBinding
- Classes : Classes
- Inheritance : Inheritance
- Reworked interpreter to facilitate testing (see Interpreter.Tests)
- Superclass format is like C# (
class : superclass
) instead of using<
-
block comments
-
ternary expressions
-
comma separated expression (var a = 1, var b = 2;)
-
detect divide by zero
-
REPL autoprints expressions
-
add continue and break
-
anonymous functions
-
report unused variables
-
static methods for classes
-
public, private, protected fields and methods
-
getters and setters
-
multiple inheritance
-
interfaces
-
read user input built-ins
-
namespaces and imports?
-
enforce class name is upper case
-
virtual, abstract, override
-
warn user if field overrides method name
-
make print a built-in function
-
global scope not special (no more multiple declarations)
-
allow single line functions (no braces)