home *** CD-ROM | disk | FTP | other *** search
- var
- f1, f2 : text;
- i,j : integer;
- eqPos, stPos : integer;
- a,b,proc : string[200];
- c : char;
- delim : set of char;
-
-
- procedure skip_to_quote;
- begin
- i:= i+1;
- while not (a[i] in [#13,#34]) do i:= i+1;
- if a[i] = #34 then i:= i+1;
- end;
-
-
- procedure skip_to_end;
- begin
- i:= i+1;
- while (a[i] <> #13) do i:= i+1;
- end;
-
-
- begin
- delim:= ['A'..'Z','a'..'z','0'..'9','_'];
- assign(f1,'pcvis5.pas');
- assign(f2,'var2');
- reset(f1);rewrite(f2);
- readln(f1,a);
- i:= 0; j:= 1;
- repeat
- if pos('procedure',a) > 0 then proc:= a;
- eqPos:= pos(':=',a)-1;
- while (a[eqPos] = ' ') do eqPos:= eqPos - 1;
- if (eqPos > 1) and (a[eqPos] in delim) then
- begin
- stPos:= eqPos;
- while a[stPos] in delim do
- stPos:= stPos - 1;
- b:= copy(a,stPos+1,eqPos - stPos);
- a:= copy(a,eqPos+1,length(a));
- if proc <> '' then writeln(f2,proc);
- proc:= '';
- writeln(f2,b);
- end
- else
- readln(f1,a);
- until eof(f1);
- close(f1);close(f2);
- end.