in reply to converting context free grammar to BNF

How is it failing for you? Do you get an error message?

Note that you don't use Parse::RecDescent but seem to be using a module "Grammar::BNF", which doesn't exist on CPAN.

Also, your syntax seems weird for Perl 5:

my $g = Grammar::BNF.generate(Q:to<END>

This seems to be closer to Perl 6 syntax, but with the little information you've given us, that's hard to tell.

Please help us help you better by providing the version of Perl you're using and the exact error message(s) you get. Also, please provide us a small sample of code you're trying to parse using your BNF.