jaskell.parsec.Combinator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaskell-java8 Show documentation
Show all versions of jaskell-java8 Show documentation
This is a utils library for java 8 project.
It include parsec combinators and sql generators library.
package jaskell.parsec;
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 Choice choice(List> 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 Between between(
Parsec open, Parsec close,
Parsec parser){
return new Between<>(open, close, parser);
}
public static Option option(Parsec parser){
return new Option<>(parser);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy