@typed_pos_args('generator', (build.Executable, ExternalProgram))
@typed_kwargs('generator', KwargInfo('arguments', ContainerTypeInfo(list, str, allow_empty=False), required=True, listify=True), KwargInfo('output', ContainerTypeInfo(list, str, allow_empty=False), required=True, listify=True), DEPFILE_KW, DEPENDS_KW, KwargInfo('capture', bool, default=False, since='0.43.0'))
def func_generator(self, node: mparser.FunctionNode, args: T.Tuple[T.Union[(build.Executable, ExternalProgram)]], kwargs: 'kwargs.FuncGenerator') -> build.Generator:
    for rule in kwargs['output']:
        if (('@BASENAME@' not in rule) and ('@PLAINNAME@' not in rule)):
            raise InvalidArguments('Every element of "output" must contain @BASENAME@ or @PLAINNAME@.')
        if has_path_sep(rule):
            raise InvalidArguments('"output" must not contain a directory separator.')
    if (len(kwargs['output']) > 1):
        for o in kwargs['output']:
            if ('@OUTPUT@' in o):
                raise InvalidArguments('Tried to use @OUTPUT@ in a rule with more than one output.')
    gen = build.Generator(args[0], **kwargs)
    self.generators.append(gen)
    return gen
@typed_pos_args('generator', (build.Executable, ExternalProgram))
@typed_kwargs('generator', KwargInfo('arguments', ContainerTypeInfo(list, str, allow_empty=False), required=True, listify=True), KwargInfo('output', ContainerTypeInfo(list, str, allow_empty=False), required=True, listify=True), DEPFILE_KW, DEPENDS_KW, KwargInfo('capture', bool, default=False, since='0.43.0'))
def func_generator(self, node: mparser.FunctionNode, args: T.Tuple[T.Union[(build.Executable, ExternalProgram)]], kwargs: 'kwargs.FuncGenerator') -> build.Generator:
    for rule in kwargs['output']:
        if (('@BASENAME@' not in rule) and ('@PLAINNAME@' not in rule)):
            raise InvalidArguments('Every element of "output" must contain @BASENAME@ or @PLAINNAME@.')
        if has_path_sep(rule):
            raise InvalidArguments('"output" must not contain a directory separator.')
    if (len(kwargs['output']) > 1):
        for o in kwargs['output']:
            if ('@OUTPUT@' in o):
                raise InvalidArguments('Tried to use @OUTPUT@ in a rule with more than one output.')
    gen = build.Generator(args[0], **kwargs)
    self.generators.append(gen)
    return gen