    %% parse_id
%   function will parse the individual ids of the decls
% inputs:
%   string:string - string containing the read in prf file.
%   pos:int - position to start reading the string from.
% outputs;
%   id:structure - structure containing the parsed prf id section
%   new_pos:int - the position where the ending char was found.
% Author: Colin Eles elesc@mcmaster.ca
% Organization: McMaster Centre for Software Certification
function [id,new_pos] = parse_id(string,pos)
i = pos + 1;
id.id = [];
id.description = [];
id.run_date = [];
id.create_date = [];
id.status = [];
id.refers_to = [];
id.real_time = [];
id.run_time = [];
id.interactive = [];
id.decision_proc = [];


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

i = i + 1;

% find the description
if (string(i) == '"')
    stop_char = '"';
else
    stop_char = ' ';
end

while(string(i) ~= stop_char)
    id.description = [id.description string(i)];
    i = i + 1;
end

if (string(i) == '"')
    i = i + 1;
end

% get the create_date
i = i + 1;

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

% get the run date
i = i + 1;

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

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

[id.script, new_pos] = PVS_checker.parse_paren(string,i);

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

%get the status


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

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

% get the refers_to

if (string(i) == '(')
    [id.refers_to, new_pos] = PVS_checker.parse_paren(string,i);
    i = new_pos + 1;
else
    while(string(i) ~= ' ')
        id.refers_to = [id.refers_to string(i)];
        i = i + 1;
    end
end



% get the real_time

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

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


% get the run_time
while(string(i) == ' ' || string(i) == 10 || string(i) == 13)
    i = i + 1;
end

while(string(i) ~= ' ' )
    id.run_time = [id.run_time string(i)];
    i = i + 1;
end
% get the interactive

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

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

% get the decision_proc
while(string(i) == ' ' || string(i) == 10 || string(i) == 13)
    i = i + 1;
end

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

end