public static List<ASTNode> flattenChildren(List<ASTNode> children) {
    ArrayList<ASTNode> result = new ArrayList<>();
    for (ASTNode child : children) {
      processNodeFlattening(result, child);
    }
    return result;
  }
public static List<ASTNode> flattenChildren(List<ASTNode> children)