예제 #1
0
    class found:
        pass

    class findShmem(TypeVisitor):
        def visitShmemType(self, s):
            raise found()

    try:
        type.accept(findShmem())
    except found:
        return True
    return False


# --------------------
_builtinloc = Loc('<builtin>', 0)


def makeBuiltinUsing(tname):
    quals = tname.split('::')
    base = quals.pop()
    quals = quals[0:]
    return UsingStmt(
        _builtinloc,
        TypeSpec(_builtinloc, QualifiedId(_builtinloc, base, quals)))


builtinUsing = [makeBuiltinUsing(t) for t in builtin.Types]
builtinHeaderIncludes = [
    CxxInclude(_builtinloc, f) for f in builtin.HeaderIncludes
]
예제 #2
0
    class found(BaseException):
        pass

    class findShmem(TypeVisitor):
        def visitShmemType(self, s):
            raise found()

    try:
        type.accept(findShmem())
    except found:
        return True
    return False


# --------------------
_builtinloc = Loc("<builtin>", 0)


def makeBuiltinUsing(tname):
    quals = tname.split("::")
    base = quals.pop()
    quals = quals[0:]
    return UsingStmt(
        _builtinloc,
        TypeSpec(_builtinloc, QualifiedId(_builtinloc, base, quals)))


builtinUsing = [makeBuiltinUsing(t) for t in builtin.Types]
builtinHeaderIncludes = [
    CxxInclude(_builtinloc, f) for f in builtin.HeaderIncludes
]