private static void processNodeFlattening(ArrayList<ASTNode> result, ASTNode child) {
    result.add(child);
    if (child.getElementType() == GroovyElementTypes.LABELED_STATEMENT) {
      for (ASTNode node : visibleChildren(child)) {
        processNodeFlattening(result, node);
      }
    }
  }
private static void processNodeFlattening(ArrayList<ASTNode> result, ASTNode child)