From a954f8e9e1ff408c0333426c2b1972d98b411d78 Mon Sep 17 00:00:00 2001 From: Robin Bygrave Date: Wed, 1 Jun 2016 17:27:35 +1200 Subject: [PATCH] EQL - initial --- pom.xml | 6 + .../server/grammer/EqlAdapter.java | 200 ++ .../server/grammer/EqlAdapterHelper.java | 131 ++ .../server/grammer/EqlOperator.java | 20 + .../server/grammer/EqlParser.java | 24 + .../server/grammer/NamedParameter.java | 16 + .../server/grammer/OperatorMapping.java | 47 + .../server/grammer/antlr/EQL.tokens | 96 + .../server/grammer/antlr/EQLBaseListener.java | 351 ++++ .../server/grammer/antlr/EQLLexer.java | 253 +++ .../server/grammer/antlr/EQLLexer.tokens | 96 + .../server/grammer/antlr/EQLListener.java | 270 +++ .../server/grammer/antlr/EQLParser.java | 1651 +++++++++++++++++ .../server/grammer/EqlParserTest.java | 55 + src/test/resources/EQL.g4 | 169 ++ src/test/resources/logback-test.xml | 8 +- 16 files changed, 3389 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapter.java create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapterHelper.java create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/EqlOperator.java create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/EqlParser.java create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/NamedParameter.java create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/OperatorMapping.java create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQL.tokens create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLBaseListener.java create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.java create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.tokens create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLListener.java create mode 100644 src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLParser.java create mode 100644 src/test/java/com/avaje/ebeaninternal/server/grammer/EqlParserTest.java create mode 100644 src/test/resources/EQL.g4 diff --git a/pom.xml b/pom.xml index 5ef29aa42..b5ab2bca6 100644 --- a/pom.xml +++ b/pom.xml @@ -90,6 +90,12 @@ [1.7.1,1.7.99) + + org.antlr + antlr4-runtime + 4.5.3 + + com.fasterxml.jackson.core diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapter.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapter.java new file mode 100644 index 000000000..b3f7a6ad7 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapter.java @@ -0,0 +1,200 @@ +package com.avaje.ebeaninternal.server.grammer; + +import com.avaje.ebean.ExpressionList; +import com.avaje.ebean.Query; +import com.avaje.ebeaninternal.server.grammer.antlr.EQLBaseListener; +import com.avaje.ebeaninternal.server.grammer.antlr.EQLLexer; +import com.avaje.ebeaninternal.server.grammer.antlr.EQLParser; +import com.avaje.ebeaninternal.server.util.ArrayStack; +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.TerminalNode; + +class EqlAdapter extends EQLBaseListener { + + private static final OperatorMapping operatorMapping = new OperatorMapping(); + + private final Query query; + + private final EqlAdapterHelper helper; + + private ArrayStack> textStack; + + private ArrayStack> whereStack; + + private boolean textMode; + + public EqlAdapter(Query query) { + this.query = query; + this.helper = new EqlAdapterHelper(this); + } + + /** + * Return the current expression list that expressions should be added to. + */ + protected ExpressionList peekExprList() { + + if (textMode) { + // return the current text expression list + return _peekText(); + } + + if (whereStack == null) { + whereStack = new ArrayStack>(); + whereStack.push(query.where()); + } + // return the current expression list + return whereStack.peek(); + } + + private ExpressionList _peekText() { + if (textStack == null) { + textStack = new ArrayStack>(); + // empty so push on the queries base expression list + textStack.push(query.text()); + } + // return the current expression list + return textStack.peek(); + } + + /** + * Push the expression list onto the appropriate stack. + */ + private void pushExprList(ExpressionList list, String type) { + System.out.println("Push " + type + ">> "); + if (textMode) { + textStack.push(list); + } else { + whereStack.push(list); + } + } + + /** + * End a list of expressions added by 'OR'. + */ + private void popJunction(String type) { + System.out.println("Pop " + type + " >> "); + if (textMode) { + textStack.pop(); + } else { + whereStack.pop(); + } + } + + + private String getLeftHandSidePath(ParserRuleContext ctx) { + TerminalNode pathToken = ctx.getToken(EQLLexer.PATH_VARIABLE, 0); + return pathToken.getText(); + } + + @Override + public void enterBetween_expression(EQLParser.Between_expressionContext ctx) { + + } + + @Override + public void enterPropertyBetween_expression(EQLParser.PropertyBetween_expressionContext ctx) { + + } + + @Override + public void enterIn_expression(EQLParser.In_expressionContext ctx) { + + } + + @Override + public void enterIsNull_expression(EQLParser.IsNull_expressionContext ctx) { + String path = getLeftHandSidePath(ctx); + peekExprList().isNull(path); + } + + @Override + public void enterIsNotNull_expression(EQLParser.IsNotNull_expressionContext ctx) { + String path = getLeftHandSidePath(ctx); + peekExprList().isNotNull(path); + } + + @Override + public void enterIsEmpty_expression(EQLParser.IsEmpty_expressionContext ctx) { + String path = getLeftHandSidePath(ctx); + peekExprList().isEmpty(path); + } + + @Override + public void enterIsNotEmpty_expression(EQLParser.IsNotEmpty_expressionContext ctx) { + String path = getLeftHandSidePath(ctx); + peekExprList().isNotEmpty(path); + } + + @Override + public void enterLike_expression(EQLParser.Like_expressionContext ctx) { + addExpression(ctx); + } + + @Override + public void enterComparison_expression(EQLParser.Comparison_expressionContext ctx) { + addExpression(ctx); + } + + private void addExpression(ParserRuleContext ctx) { + int childCount = ctx.getChildCount(); + if (childCount < 3) { + throw new IllegalStateException("expecting 3 children for comparison? " + ctx); + } + String path = getLeftHandSidePath(ctx); + String operator = ctx.getChild(1).getText(); + EqlOperator op = operatorMapping.get(operator); + if (op == null) { + throw new IllegalStateException("No operator found for " + op); + } + + // RHS is Path, Literal or Named input parameter + ParseTree rhs = ctx.getChild(2); + helper.addExpression(path, op, rhs.getText()); + } + + + @Override + public void enterConditional_term(EQLParser.Conditional_termContext ctx) { + int childCount = ctx.getChildCount(); + if (childCount > 1) { + pushExprList(peekExprList().and(), "Conjunction"); + } + } + + @Override + public void exitConditional_term(EQLParser.Conditional_termContext ctx) { + if (ctx.getChildCount() > 1) { + popJunction("Conjunction"); + } + } + + @Override + public void enterConditional_expression(EQLParser.Conditional_expressionContext ctx) { + if (ctx.getChildCount() > 1) { + pushExprList(peekExprList().or(), "Disjunction"); + } + } + + @Override + public void exitConditional_expression(EQLParser.Conditional_expressionContext ctx) { + if (ctx.getChildCount() > 1) { + popJunction("Disjunction"); + } + } + + @Override + public void enterConditional_factor(EQLParser.Conditional_factorContext ctx) { + if (ctx.getChildCount() > 1) { + pushExprList(peekExprList().not(), "Not"); + } + } + + @Override + public void exitConditional_factor(EQLParser.Conditional_factorContext ctx) { + if (ctx.getChildCount() > 1) { + popJunction("Not"); + } + } + +} diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapterHelper.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapterHelper.java new file mode 100644 index 000000000..6e3754b93 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapterHelper.java @@ -0,0 +1,131 @@ +package com.avaje.ebeaninternal.server.grammer; + +import com.avaje.ebean.ExpressionList; + +import java.math.BigDecimal; + +class EqlAdapterHelper { + + private final EqlAdapter owner; + + public EqlAdapterHelper(EqlAdapter owner) { + this.owner = owner; + } + + enum ValueType { + NAMED_PARAM, + STRING, + BOOL, + NUMBER + } + + private ValueType getValueType(String valueAsText) { + + char firstChar = Character.toLowerCase(valueAsText.charAt(0)); + switch (firstChar) { + case ':': + return ValueType.NAMED_PARAM; + case 't': + return ValueType.BOOL; + case 'f': + return ValueType.BOOL; + case '\'': + return ValueType.STRING; + default: + if (Character.isDigit(firstChar)) { + return ValueType.NUMBER; + } + throw new IllegalArgumentException("Unexpected first character in value [" + valueAsText + "]"); + } + } + + + protected void addExpression(String path, EqlOperator op, String value) { + + switch (op) { + case EQ: + peekExprList().eq(path, bind(value)); + break; + case NE: + peekExprList().ne(path, bind(value)); + break; + case GT: + peekExprList().gt(path, bind(value)); + break; + case LT: + peekExprList().lt(path, bind(value)); + break; + case GTE: + peekExprList().ge(path, bind(value)); + break; + case LTE: + peekExprList().le(path, bind(value)); + break; + case LIKE: + peekExprList().like(path, bindString(value)); + break; + case CONTAINS: + peekExprList().contains(path, bindString(value)); + break; + case STARTS_WITH: + peekExprList().startsWith(path, bindString(value)); + break; + case ENDS_WITH: + peekExprList().endsWith(path, bindString(value)); + break; + case ILIKE: + peekExprList().ilike(path, bindString(value)); + break; + case ICONTAINS: + peekExprList().icontains(path, bindString(value)); + break; + case ISTARTS_WITH: + peekExprList().istartsWith(path, bindString(value)); + break; + case IENDS_WITH: + peekExprList().iendsWith(path, bindString(value)); + break; + default: + throw new IllegalStateException("Unhandled operator " + op); + } + + } + + private String bindString(String value) { + ValueType valueType = getValueType(value); + switch (valueType) { + case NAMED_PARAM: + return NamedParameter.PREFIX + value; + case STRING: + return unquote(value); + default: + throw new IllegalArgumentException("Only STRING or NAMED PARAMETER argument allowed but got " + valueType); + } + } + + private Object bind(String value) { + ValueType valueType = getValueType(value); + return getBindValue(valueType, value); + } + + private ExpressionList peekExprList() { + return owner.peekExprList(); + } + + private Object getBindValue(ValueType valueType, String value) { + switch (valueType) { + case BOOL: return Boolean.parseBoolean(value); + case NUMBER: return new BigDecimal(value); + case STRING: return unquote(value); + case NAMED_PARAM: return new NamedParameter(value.substring(1)); + default: + throw new IllegalArgumentException("Unhandled valueType "+valueType); + } + } + + private String unquote(String value) { + String raw = value.substring(1, value.length() - 1); + //raw.replaceAll(); + return raw; + } +} diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlOperator.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlOperator.java new file mode 100644 index 000000000..d5fb64b20 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlOperator.java @@ -0,0 +1,20 @@ +package com.avaje.ebeaninternal.server.grammer; + +enum EqlOperator { + + EQ, + NE, + LT, + LTE, + GT, + GTE, + CONTAINS, + STARTS_WITH, + ENDS_WITH, + LIKE, + ICONTAINS, + ISTARTS_WITH, + IENDS_WITH, + ILIKE + +} diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlParser.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlParser.java new file mode 100644 index 000000000..980aad011 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlParser.java @@ -0,0 +1,24 @@ +package com.avaje.ebeaninternal.server.grammer; + +import com.avaje.ebean.Query; +import com.avaje.ebeaninternal.server.grammer.antlr.EQLLexer; +import com.avaje.ebeaninternal.server.grammer.antlr.EQLParser; +import org.antlr.v4.runtime.ANTLRInputStream; +import org.antlr.v4.runtime.CommonTokenStream; +import org.antlr.v4.runtime.tree.ParseTreeWalker; + +public class EqlParser { + + public static void parse(String raw, Query query) { + + EQLLexer lexer = new EQLLexer(new ANTLRInputStream(raw)); + CommonTokenStream tokens = new CommonTokenStream(lexer); + EQLParser parser = new EQLParser(tokens); + EQLParser.Select_statementContext context = parser.select_statement(); + + EqlAdapter adapter = new EqlAdapter(query); + + ParseTreeWalker walker = new ParseTreeWalker(); + walker.walk(adapter, context); + } +} diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/NamedParameter.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/NamedParameter.java new file mode 100644 index 000000000..23f508f33 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/NamedParameter.java @@ -0,0 +1,16 @@ +package com.avaje.ebeaninternal.server.grammer; + +public class NamedParameter { + + public static final String PREFIX = "$namedParam$"; + + private final String name; + + public NamedParameter(String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/OperatorMapping.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/OperatorMapping.java new file mode 100644 index 000000000..355fa7b58 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/OperatorMapping.java @@ -0,0 +1,47 @@ +package com.avaje.ebeaninternal.server.grammer; + +import java.util.HashMap; +import java.util.Map; + +class OperatorMapping { + + Map map = new HashMap(); + + public OperatorMapping() { + map.put("eq", EqlOperator.EQ); + map.put("=", EqlOperator.EQ); + + map.put("ne", EqlOperator.NE); + map.put("<>", EqlOperator.NE); + map.put("!=", EqlOperator.NE); + + map.put(">", EqlOperator.GT); + map.put("gt", EqlOperator.GT); + + map.put(">=", EqlOperator.GTE); + map.put("gte", EqlOperator.GTE); + map.put("ge", EqlOperator.GTE); + + map.put("<", EqlOperator.LT); + map.put("lt", EqlOperator.LT); + + map.put("<=", EqlOperator.LTE); + map.put("lte", EqlOperator.LTE); + map.put("le", EqlOperator.LTE); + + map.put("contains", EqlOperator.CONTAINS); + map.put("startsWith", EqlOperator.STARTS_WITH); + map.put("endsWith", EqlOperator.ENDS_WITH); + map.put("like", EqlOperator.LIKE); + + map.put("icontains", EqlOperator.ICONTAINS); + map.put("istartsWith", EqlOperator.ISTARTS_WITH); + map.put("iendsWith", EqlOperator.IENDS_WITH); + map.put("ilike", EqlOperator.ILIKE); + + } + + public EqlOperator get(String key) { + return map.get(key); + } +} diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQL.tokens b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQL.tokens new file mode 100644 index 000000000..29cd61604 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQL.tokens @@ -0,0 +1,96 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +T__7=8 +T__8=9 +T__9=10 +T__10=11 +T__11=12 +T__12=13 +T__13=14 +T__14=15 +T__15=16 +T__16=17 +T__17=18 +T__18=19 +T__19=20 +T__20=21 +T__21=22 +T__22=23 +T__23=24 +T__24=25 +T__25=26 +T__26=27 +T__27=28 +T__28=29 +T__29=30 +T__30=31 +T__31=32 +T__32=33 +T__33=34 +T__34=35 +T__35=36 +T__36=37 +T__37=38 +T__38=39 +T__39=40 +T__40=41 +T__41=42 +T__42=43 +T__43=44 +INPUT_VARIABLE=45 +PATH_VARIABLE=46 +CHARACTER=47 +BOOLEAN_LITERAL=48 +NUMBER_LITERAL=49 +STRING_LITERAL=50 +ESCAPE_CHARACTER=51 +WS=52 +'select'=1 +'('=2 +')'=3 +'where'=4 +'fetch'=5 +','=6 +'or'=7 +'and'=8 +'not'=9 +'in'=10 +'between'=11 +'is'=12 +'null'=13 +'isNull'=14 +'isNotNull'=15 +'notNull'=16 +'empty'=17 +'isEmpty'=18 +'isNotEmpty'=19 +'notEmpty'=20 +'like'=21 +'ilike'=22 +'contains'=23 +'icontains'=24 +'startsWith'=25 +'istartsWith'=26 +'endsWith'=27 +'iendsWith'=28 +'='=29 +'eq'=30 +'>'=31 +'gt'=32 +'>='=33 +'ge'=34 +'gte'=35 +'<'=36 +'lt'=37 +'<='=38 +'le'=39 +'lte'=40 +'<>'=41 +'!='=42 +'ne'=43 +'ieq'=44 diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLBaseListener.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLBaseListener.java new file mode 100644 index 000000000..a4bc3fbbc --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLBaseListener.java @@ -0,0 +1,351 @@ +// Generated from /home/rob/github/avaje-ebeanorm/src/test/resources/EQL.g4 by ANTLR 4.5.1 +package com.avaje.ebeaninternal.server.grammer.antlr; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ErrorNode; +import org.antlr.v4.runtime.tree.TerminalNode; + +/** + * This class provides an empty implementation of {@link EQLListener}, + * which can be extended to create a listener which only needs to handle a subset + * of the available methods. + */ +public class EQLBaseListener implements EQLListener { + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSelect_statement(EQLParser.Select_statementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSelect_statement(EQLParser.Select_statementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSelect_clause(EQLParser.Select_clauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSelect_clause(EQLParser.Select_clauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFetch_clause(EQLParser.Fetch_clauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFetch_clause(EQLParser.Fetch_clauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterWhere_clause(EQLParser.Where_clauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitWhere_clause(EQLParser.Where_clauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFetch_path(EQLParser.Fetch_pathContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFetch_path(EQLParser.Fetch_pathContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFetch_property_group(EQLParser.Fetch_property_groupContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFetch_property_group(EQLParser.Fetch_property_groupContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFetch_property(EQLParser.Fetch_propertyContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFetch_property(EQLParser.Fetch_propertyContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterConditional_expression(EQLParser.Conditional_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitConditional_expression(EQLParser.Conditional_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterConditional_term(EQLParser.Conditional_termContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitConditional_term(EQLParser.Conditional_termContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterConditional_factor(EQLParser.Conditional_factorContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitConditional_factor(EQLParser.Conditional_factorContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterConditional_primary(EQLParser.Conditional_primaryContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitConditional_primary(EQLParser.Conditional_primaryContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAny_expression(EQLParser.Any_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAny_expression(EQLParser.Any_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIn_expression(EQLParser.In_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIn_expression(EQLParser.In_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIn_value(EQLParser.In_valueContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIn_value(EQLParser.In_valueContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBetween_expression(EQLParser.Between_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBetween_expression(EQLParser.Between_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPropertyBetween_expression(EQLParser.PropertyBetween_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPropertyBetween_expression(EQLParser.PropertyBetween_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIsNull_expression(EQLParser.IsNull_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIsNull_expression(EQLParser.IsNull_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIsNotNull_expression(EQLParser.IsNotNull_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIsNotNull_expression(EQLParser.IsNotNull_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIsEmpty_expression(EQLParser.IsEmpty_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIsEmpty_expression(EQLParser.IsEmpty_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIsNotEmpty_expression(EQLParser.IsNotEmpty_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIsNotEmpty_expression(EQLParser.IsNotEmpty_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLike_expression(EQLParser.Like_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLike_expression(EQLParser.Like_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLike_op(EQLParser.Like_opContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLike_op(EQLParser.Like_opContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterComparison_expression(EQLParser.Comparison_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitComparison_expression(EQLParser.Comparison_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterComparison_operator(EQLParser.Comparison_operatorContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitComparison_operator(EQLParser.Comparison_operatorContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterValue_expression(EQLParser.Value_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitValue_expression(EQLParser.Value_expressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLiteral(EQLParser.LiteralContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLiteral(EQLParser.LiteralContext ctx) { } + + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitTerminal(TerminalNode node) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitErrorNode(ErrorNode node) { } +} \ No newline at end of file diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.java new file mode 100644 index 000000000..62bd17a20 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.java @@ -0,0 +1,253 @@ +// Generated from /home/rob/github/avaje-ebeanorm/src/test/resources/EQL.g4 by ANTLR 4.5.1 +package com.avaje.ebeaninternal.server.grammer.antlr; +import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.TokenStream; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.misc.*; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class EQLLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.5.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, + T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, + T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, + T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31, + T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, T__36=37, T__37=38, + T__38=39, T__39=40, T__40=41, T__41=42, T__42=43, T__43=44, INPUT_VARIABLE=45, + PATH_VARIABLE=46, CHARACTER=47, BOOLEAN_LITERAL=48, NUMBER_LITERAL=49, + STRING_LITERAL=50, ESCAPE_CHARACTER=51, WS=52; + public static String[] modeNames = { + "DEFAULT_MODE" + }; + + public static final String[] ruleNames = { + "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", + "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", + "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", + "T__25", "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", "T__32", + "T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "T__39", "T__40", + "T__41", "T__42", "T__43", "INPUT_VARIABLE", "PATH_VARIABLE", "CHARACTER", + "BOOLEAN_LITERAL", "NUMBER_LITERAL", "STRING_LITERAL", "ESCAPE_CHARACTER", + "WS" + }; + + private static final String[] _LITERAL_NAMES = { + null, "'select'", "'('", "')'", "'where'", "'fetch'", "','", "'or'", "'and'", + "'not'", "'in'", "'between'", "'is'", "'null'", "'isNull'", "'isNotNull'", + "'notNull'", "'empty'", "'isEmpty'", "'isNotEmpty'", "'notEmpty'", "'like'", + "'ilike'", "'contains'", "'icontains'", "'startsWith'", "'istartsWith'", + "'endsWith'", "'iendsWith'", "'='", "'eq'", "'>'", "'gt'", "'>='", "'ge'", + "'gte'", "'<'", "'lt'", "'<='", "'le'", "'lte'", "'<>'", "'!='", "'ne'", + "'ieq'" + }; + private static final String[] _SYMBOLIC_NAMES = { + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, "INPUT_VARIABLE", + "PATH_VARIABLE", "CHARACTER", "BOOLEAN_LITERAL", "NUMBER_LITERAL", "STRING_LITERAL", + "ESCAPE_CHARACTER", "WS" + }; + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + + public EQLLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @Override + public String getGrammarFileName() { return "EQL.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public String[] getModeNames() { return modeNames; } + + @Override + public ATN getATN() { return _ATN; } + + public static final String _serializedATN = + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\66\u0192\b\1\4\2"+ + "\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4"+ + "\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+ + "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+ + "\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t"+ + " \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t"+ + "+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64"+ + "\t\64\4\65\t\65\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3"+ + "\5\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\b\3\b\3\b\3\t\3\t\3\t"+ + "\3\t\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3"+ + "\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17"+ + "\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21"+ + "\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23"+ + "\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24"+ + "\3\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3\26"+ + "\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\30\3\30\3\30\3\30"+ + "\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\32\3\32"+ + "\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33"+ + "\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34"+ + "\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\36\3\36"+ + "\3\37\3\37\3\37\3 \3 \3!\3!\3!\3\"\3\"\3\"\3#\3#\3#\3$\3$\3$\3$\3%\3%"+ + "\3&\3&\3&\3\'\3\'\3\'\3(\3(\3(\3)\3)\3)\3)\3*\3*\3*\3+\3+\3+\3,\3,\3,"+ + "\3-\3-\3-\3-\3.\3.\3.\7.\u0159\n.\f.\16.\u015c\13.\3/\3/\7/\u0160\n/\f"+ + "/\16/\u0163\13/\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61\3\61\3\61\3\61"+ + "\3\61\3\61\5\61\u0172\n\61\3\62\6\62\u0175\n\62\r\62\16\62\u0176\3\62"+ + "\5\62\u017a\n\62\3\62\7\62\u017d\n\62\f\62\16\62\u0180\13\62\3\63\3\63"+ + "\3\63\3\63\7\63\u0186\n\63\f\63\16\63\u0189\13\63\3\63\3\63\3\64\3\64"+ + "\3\65\3\65\3\65\3\65\2\2\66\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25"+ + "\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32"+ + "\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a"+ + "\62c\63e\64g\65i\66\3\2\t\5\2C\\aac|\6\2\62;C\\aac|\7\2\60\60\62;C\\a"+ + "ac|\4\2))^^\3\2\62;\3\2))\5\2\13\f\17\17\"\"\u0199\2\3\3\2\2\2\2\5\3\2"+ + "\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21"+ + "\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2"+ + "\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3"+ + "\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3"+ + "\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3"+ + "\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2"+ + "\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2"+ + "Y\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2\2\2e\3"+ + "\2\2\2\2g\3\2\2\2\2i\3\2\2\2\3k\3\2\2\2\5r\3\2\2\2\7t\3\2\2\2\tv\3\2\2"+ + "\2\13|\3\2\2\2\r\u0082\3\2\2\2\17\u0084\3\2\2\2\21\u0087\3\2\2\2\23\u008b"+ + "\3\2\2\2\25\u008f\3\2\2\2\27\u0092\3\2\2\2\31\u009a\3\2\2\2\33\u009d\3"+ + "\2\2\2\35\u00a2\3\2\2\2\37\u00a9\3\2\2\2!\u00b3\3\2\2\2#\u00bb\3\2\2\2"+ + "%\u00c1\3\2\2\2\'\u00c9\3\2\2\2)\u00d4\3\2\2\2+\u00dd\3\2\2\2-\u00e2\3"+ + "\2\2\2/\u00e8\3\2\2\2\61\u00f1\3\2\2\2\63\u00fb\3\2\2\2\65\u0106\3\2\2"+ + "\2\67\u0112\3\2\2\29\u011b\3\2\2\2;\u0125\3\2\2\2=\u0127\3\2\2\2?\u012a"+ + "\3\2\2\2A\u012c\3\2\2\2C\u012f\3\2\2\2E\u0132\3\2\2\2G\u0135\3\2\2\2I"+ + "\u0139\3\2\2\2K\u013b\3\2\2\2M\u013e\3\2\2\2O\u0141\3\2\2\2Q\u0144\3\2"+ + "\2\2S\u0148\3\2\2\2U\u014b\3\2\2\2W\u014e\3\2\2\2Y\u0151\3\2\2\2[\u0155"+ + "\3\2\2\2]\u015d\3\2\2\2_\u0164\3\2\2\2a\u0171\3\2\2\2c\u0174\3\2\2\2e"+ + "\u0181\3\2\2\2g\u018c\3\2\2\2i\u018e\3\2\2\2kl\7u\2\2lm\7g\2\2mn\7n\2"+ + "\2no\7g\2\2op\7e\2\2pq\7v\2\2q\4\3\2\2\2rs\7*\2\2s\6\3\2\2\2tu\7+\2\2"+ + "u\b\3\2\2\2vw\7y\2\2wx\7j\2\2xy\7g\2\2yz\7t\2\2z{\7g\2\2{\n\3\2\2\2|}"+ + "\7h\2\2}~\7g\2\2~\177\7v\2\2\177\u0080\7e\2\2\u0080\u0081\7j\2\2\u0081"+ + "\f\3\2\2\2\u0082\u0083\7.\2\2\u0083\16\3\2\2\2\u0084\u0085\7q\2\2\u0085"+ + "\u0086\7t\2\2\u0086\20\3\2\2\2\u0087\u0088\7c\2\2\u0088\u0089\7p\2\2\u0089"+ + "\u008a\7f\2\2\u008a\22\3\2\2\2\u008b\u008c\7p\2\2\u008c\u008d\7q\2\2\u008d"+ + "\u008e\7v\2\2\u008e\24\3\2\2\2\u008f\u0090\7k\2\2\u0090\u0091\7p\2\2\u0091"+ + "\26\3\2\2\2\u0092\u0093\7d\2\2\u0093\u0094\7g\2\2\u0094\u0095\7v\2\2\u0095"+ + "\u0096\7y\2\2\u0096\u0097\7g\2\2\u0097\u0098\7g\2\2\u0098\u0099\7p\2\2"+ + "\u0099\30\3\2\2\2\u009a\u009b\7k\2\2\u009b\u009c\7u\2\2\u009c\32\3\2\2"+ + "\2\u009d\u009e\7p\2\2\u009e\u009f\7w\2\2\u009f\u00a0\7n\2\2\u00a0\u00a1"+ + "\7n\2\2\u00a1\34\3\2\2\2\u00a2\u00a3\7k\2\2\u00a3\u00a4\7u\2\2\u00a4\u00a5"+ + "\7P\2\2\u00a5\u00a6\7w\2\2\u00a6\u00a7\7n\2\2\u00a7\u00a8\7n\2\2\u00a8"+ + "\36\3\2\2\2\u00a9\u00aa\7k\2\2\u00aa\u00ab\7u\2\2\u00ab\u00ac\7P\2\2\u00ac"+ + "\u00ad\7q\2\2\u00ad\u00ae\7v\2\2\u00ae\u00af\7P\2\2\u00af\u00b0\7w\2\2"+ + "\u00b0\u00b1\7n\2\2\u00b1\u00b2\7n\2\2\u00b2 \3\2\2\2\u00b3\u00b4\7p\2"+ + "\2\u00b4\u00b5\7q\2\2\u00b5\u00b6\7v\2\2\u00b6\u00b7\7P\2\2\u00b7\u00b8"+ + "\7w\2\2\u00b8\u00b9\7n\2\2\u00b9\u00ba\7n\2\2\u00ba\"\3\2\2\2\u00bb\u00bc"+ + "\7g\2\2\u00bc\u00bd\7o\2\2\u00bd\u00be\7r\2\2\u00be\u00bf\7v\2\2\u00bf"+ + "\u00c0\7{\2\2\u00c0$\3\2\2\2\u00c1\u00c2\7k\2\2\u00c2\u00c3\7u\2\2\u00c3"+ + "\u00c4\7G\2\2\u00c4\u00c5\7o\2\2\u00c5\u00c6\7r\2\2\u00c6\u00c7\7v\2\2"+ + "\u00c7\u00c8\7{\2\2\u00c8&\3\2\2\2\u00c9\u00ca\7k\2\2\u00ca\u00cb\7u\2"+ + "\2\u00cb\u00cc\7P\2\2\u00cc\u00cd\7q\2\2\u00cd\u00ce\7v\2\2\u00ce\u00cf"+ + "\7G\2\2\u00cf\u00d0\7o\2\2\u00d0\u00d1\7r\2\2\u00d1\u00d2\7v\2\2\u00d2"+ + "\u00d3\7{\2\2\u00d3(\3\2\2\2\u00d4\u00d5\7p\2\2\u00d5\u00d6\7q\2\2\u00d6"+ + "\u00d7\7v\2\2\u00d7\u00d8\7G\2\2\u00d8\u00d9\7o\2\2\u00d9\u00da\7r\2\2"+ + "\u00da\u00db\7v\2\2\u00db\u00dc\7{\2\2\u00dc*\3\2\2\2\u00dd\u00de\7n\2"+ + "\2\u00de\u00df\7k\2\2\u00df\u00e0\7m\2\2\u00e0\u00e1\7g\2\2\u00e1,\3\2"+ + "\2\2\u00e2\u00e3\7k\2\2\u00e3\u00e4\7n\2\2\u00e4\u00e5\7k\2\2\u00e5\u00e6"+ + "\7m\2\2\u00e6\u00e7\7g\2\2\u00e7.\3\2\2\2\u00e8\u00e9\7e\2\2\u00e9\u00ea"+ + "\7q\2\2\u00ea\u00eb\7p\2\2\u00eb\u00ec\7v\2\2\u00ec\u00ed\7c\2\2\u00ed"+ + "\u00ee\7k\2\2\u00ee\u00ef\7p\2\2\u00ef\u00f0\7u\2\2\u00f0\60\3\2\2\2\u00f1"+ + "\u00f2\7k\2\2\u00f2\u00f3\7e\2\2\u00f3\u00f4\7q\2\2\u00f4\u00f5\7p\2\2"+ + "\u00f5\u00f6\7v\2\2\u00f6\u00f7\7c\2\2\u00f7\u00f8\7k\2\2\u00f8\u00f9"+ + "\7p\2\2\u00f9\u00fa\7u\2\2\u00fa\62\3\2\2\2\u00fb\u00fc\7u\2\2\u00fc\u00fd"+ + "\7v\2\2\u00fd\u00fe\7c\2\2\u00fe\u00ff\7t\2\2\u00ff\u0100\7v\2\2\u0100"+ + "\u0101\7u\2\2\u0101\u0102\7Y\2\2\u0102\u0103\7k\2\2\u0103\u0104\7v\2\2"+ + "\u0104\u0105\7j\2\2\u0105\64\3\2\2\2\u0106\u0107\7k\2\2\u0107\u0108\7"+ + "u\2\2\u0108\u0109\7v\2\2\u0109\u010a\7c\2\2\u010a\u010b\7t\2\2\u010b\u010c"+ + "\7v\2\2\u010c\u010d\7u\2\2\u010d\u010e\7Y\2\2\u010e\u010f\7k\2\2\u010f"+ + "\u0110\7v\2\2\u0110\u0111\7j\2\2\u0111\66\3\2\2\2\u0112\u0113\7g\2\2\u0113"+ + "\u0114\7p\2\2\u0114\u0115\7f\2\2\u0115\u0116\7u\2\2\u0116\u0117\7Y\2\2"+ + "\u0117\u0118\7k\2\2\u0118\u0119\7v\2\2\u0119\u011a\7j\2\2\u011a8\3\2\2"+ + "\2\u011b\u011c\7k\2\2\u011c\u011d\7g\2\2\u011d\u011e\7p\2\2\u011e\u011f"+ + "\7f\2\2\u011f\u0120\7u\2\2\u0120\u0121\7Y\2\2\u0121\u0122\7k\2\2\u0122"+ + "\u0123\7v\2\2\u0123\u0124\7j\2\2\u0124:\3\2\2\2\u0125\u0126\7?\2\2\u0126"+ + "<\3\2\2\2\u0127\u0128\7g\2\2\u0128\u0129\7s\2\2\u0129>\3\2\2\2\u012a\u012b"+ + "\7@\2\2\u012b@\3\2\2\2\u012c\u012d\7i\2\2\u012d\u012e\7v\2\2\u012eB\3"+ + "\2\2\2\u012f\u0130\7@\2\2\u0130\u0131\7?\2\2\u0131D\3\2\2\2\u0132\u0133"+ + "\7i\2\2\u0133\u0134\7g\2\2\u0134F\3\2\2\2\u0135\u0136\7i\2\2\u0136\u0137"+ + "\7v\2\2\u0137\u0138\7g\2\2\u0138H\3\2\2\2\u0139\u013a\7>\2\2\u013aJ\3"+ + "\2\2\2\u013b\u013c\7n\2\2\u013c\u013d\7v\2\2\u013dL\3\2\2\2\u013e\u013f"+ + "\7>\2\2\u013f\u0140\7?\2\2\u0140N\3\2\2\2\u0141\u0142\7n\2\2\u0142\u0143"+ + "\7g\2\2\u0143P\3\2\2\2\u0144\u0145\7n\2\2\u0145\u0146\7v\2\2\u0146\u0147"+ + "\7g\2\2\u0147R\3\2\2\2\u0148\u0149\7>\2\2\u0149\u014a\7@\2\2\u014aT\3"+ + "\2\2\2\u014b\u014c\7#\2\2\u014c\u014d\7?\2\2\u014dV\3\2\2\2\u014e\u014f"+ + "\7p\2\2\u014f\u0150\7g\2\2\u0150X\3\2\2\2\u0151\u0152\7k\2\2\u0152\u0153"+ + "\7g\2\2\u0153\u0154\7s\2\2\u0154Z\3\2\2\2\u0155\u0156\7<\2\2\u0156\u015a"+ + "\t\2\2\2\u0157\u0159\t\3\2\2\u0158\u0157\3\2\2\2\u0159\u015c\3\2\2\2\u015a"+ + "\u0158\3\2\2\2\u015a\u015b\3\2\2\2\u015b\\\3\2\2\2\u015c\u015a\3\2\2\2"+ + "\u015d\u0161\t\2\2\2\u015e\u0160\t\4\2\2\u015f\u015e\3\2\2\2\u0160\u0163"+ + "\3\2\2\2\u0161\u015f\3\2\2\2\u0161\u0162\3\2\2\2\u0162^\3\2\2\2\u0163"+ + "\u0161\3\2\2\2\u0164\u0165\7)\2\2\u0165\u0166\n\5\2\2\u0166\u0167\7)\2"+ + "\2\u0167`\3\2\2\2\u0168\u0169\7v\2\2\u0169\u016a\7t\2\2\u016a\u016b\7"+ + "w\2\2\u016b\u0172\7g\2\2\u016c\u016d\7h\2\2\u016d\u016e\7c\2\2\u016e\u016f"+ + "\7n\2\2\u016f\u0170\7u\2\2\u0170\u0172\7g\2\2\u0171\u0168\3\2\2\2\u0171"+ + "\u016c\3\2\2\2\u0172b\3\2\2\2\u0173\u0175\t\6\2\2\u0174\u0173\3\2\2\2"+ + "\u0175\u0176\3\2\2\2\u0176\u0174\3\2\2\2\u0176\u0177\3\2\2\2\u0177\u0179"+ + "\3\2\2\2\u0178\u017a\7\60\2\2\u0179\u0178\3\2\2\2\u0179\u017a\3\2\2\2"+ + "\u017a\u017e\3\2\2\2\u017b\u017d\t\6\2\2\u017c\u017b\3\2\2\2\u017d\u0180"+ + "\3\2\2\2\u017e\u017c\3\2\2\2\u017e\u017f\3\2\2\2\u017fd\3\2\2\2\u0180"+ + "\u017e\3\2\2\2\u0181\u0187\7)\2\2\u0182\u0186\n\7\2\2\u0183\u0184\7)\2"+ + "\2\u0184\u0186\7)\2\2\u0185\u0182\3\2\2\2\u0185\u0183\3\2\2\2\u0186\u0189"+ + "\3\2\2\2\u0187\u0185\3\2\2\2\u0187\u0188\3\2\2\2\u0188\u018a\3\2\2\2\u0189"+ + "\u0187\3\2\2\2\u018a\u018b\7)\2\2\u018bf\3\2\2\2\u018c\u018d\5_\60\2\u018d"+ + "h\3\2\2\2\u018e\u018f\t\b\2\2\u018f\u0190\3\2\2\2\u0190\u0191\b\65\2\2"+ + "\u0191j\3\2\2\2\13\2\u015a\u0161\u0171\u0176\u0179\u017e\u0185\u0187\3"+ + "\b\2\2"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.tokens b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.tokens new file mode 100644 index 000000000..29cd61604 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.tokens @@ -0,0 +1,96 @@ +T__0=1 +T__1=2 +T__2=3 +T__3=4 +T__4=5 +T__5=6 +T__6=7 +T__7=8 +T__8=9 +T__9=10 +T__10=11 +T__11=12 +T__12=13 +T__13=14 +T__14=15 +T__15=16 +T__16=17 +T__17=18 +T__18=19 +T__19=20 +T__20=21 +T__21=22 +T__22=23 +T__23=24 +T__24=25 +T__25=26 +T__26=27 +T__27=28 +T__28=29 +T__29=30 +T__30=31 +T__31=32 +T__32=33 +T__33=34 +T__34=35 +T__35=36 +T__36=37 +T__37=38 +T__38=39 +T__39=40 +T__40=41 +T__41=42 +T__42=43 +T__43=44 +INPUT_VARIABLE=45 +PATH_VARIABLE=46 +CHARACTER=47 +BOOLEAN_LITERAL=48 +NUMBER_LITERAL=49 +STRING_LITERAL=50 +ESCAPE_CHARACTER=51 +WS=52 +'select'=1 +'('=2 +')'=3 +'where'=4 +'fetch'=5 +','=6 +'or'=7 +'and'=8 +'not'=9 +'in'=10 +'between'=11 +'is'=12 +'null'=13 +'isNull'=14 +'isNotNull'=15 +'notNull'=16 +'empty'=17 +'isEmpty'=18 +'isNotEmpty'=19 +'notEmpty'=20 +'like'=21 +'ilike'=22 +'contains'=23 +'icontains'=24 +'startsWith'=25 +'istartsWith'=26 +'endsWith'=27 +'iendsWith'=28 +'='=29 +'eq'=30 +'>'=31 +'gt'=32 +'>='=33 +'ge'=34 +'gte'=35 +'<'=36 +'lt'=37 +'<='=38 +'le'=39 +'lte'=40 +'<>'=41 +'!='=42 +'ne'=43 +'ieq'=44 diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLListener.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLListener.java new file mode 100644 index 000000000..e578fc3c4 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLListener.java @@ -0,0 +1,270 @@ +// Generated from /home/rob/github/avaje-ebeanorm/src/test/resources/EQL.g4 by ANTLR 4.5.1 +package com.avaje.ebeaninternal.server.grammer.antlr; +import org.antlr.v4.runtime.tree.ParseTreeListener; + +/** + * This interface defines a complete listener for a parse tree produced by + * {@link EQLParser}. + */ +public interface EQLListener extends ParseTreeListener { + /** + * Enter a parse tree produced by {@link EQLParser#select_statement}. + * @param ctx the parse tree + */ + void enterSelect_statement(EQLParser.Select_statementContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#select_statement}. + * @param ctx the parse tree + */ + void exitSelect_statement(EQLParser.Select_statementContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#select_clause}. + * @param ctx the parse tree + */ + void enterSelect_clause(EQLParser.Select_clauseContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#select_clause}. + * @param ctx the parse tree + */ + void exitSelect_clause(EQLParser.Select_clauseContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#fetch_clause}. + * @param ctx the parse tree + */ + void enterFetch_clause(EQLParser.Fetch_clauseContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#fetch_clause}. + * @param ctx the parse tree + */ + void exitFetch_clause(EQLParser.Fetch_clauseContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#where_clause}. + * @param ctx the parse tree + */ + void enterWhere_clause(EQLParser.Where_clauseContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#where_clause}. + * @param ctx the parse tree + */ + void exitWhere_clause(EQLParser.Where_clauseContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#fetch_path}. + * @param ctx the parse tree + */ + void enterFetch_path(EQLParser.Fetch_pathContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#fetch_path}. + * @param ctx the parse tree + */ + void exitFetch_path(EQLParser.Fetch_pathContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#fetch_property_group}. + * @param ctx the parse tree + */ + void enterFetch_property_group(EQLParser.Fetch_property_groupContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#fetch_property_group}. + * @param ctx the parse tree + */ + void exitFetch_property_group(EQLParser.Fetch_property_groupContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#fetch_property}. + * @param ctx the parse tree + */ + void enterFetch_property(EQLParser.Fetch_propertyContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#fetch_property}. + * @param ctx the parse tree + */ + void exitFetch_property(EQLParser.Fetch_propertyContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#conditional_expression}. + * @param ctx the parse tree + */ + void enterConditional_expression(EQLParser.Conditional_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#conditional_expression}. + * @param ctx the parse tree + */ + void exitConditional_expression(EQLParser.Conditional_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#conditional_term}. + * @param ctx the parse tree + */ + void enterConditional_term(EQLParser.Conditional_termContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#conditional_term}. + * @param ctx the parse tree + */ + void exitConditional_term(EQLParser.Conditional_termContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#conditional_factor}. + * @param ctx the parse tree + */ + void enterConditional_factor(EQLParser.Conditional_factorContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#conditional_factor}. + * @param ctx the parse tree + */ + void exitConditional_factor(EQLParser.Conditional_factorContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#conditional_primary}. + * @param ctx the parse tree + */ + void enterConditional_primary(EQLParser.Conditional_primaryContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#conditional_primary}. + * @param ctx the parse tree + */ + void exitConditional_primary(EQLParser.Conditional_primaryContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#any_expression}. + * @param ctx the parse tree + */ + void enterAny_expression(EQLParser.Any_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#any_expression}. + * @param ctx the parse tree + */ + void exitAny_expression(EQLParser.Any_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#in_expression}. + * @param ctx the parse tree + */ + void enterIn_expression(EQLParser.In_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#in_expression}. + * @param ctx the parse tree + */ + void exitIn_expression(EQLParser.In_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#in_value}. + * @param ctx the parse tree + */ + void enterIn_value(EQLParser.In_valueContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#in_value}. + * @param ctx the parse tree + */ + void exitIn_value(EQLParser.In_valueContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#between_expression}. + * @param ctx the parse tree + */ + void enterBetween_expression(EQLParser.Between_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#between_expression}. + * @param ctx the parse tree + */ + void exitBetween_expression(EQLParser.Between_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#propertyBetween_expression}. + * @param ctx the parse tree + */ + void enterPropertyBetween_expression(EQLParser.PropertyBetween_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#propertyBetween_expression}. + * @param ctx the parse tree + */ + void exitPropertyBetween_expression(EQLParser.PropertyBetween_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#isNull_expression}. + * @param ctx the parse tree + */ + void enterIsNull_expression(EQLParser.IsNull_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#isNull_expression}. + * @param ctx the parse tree + */ + void exitIsNull_expression(EQLParser.IsNull_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#isNotNull_expression}. + * @param ctx the parse tree + */ + void enterIsNotNull_expression(EQLParser.IsNotNull_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#isNotNull_expression}. + * @param ctx the parse tree + */ + void exitIsNotNull_expression(EQLParser.IsNotNull_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#isEmpty_expression}. + * @param ctx the parse tree + */ + void enterIsEmpty_expression(EQLParser.IsEmpty_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#isEmpty_expression}. + * @param ctx the parse tree + */ + void exitIsEmpty_expression(EQLParser.IsEmpty_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#isNotEmpty_expression}. + * @param ctx the parse tree + */ + void enterIsNotEmpty_expression(EQLParser.IsNotEmpty_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#isNotEmpty_expression}. + * @param ctx the parse tree + */ + void exitIsNotEmpty_expression(EQLParser.IsNotEmpty_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#like_expression}. + * @param ctx the parse tree + */ + void enterLike_expression(EQLParser.Like_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#like_expression}. + * @param ctx the parse tree + */ + void exitLike_expression(EQLParser.Like_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#like_op}. + * @param ctx the parse tree + */ + void enterLike_op(EQLParser.Like_opContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#like_op}. + * @param ctx the parse tree + */ + void exitLike_op(EQLParser.Like_opContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#comparison_expression}. + * @param ctx the parse tree + */ + void enterComparison_expression(EQLParser.Comparison_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#comparison_expression}. + * @param ctx the parse tree + */ + void exitComparison_expression(EQLParser.Comparison_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#comparison_operator}. + * @param ctx the parse tree + */ + void enterComparison_operator(EQLParser.Comparison_operatorContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#comparison_operator}. + * @param ctx the parse tree + */ + void exitComparison_operator(EQLParser.Comparison_operatorContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#value_expression}. + * @param ctx the parse tree + */ + void enterValue_expression(EQLParser.Value_expressionContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#value_expression}. + * @param ctx the parse tree + */ + void exitValue_expression(EQLParser.Value_expressionContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#literal}. + * @param ctx the parse tree + */ + void enterLiteral(EQLParser.LiteralContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#literal}. + * @param ctx the parse tree + */ + void exitLiteral(EQLParser.LiteralContext ctx); +} \ No newline at end of file diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLParser.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLParser.java new file mode 100644 index 000000000..5fb73d454 --- /dev/null +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLParser.java @@ -0,0 +1,1651 @@ +// Generated from /home/rob/github/avaje-ebeanorm/src/test/resources/EQL.g4 by ANTLR 4.5.1 +package com.avaje.ebeaninternal.server.grammer.antlr; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.*; +import org.antlr.v4.runtime.tree.*; +import java.util.List; +import java.util.Iterator; +import java.util.ArrayList; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) +public class EQLParser extends Parser { + static { RuntimeMetaData.checkVersion("4.5.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, + T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, + T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, + T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31, + T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, T__36=37, T__37=38, + T__38=39, T__39=40, T__40=41, T__41=42, T__42=43, T__43=44, INPUT_VARIABLE=45, + PATH_VARIABLE=46, CHARACTER=47, BOOLEAN_LITERAL=48, NUMBER_LITERAL=49, + STRING_LITERAL=50, ESCAPE_CHARACTER=51, WS=52; + public static final int + RULE_select_statement = 0, RULE_select_clause = 1, RULE_fetch_clause = 2, + RULE_where_clause = 3, RULE_fetch_path = 4, RULE_fetch_property_group = 5, + RULE_fetch_property = 6, RULE_conditional_expression = 7, RULE_conditional_term = 8, + RULE_conditional_factor = 9, RULE_conditional_primary = 10, RULE_any_expression = 11, + RULE_in_expression = 12, RULE_in_value = 13, RULE_between_expression = 14, + RULE_propertyBetween_expression = 15, RULE_isNull_expression = 16, RULE_isNotNull_expression = 17, + RULE_isEmpty_expression = 18, RULE_isNotEmpty_expression = 19, RULE_like_expression = 20, + RULE_like_op = 21, RULE_comparison_expression = 22, RULE_comparison_operator = 23, + RULE_value_expression = 24, RULE_literal = 25; + public static final String[] ruleNames = { + "select_statement", "select_clause", "fetch_clause", "where_clause", "fetch_path", + "fetch_property_group", "fetch_property", "conditional_expression", "conditional_term", + "conditional_factor", "conditional_primary", "any_expression", "in_expression", + "in_value", "between_expression", "propertyBetween_expression", "isNull_expression", + "isNotNull_expression", "isEmpty_expression", "isNotEmpty_expression", + "like_expression", "like_op", "comparison_expression", "comparison_operator", + "value_expression", "literal" + }; + + private static final String[] _LITERAL_NAMES = { + null, "'select'", "'('", "')'", "'where'", "'fetch'", "','", "'or'", "'and'", + "'not'", "'in'", "'between'", "'is'", "'null'", "'isNull'", "'isNotNull'", + "'notNull'", "'empty'", "'isEmpty'", "'isNotEmpty'", "'notEmpty'", "'like'", + "'ilike'", "'contains'", "'icontains'", "'startsWith'", "'istartsWith'", + "'endsWith'", "'iendsWith'", "'='", "'eq'", "'>'", "'gt'", "'>='", "'ge'", + "'gte'", "'<'", "'lt'", "'<='", "'le'", "'lte'", "'<>'", "'!='", "'ne'", + "'ieq'" + }; + private static final String[] _SYMBOLIC_NAMES = { + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, "INPUT_VARIABLE", + "PATH_VARIABLE", "CHARACTER", "BOOLEAN_LITERAL", "NUMBER_LITERAL", "STRING_LITERAL", + "ESCAPE_CHARACTER", "WS" + }; + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + @Override + public String getGrammarFileName() { return "EQL.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public ATN getATN() { return _ATN; } + + public EQLParser(TokenStream input) { + super(input); + _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + public static class Select_statementContext extends ParserRuleContext { + public Select_clauseContext select_clause() { + return getRuleContext(Select_clauseContext.class,0); + } + public Fetch_clauseContext fetch_clause() { + return getRuleContext(Fetch_clauseContext.class,0); + } + public Where_clauseContext where_clause() { + return getRuleContext(Where_clauseContext.class,0); + } + public Select_statementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_select_statement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterSelect_statement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitSelect_statement(this); + } + } + + public final Select_statementContext select_statement() throws RecognitionException { + Select_statementContext _localctx = new Select_statementContext(_ctx, getState()); + enterRule(_localctx, 0, RULE_select_statement); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(53); + _la = _input.LA(1); + if (_la==T__0) { + { + setState(52); + select_clause(); + } + } + + setState(56); + _la = _input.LA(1); + if (_la==T__4) { + { + setState(55); + fetch_clause(); + } + } + + setState(59); + _la = _input.LA(1); + if (_la==T__3) { + { + setState(58); + where_clause(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Select_clauseContext extends ParserRuleContext { + public Fetch_property_groupContext fetch_property_group() { + return getRuleContext(Fetch_property_groupContext.class,0); + } + public Select_clauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_select_clause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterSelect_clause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitSelect_clause(this); + } + } + + public final Select_clauseContext select_clause() throws RecognitionException { + Select_clauseContext _localctx = new Select_clauseContext(_ctx, getState()); + enterRule(_localctx, 2, RULE_select_clause); + try { + enterOuterAlt(_localctx, 1); + { + setState(61); + match(T__0); + setState(62); + match(T__1); + setState(63); + fetch_property_group(); + setState(64); + match(T__2); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Fetch_clauseContext extends ParserRuleContext { + public Fetch_pathContext fetch_path() { + return getRuleContext(Fetch_pathContext.class,0); + } + public Fetch_clauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fetch_clause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterFetch_clause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitFetch_clause(this); + } + } + + public final Fetch_clauseContext fetch_clause() throws RecognitionException { + Fetch_clauseContext _localctx = new Fetch_clauseContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_fetch_clause); + try { + enterOuterAlt(_localctx, 1); + { + setState(66); + fetch_path(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Where_clauseContext extends ParserRuleContext { + public Conditional_expressionContext conditional_expression() { + return getRuleContext(Conditional_expressionContext.class,0); + } + public Where_clauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_where_clause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterWhere_clause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitWhere_clause(this); + } + } + + public final Where_clauseContext where_clause() throws RecognitionException { + Where_clauseContext _localctx = new Where_clauseContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_where_clause); + try { + enterOuterAlt(_localctx, 1); + { + setState(68); + match(T__3); + setState(69); + conditional_expression(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Fetch_pathContext extends ParserRuleContext { + public TerminalNode PATH_VARIABLE() { return getToken(EQLParser.PATH_VARIABLE, 0); } + public Fetch_property_groupContext fetch_property_group() { + return getRuleContext(Fetch_property_groupContext.class,0); + } + public Fetch_pathContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fetch_path; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterFetch_path(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitFetch_path(this); + } + } + + public final Fetch_pathContext fetch_path() throws RecognitionException { + Fetch_pathContext _localctx = new Fetch_pathContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_fetch_path); + try { + enterOuterAlt(_localctx, 1); + { + setState(71); + match(T__4); + setState(72); + match(PATH_VARIABLE); + setState(73); + match(T__1); + setState(74); + fetch_property_group(); + setState(75); + match(T__2); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Fetch_property_groupContext extends ParserRuleContext { + public List fetch_property() { + return getRuleContexts(Fetch_propertyContext.class); + } + public Fetch_propertyContext fetch_property(int i) { + return getRuleContext(Fetch_propertyContext.class,i); + } + public Fetch_property_groupContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fetch_property_group; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterFetch_property_group(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitFetch_property_group(this); + } + } + + public final Fetch_property_groupContext fetch_property_group() throws RecognitionException { + Fetch_property_groupContext _localctx = new Fetch_property_groupContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_fetch_property_group); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(77); + fetch_property(); + setState(82); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==T__5) { + { + { + setState(78); + match(T__5); + setState(79); + fetch_property(); + } + } + setState(84); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Fetch_propertyContext extends ParserRuleContext { + public TerminalNode PATH_VARIABLE() { return getToken(EQLParser.PATH_VARIABLE, 0); } + public Fetch_propertyContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fetch_property; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterFetch_property(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitFetch_property(this); + } + } + + public final Fetch_propertyContext fetch_property() throws RecognitionException { + Fetch_propertyContext _localctx = new Fetch_propertyContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_fetch_property); + try { + enterOuterAlt(_localctx, 1); + { + setState(85); + match(PATH_VARIABLE); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Conditional_expressionContext extends ParserRuleContext { + public List conditional_term() { + return getRuleContexts(Conditional_termContext.class); + } + public Conditional_termContext conditional_term(int i) { + return getRuleContext(Conditional_termContext.class,i); + } + public Conditional_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_conditional_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterConditional_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitConditional_expression(this); + } + } + + public final Conditional_expressionContext conditional_expression() throws RecognitionException { + Conditional_expressionContext _localctx = new Conditional_expressionContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_conditional_expression); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + { + setState(87); + conditional_term(); + } + setState(92); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==T__6) { + { + { + setState(88); + match(T__6); + setState(89); + conditional_term(); + } + } + setState(94); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Conditional_termContext extends ParserRuleContext { + public List conditional_factor() { + return getRuleContexts(Conditional_factorContext.class); + } + public Conditional_factorContext conditional_factor(int i) { + return getRuleContext(Conditional_factorContext.class,i); + } + public Conditional_termContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_conditional_term; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterConditional_term(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitConditional_term(this); + } + } + + public final Conditional_termContext conditional_term() throws RecognitionException { + Conditional_termContext _localctx = new Conditional_termContext(_ctx, getState()); + enterRule(_localctx, 16, RULE_conditional_term); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + { + setState(95); + conditional_factor(); + } + setState(100); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==T__7) { + { + { + setState(96); + match(T__7); + setState(97); + conditional_factor(); + } + } + setState(102); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Conditional_factorContext extends ParserRuleContext { + public Conditional_primaryContext conditional_primary() { + return getRuleContext(Conditional_primaryContext.class,0); + } + public Conditional_factorContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_conditional_factor; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterConditional_factor(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitConditional_factor(this); + } + } + + public final Conditional_factorContext conditional_factor() throws RecognitionException { + Conditional_factorContext _localctx = new Conditional_factorContext(_ctx, getState()); + enterRule(_localctx, 18, RULE_conditional_factor); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(104); + _la = _input.LA(1); + if (_la==T__8) { + { + setState(103); + match(T__8); + } + } + + setState(106); + conditional_primary(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Conditional_primaryContext extends ParserRuleContext { + public Any_expressionContext any_expression() { + return getRuleContext(Any_expressionContext.class,0); + } + public Conditional_expressionContext conditional_expression() { + return getRuleContext(Conditional_expressionContext.class,0); + } + public Conditional_primaryContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_conditional_primary; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterConditional_primary(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitConditional_primary(this); + } + } + + public final Conditional_primaryContext conditional_primary() throws RecognitionException { + Conditional_primaryContext _localctx = new Conditional_primaryContext(_ctx, getState()); + enterRule(_localctx, 20, RULE_conditional_primary); + try { + setState(113); + switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(108); + any_expression(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(109); + match(T__1); + setState(110); + conditional_expression(); + setState(111); + match(T__2); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Any_expressionContext extends ParserRuleContext { + public Comparison_expressionContext comparison_expression() { + return getRuleContext(Comparison_expressionContext.class,0); + } + public Like_expressionContext like_expression() { + return getRuleContext(Like_expressionContext.class,0); + } + public Between_expressionContext between_expression() { + return getRuleContext(Between_expressionContext.class,0); + } + public PropertyBetween_expressionContext propertyBetween_expression() { + return getRuleContext(PropertyBetween_expressionContext.class,0); + } + public In_expressionContext in_expression() { + return getRuleContext(In_expressionContext.class,0); + } + public IsNull_expressionContext isNull_expression() { + return getRuleContext(IsNull_expressionContext.class,0); + } + public IsNotNull_expressionContext isNotNull_expression() { + return getRuleContext(IsNotNull_expressionContext.class,0); + } + public IsEmpty_expressionContext isEmpty_expression() { + return getRuleContext(IsEmpty_expressionContext.class,0); + } + public IsNotEmpty_expressionContext isNotEmpty_expression() { + return getRuleContext(IsNotEmpty_expressionContext.class,0); + } + public Any_expressionContext any_expression() { + return getRuleContext(Any_expressionContext.class,0); + } + public Any_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_any_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterAny_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitAny_expression(this); + } + } + + public final Any_expressionContext any_expression() throws RecognitionException { + Any_expressionContext _localctx = new Any_expressionContext(_ctx, getState()); + enterRule(_localctx, 22, RULE_any_expression); + try { + setState(128); + switch ( getInterpreter().adaptivePredict(_input,8,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(115); + comparison_expression(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(116); + like_expression(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(117); + between_expression(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(118); + propertyBetween_expression(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(119); + in_expression(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(120); + isNull_expression(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(121); + isNotNull_expression(); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(122); + isEmpty_expression(); + } + break; + case 9: + enterOuterAlt(_localctx, 9); + { + setState(123); + isNotEmpty_expression(); + } + break; + case 10: + enterOuterAlt(_localctx, 10); + { + setState(124); + match(T__1); + setState(125); + any_expression(); + setState(126); + match(T__2); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class In_expressionContext extends ParserRuleContext { + public TerminalNode PATH_VARIABLE() { return getToken(EQLParser.PATH_VARIABLE, 0); } + public In_valueContext in_value() { + return getRuleContext(In_valueContext.class,0); + } + public In_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_in_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterIn_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitIn_expression(this); + } + } + + public final In_expressionContext in_expression() throws RecognitionException { + In_expressionContext _localctx = new In_expressionContext(_ctx, getState()); + enterRule(_localctx, 24, RULE_in_expression); + try { + enterOuterAlt(_localctx, 1); + { + setState(130); + match(PATH_VARIABLE); + setState(131); + match(T__9); + setState(132); + in_value(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class In_valueContext extends ParserRuleContext { + public TerminalNode INPUT_VARIABLE() { return getToken(EQLParser.INPUT_VARIABLE, 0); } + public List value_expression() { + return getRuleContexts(Value_expressionContext.class); + } + public Value_expressionContext value_expression(int i) { + return getRuleContext(Value_expressionContext.class,i); + } + public In_valueContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_in_value; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterIn_value(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitIn_value(this); + } + } + + public final In_valueContext in_value() throws RecognitionException { + In_valueContext _localctx = new In_valueContext(_ctx, getState()); + enterRule(_localctx, 26, RULE_in_value); + int _la; + try { + setState(149); + switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(134); + match(INPUT_VARIABLE); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(135); + match(T__1); + setState(136); + match(INPUT_VARIABLE); + setState(137); + match(T__2); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(138); + match(T__1); + setState(139); + value_expression(); + setState(144); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==T__5) { + { + { + setState(140); + match(T__5); + setState(141); + value_expression(); + } + } + setState(146); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(147); + match(T__2); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Between_expressionContext extends ParserRuleContext { + public TerminalNode PATH_VARIABLE() { return getToken(EQLParser.PATH_VARIABLE, 0); } + public List value_expression() { + return getRuleContexts(Value_expressionContext.class); + } + public Value_expressionContext value_expression(int i) { + return getRuleContext(Value_expressionContext.class,i); + } + public Between_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_between_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterBetween_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitBetween_expression(this); + } + } + + public final Between_expressionContext between_expression() throws RecognitionException { + Between_expressionContext _localctx = new Between_expressionContext(_ctx, getState()); + enterRule(_localctx, 28, RULE_between_expression); + try { + enterOuterAlt(_localctx, 1); + { + setState(151); + match(PATH_VARIABLE); + setState(152); + match(T__10); + setState(153); + value_expression(); + setState(154); + match(T__7); + setState(155); + value_expression(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class PropertyBetween_expressionContext extends ParserRuleContext { + public Value_expressionContext value_expression() { + return getRuleContext(Value_expressionContext.class,0); + } + public List PATH_VARIABLE() { return getTokens(EQLParser.PATH_VARIABLE); } + public TerminalNode PATH_VARIABLE(int i) { + return getToken(EQLParser.PATH_VARIABLE, i); + } + public PropertyBetween_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_propertyBetween_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterPropertyBetween_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitPropertyBetween_expression(this); + } + } + + public final PropertyBetween_expressionContext propertyBetween_expression() throws RecognitionException { + PropertyBetween_expressionContext _localctx = new PropertyBetween_expressionContext(_ctx, getState()); + enterRule(_localctx, 30, RULE_propertyBetween_expression); + try { + enterOuterAlt(_localctx, 1); + { + setState(157); + value_expression(); + setState(158); + match(T__10); + setState(159); + match(PATH_VARIABLE); + setState(160); + match(T__7); + setState(161); + match(PATH_VARIABLE); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IsNull_expressionContext extends ParserRuleContext { + public TerminalNode PATH_VARIABLE() { return getToken(EQLParser.PATH_VARIABLE, 0); } + public IsNull_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_isNull_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterIsNull_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitIsNull_expression(this); + } + } + + public final IsNull_expressionContext isNull_expression() throws RecognitionException { + IsNull_expressionContext _localctx = new IsNull_expressionContext(_ctx, getState()); + enterRule(_localctx, 32, RULE_isNull_expression); + try { + setState(168); + switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(163); + match(PATH_VARIABLE); + setState(164); + match(T__11); + setState(165); + match(T__12); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(166); + match(PATH_VARIABLE); + setState(167); + match(T__13); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IsNotNull_expressionContext extends ParserRuleContext { + public TerminalNode PATH_VARIABLE() { return getToken(EQLParser.PATH_VARIABLE, 0); } + public IsNotNull_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_isNotNull_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterIsNotNull_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitIsNotNull_expression(this); + } + } + + public final IsNotNull_expressionContext isNotNull_expression() throws RecognitionException { + IsNotNull_expressionContext _localctx = new IsNotNull_expressionContext(_ctx, getState()); + enterRule(_localctx, 34, RULE_isNotNull_expression); + try { + setState(178); + switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(170); + match(PATH_VARIABLE); + setState(171); + match(T__11); + setState(172); + match(T__8); + setState(173); + match(T__12); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(174); + match(PATH_VARIABLE); + setState(175); + match(T__14); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(176); + match(PATH_VARIABLE); + setState(177); + match(T__15); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IsEmpty_expressionContext extends ParserRuleContext { + public TerminalNode PATH_VARIABLE() { return getToken(EQLParser.PATH_VARIABLE, 0); } + public IsEmpty_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_isEmpty_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterIsEmpty_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitIsEmpty_expression(this); + } + } + + public final IsEmpty_expressionContext isEmpty_expression() throws RecognitionException { + IsEmpty_expressionContext _localctx = new IsEmpty_expressionContext(_ctx, getState()); + enterRule(_localctx, 36, RULE_isEmpty_expression); + try { + setState(185); + switch ( getInterpreter().adaptivePredict(_input,13,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(180); + match(PATH_VARIABLE); + setState(181); + match(T__11); + setState(182); + match(T__16); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(183); + match(PATH_VARIABLE); + setState(184); + match(T__17); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class IsNotEmpty_expressionContext extends ParserRuleContext { + public TerminalNode PATH_VARIABLE() { return getToken(EQLParser.PATH_VARIABLE, 0); } + public IsNotEmpty_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_isNotEmpty_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterIsNotEmpty_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitIsNotEmpty_expression(this); + } + } + + public final IsNotEmpty_expressionContext isNotEmpty_expression() throws RecognitionException { + IsNotEmpty_expressionContext _localctx = new IsNotEmpty_expressionContext(_ctx, getState()); + enterRule(_localctx, 38, RULE_isNotEmpty_expression); + try { + setState(195); + switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(187); + match(PATH_VARIABLE); + setState(188); + match(T__11); + setState(189); + match(T__8); + setState(190); + match(T__16); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(191); + match(PATH_VARIABLE); + setState(192); + match(T__18); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(193); + match(PATH_VARIABLE); + setState(194); + match(T__19); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Like_expressionContext extends ParserRuleContext { + public TerminalNode PATH_VARIABLE() { return getToken(EQLParser.PATH_VARIABLE, 0); } + public Like_opContext like_op() { + return getRuleContext(Like_opContext.class,0); + } + public Value_expressionContext value_expression() { + return getRuleContext(Value_expressionContext.class,0); + } + public Like_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_like_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterLike_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitLike_expression(this); + } + } + + public final Like_expressionContext like_expression() throws RecognitionException { + Like_expressionContext _localctx = new Like_expressionContext(_ctx, getState()); + enterRule(_localctx, 40, RULE_like_expression); + try { + enterOuterAlt(_localctx, 1); + { + setState(197); + match(PATH_VARIABLE); + setState(198); + like_op(); + setState(199); + value_expression(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Like_opContext extends ParserRuleContext { + public Like_opContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_like_op; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterLike_op(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitLike_op(this); + } + } + + public final Like_opContext like_op() throws RecognitionException { + Like_opContext _localctx = new Like_opContext(_ctx, getState()); + enterRule(_localctx, 42, RULE_like_op); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(201); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__20) | (1L << T__21) | (1L << T__22) | (1L << T__23) | (1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Comparison_expressionContext extends ParserRuleContext { + public TerminalNode PATH_VARIABLE() { return getToken(EQLParser.PATH_VARIABLE, 0); } + public Comparison_operatorContext comparison_operator() { + return getRuleContext(Comparison_operatorContext.class,0); + } + public Value_expressionContext value_expression() { + return getRuleContext(Value_expressionContext.class,0); + } + public Comparison_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_comparison_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterComparison_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitComparison_expression(this); + } + } + + public final Comparison_expressionContext comparison_expression() throws RecognitionException { + Comparison_expressionContext _localctx = new Comparison_expressionContext(_ctx, getState()); + enterRule(_localctx, 44, RULE_comparison_expression); + try { + enterOuterAlt(_localctx, 1); + { + setState(203); + match(PATH_VARIABLE); + setState(204); + comparison_operator(); + setState(205); + value_expression(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Comparison_operatorContext extends ParserRuleContext { + public Comparison_operatorContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_comparison_operator; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterComparison_operator(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitComparison_operator(this); + } + } + + public final Comparison_operatorContext comparison_operator() throws RecognitionException { + Comparison_operatorContext _localctx = new Comparison_operatorContext(_ctx, getState()); + enterRule(_localctx, 46, RULE_comparison_operator); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(207); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33) | (1L << T__34) | (1L << T__35) | (1L << T__36) | (1L << T__37) | (1L << T__38) | (1L << T__39) | (1L << T__40) | (1L << T__41) | (1L << T__42) | (1L << T__43))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Value_expressionContext extends ParserRuleContext { + public LiteralContext literal() { + return getRuleContext(LiteralContext.class,0); + } + public TerminalNode INPUT_VARIABLE() { return getToken(EQLParser.INPUT_VARIABLE, 0); } + public Value_expressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_value_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterValue_expression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitValue_expression(this); + } + } + + public final Value_expressionContext value_expression() throws RecognitionException { + Value_expressionContext _localctx = new Value_expressionContext(_ctx, getState()); + enterRule(_localctx, 48, RULE_value_expression); + try { + setState(211); + switch (_input.LA(1)) { + case BOOLEAN_LITERAL: + case NUMBER_LITERAL: + case STRING_LITERAL: + enterOuterAlt(_localctx, 1); + { + setState(209); + literal(); + } + break; + case INPUT_VARIABLE: + enterOuterAlt(_localctx, 2); + { + setState(210); + match(INPUT_VARIABLE); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class LiteralContext extends ParserRuleContext { + public TerminalNode STRING_LITERAL() { return getToken(EQLParser.STRING_LITERAL, 0); } + public TerminalNode BOOLEAN_LITERAL() { return getToken(EQLParser.BOOLEAN_LITERAL, 0); } + public TerminalNode NUMBER_LITERAL() { return getToken(EQLParser.NUMBER_LITERAL, 0); } + public LiteralContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_literal; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterLiteral(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitLiteral(this); + } + } + + public final LiteralContext literal() throws RecognitionException { + LiteralContext _localctx = new LiteralContext(_ctx, getState()); + enterRule(_localctx, 50, RULE_literal); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(213); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN_LITERAL) | (1L << NUMBER_LITERAL) | (1L << STRING_LITERAL))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static final String _serializedATN = + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\66\u00da\4\2\t\2"+ + "\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ + "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ + "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ + "\4\32\t\32\4\33\t\33\3\2\5\28\n\2\3\2\5\2;\n\2\3\2\5\2>\n\2\3\3\3\3\3"+ + "\3\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\7\7"+ + "S\n\7\f\7\16\7V\13\7\3\b\3\b\3\t\3\t\3\t\7\t]\n\t\f\t\16\t`\13\t\3\n\3"+ + "\n\3\n\7\ne\n\n\f\n\16\nh\13\n\3\13\5\13k\n\13\3\13\3\13\3\f\3\f\3\f\3"+ + "\f\3\f\5\ft\n\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\5"+ + "\r\u0083\n\r\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3"+ + "\17\7\17\u0091\n\17\f\17\16\17\u0094\13\17\3\17\3\17\5\17\u0098\n\17\3"+ + "\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3"+ + "\22\3\22\3\22\5\22\u00ab\n\22\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\23"+ + "\5\23\u00b5\n\23\3\24\3\24\3\24\3\24\3\24\5\24\u00bc\n\24\3\25\3\25\3"+ + "\25\3\25\3\25\3\25\3\25\3\25\5\25\u00c6\n\25\3\26\3\26\3\26\3\26\3\27"+ + "\3\27\3\30\3\30\3\30\3\30\3\31\3\31\3\32\3\32\5\32\u00d6\n\32\3\33\3\33"+ + "\3\33\2\2\34\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64"+ + "\2\5\3\2\27\36\3\2\37.\3\2\62\64\u00da\2\67\3\2\2\2\4?\3\2\2\2\6D\3\2"+ + "\2\2\bF\3\2\2\2\nI\3\2\2\2\fO\3\2\2\2\16W\3\2\2\2\20Y\3\2\2\2\22a\3\2"+ + "\2\2\24j\3\2\2\2\26s\3\2\2\2\30\u0082\3\2\2\2\32\u0084\3\2\2\2\34\u0097"+ + "\3\2\2\2\36\u0099\3\2\2\2 \u009f\3\2\2\2\"\u00aa\3\2\2\2$\u00b4\3\2\2"+ + "\2&\u00bb\3\2\2\2(\u00c5\3\2\2\2*\u00c7\3\2\2\2,\u00cb\3\2\2\2.\u00cd"+ + "\3\2\2\2\60\u00d1\3\2\2\2\62\u00d5\3\2\2\2\64\u00d7\3\2\2\2\668\5\4\3"+ + "\2\67\66\3\2\2\2\678\3\2\2\28:\3\2\2\29;\5\6\4\2:9\3\2\2\2:;\3\2\2\2;"+ + "=\3\2\2\2<>\5\b\5\2=<\3\2\2\2=>\3\2\2\2>\3\3\2\2\2?@\7\3\2\2@A\7\4\2\2"+ + "AB\5\f\7\2BC\7\5\2\2C\5\3\2\2\2DE\5\n\6\2E\7\3\2\2\2FG\7\6\2\2GH\5\20"+ + "\t\2H\t\3\2\2\2IJ\7\7\2\2JK\7\60\2\2KL\7\4\2\2LM\5\f\7\2MN\7\5\2\2N\13"+ + "\3\2\2\2OT\5\16\b\2PQ\7\b\2\2QS\5\16\b\2RP\3\2\2\2SV\3\2\2\2TR\3\2\2\2"+ + "TU\3\2\2\2U\r\3\2\2\2VT\3\2\2\2WX\7\60\2\2X\17\3\2\2\2Y^\5\22\n\2Z[\7"+ + "\t\2\2[]\5\22\n\2\\Z\3\2\2\2]`\3\2\2\2^\\\3\2\2\2^_\3\2\2\2_\21\3\2\2"+ + "\2`^\3\2\2\2af\5\24\13\2bc\7\n\2\2ce\5\24\13\2db\3\2\2\2eh\3\2\2\2fd\3"+ + "\2\2\2fg\3\2\2\2g\23\3\2\2\2hf\3\2\2\2ik\7\13\2\2ji\3\2\2\2jk\3\2\2\2"+ + "kl\3\2\2\2lm\5\26\f\2m\25\3\2\2\2nt\5\30\r\2op\7\4\2\2pq\5\20\t\2qr\7"+ + "\5\2\2rt\3\2\2\2sn\3\2\2\2so\3\2\2\2t\27\3\2\2\2u\u0083\5.\30\2v\u0083"+ + "\5*\26\2w\u0083\5\36\20\2x\u0083\5 \21\2y\u0083\5\32\16\2z\u0083\5\"\22"+ + "\2{\u0083\5$\23\2|\u0083\5&\24\2}\u0083\5(\25\2~\177\7\4\2\2\177\u0080"+ + "\5\30\r\2\u0080\u0081\7\5\2\2\u0081\u0083\3\2\2\2\u0082u\3\2\2\2\u0082"+ + "v\3\2\2\2\u0082w\3\2\2\2\u0082x\3\2\2\2\u0082y\3\2\2\2\u0082z\3\2\2\2"+ + "\u0082{\3\2\2\2\u0082|\3\2\2\2\u0082}\3\2\2\2\u0082~\3\2\2\2\u0083\31"+ + "\3\2\2\2\u0084\u0085\7\60\2\2\u0085\u0086\7\f\2\2\u0086\u0087\5\34\17"+ + "\2\u0087\33\3\2\2\2\u0088\u0098\7/\2\2\u0089\u008a\7\4\2\2\u008a\u008b"+ + "\7/\2\2\u008b\u0098\7\5\2\2\u008c\u008d\7\4\2\2\u008d\u0092\5\62\32\2"+ + "\u008e\u008f\7\b\2\2\u008f\u0091\5\62\32\2\u0090\u008e\3\2\2\2\u0091\u0094"+ + "\3\2\2\2\u0092\u0090\3\2\2\2\u0092\u0093\3\2\2\2\u0093\u0095\3\2\2\2\u0094"+ + "\u0092\3\2\2\2\u0095\u0096\7\5\2\2\u0096\u0098\3\2\2\2\u0097\u0088\3\2"+ + "\2\2\u0097\u0089\3\2\2\2\u0097\u008c\3\2\2\2\u0098\35\3\2\2\2\u0099\u009a"+ + "\7\60\2\2\u009a\u009b\7\r\2\2\u009b\u009c\5\62\32\2\u009c\u009d\7\n\2"+ + "\2\u009d\u009e\5\62\32\2\u009e\37\3\2\2\2\u009f\u00a0\5\62\32\2\u00a0"+ + "\u00a1\7\r\2\2\u00a1\u00a2\7\60\2\2\u00a2\u00a3\7\n\2\2\u00a3\u00a4\7"+ + "\60\2\2\u00a4!\3\2\2\2\u00a5\u00a6\7\60\2\2\u00a6\u00a7\7\16\2\2\u00a7"+ + "\u00ab\7\17\2\2\u00a8\u00a9\7\60\2\2\u00a9\u00ab\7\20\2\2\u00aa\u00a5"+ + "\3\2\2\2\u00aa\u00a8\3\2\2\2\u00ab#\3\2\2\2\u00ac\u00ad\7\60\2\2\u00ad"+ + "\u00ae\7\16\2\2\u00ae\u00af\7\13\2\2\u00af\u00b5\7\17\2\2\u00b0\u00b1"+ + "\7\60\2\2\u00b1\u00b5\7\21\2\2\u00b2\u00b3\7\60\2\2\u00b3\u00b5\7\22\2"+ + "\2\u00b4\u00ac\3\2\2\2\u00b4\u00b0\3\2\2\2\u00b4\u00b2\3\2\2\2\u00b5%"+ + "\3\2\2\2\u00b6\u00b7\7\60\2\2\u00b7\u00b8\7\16\2\2\u00b8\u00bc\7\23\2"+ + "\2\u00b9\u00ba\7\60\2\2\u00ba\u00bc\7\24\2\2\u00bb\u00b6\3\2\2\2\u00bb"+ + "\u00b9\3\2\2\2\u00bc\'\3\2\2\2\u00bd\u00be\7\60\2\2\u00be\u00bf\7\16\2"+ + "\2\u00bf\u00c0\7\13\2\2\u00c0\u00c6\7\23\2\2\u00c1\u00c2\7\60\2\2\u00c2"+ + "\u00c6\7\25\2\2\u00c3\u00c4\7\60\2\2\u00c4\u00c6\7\26\2\2\u00c5\u00bd"+ + "\3\2\2\2\u00c5\u00c1\3\2\2\2\u00c5\u00c3\3\2\2\2\u00c6)\3\2\2\2\u00c7"+ + "\u00c8\7\60\2\2\u00c8\u00c9\5,\27\2\u00c9\u00ca\5\62\32\2\u00ca+\3\2\2"+ + "\2\u00cb\u00cc\t\2\2\2\u00cc-\3\2\2\2\u00cd\u00ce\7\60\2\2\u00ce\u00cf"+ + "\5\60\31\2\u00cf\u00d0\5\62\32\2\u00d0/\3\2\2\2\u00d1\u00d2\t\3\2\2\u00d2"+ + "\61\3\2\2\2\u00d3\u00d6\5\64\33\2\u00d4\u00d6\7/\2\2\u00d5\u00d3\3\2\2"+ + "\2\u00d5\u00d4\3\2\2\2\u00d6\63\3\2\2\2\u00d7\u00d8\t\4\2\2\u00d8\65\3"+ + "\2\2\2\22\67:=T^fjs\u0082\u0092\u0097\u00aa\u00b4\u00bb\u00c5\u00d5"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/test/java/com/avaje/ebeaninternal/server/grammer/EqlParserTest.java b/src/test/java/com/avaje/ebeaninternal/server/grammer/EqlParserTest.java new file mode 100644 index 000000000..0652f9b59 --- /dev/null +++ b/src/test/java/com/avaje/ebeaninternal/server/grammer/EqlParserTest.java @@ -0,0 +1,55 @@ +package com.avaje.ebeaninternal.server.grammer; + +import com.avaje.ebean.Ebean; +import com.avaje.ebean.Query; +import com.avaje.tests.model.basic.Customer; +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class EqlParserTest { + + @Test + public void where_eq() throws Exception { + + Query query = parse("where name eq 'Rob'"); + query.findList(); + + assertThat(query.getGeneratedSql()).contains("where t0.name = ?"); + } + + @Test + public void where_eq2() throws Exception { + + Query query = parse("where name = 'Rob'"); + query.findList(); + + assertThat(query.getGeneratedSql()).contains("where t0.name = ?"); + } + + @Test + public void where_or1() throws Exception { + + Query query = parse("where name = 'Rob' or (status = 'NEW' and smallnote is null)"); + query.findList(); + + assertThat(query.getGeneratedSql()).contains("where (t0.name = ? or (t0.status = ? and t0.smallnote is null ) )"); + } + + @Test + public void where_or2() throws Exception { + + Query query = parse("where (name = 'Rob' or status = 'NEW') and smallnote is null"); + query.findList(); + + assertThat(query.getGeneratedSql()).contains("where ((t0.name = ? or t0.status = ? ) and t0.smallnote is null )"); + } + + private Query parse(String raw) { + + Query query = Ebean.find(Customer.class); + EqlParser.parse(raw, query); + return query; + } + +} \ No newline at end of file diff --git a/src/test/resources/EQL.g4 b/src/test/resources/EQL.g4 new file mode 100644 index 000000000..7a34bbc13 --- /dev/null +++ b/src/test/resources/EQL.g4 @@ -0,0 +1,169 @@ +grammar EQL; + +select_statement + : (select_clause)? (fetch_clause)? (where_clause)? + ; + +select_clause + : 'select' '(' fetch_property_group ')' + ; + +fetch_clause + : fetch_path + ; + +where_clause + : 'where' conditional_expression + ; + +fetch_path + : 'fetch' PATH_VARIABLE '(' fetch_property_group ')' + ; + +fetch_property_group + : fetch_property (',' fetch_property)* + ; + +fetch_property + : PATH_VARIABLE + ; + + +conditional_expression + : (conditional_term) ('or' conditional_term)* + ; + +conditional_term + : (conditional_factor) ('and' conditional_factor)* + ; + +conditional_factor + : ('not')? conditional_primary + ; + +conditional_primary + : any_expression + | '(' conditional_expression ')' + ; + +any_expression + : comparison_expression + | like_expression + | between_expression + | propertyBetween_expression + | in_expression + | isNull_expression + | isNotNull_expression + | isEmpty_expression + | isNotEmpty_expression + | '(' any_expression ')' + ; + +in_expression + : PATH_VARIABLE 'in' in_value + ; + +in_value + : INPUT_VARIABLE + | '(' INPUT_VARIABLE ')' + | '(' value_expression (',' value_expression)* ')' + ; + +between_expression + : PATH_VARIABLE 'between' value_expression 'and' value_expression + ; + +propertyBetween_expression + : value_expression 'between' PATH_VARIABLE 'and' PATH_VARIABLE + ; + +isNull_expression + : PATH_VARIABLE 'is' 'null' + | PATH_VARIABLE 'isNull' + ; + +isNotNull_expression + : PATH_VARIABLE 'is' 'not' 'null' + | PATH_VARIABLE 'isNotNull' + | PATH_VARIABLE 'notNull' + ; + +isEmpty_expression + : PATH_VARIABLE 'is' 'empty' + | PATH_VARIABLE 'isEmpty' + ; + +isNotEmpty_expression + : PATH_VARIABLE 'is' 'not' 'empty' + | PATH_VARIABLE 'isNotEmpty' + | PATH_VARIABLE 'notEmpty' + ; + +like_expression + : PATH_VARIABLE like_op value_expression + ; + +like_op + : 'like' | 'ilike' + | 'contains' | 'icontains' + | 'startsWith' | 'istartsWith' + | 'endsWith' | 'iendsWith' + ; + +comparison_expression + : PATH_VARIABLE comparison_operator value_expression + ; + +comparison_operator + : '=' | 'eq' + | '>' | 'gt' + | '>=' | 'ge' | 'gte' + | '<' | 'lt' + | '<=' | 'le' | 'lte' + | '<>' | '!=' | 'ne' + | 'ieq' + ; + +value_expression + : literal + | INPUT_VARIABLE + ; + +literal + : STRING_LITERAL + | BOOLEAN_LITERAL + | NUMBER_LITERAL + ; + + +INPUT_VARIABLE + : ':' ('a' .. 'z' | 'A' .. 'Z' | '_') ('a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_')* + ; + +PATH_VARIABLE + : ('a' .. 'z' | 'A' .. 'Z' | '_') ('a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '.')* + ; + +CHARACTER + : '\'' (~ ('\'' | '\\')) '\'' + ; + +BOOLEAN_LITERAL + : 'true' + | 'false' + ; + +NUMBER_LITERAL + : [0-9]+ '.'? [0-9]*; + +STRING_LITERAL + : '\'' ( ~'\'' | '\'\'' )* '\'' + ; + +ESCAPE_CHARACTER + : CHARACTER + ; + +WS + : [ \t\r\n] -> skip + ; diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 466673fd5..c6a513108 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -76,10 +76,10 @@ - - - - + + + +