I've been trying to get grammarinator to generate random test programs based on the openQasm3.0 grammar (https://github.com/Qiskit/openqasm/blob/master/source/grammar/qasm3.g4), What I want to get is:
qasm3.g4 -> Antlr4py3 -> *.g4 files -> Grammarinator-generate -> a bunch of valid program files as tests.
So far what I got is:
- antlr4py3 -o ./somedir qasm3.g4 (which is based on the instructions given on openqasm github)
- Step 1 yielded a bunch of files, most importantly: qasm3Lexer.py, qasm3Parser.py, qasm3Lexer.tokens, qasm3tokens.
- When I looked at them, they don't seem to reminiscence what grammarinator expects. Based on info and examples that I read online, I need to feed grammarinator-process and grammarinator-generate with some g4 files, such as qasm3Lexer4 and qasm3Parser.g4 etc, but I can't find them from Step 2. I tried to feed them with the *.py files from step 2, but they generated gibberish test programs.
Some of the commands that I tried are:
i) grammarinator-process qasm3Lexer.tokens qasm3.tokens -o
ii) grammarinator-process qasm3.g4 -o output
Followed by: grammarinator-generate -l qasm3Unlexer.py -p qasm3Uparser.py -r program -n number -d depth -o test.txt
I've also tried various combinations, compared the samples with what's in qasm3, but to no avail, and I'm lost. Just wondering if someone could give me some pointers on how to proceed? Thanks in advance.