[ Term I/O | Reference Manual | Alphabetic Index ]

# read_annotated(+Stream, -AnnTerm)

Read term with type and source position information

Stream
  Stream handle or alias (atom)
AnnTerm
  Variable or term

## Description

This is defined as

        read_annoated(Stream, AnnTerm) :-
            read_annotated(Stream _Term, AnnTerm).

### Modes and Determinism

- read_annotated(+, -) is semidet

### Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

### Fail Conditions

Fails if a syntax error was detected and no term could be read

### Exceptions

(4) instantiation fault
  Stream is not instantiated.
(5) type error
  Stream is not an atom or a stream handle.
(190) end of file reached
  End of file was encountered before reading any character.
(192) illegal stream mode
  Stream is not an input stream.
(193) illegal stream specification
  Stream is an illegal stream specification.
(198) reading past the file end
  Trying to read even after the error 190 was raised.

## See Also

read_annotated / 3