def _find_table_annotation(item, example):
  """Finds a reference to a table in the schema."""
  if _is_name(item):
    return _find_simple_entity(item.value, example, include_columns=False)

  tokens = _get_tokens(item)

  if len(tokens) == 1:
    return _find_table_annotation(tokens[0], example)

  # Assume it's AS
  if _is_identifier(item) and len(tokens) == 3:
    return _find_table_annotation(tokens[0], example)

  _debug_sql_item(item)
  raise ParseError('Cannot find table annotation')
Finds a reference to a table in the schema.
language/xsp/data_preprocessing/sql_parsing.py