jaskell.parsec.Digit 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;
/**
* Created by Mars Liu on 2016-01-07.
* Digit 判断下一个项是否是一个表示数字的字符.它仅接受 Character/char .
*/
public class Digit
implements Parsec {
@Override
public Character parse(State s)
throws EOFException, ParsecException {
Character re = s.next();
if (Character.isDigit(re)) {
return re;
} else {
String message = String.format("Expect %c is digit.", re);
throw s.trap(message);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy