jaskell.parsec.Many 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.io.EOFException;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Mars Liu on 2016-01-03.
* Many 算子匹配给定算子0到多次.
*/
public class Many
implements Parsec, Status, Tran> {
private final Parsec parsec;
@Override
public List parse(State s) throws EOFException, ParsecException {
List re = new ArrayList<>();
try{
while (true){
re.add(this.parsec.parse(s));
}
} catch (Exception e){
return re;
}
}
public Many(Parsec parsec) {
this.parsec = new Try<>(parsec);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy