def _string_to_dictsql(self, part):
self._logger.debug("<STR_LIT>" + str(part[<NUM_LIT:0>]) + "<STR_LIT>" + part.getName())<EOL>if part.getName() == '<STR_LIT>':<EOL><INDENT>self._logger.debug("<STR_LIT>" + part[<NUM_LIT:0>] + "<STR_LIT>")<EOL>dictsql = {<EOL>'<STR_LIT>': {<EOL>'<STR_LIT:string>': part[<NUM_LIT:0>],<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:error>': False<EOL>},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': part[<NUM_LIT:0>][<NUM_LIT:1>:]<EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': part[<NUM_LIT:0>][<NUM_LIT:1>:]<EOL>}<EOL>}<EOL><DEDENT>elif part.getName() == '<STR_LIT>':<EOL><INDENT>self._logger.debug("<STR_LIT>" + part.vrf_rt + "<STR_LIT>")<EOL>dictsql = {<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:string>': part.vrf_rt,<EOL>'<STR_LIT:error>': False<EOL>},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': part.vrf_rt<EOL>}<EOL><DEDENT>elif part.getName() == '<STR_LIT>':<EOL><INDENT>self._logger.debug("<STR_LIT>" + part.ipv6_address + "<STR_LIT>")<EOL>dictsql = {<EOL>'<STR_LIT>': {<EOL>'<STR_LIT:string>': part.ipv6_address,<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:error>': False<EOL>},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': part.ipv6_address<EOL>}<EOL><DEDENT>elif part.getName() == '<STR_LIT>':<EOL><INDENT>self._logger.debug("<STR_LIT>" + part.ipv6_prefix[<NUM_LIT:0>] + "<STR_LIT>")<EOL>strict_prefix = str(IPy.IP(part.ipv6_prefix[<NUM_LIT:0>], make_net=True))<EOL>interp = {<EOL>'<STR_LIT:string>': part.ipv6_prefix[<NUM_LIT:0>],<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:error>': False<EOL>}<EOL>if part.ipv6_prefix[<NUM_LIT:0>] != strict_prefix:<EOL><INDENT>interp['<STR_LIT>'] = strict_prefix<EOL><DEDENT>dictsql = {<EOL>'<STR_LIT>': interp,<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': strict_prefix<EOL>}<EOL><DEDENT>else:<EOL><INDENT>if self._get_afi(part[<NUM_LIT:0>]) == <NUM_LIT:4> and len(part[<NUM_LIT:0>].split('<STR_LIT:/>')) == <NUM_LIT:2>:<EOL><INDENT>self._logger.debug("<STR_LIT>" + part[<NUM_LIT:0>] + "<STR_LIT>")<EOL>address, prefix_length = part[<NUM_LIT:0>].split('<STR_LIT:/>')<EOL>while len(address.split('<STR_LIT:.>')) < <NUM_LIT:4>:<EOL><INDENT>address += '<STR_LIT>'<EOL><DEDENT>prefix = address + '<STR_LIT:/>' + prefix_length<EOL>strict_prefix = str(IPy.IP(part[<NUM_LIT:0>], make_net=True))<EOL>interp = {<EOL>'<STR_LIT:string>': part[<NUM_LIT:0>],<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:error>': False<EOL>}<EOL>if prefix != part[<NUM_LIT:0>]:<EOL><INDENT>interp['<STR_LIT>'] = prefix<EOL><DEDENT>if prefix != strict_prefix:<EOL><INDENT>interp['<STR_LIT>'] = strict_prefix<EOL><DEDENT>dictsql = {<EOL>'<STR_LIT>': interp,<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': strict_prefix<EOL>}<EOL><DEDENT>elif self._get_afi(part[<NUM_LIT:0>]) == <NUM_LIT:4> and len(part[<NUM_LIT:0>].split('<STR_LIT:.>')) == <NUM_LIT:4>:<EOL><INDENT>self._logger.debug("<STR_LIT>" + part[<NUM_LIT:0>] + "<STR_LIT>")<EOL>address = str(IPy.IP(part[<NUM_LIT:0>]))<EOL>dictsql = {<EOL>'<STR_LIT>': {<EOL>'<STR_LIT:string>': address,<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:error>': False<EOL>},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': address<EOL>}<EOL><DEDENT>else:<EOL><INDENT>self._logger.debug("<STR_LIT>" + part[<NUM_LIT:0>] + "<STR_LIT>")<EOL>dictsql = {<EOL>'<STR_LIT>': {<EOL>'<STR_LIT:string>': part[<NUM_LIT:0>],<EOL>'<STR_LIT>': '<STR_LIT:text>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:error>': False<EOL>},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': part[<NUM_LIT:0>]<EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT:description>',<EOL>'<STR_LIT>': part[<NUM_LIT:0>]<EOL>}<EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': part[<NUM_LIT:0>]<EOL>}<EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': part[<NUM_LIT:0>]<EOL>},<EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': part[<NUM_LIT:0>]<EOL>}<EOL>}<EOL><DEDENT><DEDENT>return dictsql<EOL>
Do magic matching of single words or quoted string