Author(s): Daniel Cabeza.
Version: 0.4#5 (1998/2/24)
This module provides predicates for doing input/output with strings (character code lists) and for including in grammars defining strings.
strings
)strings
)
get_line(Stream, Line)
Reads from Stream
a line of text and unifies Line
with it. The end of the line can have UNIX [10] or MS-DOS [13 10] termination, which is not included in Line
. At EOF, the term end_of_file is returned.
Usage:
strings:line(Line)
(strings:line/1
)
Stream
is an open stream.
(streams_basic:stream/1
)
strings:line(Line)
(strings:line/1
)
get_line(Line)
Behaves like current_input(S), get_line(S,Line)
.
Usage:
strings:line(Line)
(strings:line/1
)
strings:line(Line)
(strings:line/1
)
write_string(Stream, String)
Writes String
onto Stream
.
Usage:
Stream
is an open stream.
(streams_basic:stream/1
)
String
is a string (a list of character codes).
(basic_props:string/1
)
write_string(String)
Behaves like current_input(S), write_string(S, String)
.
Usage:
String
is a string (a list of character codes).
(basic_props:string/1
)
whitespace(String, Rest)
In a grammar rule, as whitespace/0
, represents whitespace (a positive number of space (32), tab (9), newline (10) or return (13) characters). Thus, Rest
is a proper suffix of String
with one or more whitespace characters removed. An example of use would be:
attrs([]) --> "" attrs([N|Ns]) --> whitespace, attr(N), attrs(Ns).
Usage:
Rest
is a string (a list of character codes).
(basic_props:string/1
)
String
is a string (a list of character codes).
(basic_props:string/1
)
Rest
is a string (a list of character codes).
(basic_props:string/1
)
whitespace0(String, Rest)
In a grammar rule, as whitespace0/0
, represents possible whitespace (any number of space (32), tab (9), newline (10) or return (13) characters). Thus, Rest
is String
or a proper suffix of String
with one or more whitespace characters removed. An example of use would be:
assignment(N,V) --> variable_name(N), whitespace0, "=", whitespace0, value(V).
Usage:
Rest
is a string (a list of character codes).
(basic_props:string/1
)
String
is a string (a list of character codes).
(basic_props:string/1
)
Rest
is a string (a list of character codes).
(basic_props:string/1
)
string(String, Head, Tail)
In a
grammar rule, as string/1
, represents literally String
. An example of use would be:
double(A) --> string(A), string(A).
Usage:
String
is a string (a list of character codes).
(basic_props:string/1
)
Head
is a string (a list of character codes).
(basic_props:string/1
)
Tail
is a string (a list of character codes).
(basic_props:string/1
)
String
is a string (a list of character codes).
(basic_props:string/1
)
Head
is a string (a list of character codes).
(basic_props:string/1
)
Tail
is a string (a list of character codes).
(basic_props:string/1
)
strings
)A property, defined as follows:
line(L) :- string(L). line(end_of_file).
Go to the first, previous, next, last section, table of contents.