format grammar in 1a as code blocks