- Python 3
- Java 11
- Create a Python virtual environment
python3 -m venv venv
- Activate virtual environment
source venv/bin/activate
- Install dependencies
pip install -r requirements.txt
- (If needed) Make changes to the lexer and parser declarations in the "ducklang.g4" file, then run this command to generate the necessary Python module files
java -jar antlr-4.13.2-complete.jar -Dlanguage=Python3 ducklang.g4
- (If needed) Make changes to the input file where the ducklang code is ("input_ducklang_code.txt")
- (If needed) Make changes to the semantic analyzer ("ducklangSemanticAnalyzer.py"), and/or to the file that executes the compiler ("main.py")
- Execute the parser
python main.py
- Deactivate virtual environment
deactivate venv