jaskell.parsec.common.UInt 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.common;
import jaskell.parsec.ParsecException;
import java.io.EOFException;
import java.util.List;
/**
* Created by Mars Liu on 2016-01-07.
* UInt 尝试将后续信息流解析成一个表示无符号整数的字符串,如果匹配失败就抛出异常.
*/
public class UInt
implements Parsec {
private final Parsec> parser = new Many1<>(new Digit());
@Override
public String parse(State s)
throws EOFException, ParsecException {
List buffer = parser.parse(s);
StringBuilder sb = new StringBuilder();
buffer.forEach(sb::append);
return sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy