parameters: (self, flag_token)
docstring: Creates the DocFlag object and attaches it to the given start token.
  
      Args:
        flag_token: The starting token of the flag.
docstring_summary: Creates the DocFlag object and attaches it to the given start token.
docstring_tokens: Creates the DocFlag object and attaches it to the given start token .
function: def __init__(self, flag_token):
      """Creates the DocFlag object and attaches it to the given start token.
  
      Args:
        flag_token: The starting token of the flag.
      """
      self.flag_token = flag_token
      self.flag_type = flag_token.string.strip().lstrip('@')
  
      # Extract type, if applicable.
      self.type = None
      self.type_start_token = None
      self.type_end_token = None
      if self.flag_type in self.HAS_TYPE:
        brace = tokenutil.SearchUntil(flag_token, [Type.DOC_START_BRACE],
                                      Type.FLAG_ENDING_TYPES)
        if brace:
          end_token, contents = _GetMatchingEndBraceAndContents(brace)
          self.type = contents
          self.type_start_token = brace
          self.type_end_token = end_token
        elif (self.flag_type in self.TYPE_ONLY and
            flag_token.next.type not in Type.FLAG_ENDING_TYPES):
          self.type_start_token = flag_token.next
          self.type_end_token, self.type = _GetEndTokenAndContents(
              self.type_start_token)
          if self.type is not None:
            self.type = self.type.strip()
  
      # Extract name, if applicable.
      self.name_token = None
      self.name = None
      if self.flag_type in self.HAS_NAME:
        # Handle bad case, name could be immediately after flag token.
        self.name_token = _GetNextIdentifierToken(flag_token)
  
        # Handle good case, if found token is after type start, look for
        # identifier after type end, since types contain identifiers.
        if (self.type and self.name_token and
            tokenutil.Compare(self.name_token, self.type_start_token) > 0):
          self.name_token = _GetNextIdentifierToken(self.type_end_token)
  
        if self.name_token:
          self.name = self.name_token.string
  
      # Extract description, if applicable.
      self.description_start_token = None
      self.description_end_token = None
      self.description = None
      if self.flag_type in self.HAS_DESCRIPTION:
        search_start_token = flag_token
        if self.name_token and self.type_end_token:
          if tokenutil.Compare(self.type_end_token, self.name_token) > 0:
            search_start_token = self.type_end_token
          else:
            search_start_token = self.name_token
        elif self.name_token:
          search_start_token = self.name_token
        elif self.type:
          search_start_token = self.type_end_token
  
        interesting_token = tokenutil.Search(search_start_token,
            Type.FLAG_DESCRIPTION_TYPES | Type.FLAG_ENDING_TYPES)
        if interesting_token.type in Type.FLAG_DESCRIPTION_TYPES:
          self.description_start_token = interesting_token
          self.description_end_token, self.description = (
              _GetEndTokenAndContents(interesting_token))
function_tokens: def __init__ ( self , flag_token ) : self . flag_token = flag_token self . flag_type = flag_token . string . strip ( ) . lstrip ( '@' ) # Extract type, if applicable. self . type = None self . type_start_token = None self . type_end_token = None if self . flag_type in self . HAS_TYPE : brace = tokenutil . SearchUntil ( flag_token , [ Type . DOC_START_BRACE ] , Type . FLAG_ENDING_TYPES ) if brace : end_token , contents = _GetMatchingEndBraceAndContents ( brace ) self . type = contents self . type_start_token = brace self . type_end_token = end_token elif ( self . flag_type in self . TYPE_ONLY and flag_token . next . type not in Type . FLAG_ENDING_TYPES ) : self . type_start_token = flag_token . next self . type_end_token , self . type = _GetEndTokenAndContents ( self . type_start_token ) if self . type is not None : self . type = self . type . strip ( ) # Extract name, if applicable. self . name_token = None self . name = None if self . flag_type in self . HAS_NAME : # Handle bad case, name could be immediately after flag token. self . name_token = _GetNextIdentifierToken ( flag_token ) # Handle good case, if found token is after type start, look for # identifier after type end, since types contain identifiers. if ( self . type and self . name_token and tokenutil . Compare ( self . name_token , self . type_start_token ) > 0 ) : self . name_token = _GetNextIdentifierToken ( self . type_end_token ) if self . name_token : self . name = self . name_token . string # Extract description, if applicable. self . description_start_token = None self . description_end_token = None self . description = None if self . flag_type in self . HAS_DESCRIPTION : search_start_token = flag_token if self . name_token and self . type_end_token : if tokenutil . Compare ( self . type_end_token , self . name_token ) > 0 : search_start_token = self . type_end_token else : search_start_token = self . name_token elif self . name_token : search_start_token = self . name_token elif self . type : search_start_token = self . type_end_token interesting_token = tokenutil . Search ( search_start_token , Type . FLAG_DESCRIPTION_TYPES | Type . FLAG_ENDING_TYPES ) if interesting_token . type in Type . FLAG_DESCRIPTION_TYPES : self . description_start_token = interesting_token self . description_end_token , self . description = ( _GetEndTokenAndContents ( interesting_token ) )