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

jaskell.expression.parser.Q 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.expression.parser;

import jaskell.expression.Expression;
import jaskell.expression.Quote;
import jaskell.parsec.ParsecException;
import jaskell.parsec.common.Parsec;
import jaskell.parsec.common.SkipWhitespaces;
import jaskell.parsec.common.State;

import java.io.EOFException;

import static jaskell.parsec.common.Txt.ch;
import static jaskell.parsec.common.Txt.skipWhiteSpaces;
import static jaskell.parsec.common.Combinator.between;

/**
 * TODO
 *
 * @author mars
 * @version 1.0.0
 * @since 2020/06/04 11:31
 */
public class Q implements Parsec {
  @Override
  public Quote parse(State s) throws EOFException, ParsecException {
    Parser p = new Parser();
    SkipWhitespaces skips = skipWhiteSpaces();
    Parsec parser = between(ch('(').then(skips), skips.then(ch(')')), p);
    return new Quote(parser.parse(s));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy