This library provides various commonly used DCG primitives acting on list of character codes. Character classification is based on code_type/2.
This module started its life as library(http/dcg_basics)
to support the HTTP protocol. Since then, it was increasingly used in
code that has no relation to HTTP and therefore this library was moved
to the core library.
//
...,
string_without("\n", RestOfLine)
| EndCodes | is a list of character codes. |
//
upto_colon(Atom) -->
string(Codes), ":", !,
{ atom_codes(Atom, Codes) }.
////space character from input. Space characters
include newline.
//graph characters//graph) character.//////white character from input. White characters do
not include newline.//alpha) and return it as a lowercase
letter. If C is instantiated and the DCG list is already
bound,
C must be lower and matches both a lower and
uppercase letter. If the output list is unbound, its first element is
bound to C. For example:
?- alpha_to_lower(0'a, `AB`, R). R = [66]. ?- alpha_to_lower(C, `AB`, R). C = 97, R = [66]. ?- alpha_to_lower(0'a, L, R). L = [97|R].
//////////////////////eos --> call(eos_). eos_([], []).
//////