parameters: (lines)
return_statement: return (entries, prefix_name, verbatim, namespaces, errors)
docstring: Parse an .entries file and return a tuple of:
          entries: list of Entry instances from the file.
          prefix_name: prefix name from the file, or None.
          verbatim: list of verbatim lines from the file.
          errors: list of errors in the file, prefixed by line number.
docstring_summary: Parse an .entries file and return a tuple of:
          entries: list of Entry instances from the file.
          prefix_name: prefix name from the file, or None.
          verbatim: list of verbatim lines from the file.
          errors: list of errors in the file, prefixed by line number.
docstring_tokens: Parse an . entries file and return a tuple of : entries : list of Entry instances from the file . prefix_name : prefix name from the file or None . verbatim : list of verbatim lines from the file . errors : list of errors in the file prefixed by line number .
function: def parse_entries_file(lines):
      """Parse an .entries file and return a tuple of:
          entries: list of Entry instances from the file.
          prefix_name: prefix name from the file, or None.
          verbatim: list of verbatim lines from the file.
          errors: list of errors in the file, prefixed by line number.
      """
      entries = []
      verbatim = []
      errors = []
      lineno = 0
      prefix_name = None
      namespaces = []
      for line in lines:
          lineno += 1
          line = line.strip()
          if len(line) == 0:  # Ignore empty lines
              continue
          if line[0] == '#':  # Ignore comments
              continue
          if line[0] == '!':  # Prefix name
              prefix_name = line[1:]
              continue
          if line[0] == '%':  # Verbatim line copy
              verbatim.append(line[1:])
              continue
          if line.startswith("namespaces"): # Namespaces
              namespaces = map(lambda t: t.strip(), line.split("namespaces")[1].strip().split(","))
              continue
          # Must be a function signature.
          m = re_func.match(line)
          if not m:
              errors.append("%d: '%s'" % (lineno, line))
              continue
          return_type, func_name, parameters = m.groups()
          return_type = return_type.strip()
          parameters = parameters.strip()
          params = []
          failure = False
          if parameters != "void":
              for parameter in parameters.split(','):
                  parameter = parameter.strip()
                  m = re_param.match(parameter)
                  if not m:
                      errors.append("%d: parameter '%s'" % (lineno, parameter))
                      failure = True
                      break
                  else:
                      param_type, param_name = m.groups()
                      params.append((param_type.strip(), param_name.strip()))
          if not failure:
              entries.append(Entry(func_name, return_type, params))
      return (entries, prefix_name, verbatim, namespaces, errors)
function_tokens: def parse_entries_file ( lines ) : entries = [ ] verbatim = [ ] errors = [ ] lineno = 0 prefix_name = None namespaces = [ ] for line in lines : lineno += 1 line = line . strip ( ) if len ( line ) == 0 : # Ignore empty lines continue if line [ 0 ] == '#' : # Ignore comments continue if line [ 0 ] == '!' : # Prefix name prefix_name = line [ 1 : ] continue if line [ 0 ] == '%' : # Verbatim line copy verbatim . append ( line [ 1 : ] ) continue if line . startswith ( "namespaces" ) : # Namespaces namespaces = map ( lambda t : t . strip ( ) , line . split ( "namespaces" ) [ 1 ] . strip ( ) . split ( "," ) ) continue # Must be a function signature. m = re_func . match ( line ) if not m : errors . append ( "%d: '%s'" % ( lineno , line ) ) continue return_type , func_name , parameters = m . groups ( ) return_type = return_type . strip ( ) parameters = parameters . strip ( ) params = [ ] failure = False if parameters != "void" : for parameter in parameters . split ( ',' ) : parameter = parameter . strip ( ) m = re_param . match ( parameter ) if not m : errors . append ( "%d: parameter '%s'" % ( lineno , parameter ) ) failure = True break else : param_type , param_name = m . groups ( ) params . append ( ( param_type . strip ( ) , param_name . strip ( ) ) ) if not failure : entries . append ( Entry ( func_name , return_type , params ) ) return ( entries , prefix_name , verbatim , namespaces , errors )