code: def _ParseFSMVariables(self, template):
      
  
      self.values = []
  
      for line in template:
        self._line_num += 1
        line = line.rstrip()
  
        # Blank line signifies end of Value definitions.
        if not line:
          return
  
        # Skip commented lines.
        if self.comment_regex.match(line):
          continue
  
        if line.startswith('Value '):
          try:
            value = TextFSMValue(
                fsm=self, max_name_len=self.MAX_NAME_LEN,
                options_class=self._options_cls)
            value.Parse(line)
          except TextFSMTemplateError as error:
            raise TextFSMTemplateError('%s Line %s.' % (error, self._line_num))
  
          if value.name in self.header:
            raise TextFSMTemplateError(
                "Duplicate declarations for Value '%s'. Line: %s."
                % (value.name, self._line_num))
  
          try:
            self._ValidateOptions(value)
          except TextFSMTemplateError as error:
            raise TextFSMTemplateError('%s Line %s.' % (error, self._line_num))
  
          self.values.append(value)
          self.value_map[value.name] = value.template
        # The line has text but without the 'Value ' prefix.
        elif not self.values:
          raise TextFSMTemplateError('No Value definitions found.')
        else:
          raise TextFSMTemplateError(
              'Expected blank line after last Value entry. Line: %s.'
              % (self._line_num))
docs: Extracts Variables from start of template file.
  
      Values are expected as a contiguous block at the head of the file.
      These will be line separated from the State definitions that follow.
  
      Args:
        template: Valid template file, with Value definitions at the top.
  
      Raises:
        TextFSMTemplateError: If syntax or semantic errors are found.