A Prolog program may contain one or more grammar rules. These grammar rules may be used to define the syntax of a language and to define a parser for that language.
A grammar rule takes the form:
grammar_head --> grammar_body.Where grammar_head is a non-terminal symbol optionally followed by a terminal symbol. The body of the grammar rule is a sequence of terminals, non-terminals or grammar conditions, each separated by commas or semi-colons. A grammar condition is a sequence of Prolog call terms surrounded by curly brackets (’{’ and ’}’).