def _FormatToken(token):
  """Converts a Pythonic token name into a Java-friendly constant name."""
  assert str(token).startswith('Token.'), 'Expected token, found ' + token
  return str(token)[len('Token.'):].replace('.', '_').upper()