basics.pl -- Various general DCG utilities
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(+EndCodes, -Codes)// is det
- Take as many codes from the input until the next character code
appears in the list EndCodes. The terminating code itself is
left on the input. Typical use is to read upto a defined
delimiter such as a newline or other reserved character. For
example:
..., string_without("\n", RestOfLine)
Undocumented predicates
The following predicates are exported, but not or incorrectly documented.
- blank(Arg1, Arg2)
- remainder(Arg1, Arg2, Arg3)
- xdigit(Arg1, Arg2, Arg3)
- integer(Arg1, Arg2, Arg3)
- blanks_to_nl(Arg1, Arg2)
- whites(Arg1, Arg2)
- eos(Arg1, Arg2)
- xdigits(Arg1, Arg2, Arg3)
- alpha_to_lower(Arg1, Arg2, Arg3)
- digit(Arg1, Arg2, Arg3)
- nonblanks(Arg1, Arg2, Arg3)
- nonblank(Arg1, Arg2, Arg3)
- white(Arg1, Arg2)
- prolog_var_name(Arg1, Arg2, Arg3)
- number(Arg1, Arg2, Arg3)
- digits(Arg1, Arg2, Arg3)
- blanks(Arg1, Arg2)
- atom(Arg1, Arg2, Arg3)
- xinteger(Arg1, Arg2, Arg3)
- float(Arg1, Arg2, Arg3)
- string(Arg1, Arg2, Arg3)