Files
Digital-Research-Source-Code/MPM OPERATING SYSTEMS/MPM-86/MISC DRI DISKS/09/SCAN.PLI
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

44 lines
896 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

scan:
proc;
%replace
true by '1'b,
false by '0'b;
dcl
f_stack(8) file variable external,
f_top fixed external,
accum char (128) var external,
line char (128) var static init('');
dcl
c char(1),
i fixed;
do while(true);
if length(line) = 0 then
get file(f_stack(f_top)) edit(line) (a);
else
line = substr(line,length(accum)+1);
i = verify(line,' ');
if i = 0 then
line = '';
else
do;
line = substr(line,i);
accum = substr(line,1,1);
if index('[]->;().,"',accum) ~= 0 then
return;
do i = 2 to length(line);
c = substr(line,i,1);
if index(' []->;().,',c) ~= 0 then
do;
accum = substr(line,1,i-1);
if c ~= '.' then
return;
if verify(accum,'0123456789') ~= 0 then
return;
end;
end;
accum = line;
return;
end;
end;
end scan;