Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Pylasu Interpreter Example
This [Interpreter Example project](https://github.com/Strumenta/pylasu-interpreter-example) demonstrates an interpreter implementation using the [Pylasu](https://github.com/strumenta/pylasu) library. For details, you can check the the Virtual Meetup - [Building an interpreter in Python with Pylasu](https://www.youtube.com/watch?v=W1SqfflBwcc).

- Prerequisites: Python, Git
## Setup

### Installation

Clone the repository
```bash
git clone git@github.com:Strumenta/pylasu-interpreter-example.git
cd pylasu-interpreter-example
```

Activate the virtual environment
```python
python -m venv venv
source venv/bin/activate
pip install -r Requirements.txt
```

Generate the parsers inside the **entity_parser** folder
```bash
sh generate_parsers.sh
```
### Usage

Run the interpreter though a local server at http://127.0.0.1:5000/
```bash
sh run_web.sh
```

### Version Compatibility
This project is designed to work with python 3.12.
In case of version issues, you can use pyenv, e.g.
```bash
pyenv install 3.<another-version>
pyenv local 3.<another-version>
```

6 changes: 3 additions & 3 deletions Requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ antlr4-python3-runtime==4.11.1
click==8.1.3
Flask==2.2.2
future-fstrings==1.2.0
importlib-metadata==5.0.0
importlib-metadata==6.0.0 # Update to a version compatible with Python 3.12
itsdangerous==2.1.2
Jinja2==3.1.2
lxml==4.9.1
lxml==4.9.3 # Use a more recent version
MarkupSafe==2.1.1
ordered-set==4.1.0
pyecore==0.13.0
pylasu==0.3.0
RestrictedPython==6.0
RestrictedPython==7.2 # Update to the newer version
Werkzeug==2.2.2
zipp==3.10.0