Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 959 Bytes

README.md

File metadata and controls

16 lines (10 loc) · 959 Bytes

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)