use of org.geotoolkit.cql.CQLParser in project geotoolkit by Geomatys.
the class CQL method compileExpression.
private static Object compileExpression(String cql) {
try {
// lexer splits input into tokens
final ANTLRInputStream input = new ANTLRInputStream(cql);
final TokenStream tokens = new CommonTokenStream(new CQLLexer(input));
// parser generates abstract syntax tree
final CQLParser parser = new CQLParser(tokens);
final ExpressionContext ctx = parser.expression();
return ctx;
} catch (RecognitionException e) {
throw new IllegalStateException("Recognition exception is never thrown, only declared.");
}
}
use of org.geotoolkit.cql.CQLParser in project geotoolkit by Geomatys.
the class CQL method compileFilter.
private static Object compileFilter(String cql) {
try {
// lexer splits input into tokens
final ANTLRInputStream input = new ANTLRInputStream(cql);
final TokenStream tokens = new CommonTokenStream(new CQLLexer(input));
// parser generates abstract syntax tree
final CQLParser parser = new CQLParser(tokens);
final FilterContext retfilter = parser.filter();
return retfilter;
} catch (RecognitionException e) {
throw new IllegalStateException("Recognition exception is never thrown, only declared.");
}
}
use of org.geotoolkit.cql.CQLParser in project geotoolkit by Geomatys.
the class CQL method compileFilterOrExpression.
private static Object compileFilterOrExpression(String cql) {
try {
// lexer splits input into tokens
final ANTLRInputStream input = new ANTLRInputStream(cql);
final TokenStream tokens = new CommonTokenStream(new CQLLexer(input));
// parser generates abstract syntax tree
final CQLParser parser = new CQLParser(tokens);
final FilterOrExpressionContext retfilter = parser.filterOrExpression();
return retfilter;
} catch (RecognitionException e) {
throw new IllegalStateException("Recognition exception is never thrown, only declared.");
}
}
Aggregations