'Look in the tool\'s <stdio> elem for all <regex> subelements
that define how to look for warnings and fatal errors in
stdout and stderr. This will add all such regex elements
to the Tols\'s stdio_regexes list.'

def parse_stdio_regexes(self, stdio_elem):

    try:
        for regex_elem in stdio_elem.findall('regex'):
            regex = ToolStdioRegex()
            regex.desc = regex_elem.get('desc')
            if (regex.desc is None):
                regex.desc = regex_elem.get('description')
            regex.error_level = self.parse_error_level(regex_elem.get('level'))
            regex.match = regex_elem.get('match', '')
            if (regex.match is None):
                log.warning("Ignoring    tool's    stdio    regex    element    %s    -    the    'match'    attribute    must    exist")
                continue
            output_srcs = regex_elem.get('src')
            if (output_srcs is None):
                output_srcs = regex_elem.get('source')
            if (output_srcs is None):
                output_srcs = regex_elem.get('sources')
            if (output_srcs is None):
                output_srcs = 'output,error'
            output_srcs = re.sub('\\s', '', output_srcs)
            src_list = re.split(',', output_srcs)
            for src in src_list:
                if re.search('both', src, re.IGNORECASE):
                    regex.stdout_match = True
                    regex.stderr_match = True
                if re.search('out', src, re.IGNORECASE):
                    regex.stdout_match = True
                if re.search('err', src, re.IGNORECASE):
                    regex.stderr_match = True
                if ((not regex.stdout_match) and (not regex.stderr_match)):
                    log.warning(('Tool    id    %s:    unable    to    determine    if    tool    stream    source    scanning    is    output,    error,    or    both.    Defaulting    to    use    both.' % self.id))
                    regex.stdout_match = True
                    regex.stderr_match = True
            self.stdio_regexes.append(regex)
    except Exception:
        log.error(('Exception    in    parse_stdio_exit_codes!    ' + str(sys.exc_info())))
        trace = sys.exc_info()[2]
        if (trace is not None):
            trace_msg = repr(traceback.format_tb(trace))
            log.error(('Traceback:    %s' % trace_msg))
