def addsequence(element): tag,elements=element tag=hextag(tag) for element in elements: if type(element)==long: addtosba(tag,element) elif type(element)==str: if element==mm: print >> sys.stderr, "macro",mm,"includes itself" continue for element in expand(element): addtosba(tag,element) else: addtosba(tag,element[0]) addsequence(element)
def addsequence(element): tag, elements = element tag = hextag(tag) for element in elements: if type(element) == long: addtosba(tag, element) elif type(element) == str: if element == mm: print >> sys.stderr, "macro", mm, "includes itself" continue for element in expand(element): addtosba(tag, element) else: addtosba(tag, element[0]) addsequence(element)
#!/usr/bin/python import sys sys.path.append('..') from parse import hextag from expandmacro import expand from datadict import * from modulemacros import * # check for infinite recursions for mm in modulemacros: expand(mm) def addtosba(tag,element): if element in sequencesbyattribute: if tag not in sequencesbyattribute[element]: sequencesbyattribute[element].append(tag) else: sequencesbyattribute[element]=[tag] def addsequence(element): tag,elements=element tag=hextag(tag) for element in elements: if type(element)==long: addtosba(tag,element) elif type(element)==str: if element==mm: print >> sys.stderr, "macro",mm,"includes itself" continue
#!/usr/bin/python import sys sys.path.append('..') from parse import hextag from expandmacro import expand from datadict import * from modulemacros import * # check for infinite recursions for mm in modulemacros: expand(mm) def addtosba(tag, element): if element in sequencesbyattribute: if tag not in sequencesbyattribute[element]: sequencesbyattribute[element].append(tag) else: sequencesbyattribute[element] = [tag] def addsequence(element): tag, elements = element tag = hextag(tag) for element in elements: if type(element) == long: addtosba(tag, element) elif type(element) == str: if element == mm:
#!/usr/bin/python import sys sys.path.append('..') from parse import hextag from expandmacro import expand from datadict import * from modulemacros import * from iods import * # check for infinite recursions for mm in modulemacros: expand(mm) iesbyattribute = {} for iod, ioddict in iods.items(): for ie, modules in ioddict.items(): for module, usage in modules: for attribute in expand(module): if attribute in iesbyattribute: if ie not in iesbyattribute[attribute][None]: iesbyattribute[attribute][None].append(ie) if iod in iesbyattribute[attribute]: if ie not in iesbyattribute[attribute][iod]: iesbyattribute[attribute][iod].append(ie) else: iesbyattribute[attribute][iod] = [ie] else: iesbyattribute[attribute] = {None: [ie], iod: [ie]}
#!/usr/bin/python import sys sys.path.append('..') from parse import hextag from expandmacro import expand from datadict import * from modulemacros import * from iods import * # check for infinite recursions for mm in modulemacros: expand(mm) iesbyattribute={} for iod,ioddict in iods.items(): for ie,modules in ioddict.items(): for module,usage in modules: for attribute in expand(module): if attribute in iesbyattribute: if ie not in iesbyattribute[attribute][None]: iesbyattribute[attribute][None].append(ie) if iod in iesbyattribute[attribute]: if ie not in iesbyattribute[attribute][iod]: iesbyattribute[attribute][iod].append(ie) else: iesbyattribute[attribute][iod]=[ie] else: iesbyattribute[attribute]={None:[ie],iod:[ie]}