This repository contains Python code to test Owl; a parser generator for visibly pushdown grammars. It is part of research by Luc Timmerman at the University of Twente.
Running these tests for yourself is simple (these instructions should work for any OS with:
-
Clone the repository;
-
Edit the variables at the top of
main.py
to your liking:TOTAL_MEMORY_GB
: the total memory in gigabytes which you'd like to dedicate to the testing;TOTAL_WORKER_COUNT
: the total number of threads you'd like to dedicate to the testing;TYPES
: the types you'd like to test for (by default, this is all of them);TEST_COUNT
: the number of tests;STEP_SIZE
: the size of the steps in size between tests;REMOVE_AFTERWARDS
: whether or not the generated grammars and resulting parsers should be removed after running.
As such, when using the default values (
TEST_COUNT
of 1000 andSTEP_SIZE
of 10), 1000 tests will be run with sizesN = 0
,N = 10
,N = 20
up toN = 9990
; -
Install dependencies (like
matplotlib
andnumpy
) using the method of your choice; -
Running can be done by simple executing
python main.py
. When testing large sample sizes, it might be beneficial to usenice
(orSTART
on Windows systems) to set a priority for the threads created by usingnice -n 10 python3 main.py
.
Depending on the setting of REMOVE_AFTERWARDS
, this will generate a number of files:
{grammar-type}_result.json
files: these are files containing the results of the tests with an entry for every input size per grammar type including:time
: time to parse and generate in seconds;lines
: number of lines in the resulting parser.
{grammar-type}.png
: a fitted graph displaying the results for a certain grammar type;tests/
: the grammars generated. The filenames are structured as follows:{grammar-type}_{N}
;parsers/
: the parsers generated by Owl. Their filenames correspond to those of the generated grammars.