code: private List<Snippet> sourceToSnippets(String userSource) {
          String compileSource = Util.trimEnd(new MaskCommentsAndModifiers(userSource, false).cleared());
          if (compileSource.length() == 0) {
              return Collections.emptyList();
          }
          ParseTask pt = state.taskFactory.parse(compileSource);
          List<? extends Tree> units = pt.units();
          if (units.isEmpty()) {
              return compileFailResult(pt, userSource, Kind.ERRONEOUS);
          }
          Tree unitTree = units.get(0);
          if (pt.getDiagnostics().hasOtherThanNotStatementErrors()) {
              return compileFailResult(pt, userSource, kindOfTree(unitTree));
          }
  
          // Erase illegal/ignored modifiers
          compileSource = new MaskCommentsAndModifiers(compileSource, true).cleared();
  
          state.debug(DBG_GEN, "Kind: %s -- %s\n", unitTree.getKind(), unitTree);
          switch (unitTree.getKind()) {
              case IMPORT:
                  return processImport(userSource, compileSource);
              case VARIABLE:
                  return processVariables(userSource, units, compileSource, pt);
              case EXPRESSION_STATEMENT:
                  return processExpression(userSource, compileSource);
              case CLASS:
                  return processClass(userSource, unitTree, compileSource, SubKind.CLASS_SUBKIND, pt);
              case ENUM:
                  return processClass(userSource, unitTree, compileSource, SubKind.ENUM_SUBKIND, pt);
              case ANNOTATION_TYPE:
                  return processClass(userSource, unitTree, compileSource, SubKind.ANNOTATION_TYPE_SUBKIND, pt);
              case INTERFACE:
                  return processClass(userSource, unitTree, compileSource, SubKind.INTERFACE_SUBKIND, pt);
              case METHOD:
                  return processMethod(userSource, unitTree, compileSource, pt);
              default:
                  return processStatement(userSource, compileSource);
          }
      }
docs: Converts the user source of a snippet into a Snippet object (or list of
  objects in the case of: int x, y, z;).  Does not install the Snippets
  or execute them.
  
  @param userSource the source of the snippet
  @return usually a singleton list of Snippet, but may be empty or multiple