sheikhartin / bytecode-based-calculator

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bytecode Based Calculator

GitHub repo status GitHub license GitHub contributors GitHub tag (latest by date) GitHub repo size

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:

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 file in the root directory of this repository.

About

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

License:MIT License


Languages

Language:Go 100.0%