IMPLEMENTATION MODULE StreamLookAhead;

FROM Streams IMPORT Stream, InputStream;
IMPORT LookAhead;

  CLASS StreamLookAhead;
    INHERITS LookAhead;
    VAR
      TheStream: InputStream;

    REDEFINE METHOD CREATE (Input: InputStream;
                            KeepComments: BOOLEAN);
      BEGIN
      BASE(KeepComments);
      TheStream := Input;
      END CREATE;

    REDEFINE METHOD GetLine: ARRAY OF CHAR;
      BEGIN
      IF NOT TheStream.Eof THEN
        RESULT := TheStream.ReadLine;
        END;
      END GetLine;

    END StreamLookAhead;

END StreamLookAhead;

