Search in sources :

Example 1 with HL7QueryParser

use of org.apache.nifi.hl7.query.antlr.HL7QueryParser in project nifi by apache.

the class HL7Query method compile.

public static HL7Query compile(final String query) {
    try {
        final CommonTokenStream lexerTokenStream = createTokenStream(query);
        final HL7QueryParser parser = new HL7QueryParser(lexerTokenStream);
        final Tree tree = (Tree) parser.query().getTree();
        return new HL7Query(tree, query);
    } catch (final HL7QueryParsingException e) {
        throw e;
    } catch (final Exception e) {
        throw new HL7QueryParsingException(e);
    }
}
Also used : CommonTokenStream(org.antlr.runtime.CommonTokenStream) HL7QueryParser(org.apache.nifi.hl7.query.antlr.HL7QueryParser) HL7QueryParsingException(org.apache.nifi.hl7.query.exception.HL7QueryParsingException) Tree(org.antlr.runtime.tree.Tree) HL7QueryParsingException(org.apache.nifi.hl7.query.exception.HL7QueryParsingException)

Aggregations

CommonTokenStream (org.antlr.runtime.CommonTokenStream)1 Tree (org.antlr.runtime.tree.Tree)1 HL7QueryParser (org.apache.nifi.hl7.query.antlr.HL7QueryParser)1 HL7QueryParsingException (org.apache.nifi.hl7.query.exception.HL7QueryParsingException)1