Class Folder<E>

  • Type Parameters:
    E - Element type
    Direct Known Subclasses:
    Folder.End

    public abstract class Folder<E>
    extends Object
    Enable creating right-deep trees.
    • Field Detail

      • e

        final E e
    • Constructor Detail

      • Folder

        Folder​(E e)
    • Method Detail

      • combineAll

        public static <E> E combineAll​(List<Folder<E>> list)
      • end

        private static <E> Folder<E> end​(E e)
      • start

        public static <E> void start​(List<Folder<E>> list,
                                     E e)
        Adds an element to an empty list.
      • append

        private static <E> void append​(List<Folder<E>> list,
                                       E e,
                                       Function<E,​Folder<E>> fn)
        Adds an element and operator to a non-empty list.
      • op

        private static Folder<Ast.Exp> op​(Ast.Exp exp,
                                          Op at)
        Creates a folder that combines an expression with whatever follows using an infix operator.