Skip to content
/ golox Public

Implementation of the Interpreter for the Lox language in Go

Notifications You must be signed in to change notification settings

godlixe/golox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an interpreter project for the language Lox from craftinginterpreters built in Golang, hence the name Golox. To run this project, you can run the executables located in the bin directory, or build the project using go build. Run a file by passing it as an argument to the program :

golox lex.golox

The interpreter is currently able to evaluate expressions and statements. It supports :

  • Variables and expressions
  • Blocks and scopes
  • Conditionals
  • For loop and while loop
  • Functions and returns

The goal is to make a working interpreter. Currently, the interpreter consists of :

  • Scanner
  • Parser
  • Interpreter
graph TD;
      Source-->Scanner;
      Scanner-->Tokens;
      Tokens-->Parser
      Parser-->Statements;
      Statements-->Interpreter;
Loading

Testing of the interpreter is still in process.