def METHOD_NAME(env, append_paths=False):
    """
    Find the path to the lex tool, searching several possible names
    Only called in the Windows case, so the default_path
    can be Windows-specific
    :param env: current construction environment
    :param append_paths: if set, add the path to the tool to PATH
    :return: path to lex tool, if found
    """
    for prog in BINS:
        bin_path = SCons.Tool.find_program_path(
            env,
            prog,
            default_paths=CHOCO_DEFAULT_PATH + MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS )
        if bin_path:
            if append_paths:
                env.AppendENVPath('PATH', os.path.dirname(bin_path))
            return bin_path
    SCons.Warnings.SConsWarning('lex tool requested, but lex or flex binary not found in ENV PATH')