NB.
FAIL is just {fail} or dcg_core:fail
SUCCEED is {repeat} or dcg_core:repeat.
FENCE is ! (cut).
Sequence capture in SNOBOL ($) is also $ here: use Phrase $ List to
capture the sequence matched by Phrase in the List.
ABORT cannot be implemented in plain Prolog because there is no
ancestral cut operator. Instead abort//0 just throws an exception
which you must arrange to catch yourself.
POS, RPOS, TAB and RTAB are not context-free rules and can only be
implemented in paired-state DCG which counts the current position in
the string.
- rem// is det
- any(+L:list(_))// is nondet
- Matches any element of L.
- notany(+L:list(_))// is nondet
- Matches anything not in L.
- arb// is nondet
- Matches an arbitrary sequence. Proceeds cautiously.
- arbno(+P:phrase)// is nondet
- Matches an arbitrary number of P. Proceeds cautiously.
Any variables in P are shared across calls.
- span(+L:list(_))// is nondet
- Matches the longest possible sequence of symbols from L.
- break(+L:list(_))// is nondet
- Matches the longest possible sequence of symbols not in L.
- len(+N:natural)// is det
- len(-N:natural)// is nondet
- Matches any N symbols.
- bal(+Delims:list(C))// is nondet
- Matches any expression with balanced generalised parentheses.
The opening and closing parenthesis must be supplied as a list
of terminals [Open,Close].
Undocumented predicates
The following predicates are exported, but not or incorrectly documented.
- $(Arg1, Arg2, Arg3, Arg4)