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)
예제 #2
0
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
예제 #4
0
#!/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:
예제 #5
0
#!/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]}
예제 #6
0
#!/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]}