def getLinesWithRegExp(lines):
    dico = {}
    for xd in ['XD', '2XD', '3XD']:
        debut = 0
        for line in lines:
            line += ' '
            if ((len(line.strip()) >= 8) and (line.split()[0] == 'New_file')):
                debut = 1
                filename = line.split()[1]
            elif re.findall((('//[ ]*' + xd) + '[ ]+'), line):
                li = re.findall(((re.escape(xd) + '(.*)') + re.escape(' ')), line)[0].split(' ')
                li = [x for x in li if x.strip()]
                desc = re.split((('//[ ]*' + xd) + '[ ]+'), line)[(- 1)]
                if (li[0] == 'attr'):
                    if (debut < 2):
                        raise Exception(((('error in ' + filename) + ' first line XD ') + line))
                    desc2 = li[1:]
                    dico_p = {'desc': ' '.join(desc2)}
                    dico_p['dict'] = {}
                    dico_p['numero'] = len(dico[nameClass]['parameters'])
                    dico[nameClass]['parameters'][li[1]] = dico_p
                elif (li[0] == 'ref'):
                    if (debut < 2):
                        raise Exception(((('error in ' + filename) + ' first line XD ') + line))
                    dico[nameClass]['refs'].append([li[1], li[2]])
                else:
                    nameClass = li[0]
                    dico[nameClass] = {'desc': desc, 'parameters': {}, 'refs': []}
                    debut = 2
                pass
            elif re.findall((('//[ ]*' + xd) + '_ADD_P+'), line):
                if (debut < 2):
                    raise Exception(((('error in ' + filename) + ' first line XD ') + line))
                dico_param = {}
                optionnel = True
                if re.findall('Param::REQUIRED', line):
                    optionnel = False
                    pass
                print('line:', line)
                param = line.split('"')[1].lower()
                mparam = param.split('|')[0]
                if (mparam == 'lambda'):
                    mparam = 'lambda_u'
                dico_param['mparm'] = mparam
                dico_param['optionnel'] = optionnel
                dr = line.split((xd + '_ADD_P'))[(- 1)].split()
                desc = ((((((((param + ' ') + dr[0]) + ' ') + mparam) + ' ') + str(int(optionnel))) + ' ') + ' '.join(dr[1:]))
                dico_param['desc'] = desc
                dico_param['numero'] = len(dico[nameClass]['parameters'])
                dico_param['dict'] = {}
                dico[nameClass]['parameters'][param] = dico_param
                pass
            elif re.findall((('//[ ]*' + xd) + '_ADD_DICO+'), line):
                if (debut < 2):
                    raise 'jjjjjjjj'
                dr = line.split((xd + '_ADD_P'))[(- 1)].split()
                dico_dict = {}
                dico_dict['desc'] = line
                dict_name = line.split('"')[1].lower()
                dico[nameClass]['parameters'][param]['dict'][dict_name] = dico_dict
                pass
            pass
    return dico
def getLinesWithRegExp(lines):
    dico = {}
    for xd in ['XD', '2XD', '3XD']:
        debut = 0
        for line in lines:
            line += ' '
            if ((len(line.strip()) >= 8) and (line.split()[0] == 'New_file')):
                debut = 1
                filename = line.split()[1]
            elif re.findall((('//[ ]*' + xd) + '[ ]+'), line):
                li = re.findall(((re.escape(xd) + '(.*)') + re.escape(' ')), line)[0].split(' ')
                li = [x for x in li if x.strip()]
                desc = re.split((('//[ ]*' + xd) + '[ ]+'), line)[(- 1)]
                if (li[0] == 'attr'):
                    if (debut < 2):
                        raise Exception(((('error in ' + filename) + ' first line XD ') + line))
                    desc2 = li[1:]
                    dico_p = {'desc': ' '.join(desc2)}
                    dico_p['dict'] = {}
                    dico_p['numero'] = len(dico[nameClass]['parameters'])
                    dico[nameClass]['parameters'][li[1]] = dico_p
                elif (li[0] == 'ref'):
                    if (debut < 2):
                        raise Exception(((('error in ' + filename) + ' first line XD ') + line))
                    dico[nameClass]['refs'].append([li[1], li[2]])
                else:
                    nameClass = li[0]
                    dico[nameClass] = {'desc': desc, 'parameters': {}, 'refs': []}
                    debut = 2
                pass
            elif re.findall((('//[ ]*' + xd) + '_ADD_P+'), line):
                if (debut < 2):
                    raise Exception(((('error in ' + filename) + ' first line XD ') + line))
                dico_param = {}
                optionnel = True
                if re.findall('Param::REQUIRED', line):
                    optionnel = False
                    pass
                print('line:', line)
                param = line.split('"')[1].lower()
                mparam = param.split('|')[0]
                if (mparam == 'lambda'):
                    mparam = 'lambda_u'
                dico_param['mparm'] = mparam
                dico_param['optionnel'] = optionnel
                dr = line.split((xd + '_ADD_P'))[(- 1)].split()
                desc = ((((((((param + ' ') + dr[0]) + ' ') + mparam) + ' ') + str(int(optionnel))) + ' ') + ' '.join(dr[1:]))
                dico_param['desc'] = desc
                dico_param['numero'] = len(dico[nameClass]['parameters'])
                dico_param['dict'] = {}
                dico[nameClass]['parameters'][param] = dico_param
                pass
            elif re.findall((('//[ ]*' + xd) + '_ADD_DICO+'), line):
                if (debut < 2):
                    raise 'jjjjjjjj'
                dr = line.split((xd + '_ADD_P'))[(- 1)].split()
                dico_dict = {}
                dico_dict['desc'] = line
                dict_name = line.split('"')[1].lower()
                dico[nameClass]['parameters'][param]['dict'][dict_name] = dico_dict
                pass
            pass
    return dico