public static void acceptChildren(@NotNull PsiElementVisitor visitor, @NotNull ASTNode root) {
    ASTNode childNode = root.getFirstChildNode();

    while (childNode != null) {
      PsiElement psi;
      if (childNode instanceof PsiElement) {
        psi = (PsiElement)childNode;
      }
      else {
        psi = childNode.getPsi();
      }
      psi.accept(visitor);

      childNode = childNode.getTreeNext();
    }
  }
public static void acceptChildren(@NotNull PsiElementVisitor visitor, @NotNull ASTNode root)