Here are some examples of using defgrammar .
defgrammar
KnowledgeWorks and Prolog User Guide (Windows version) - 6 Dec 2011