{****************************************************************************} {* Puffer-Operationen mit FIFO *} {****************************************************************************} FUNCTION leer(VAR x : line) : boolean; VAR h : boolean; i : integer; BEGIN h:=true; i:=1; WHILE h AND (i<=length(x)) DO BEGIN h:=ord(x[i])=32; i:=i+1 END; leer:=h END; FUNCTION EndOfBlock : boolean; VAR h : boolean; BEGIN h:=EOF(MainFile); IF IncludeFlag THEN IF EOF(InclFile) THEN BEGIN h:=true; IncludeFlag:=false; SchliessIncludeFile END; IF NOT(h) THEN h:=leer(zeile); IF NOT(h) THEN h:=Sonder(zeile); IF PufferGroesse>PL-MT-MB-3 THEN h:=true; EndOfBlock:=h END; PROCEDURE ClearPuffer; BEGIN p:=Anfang; WHILE p^.Naechster<>NIL DO BEGIN q:=p; dispose(p); p:=q^.Naechster; END; dispose(p); PufferVoll:=false END; PROCEDURE LiesPuffer; BEGIN PufferGroesse:=0; new(q); Anfang:=q; q^.Naechster:=NIL; REPEAT IF IncludeFlag THEN readln(InclFile,zeile) ELSE readln(MainFile,zeile); q^.Eintrag:=zeile; PufferGroesse:=PufferGroesse+1; new(p); q^.Naechster:=p; p^.Naechster:=NIL; q:=p; UNTIL EndOfBlock; PufferVoll:=true END;