from __future__ import print_function, absolute_import
from . import _utils
from . import types


class Context(object):
    def __init__(self):
        self.scope = _utils.NameScope()
        self.identified_types = {}

    def get_identified_type(self, name):
        if name not in self.identified_types:
            self.scope.register(name)
            ty = types.IdentifiedStructType(self, name)
            self.identified_types[name] = ty
        else:
            ty = self.identified_types[name]
        return ty


global_context = Context()
