next up previous index
Next: Term I/O Up: Communication with Streams Previous: Character I/O

Token I/O

The predicate

read_token(Token, Class)
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(Stream, 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-ins    
read_string(Stream, Delimiters, Length, String)
read_string(Delimiters, Length, String)
Here, the input is read up to a specified delimiter or up to a specified length, and returned as an ECLiPSe string.



Micha Meier
Mon Mar 4 12:11:45 MET 1996