Пример #1
0
def generateclass(dclass):
    handlers = [
        transmutate(__file__, defkey, defds[defkey], d, fds[d], True)
        for d in fds
    ]
    handlers += [
        transmutate(__file__, defkey, defds[defkey], d, allds[d], False)
        for d in allds
    ]
    handlers += [
        transmutate(__file__, defkey, defds[defkey], d, bds[d], False, True)
        for d in bds
    ]
    handlers += [
        transmutate(__file__, defkey, defds[defkey], d, ods[d], False, False,
                    True) for d in ods
    ]
    files = [open(d + ".java", "w") for d in fds]
    files += [open(d + ".java", "w") for d in allds]
    files += [open(d + ".java", "w") for d in bds]
    files += [open(d + ".java", "w") for d in ods]
    ncls = len(files)

    while True:
        l = dclass.readline()
        if not l:
            break
        for n in range(ncls):
            nl = handlers[n].processline(l)
            if nl != None:
                print >> files[n], nl
Пример #2
0
def generateclass(dclass):
    handlers  = [ transmutate(__file__, defkey, defds[defkey], d, fds[d], True) for d in fds ]
    handlers += [ transmutate(__file__, defkey, defds[defkey], d, allds[d], False) for d in allds ]
    files  = [ open(d + ".java", "w") for d in fds ]
    files += [ open(d + ".java", "w") for d in allds ]
    ncls = len(files)

    while True:
        l = dclass.readline()
        if not l:
            break
        for n in range(ncls):
            nl = handlers[n].processline(l)
            if nl != None:
                print >> files[n], nl