Files
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

62 lines
1.1 KiB
Plaintext
Raw Permalink 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(n);
%replace
true by '1'b,
false by '0'b;
dcl
n fixed,
accum char (128) var external,
line char (128) var static init('');
dcl
c char(1),
i fixed;
tracer:
proc;
put edit(n,' scan: ',accum) (skip,f(3),2a);
end;
do while(true);
if length(line) = 0 then
get 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
do;
call tracer();
return;
end;
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
do;
call tracer();
return;
end;
if verify(accum,'0123456789') ~= 0 then
do;
call tracer();
return;
end;
end;
end;
accum = line;
do;
call tracer();
return;
end;
end;
end;
call tracer();
end scan;