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!
- Host: GitHub
- URL: https://github.com/sheikhartin/bytecode-based-calculator
- Owner: sheikhartin
- License: mit
- Created: 2024-04-05T08:19:09.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-06T05:05:31.000Z (almost 2 years ago)
- Last Synced: 2024-04-06T10:35:06.966Z (almost 2 years ago)
- Topics: bytecode-interpreter, bytecode-virtual-machine
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 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.