Solution to Homework 03 and Homework 04 of programming languages course
Pipenv is used to manage dependencies inside the project, it’s recommended to use it instead of installing dependencies by trial and error.
Python 3.7 was used to develop this project and pipenv will attempt to create a python 3.7 environment, it’s necessary to have it installed inside the machine. However I would seriously recommend to instead make use of pyenv as it’s much much easier than to manually install python versions and it’s supported by pipenv
Cd to project directory
Create a virtual environment for the project
pipenv install
If it’s desired to run unit tests create virtual environment in the following way
pipenv install --dev
Initialize a pipenv session by running
pipenv shell
Execute the program using the following structure
python minicompiler.py scanner INPUT_STRING
Execute the program using the following structure
python minicompiler.py parser INPUT_STRING
To execute unit tests in the project run pytest command