Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

xNaCly/tiny-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiny-interpreter

INFO: currently only lexing is implemented, you shouldn't use this language 💀

Learning and applying concepts from the building compilers class in go (building an interpreter (soph) for my own programming language, teolang). The interpreter does not use any external dependencies.

Setup and running

requires git and go

git clone https://github.com/xNaCly/tiny-interpreter.git
# this will start the repl:
go run .

Building

git clone https://github.com/xNaCly/tiny-interpreter.git
# this will start the repl:
go build -o soph

Interpreter

The interpreter supports a sophisticated scripting language called the teolang (file ending *.teo)

Operating modes

REPL

To run the interpreter in read eval print line mode, simply invoke it by calling the built binary or following the steps above and running it using go run ..

File mode

To feed the interpreter a file to execute, simply call the interpreter with the file to run as an argument:

soph file.teo

Command line arguments

Help

To view the help invoke the interpreter with either the -h or the --help flag:

soph -h
soph --help
go run . -h
go run . -help

This readme will probably not be as up to date as the above command. Run the executable and take a look at the help output for more info.

Examples

Take a look at the *.teo files in the /examples directory. To run an example, run the following command:

sophia hello_world.teo

About

The teo programming language interpreter

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages