Search in sources :

Example 21 with Reference

use of org.jparsec.Parser.Reference in project fql by CategoricalData.

the class XParser method where.

private static Parser where() {
    Reference ref = Parser.newReference();
    Parser p1 = Parsers.tuple(term("("), ref.lazy(), term("and"), ref.lazy(), term(")"));
    Parser p2 = Parsers.tuple(term("("), ref.lazy(), term("or"), ref.lazy(), term(")"));
    Parser p3 = Parsers.tuple(path(), term("="), path());
    Parser p4 = Parsers.tuple(term("not"), ref.lazy());
    Parser p = Parsers.or(p1, p2, p3, p4, term("true"), term("false"));
    ref.set(p);
    return p;
}
Also used : Reference(org.jparsec.Parser.Reference) Parser(org.jparsec.Parser)

Aggregations

Reference (org.jparsec.Parser.Reference)21 Parser (org.jparsec.Parser)12