def _legacy_symbol_table(build_file_aliases):
  """Construct a SymbolTable for the given BuildFileAliases.

  :param build_file_aliases: BuildFileAliases to register.
  :type build_file_aliases: :class:`pants.build_graph.build_file_aliases.BuildFileAliases`

  :returns: A SymbolTable.
  """
  table = {
    alias: _make_target_adaptor(TargetAdaptor, target_type)
    for alias, target_type in build_file_aliases.target_types.items()
  }

  for alias, factory in build_file_aliases.target_macro_factories.items():
    # TargetMacro.Factory with more than one target type is deprecated.
    # For default sources, this means that TargetMacro Factories with more than one target_type
    # will not parse sources through the engine, and will fall back to the legacy python sources
    # parsing.
    # Conveniently, multi-target_type TargetMacro.Factory, and legacy python source parsing, are
    # targeted to be removed in the same version of pants.
    if len(factory.target_types) == 1:
      table[alias] = _make_target_adaptor(
        TargetAdaptor,
        tuple(factory.target_types)[0],
      )

  # TODO: The alias replacement here is to avoid elevating "TargetAdaptors" into the public
  # API until after https://github.com/pantsbuild/pants/issues/3560 has been completed.
  # These should likely move onto Target subclasses as the engine gets deeper into beta
  # territory.
  table['python_library'] = _make_target_adaptor(PythonTargetAdaptor, PythonLibrary)

  table['jvm_app'] = _make_target_adaptor(AppAdaptor, JvmApp)
  table['jvm_binary'] = _make_target_adaptor(JvmBinaryAdaptor, JvmBinary)
  table['python_app'] = _make_target_adaptor(AppAdaptor, PythonApp)
  table['python_tests'] = _make_target_adaptor(PythonTestsAdaptor, PythonTests)
  table['python_binary'] = _make_target_adaptor(PythonBinaryAdaptor, PythonBinary)
  table['remote_sources'] = _make_target_adaptor(RemoteSourcesAdaptor, RemoteSources)
  table['page'] = _make_target_adaptor(PageAdaptor, Page)

  # Note that these don't call _make_target_adaptor because we don't have a handy reference to the
  # types being constructed. They don't have any default_sources behavior, so this should be ok,
  # but if we end up doing more things in _make_target_adaptor, we should make sure they're
  # applied here too.
  table['pants_plugin'] = PantsPluginAdaptor
  table['contrib_plugin'] = PantsPluginAdaptor

  return SymbolTable(table)
Construct a SymbolTable for the given BuildFileAliases.

  :param build_file_aliases: BuildFileAliases to register.
  :type build_file_aliases: :class:`pants.build_graph.build_file_aliases.BuildFileAliases`

  :returns: A SymbolTable.