class_docstr: Easytrieve Plus is a programming language for extracting, filtering and
  converting sequential data. Furthermore it can layout data for reports.
  It is mainly used on mainframe platforms and can access several of the
  mainframe's native file formats. It is somewhat comparable to awk.
  
  .. versionadded:: 2.1
docstr: Perform a structural analysis for basic Easytrieve constructs.
docstr_tok: ["Perform","a","structural","analysis","for","basic","Easytrieve","constructs","."]
code: def analyse_text(text):
      """
      Perform a structural analysis for basic Easytrieve constructs.
      """
      result = 0.0
      lines = text.split("\n")
      hasEndProc = False
      hasHeaderComment = False
      hasFile = False
      hasJob = False
      hasProc = False
      hasParm = False
      hasReport = False
  
      def isCommentLine(line):
          return (
              EasytrieveLexer._COMMENT_LINE_REGEX.match(lines[0])
              is not None
          )
  
      def isEmptyLine(line):
          return not bool(line.strip())
  
      # Remove possible empty lines and header comments.
      while lines and (
          isEmptyLine(lines[0]) or isCommentLine(lines[0])
      ):
          if not isEmptyLine(lines[0]):
              hasHeaderComment = True
          del lines[0]
  
      if EasytrieveLexer._MACRO_HEADER_REGEX.match(lines[0]):
          # Looks like an Easytrieve macro.
          result = 0.4
          if hasHeaderComment:
              result += 0.4
      else:
          # Scan the source for lines starting with indicators.
          for line in lines:
              words = line.split()
              if len(words) >= 2:
                  firstWord = words[0]
                  if not hasReport:
                      if not hasJob:
                          if not hasFile:
                              if not hasParm:
                                  if firstWord == "PARM":
                                      hasParm = True
                              if firstWord == "FILE":
                                  hasFile = True
                          if firstWord == "JOB":
                              hasJob = True
                      elif firstWord == "PROC":
                          hasProc = True
                      elif firstWord == "END-PROC":
                          hasEndProc = True
                      elif firstWord == "REPORT":
                          hasReport = True
  
          # Weight the findings.
          if hasJob and (hasProc == hasEndProc):
              if hasHeaderComment:
                  result += 0.1
              if hasParm:
                  if hasProc:
                      # Found PARM, JOB and PROC/END-PROC:
                      # pretty sure this is Easytrieve.
                      result += 0.8
                  else:
                      # Found PARAM and  JOB: probably this is Easytrieve
                      result += 0.5
              else:
                  # Found JOB and possibly other keywords: might be Easytrieve
                  result += 0.11
                  if hasParm:
                      # Note: PARAM is not a proper English word, so this is
                      # regarded a much better indicator for Easytrieve than
                      # the other words.
                      result += 0.2
                  if hasFile:
                      result += 0.01
                  if hasReport:
                      result += 0.01
      assert 0.0 <= result <= 1.0
      return result
  
imports: import re
  from pygments.lexer import RegexLexer, include, bygroups, default, combined, words
  from pygments.token import Text, Comment, Operator, Keyword, Name, String, Number, Punctuation, Error, Whitespace, Other
  from pygments.util import get_bool_opt, get_list_opt, iteritems
label_desc: Use image node_id 1 for calling the EasytrieveLexer obj's underlying member method code with example usage: obj.analyse_text(text) and returns: result, unknown, unknown