presto-main/src/main/java/io/prestosql/sql/analyzer/ExpressionTreeUtils.java/ExpressionTreeUtils/linearizeNodes
class ExpressionTreeUtils:    private static List<Node> linearizeNodes(Node node)
    {
        ImmutableList.Builder<Node> nodes = ImmutableList.builder();
        new DefaultExpressionTraversalVisitor<Node, Void>()
        {
            @Override
            public Node process(Node node, Void context)
            {
                Node result = super.process(node, context);
                nodes.add(node);
                return result;
            }
        }.process(node, null);
        return nodes.build();
    }