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

jaskell.parsec.Skip 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.
 * 跳过 0 到多次重复匹配
 */
public class Skip
    implements Parsec {
    private final Parsec psc;

    @Override
    public  T parse(State s)
            throws EOFException, ParsecException {
        Tran tran = null;
        try {
            while (true) {
                tran = s.begin();
                psc.parse(s);
                s.commit(tran);
            }
        } catch (Exception e){
            s.rollback(tran);
        }
        return null;
    }

    public Skip(Parsec psc) {
        this.psc = psc;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy