This is a language model sampler that uses a Backus–Naur form schema to compute allowed logits.
see github repository(https://github.com/Dan-wanna-M/bnfsampler) and try the consoleplayground program.