The predicate
represents the second way of interpreting stream contents. It reads the next token from the current input stream, unifies it with Token, and its token class is unified with Class. A token is either a sequence of characters with the same or compatible character class, e.g. ab_1A, then it is a Prolog constant or variable, or a single character, e.g. ')'. The token class represents the type of the token and its special meaning, e.g. fullstop, comma, open_par, etc.read_token(Token, Class)
reads a token from the specified stream. A further, very flexible possibility to read a sequence of characters is provided by the built-insread_token(Stream, Token, Class)
Here, the input is read up to a specified delimiter or up to a specified length, and returned as an ECLiPSe string.read_string(Stream, Delimiters, Length, String) read_string(Delimiters, Length, String)