mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-26 09:54:20 +00:00
44 lines
896 B
Plaintext
44 lines
896 B
Plaintext
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;
|
||
|