Skip to content

chettriyuvraj/lox-crafting-interpreters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lox-crafting-interpreters

Porting the tree-walk interpreter for the Lox programming language to Go.

I am in the process of porting the Lox programming language, as described in Part II of Crafting Interpreters to Go.

  • Ported the Scanner.
  • Started porting the tokenizer, (5) != (6) spits out an ugly-printed AST as BinaryExpr { Left GroupingExpr { Expr LiteralExpr { Value 5 } };; Operator Type != Lexeme != Literal Line 0 ;; Right GroupingExpr { Expr LiteralExpr { Value 6 } } }

Usage

  • go run main.go [filename] OR go run main.go which starts a prompt for you to input source code.

Output

  • You can look up the Lox syntax
  • As of now, on input-ing source code, it will spit out the AST (not for all statements, but basic ones -> completed Parsing expressions)

About

Porting the tree-walk interpreter for the Lox programming language to Go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages