All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jaskell.parsec.Fail Maven / Gradle / Ivy

Go to download

This is a utils library for java 8 project. It include parsec combinators and sql generators library.

There is a newer version: 2.9.2
Show newest version
package jaskell.parsec;

import java.io.EOFException;

/**
 * Created by Mars Liu on 2016-01-07.
 * Fail 不改变 state , 直接抛出预设的异常.
 */
public class Fail implements Parsec {
    private final String message;

    @Override
    public  E parse(State s) throws EOFException, ParsecException {
        throw s.trap(message);
    }

    public Fail(String msg, Object...objects) {
        message = String.format(msg, objects);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy