Lox interpreter
Project · challenge · 2024
Lox interpreter is his solution, in Kotlin, to CodeCrafters' "Build your own interpreter" challenge. Lox is the small scripting language from Robert Nystrom's book Crafting Interpreters.
What's built
The code follows the first stages of an interpreter:
- a lexer that turns source text into tokens;
- a parser that turns tokens into an expression tree;
- an AST printer that shows the parsed tree, with expressions walked through the visitor pattern.
A test script runs a sample .lox file.
See also
In the knowledge graph
Lox interpreter and the 5 things it is linked to. Open any dot for its page, or explore it in the full graph.
As data
Everything on this page is read from triples in the knowledge graph. These are the 17 it states about Lox interpreter, and 2 more its ontology implies; the console runs SPARQL over the whole graph, here in your browser.
@prefix id: <https://ask.chaipat.cc/id/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix cj: <https://ask.chaipat.cc/ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . id:LoxInterpreter a cj:Project ; rdfs:label "Lox interpreter" ; cj:description "Interpreter for the Lox language (CodeCrafters “Build your own interpreter”)." ; cj:context id:OpenSource ; cj:repository "https://github.com/AppleBoiy/LoxInterpreter"^^xsd:anyURI ; cj:firstCommit "2024-07-12"^^xsd:date ; cj:lastCommit "2024-07-14"^^xsd:date ; cj:commitCount 28 ; cj:kind "challenge" ; cj:theme id:ThemeSystems ; cj:uses id:Kotlin ; cj:tier 3 ; cj:integrates id:CodeCrafters ; cj:partOf id:CodeCraftersSeries ; cj:article "https://ask.chaipat.cc/wiki/LoxInterpreter"^^xsd:anyURI ; cj:activeIn id:Y2024 ; cj:activity _:b96 .