parameters: (self, content)
docstring: :param content: Textual content of a CMake script.
      :type content: :class:`str`
  
      :raises:
        :exc:`~exceptions.SyntaxError` or :exc:`~exceptions.EOFError` if a
        parsing error occurs (i.e. if the input text is not syntactically valid).
  
      .. code-block:: python
  
        with open('CMakeLists.txt') as fi:
          script = CMakeParser.CMakeScript(f.read())
  
        with open('CMakeLists.txt.new', 'w') as fo:
          fo.write(str(script))
docstring_summary: :param content: Textual content of a CMake script.
      :type content: :class:`str`
docstring_tokens: : param content : Textual content of a CMake script . : type content : : class : str
function: def __init__(self, content):
      """
      :param content: Textual content of a CMake script.
      :type content: :class:`str`
  
      :raises:
        :exc:`~exceptions.SyntaxError` or :exc:`~exceptions.EOFError` if a
        parsing error occurs (i.e. if the input text is not syntactically valid).
  
      .. code-block:: python
  
        with open('CMakeLists.txt') as fi:
          script = CMakeParser.CMakeScript(f.read())
  
        with open('CMakeLists.txt.new', 'w') as fo:
          fo.write(str(script))
      """
  
      self.tokens = []
  
      self._content = content
      self._match = None
  
      while len(self._content):
        indent = self._chompSpace()
  
        # Consume comments
        if self._is(self._reComment):
          self.tokens.append(self._parseComment(self._match, indent))
  
        # Consume commands
        elif self._is(self._reCommand):
          self.tokens.append(self._parseCommand(self._match, indent))
  
        # Consume other tokens (pedantically, if we get here, the script is
        # malformed, except at EOF)
        else:
          m = self._reWhitespace.search(self._content)
          n = m.start() if m is not None else len(self._content)
          self.tokens.append(Token(text=self._content[:n], indent=indent))
          self._content = self._content[n:]
function_tokens: def __init__ ( self , content ) : self . tokens = [ ] self . _content = content self . _match = None while len ( self . _content ) : indent = self . _chompSpace ( ) # Consume comments if self . _is ( self . _reComment ) : self . tokens . append ( self . _parseComment ( self . _match , indent ) ) # Consume commands elif self . _is ( self . _reCommand ) : self . tokens . append ( self . _parseCommand ( self . _match , indent ) ) # Consume other tokens (pedantically, if we get here, the script is # malformed, except at EOF) else : m = self . _reWhitespace . search ( self . _content ) n = m . start ( ) if m is not None else len ( self . _content ) self . tokens . append ( Token ( text = self . _content [ : n ] , indent = indent ) ) self . _content = self . _content [ n : ]