home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / TURBO9.ZIP / XREF.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1984-09-08  |  1.1 KB  |  51 lines

  1. var
  2.   f1, f2       : text;
  3.   i,j          : integer;
  4.   eqPos, stPos : integer;
  5.   a,b,proc     : string[200];
  6.   c            : char;
  7.   delim        : set of char;
  8.  
  9.  
  10. procedure skip_to_quote;
  11. begin
  12.   i:= i+1;
  13.   while not (a[i] in [#13,#34]) do  i:= i+1;
  14.   if a[i] = #34 then i:= i+1;
  15. end;
  16.  
  17.  
  18. procedure skip_to_end;
  19. begin
  20.   i:= i+1;
  21.   while (a[i] <> #13) do  i:= i+1;
  22. end;
  23.  
  24.  
  25. begin
  26.   delim:= ['A'..'Z','a'..'z','0'..'9','_'];
  27.   assign(f1,'pcvis5.pas');
  28.   assign(f2,'var2');
  29.   reset(f1);rewrite(f2);
  30.   readln(f1,a);
  31.   i:= 0; j:= 1;
  32.   repeat
  33.     if pos('procedure',a) > 0 then proc:= a;
  34.     eqPos:= pos(':=',a)-1;
  35.     while (a[eqPos] = ' ') do eqPos:= eqPos - 1;
  36.     if (eqPos > 1) and (a[eqPos] in delim) then
  37.       begin
  38.         stPos:= eqPos;
  39.         while a[stPos] in delim do
  40.           stPos:= stPos - 1;
  41.         b:= copy(a,stPos+1,eqPos - stPos);
  42.         a:= copy(a,eqPos+1,length(a));
  43.         if proc <> '' then writeln(f2,proc);
  44.         proc:= '';
  45.         writeln(f2,b);
  46.       end
  47.     else
  48.       readln(f1,a);
  49.   until eof(f1);
  50.   close(f1);close(f2);
  51. end.