A reaction grammar implementation exists already in x4i, but as pyparser implementation here: https://github.com/brown170/x4i/blob/main/src/x4i/exfor_grammars.py