jaskell.parsec.common.Letter 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;
/**
* TODO
*
* @author mars
* @version 1.0.0
* @since 2020/06/12 19:26
*/
public class Letter implements Parsec {
@Override
public Character parse(State s) throws EOFException, ParsecException {
Character c = s.next();
if(Character.isLetter(c)){
return c;
} else {
throw s.trap(String.format("expect a letter but get %c", c));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy