Did you know ... Search Documentation:
dcg.pl -- Grammar rule (DCG) compiler
PublicShow source

This module provides the term-expansion rules for DCGs as well as phrase/2,3 and call_dcg/3 for calling DCGs. The original code was copied from C-Prolog and written by Fernando Pereira, EDCAAD, Edinburgh, 1984. Since then many people have modified and extended this code.

DCGs have for a long time been a moving target, notably when it comes to dealing with cuts and unification delaying for calls to non-DCG code. This has slowly converged. This implementation attempts to be closely compatible to the pending ISO standard for DCGs.

Source phrase(:RuleSet, ?List)
Source phrase(:RuleSet, ?List, ?Rest)
Interface to DCGs

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Source dcg_translate_rule(Arg1, Arg2, Arg3, Arg4)
Source phrase(Arg1, Arg2, Arg3)
Source call_dcg(Arg1, Arg2, Arg3)
Source dcg_translate_rule(Arg1, Arg2)