%% parse_decl_id
%   function will parse the theory declaration portion of the prf
%   file
% inputs:
%   string:string - string containing the read in prf file.
%   pos:int - position to start reading the string from.
% outputs;
%   decl_id:string - the declaration id name
%   new_pos:int - the position where the ending char was found.
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [decl_id,new_pos] = parse_decl_id(string,pos)
i = pos + 1;
decl_id.id = [];
decl_id.default_proof_posn = [];
decl_id.ids = [];

while(string(i) ~= ' ')
    decl_id.id = [decl_id.id string(i)];
    i = i + 1;
end

while(string(i) == ' ' || string(i) == 10 || string(i) == 13)
    i = i + 1;
end


while(string(i) ~= ' ')
    decl_id.default_proof_posn = [decl_id.default_proof_posn string(i)];
    i = i + 1;
end

while(string(i) ~= '(')
    i = i + 1;
end


while(string(i) ~= ')')
    if (string(i) == '(')
        pos = i;
        [id_temp, pos_temp] = PVS_checker.parse_id(string,pos);
        decl_id.ids = [decl_id.ids id_temp];
        i = pos_temp;
    end
    i = i + 1;
end
new_pos = i;


end