Definite Clause Grammars

A DCG consists of a set of rules in a notation based on logic programming. Each rule is similar to a context-free rule, with variables to show connections between the constituents involved, and an arbitrary test or action can be appended to the rule (for example, to handle number-agreement). DCGs are an extension of the grammar-rule notation in PROLOG , and can be used to parse a string simply by interpreting them in a manner similar to the execution of a Prolog program.