/cs444

A JOOS (Java Object-Oriented Subset) compiler created for the Compilers course at the University of Waterloo.

Primary LanguageJava

Compiler

A Python3 compiler for the Joos 1W language.

Running Locally

Get Python 3.10 or greater

Install Python Requirements

sudo apt install curl build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

Curl pyenv from Using bash

curl https://pyenv.run | bash

Update ~/.bashrc with the Relevant Lines

printf "%s\n" '' 'export PATH="$HOME/.pyenv/bin:$PATH"' 'eval "$(pyenv init -)"' 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc

Reload the ~/.bashrc

source ~/.bashrc

Install Python 3.10

pyenv install 3.10

Create a Virtual Environment

Use Python 3.10

pyenv local 3.10

Make the Virtual Environment Folder

python3 -m venv env

Activate Virtual Environment

source env/bin/activate

Run the Relevant Python File

Install the Given Requirements

python3 -m pip install -r requirements.txt

Run the main.py File

python3 src/main.py -a=1

Building

Single Input file

Create the joosc executable for the file

make

Parse the Input File

./joosc ./assignment_testcases/a1/J1_01.java

Multiple Input Files

Create the joosc executable for the files

make

Parse the Input Files

./joosc ./assignment_testcases/a1/J1_01.java