All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jaskell.parsec.common.Combinator Maven / Gradle / Ivy

Go to download

This is a utils library for java 8 project. It include parsec combinators and sql generators library.

There is a newer version: 2.9.2
Show newest version
package jaskell.parsec.common;

import java.util.List;
import java.util.Optional;

/**
 * Created by march on 16/9/12.
 * helper toolbox for combinator.
 */
public class Combinator {
    public static  Try attempt(Parsec parser) {
        return new Try<>(parser);
    }

    public static  Ahead ahead(Parsec parser) {
        return new Ahead<>(parser);
    }

    @SafeVarargs
    public static  Choice choice(Parsec... parsers) {
        return new Choice<>(parsers);
    }

    public static  Many many(Parsec parser) {
        return new Many<>(parser);
    }

    public static  Many1 many1(Parsec parser) {
        return new Many1<>(parser);
    }

    public static  ManyTill manyTill(Parsec parser, Parsec end) {
        return new ManyTill<>(parser, end);
    }

    public static  Skip skip(Parsec parser) {
        return new Skip<>(parser);
    }

    public static  Skip1 skip1(Parsec parser) {
        return new Skip1<>(parser);
    }

    public static  SepBy sepBy(Parsec parser, Parsec by) {
        return new SepBy<>(parser, by);
    }

    public static  SepBy1 sepBy1(Parsec parser, Parsec by) {
        return new SepBy1<>(parser, by);
    }

    public static  Find find(Parsec parser) {
        return new Find<>(parser);
    }

    public static  Parsec between(Parsec open, Parsec close,
        Parsec parser){
        return new Between<>(open, close, parser);
    }

    public static  Parsec> option(Parsec parser){
        return new Option<>(parser);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy