An open API service indexing awesome lists of open source software.

https://github.com/sheikhartin/bytecode-based-calculator

An interpreter just to execute mathematical expressions that are in the form of bytecode!
https://github.com/sheikhartin/bytecode-based-calculator

bytecode-interpreter bytecode-virtual-machine

Last synced: 3 months ago
JSON representation

An interpreter just to execute mathematical expressions that are in the form of bytecode!

Awesome Lists containing this project

README

          

## Bytecode Based Calculator

![GitHub repo status](https://img.shields.io/badge/status-active-green?style=flat)
![GitHub license](https://img.shields.io/github/license/sheikhartin/bytecode-based-calculator)
![GitHub contributors](https://img.shields.io/github/contributors/sheikhartin/bytecode-based-calculator)
![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/sheikhartin/bytecode-based-calculator)
![GitHub repo size](https://img.shields.io/github/repo-size/sheikhartin/bytecode-based-calculator)

This project aims to calculate mathematical expressions after converting them to bytecode!

### Using the REPL

The REPL supports several flags that modify its behavior:

- `-l`: Display the output of the lexer, which shows the tokenized version of the input.
- `-p`: Display the output of the parser, which shows the parsed structure of the input.
- `-g`: Display the generated bytecode for the input expression.

You can use these flags individually or in combination to see the different stages of interpretation. For example:

```bash
go run cmd/main.go -l -p -g
```

This command will display the lexer output, parser output, and generated bytecode before executing the expression.

### License

This project is licensed under the MIT license found in the [LICENSE](LICENSE) file in the root directory of this repository.