def __init__(self, modules: (types.ModuleType | list[types.ModuleType])) -> None:
    if isinstance(modules, types.ModuleType):
        modules = [modules]
    self.modules = modules
    items = []
    for module in self.modules:
        for (k, v) in module.__dict__.items():
            if (isinstance(v, type) and isinstance(v.__doc__, str)):
                dirtoks = introspection.parse_docstring(v.__doc__)
                items.append((module, k, v, dirtoks))
    self.named_objs = items
    self._cache_precedences: (list[PrecedenceSpec] | None) = None
    self._cache_tokens: (list[TokenSpec] | None) = None
    self._cache_nonterminals: (tuple[(list[NontermSpec], NontermSpec)] | None) = None
def __init__(self, modules: (types.ModuleType | list[types.ModuleType])) -> None:
    if isinstance(modules, types.ModuleType):
        modules = [modules]
    self.modules = modules
    items = []
    for module in self.modules:
        for (k, v) in module.__dict__.items():
            if (isinstance(v, type) and isinstance(v.__doc__, str)):
                dirtoks = introspection.parse_docstring(v.__doc__)
                items.append((module, k, v, dirtoks))
    self.named_objs = items
    self._cache_precedences: (list[PrecedenceSpec] | None) = None
    self._cache_tokens: (list[TokenSpec] | None) = None
    self._cache_nonterminals: (tuple[(list[NontermSpec], NontermSpec)] | None) = None