Skip to content

JayZenith/interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interpreter

An imperative, expression-based language built in C++. Features a tokenizer, recursive-descent parser, and a tree-walking interpreter with an interactive REPL.

Features

  • REPL for live code execution
  • Arithmetic expressions with operator precedence
  • Variable bindings with lexical scoping
  • AST-based execution via tree-walk evaluation

Quick Start

Build

mkdir build && cd build
cmake .. && make

The executable will be testy in the build/ directory.

Run REPL

./testy

Example

>>> let x = 10;
10
>>> x * 3 + 2;
32
>>> let y = x - 4;
6
>>> y + x;
16
>>> exit 0;

What I learned

Built a simple interpreter from scratch, covering lexical analysis, AST construction, and runtime evaluation. Gained hands-on experience with smart pointers, RAII, and recursive parsing in C++.

About

An imperative, expression-based language built in C++.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published