%% parse_prf_file
%   function will parse a pvs prf file inputed as a string and
%   return the results parsed into a stucture, parseing based on
%   "Batch Proving and Proof Scripting in PVS" section 3.
% inputs:
%   string:string - string containing the read in prf file.
% outputs;
%   theory_id:string - Theory name
%   decls:structure - structure of the declarations for the theory
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [theory_id, decls] = parse_prf_file(string)
decls = [];

if string(1) ~= '('
    msgbox('error reading file');
end
i = 2;
theory_id = [];
% find theory name
while (string(i) ~= ' ')
    theory_id = [theory_id string(i)];
    i = i + 1;
end
% addvance to next (
while (string(i) ~= '(')
    i = i+1;
end

while(string(i) ~= ')')
    if (string(i) == '(')
        pos = i;
        [decl_id_temp, pos_temp] = PVS_checker.parse_decl_id(string,pos);
        decls = [decls decl_id_temp];
        i = pos_temp;
    end
    i = i + 1;
end
end