https://github.com/crizmo/mew
A Python-based stack interpreter for a custom bytecode language. The interpreter reads .mew files, parses the opcodes and operands, and executes them.
https://github.com/crizmo/mew
interpreter python stack
Last synced: 11 months ago
JSON representation
A Python-based stack interpreter for a custom bytecode language. The interpreter reads .mew files, parses the opcodes and operands, and executes them.
- Host: GitHub
- URL: https://github.com/crizmo/mew
- Owner: crizmo
- Created: 2024-04-09T15:22:28.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T12:34:38.000Z (over 1 year ago)
- Last Synced: 2024-11-17T23:11:51.287Z (over 1 year ago)
- Topics: interpreter, python, stack
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mew Interpreter Project
This project is a simple stack-based interpreter written in Python. It interprets a custom bytecode language with a variety of opcodes.
The source code files are written in `.mew` extension.
## Project Structure
The project consists of the following files:
- `main.py`: The main driver of the program. It reads the `.mew` files, parses the opcodes and operands, and passes them to the interpreter for execution.
- `modules/interpreter.py`: Contains the Interpreter class which executes the opcodes.
- `modules/stack.py`: Contains the Stack class which is used by the interpreter to store values.
- `modules/opcodes.py`: Defines the opcodes that the interpreter can execute.
## Features
The interpreter supports a variety of opcodes, including `PUSH`, `PRINT`, `SHOW`, and `JUMP.EQ.0`. For a full list of supported opcodes, refer to the `opcodes.py` file.
## Usage
To use the interpreter, you need to provide it with a program written in the custom bytecode language. The program should be a list of opcodes and operands in a `.mew` file. Run the `main.py` file with the `.mew` file as an argument.
## Requirements
- Python 3.x
## Installation
No installation is necessary. Just clone the repository and run `main.py` with Python.
## Contributing
Contributions are welcome. Please submit a pull request or create an issue to discuss the changes you want to make.