From 9dd82c0dd7d0e6447bfaab295e734a2601858e05 Mon Sep 17 00:00:00 2001 From: Robin Bygrave Date: Wed, 13 Jul 2016 14:30:12 +1200 Subject: [PATCH] EQL - parsing limit offset clause --- .../server/grammer/EqlAdapter.java | 18 + .../server/grammer/antlr/EQL.tokens | 110 +-- .../server/grammer/antlr/EQLBaseListener.java | 24 + .../server/grammer/antlr/EQLLexer.java | 316 +++---- .../server/grammer/antlr/EQLLexer.tokens | 110 +-- .../server/grammer/antlr/EQLListener.java | 20 + .../server/grammer/antlr/EQLParser.java | 785 ++++++++++-------- .../server/grammer/EqlParserTest.java | 29 +- src/test/resources/EQL.g4 | 22 +- 9 files changed, 826 insertions(+), 608 deletions(-) diff --git a/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapter.java b/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapter.java index 5d615cb29..2a200d9cb 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapter.java +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/EqlAdapter.java @@ -126,6 +126,24 @@ class EqlAdapter extends EQLBaseListener { } } + @Override + public void enterLimit_clause(EQLParser.Limit_clauseContext ctx) { + + try { + String limitValue = child(ctx, 1); + query.setMaxRows(Integer.parseInt(limitValue)); + + int childCount = ctx.getChildCount(); + if (childCount == 3) { + ParseTree offsetTree = ctx.getChild(2); + String offsetValue = offsetTree.getChild(1).getText(); + query.setFirstRow(Integer.parseInt(offsetValue)); + } + } catch (NumberFormatException e) { + throw new IllegalArgumentException("Error parsing limit or offset parameter - not an integer", e); + } + } + /** * Trim leading '(' and trailing ')' */ 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 index dfb70e020..6a00e9224 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQL.tokens +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQL.tokens @@ -46,61 +46,65 @@ T__44=45 T__45=46 T__46=47 T__47=48 -INPUT_VARIABLE=49 -PATH_VARIABLE=50 -BOOLEAN_LITERAL=51 -NUMBER_LITERAL=52 -DOUBLE=53 -INT=54 -ZERO=55 -STRING_LITERAL=56 -WS=57 +T__48=49 +T__49=50 +INPUT_VARIABLE=51 +PATH_VARIABLE=52 +BOOLEAN_LITERAL=53 +NUMBER_LITERAL=54 +DOUBLE=55 +INT=56 +ZERO=57 +STRING_LITERAL=58 +WS=59 'select'=1 '('=2 ')'=3 'distinct'=4 'where'=5 -'fetch'=6 -','=7 -'+'=8 -'query'=9 -'lazy'=10 -'or'=11 -'and'=12 -'not'=13 -'in'=14 -'between'=15 -'is'=16 -'null'=17 -'isNull'=18 -'isNotNull'=19 -'notNull'=20 -'empty'=21 -'isEmpty'=22 -'isNotEmpty'=23 -'notEmpty'=24 -'like'=25 -'ilike'=26 -'contains'=27 -'icontains'=28 -'startsWith'=29 -'istartsWith'=30 -'endsWith'=31 -'iendsWith'=32 -'='=33 -'eq'=34 -'>'=35 -'gt'=36 -'>='=37 -'ge'=38 -'gte'=39 -'<'=40 -'lt'=41 -'<='=42 -'le'=43 -'lte'=44 -'<>'=45 -'!='=46 -'ne'=47 -'ieq'=48 -'0'=55 +'limit'=6 +'offset'=7 +'fetch'=8 +','=9 +'+'=10 +'query'=11 +'lazy'=12 +'or'=13 +'and'=14 +'not'=15 +'in'=16 +'between'=17 +'is'=18 +'null'=19 +'isNull'=20 +'isNotNull'=21 +'notNull'=22 +'empty'=23 +'isEmpty'=24 +'isNotEmpty'=25 +'notEmpty'=26 +'like'=27 +'ilike'=28 +'contains'=29 +'icontains'=30 +'startsWith'=31 +'istartsWith'=32 +'endsWith'=33 +'iendsWith'=34 +'='=35 +'eq'=36 +'>'=37 +'gt'=38 +'>='=39 +'ge'=40 +'gte'=41 +'<'=42 +'lt'=43 +'<='=44 +'le'=45 +'lte'=46 +'<>'=47 +'!='=48 +'ne'=49 +'ieq'=50 +'0'=57 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 index 045853ac6..6c8137e57 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLBaseListener.java +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLBaseListener.java @@ -71,6 +71,30 @@ public class EQLBaseListener implements EQLListener { *

The default implementation does nothing.

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

The default implementation does nothing.

+ */ + @Override public void enterLimit_clause(EQLParser.Limit_clauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLimit_clause(EQLParser.Limit_clauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterOffset_clause(EQLParser.Offset_clauseContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitOffset_clause(EQLParser.Offset_clauseContext ctx) { } /** * {@inheritDoc} * 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 index fe9718727..9f4c85e39 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.java +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.java @@ -23,8 +23,9 @@ public class EQLLexer extends Lexer { 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, T__44=45, - T__45=46, T__46=47, T__47=48, INPUT_VARIABLE=49, PATH_VARIABLE=50, BOOLEAN_LITERAL=51, - NUMBER_LITERAL=52, DOUBLE=53, INT=54, ZERO=55, STRING_LITERAL=56, WS=57; + T__45=46, T__46=47, T__47=48, T__48=49, T__49=50, INPUT_VARIABLE=51, PATH_VARIABLE=52, + BOOLEAN_LITERAL=53, NUMBER_LITERAL=54, DOUBLE=55, INT=56, ZERO=57, STRING_LITERAL=58, + WS=59; public static String[] modeNames = { "DEFAULT_MODE" }; @@ -35,28 +36,28 @@ public class EQLLexer extends Lexer { "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", "T__44", "T__45", "T__46", "T__47", "INPUT_VARIABLE", - "PATH_VARIABLE", "BOOLEAN_LITERAL", "NUMBER_LITERAL", "DOUBLE", "INT", - "ZERO", "STRING_LITERAL", "WS" + "T__41", "T__42", "T__43", "T__44", "T__45", "T__46", "T__47", "T__48", + "T__49", "INPUT_VARIABLE", "PATH_VARIABLE", "BOOLEAN_LITERAL", "NUMBER_LITERAL", + "DOUBLE", "INT", "ZERO", "STRING_LITERAL", "WS" }; private static final String[] _LITERAL_NAMES = { - null, "'select'", "'('", "')'", "'distinct'", "'where'", "'fetch'", "','", - "'+'", "'query'", "'lazy'", "'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'", null, null, null, null, null, - null, "'0'" + null, "'select'", "'('", "')'", "'distinct'", "'where'", "'limit'", "'offset'", + "'fetch'", "','", "'+'", "'query'", "'lazy'", "'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'", + null, null, null, null, null, null, "'0'" }; 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, null, null, null, - null, "INPUT_VARIABLE", "PATH_VARIABLE", "BOOLEAN_LITERAL", "NUMBER_LITERAL", - "DOUBLE", "INT", "ZERO", "STRING_LITERAL", "WS" + null, null, null, "INPUT_VARIABLE", "PATH_VARIABLE", "BOOLEAN_LITERAL", + "NUMBER_LITERAL", "DOUBLE", "INT", "ZERO", "STRING_LITERAL", "WS" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -113,152 +114,157 @@ public class EQLLexer extends Lexer { public ATN getATN() { return _ATN; } public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2;\u01be\b\1\4\2\t"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2=\u01cf\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\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\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\5\3\5\3\5\3\6\3\6"+ - "\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t\3\n\3\n\3\n\3"+ - "\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\16\3"+ - "\16\3\16\3\16\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3"+ - "\21\3\21\3\21\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\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\26\3\26\3\26\3\26\3\26\3\26\3\27\3\27\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"+ - "\30\3\30\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\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\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3"+ - "\37\3\37\3\37\3\37\3\37\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+\3+\3,\3,\3,\3-\3-\3-\3-\3.\3"+ - ".\3.\3/\3/\3/\3\60\3\60\3\60\3\61\3\61\3\61\3\61\3\62\3\62\3\62\7\62\u0179"+ - "\n\62\f\62\16\62\u017c\13\62\3\63\3\63\7\63\u0180\n\63\f\63\16\63\u0183"+ - "\13\63\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\5\64\u018e\n\64\3"+ - "\65\5\65\u0191\n\65\3\65\3\65\5\65\u0195\n\65\3\65\3\65\5\65\u0199\n\65"+ - "\3\66\6\66\u019c\n\66\r\66\16\66\u019d\3\66\3\66\7\66\u01a2\n\66\f\66"+ - "\16\66\u01a5\13\66\3\67\3\67\7\67\u01a9\n\67\f\67\16\67\u01ac\13\67\3"+ - "8\38\39\39\39\39\79\u01b4\n9\f9\169\u01b7\139\39\39\3:\3:\3:\3:\2\2;\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\66k\67m8o9"+ - "q:s;\3\2\t\5\2C\\aac|\6\2\62;C\\aac|\7\2\60\60\62;C\\aac|\3\2\62;\3\2"+ - "\63;\3\2))\5\2\13\f\17\17\"\"\u01c9\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\2Y\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"+ - "\3u\3\2\2\2\5|\3\2\2\2\7~\3\2\2\2\t\u0080\3\2\2\2\13\u0089\3\2\2\2\r\u008f"+ - "\3\2\2\2\17\u0095\3\2\2\2\21\u0097\3\2\2\2\23\u0099\3\2\2\2\25\u009f\3"+ - "\2\2\2\27\u00a4\3\2\2\2\31\u00a7\3\2\2\2\33\u00ab\3\2\2\2\35\u00af\3\2"+ - "\2\2\37\u00b2\3\2\2\2!\u00ba\3\2\2\2#\u00bd\3\2\2\2%\u00c2\3\2\2\2\'\u00c9"+ - "\3\2\2\2)\u00d3\3\2\2\2+\u00db\3\2\2\2-\u00e1\3\2\2\2/\u00e9\3\2\2\2\61"+ - "\u00f4\3\2\2\2\63\u00fd\3\2\2\2\65\u0102\3\2\2\2\67\u0108\3\2\2\29\u0111"+ - "\3\2\2\2;\u011b\3\2\2\2=\u0126\3\2\2\2?\u0132\3\2\2\2A\u013b\3\2\2\2C"+ - "\u0145\3\2\2\2E\u0147\3\2\2\2G\u014a\3\2\2\2I\u014c\3\2\2\2K\u014f\3\2"+ - "\2\2M\u0152\3\2\2\2O\u0155\3\2\2\2Q\u0159\3\2\2\2S\u015b\3\2\2\2U\u015e"+ - "\3\2\2\2W\u0161\3\2\2\2Y\u0164\3\2\2\2[\u0168\3\2\2\2]\u016b\3\2\2\2_"+ - "\u016e\3\2\2\2a\u0171\3\2\2\2c\u0175\3\2\2\2e\u017d\3\2\2\2g\u018d\3\2"+ - "\2\2i\u0198\3\2\2\2k\u019b\3\2\2\2m\u01a6\3\2\2\2o\u01ad\3\2\2\2q\u01af"+ - "\3\2\2\2s\u01ba\3\2\2\2uv\7u\2\2vw\7g\2\2wx\7n\2\2xy\7g\2\2yz\7e\2\2z"+ - "{\7v\2\2{\4\3\2\2\2|}\7*\2\2}\6\3\2\2\2~\177\7+\2\2\177\b\3\2\2\2\u0080"+ - "\u0081\7f\2\2\u0081\u0082\7k\2\2\u0082\u0083\7u\2\2\u0083\u0084\7v\2\2"+ - "\u0084\u0085\7k\2\2\u0085\u0086\7p\2\2\u0086\u0087\7e\2\2\u0087\u0088"+ - "\7v\2\2\u0088\n\3\2\2\2\u0089\u008a\7y\2\2\u008a\u008b\7j\2\2\u008b\u008c"+ - "\7g\2\2\u008c\u008d\7t\2\2\u008d\u008e\7g\2\2\u008e\f\3\2\2\2\u008f\u0090"+ - "\7h\2\2\u0090\u0091\7g\2\2\u0091\u0092\7v\2\2\u0092\u0093\7e\2\2\u0093"+ - "\u0094\7j\2\2\u0094\16\3\2\2\2\u0095\u0096\7.\2\2\u0096\20\3\2\2\2\u0097"+ - "\u0098\7-\2\2\u0098\22\3\2\2\2\u0099\u009a\7s\2\2\u009a\u009b\7w\2\2\u009b"+ - "\u009c\7g\2\2\u009c\u009d\7t\2\2\u009d\u009e\7{\2\2\u009e\24\3\2\2\2\u009f"+ - "\u00a0\7n\2\2\u00a0\u00a1\7c\2\2\u00a1\u00a2\7|\2\2\u00a2\u00a3\7{\2\2"+ - "\u00a3\26\3\2\2\2\u00a4\u00a5\7q\2\2\u00a5\u00a6\7t\2\2\u00a6\30\3\2\2"+ - "\2\u00a7\u00a8\7c\2\2\u00a8\u00a9\7p\2\2\u00a9\u00aa\7f\2\2\u00aa\32\3"+ - "\2\2\2\u00ab\u00ac\7p\2\2\u00ac\u00ad\7q\2\2\u00ad\u00ae\7v\2\2\u00ae"+ - "\34\3\2\2\2\u00af\u00b0\7k\2\2\u00b0\u00b1\7p\2\2\u00b1\36\3\2\2\2\u00b2"+ - "\u00b3\7d\2\2\u00b3\u00b4\7g\2\2\u00b4\u00b5\7v\2\2\u00b5\u00b6\7y\2\2"+ - "\u00b6\u00b7\7g\2\2\u00b7\u00b8\7g\2\2\u00b8\u00b9\7p\2\2\u00b9 \3\2\2"+ - "\2\u00ba\u00bb\7k\2\2\u00bb\u00bc\7u\2\2\u00bc\"\3\2\2\2\u00bd\u00be\7"+ - "p\2\2\u00be\u00bf\7w\2\2\u00bf\u00c0\7n\2\2\u00c0\u00c1\7n\2\2\u00c1$"+ - "\3\2\2\2\u00c2\u00c3\7k\2\2\u00c3\u00c4\7u\2\2\u00c4\u00c5\7P\2\2\u00c5"+ - "\u00c6\7w\2\2\u00c6\u00c7\7n\2\2\u00c7\u00c8\7n\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\7P\2\2\u00cf\u00d0\7w\2\2\u00d0\u00d1"+ - "\7n\2\2\u00d1\u00d2\7n\2\2\u00d2(\3\2\2\2\u00d3\u00d4\7p\2\2\u00d4\u00d5"+ - "\7q\2\2\u00d5\u00d6\7v\2\2\u00d6\u00d7\7P\2\2\u00d7\u00d8\7w\2\2\u00d8"+ - "\u00d9\7n\2\2\u00d9\u00da\7n\2\2\u00da*\3\2\2\2\u00db\u00dc\7g\2\2\u00dc"+ - "\u00dd\7o\2\2\u00dd\u00de\7r\2\2\u00de\u00df\7v\2\2\u00df\u00e0\7{\2\2"+ - "\u00e0,\3\2\2\2\u00e1\u00e2\7k\2\2\u00e2\u00e3\7u\2\2\u00e3\u00e4\7G\2"+ - "\2\u00e4\u00e5\7o\2\2\u00e5\u00e6\7r\2\2\u00e6\u00e7\7v\2\2\u00e7\u00e8"+ - "\7{\2\2\u00e8.\3\2\2\2\u00e9\u00ea\7k\2\2\u00ea\u00eb\7u\2\2\u00eb\u00ec"+ - "\7P\2\2\u00ec\u00ed\7q\2\2\u00ed\u00ee\7v\2\2\u00ee\u00ef\7G\2\2\u00ef"+ - "\u00f0\7o\2\2\u00f0\u00f1\7r\2\2\u00f1\u00f2\7v\2\2\u00f2\u00f3\7{\2\2"+ - "\u00f3\60\3\2\2\2\u00f4\u00f5\7p\2\2\u00f5\u00f6\7q\2\2\u00f6\u00f7\7"+ - "v\2\2\u00f7\u00f8\7G\2\2\u00f8\u00f9\7o\2\2\u00f9\u00fa\7r\2\2\u00fa\u00fb"+ - "\7v\2\2\u00fb\u00fc\7{\2\2\u00fc\62\3\2\2\2\u00fd\u00fe\7n\2\2\u00fe\u00ff"+ - "\7k\2\2\u00ff\u0100\7m\2\2\u0100\u0101\7g\2\2\u0101\64\3\2\2\2\u0102\u0103"+ - "\7k\2\2\u0103\u0104\7n\2\2\u0104\u0105\7k\2\2\u0105\u0106\7m\2\2\u0106"+ - "\u0107\7g\2\2\u0107\66\3\2\2\2\u0108\u0109\7e\2\2\u0109\u010a\7q\2\2\u010a"+ - "\u010b\7p\2\2\u010b\u010c\7v\2\2\u010c\u010d\7c\2\2\u010d\u010e\7k\2\2"+ - "\u010e\u010f\7p\2\2\u010f\u0110\7u\2\2\u01108\3\2\2\2\u0111\u0112\7k\2"+ - "\2\u0112\u0113\7e\2\2\u0113\u0114\7q\2\2\u0114\u0115\7p\2\2\u0115\u0116"+ - "\7v\2\2\u0116\u0117\7c\2\2\u0117\u0118\7k\2\2\u0118\u0119\7p\2\2\u0119"+ - "\u011a\7u\2\2\u011a:\3\2\2\2\u011b\u011c\7u\2\2\u011c\u011d\7v\2\2\u011d"+ - "\u011e\7c\2\2\u011e\u011f\7t\2\2\u011f\u0120\7v\2\2\u0120\u0121\7u\2\2"+ - "\u0121\u0122\7Y\2\2\u0122\u0123\7k\2\2\u0123\u0124\7v\2\2\u0124\u0125"+ - "\7j\2\2\u0125<\3\2\2\2\u0126\u0127\7k\2\2\u0127\u0128\7u\2\2\u0128\u0129"+ - "\7v\2\2\u0129\u012a\7c\2\2\u012a\u012b\7t\2\2\u012b\u012c\7v\2\2\u012c"+ - "\u012d\7u\2\2\u012d\u012e\7Y\2\2\u012e\u012f\7k\2\2\u012f\u0130\7v\2\2"+ - "\u0130\u0131\7j\2\2\u0131>\3\2\2\2\u0132\u0133\7g\2\2\u0133\u0134\7p\2"+ - "\2\u0134\u0135\7f\2\2\u0135\u0136\7u\2\2\u0136\u0137\7Y\2\2\u0137\u0138"+ - "\7k\2\2\u0138\u0139\7v\2\2\u0139\u013a\7j\2\2\u013a@\3\2\2\2\u013b\u013c"+ - "\7k\2\2\u013c\u013d\7g\2\2\u013d\u013e\7p\2\2\u013e\u013f\7f\2\2\u013f"+ - "\u0140\7u\2\2\u0140\u0141\7Y\2\2\u0141\u0142\7k\2\2\u0142\u0143\7v\2\2"+ - "\u0143\u0144\7j\2\2\u0144B\3\2\2\2\u0145\u0146\7?\2\2\u0146D\3\2\2\2\u0147"+ - "\u0148\7g\2\2\u0148\u0149\7s\2\2\u0149F\3\2\2\2\u014a\u014b\7@\2\2\u014b"+ - "H\3\2\2\2\u014c\u014d\7i\2\2\u014d\u014e\7v\2\2\u014eJ\3\2\2\2\u014f\u0150"+ - "\7@\2\2\u0150\u0151\7?\2\2\u0151L\3\2\2\2\u0152\u0153\7i\2\2\u0153\u0154"+ - "\7g\2\2\u0154N\3\2\2\2\u0155\u0156\7i\2\2\u0156\u0157\7v\2\2\u0157\u0158"+ - "\7g\2\2\u0158P\3\2\2\2\u0159\u015a\7>\2\2\u015aR\3\2\2\2\u015b\u015c\7"+ - "n\2\2\u015c\u015d\7v\2\2\u015dT\3\2\2\2\u015e\u015f\7>\2\2\u015f\u0160"+ - "\7?\2\2\u0160V\3\2\2\2\u0161\u0162\7n\2\2\u0162\u0163\7g\2\2\u0163X\3"+ - "\2\2\2\u0164\u0165\7n\2\2\u0165\u0166\7v\2\2\u0166\u0167\7g\2\2\u0167"+ - "Z\3\2\2\2\u0168\u0169\7>\2\2\u0169\u016a\7@\2\2\u016a\\\3\2\2\2\u016b"+ - "\u016c\7#\2\2\u016c\u016d\7?\2\2\u016d^\3\2\2\2\u016e\u016f\7p\2\2\u016f"+ - "\u0170\7g\2\2\u0170`\3\2\2\2\u0171\u0172\7k\2\2\u0172\u0173\7g\2\2\u0173"+ - "\u0174\7s\2\2\u0174b\3\2\2\2\u0175\u0176\7<\2\2\u0176\u017a\t\2\2\2\u0177"+ - "\u0179\t\3\2\2\u0178\u0177\3\2\2\2\u0179\u017c\3\2\2\2\u017a\u0178\3\2"+ - "\2\2\u017a\u017b\3\2\2\2\u017bd\3\2\2\2\u017c\u017a\3\2\2\2\u017d\u0181"+ - "\t\2\2\2\u017e\u0180\t\4\2\2\u017f\u017e\3\2\2\2\u0180\u0183\3\2\2\2\u0181"+ - "\u017f\3\2\2\2\u0181\u0182\3\2\2\2\u0182f\3\2\2\2\u0183\u0181\3\2\2\2"+ - "\u0184\u0185\7v\2\2\u0185\u0186\7t\2\2\u0186\u0187\7w\2\2\u0187\u018e"+ - "\7g\2\2\u0188\u0189\7h\2\2\u0189\u018a\7c\2\2\u018a\u018b\7n\2\2\u018b"+ - "\u018c\7u\2\2\u018c\u018e\7g\2\2\u018d\u0184\3\2\2\2\u018d\u0188\3\2\2"+ - "\2\u018eh\3\2\2\2\u018f\u0191\7/\2\2\u0190\u018f\3\2\2\2\u0190\u0191\3"+ - "\2\2\2\u0191\u0192\3\2\2\2\u0192\u0199\5k\66\2\u0193\u0195\7/\2\2\u0194"+ - "\u0193\3\2\2\2\u0194\u0195\3\2\2\2\u0195\u0196\3\2\2\2\u0196\u0199\5m"+ - "\67\2\u0197\u0199\5o8\2\u0198\u0190\3\2\2\2\u0198\u0194\3\2\2\2\u0198"+ - "\u0197\3\2\2\2\u0199j\3\2\2\2\u019a\u019c\t\5\2\2\u019b\u019a\3\2\2\2"+ - "\u019c\u019d\3\2\2\2\u019d\u019b\3\2\2\2\u019d\u019e\3\2\2\2\u019e\u019f"+ - "\3\2\2\2\u019f\u01a3\7\60\2\2\u01a0\u01a2\t\5\2\2\u01a1\u01a0\3\2\2\2"+ - "\u01a2\u01a5\3\2\2\2\u01a3\u01a1\3\2\2\2\u01a3\u01a4\3\2\2\2\u01a4l\3"+ - "\2\2\2\u01a5\u01a3\3\2\2\2\u01a6\u01aa\t\6\2\2\u01a7\u01a9\t\5\2\2\u01a8"+ - "\u01a7\3\2\2\2\u01a9\u01ac\3\2\2\2\u01aa\u01a8\3\2\2\2\u01aa\u01ab\3\2"+ - "\2\2\u01abn\3\2\2\2\u01ac\u01aa\3\2\2\2\u01ad\u01ae\7\62\2\2\u01aep\3"+ - "\2\2\2\u01af\u01b5\7)\2\2\u01b0\u01b4\n\7\2\2\u01b1\u01b2\7)\2\2\u01b2"+ - "\u01b4\7)\2\2\u01b3\u01b0\3\2\2\2\u01b3\u01b1\3\2\2\2\u01b4\u01b7\3\2"+ - "\2\2\u01b5\u01b3\3\2\2\2\u01b5\u01b6\3\2\2\2\u01b6\u01b8\3\2\2\2\u01b7"+ - "\u01b5\3\2\2\2\u01b8\u01b9\7)\2\2\u01b9r\3\2\2\2\u01ba\u01bb\t\b\2\2\u01bb"+ - "\u01bc\3\2\2\2\u01bc\u01bd\b:\2\2\u01bdt\3\2\2\2\16\2\u017a\u0181\u018d"+ - "\u0190\u0194\u0198\u019d\u01a3\u01aa\u01b3\u01b5\3\b\2\2"; + "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\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\5\3\5"+ + "\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3"+ + "\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\13\3\13\3\f\3\f\3\f\3\f\3"+ + "\f\3\f\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\20\3\20"+ + "\3\20\3\20\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\22\3\23"+ + "\3\23\3\23\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\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\27\3\27\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\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\34\3\34\3\34\3\34"+ + "\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\36\3\36\3\36\3\36\3\36\3\36\3\36"+ + "\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\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%\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\60\3\60\3\60\3\61\3\61\3\61\3\62\3\62\3\62"+ + "\3\63\3\63\3\63\3\63\3\64\3\64\3\64\7\64\u018a\n\64\f\64\16\64\u018d\13"+ + "\64\3\65\3\65\7\65\u0191\n\65\f\65\16\65\u0194\13\65\3\66\3\66\3\66\3"+ + "\66\3\66\3\66\3\66\3\66\3\66\5\66\u019f\n\66\3\67\5\67\u01a2\n\67\3\67"+ + "\3\67\5\67\u01a6\n\67\3\67\3\67\5\67\u01aa\n\67\38\68\u01ad\n8\r8\168"+ + "\u01ae\38\38\78\u01b3\n8\f8\168\u01b6\138\39\39\79\u01ba\n9\f9\169\u01bd"+ + "\139\3:\3:\3;\3;\3;\3;\7;\u01c5\n;\f;\16;\u01c8\13;\3;\3;\3<\3<\3<\3<"+ + "\2\2=\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\66k\67"+ + "m8o9q:s;u\3\2\2\2\u012c\u012d\7u\2\2\u012d\u012e\7v\2\2\u012e\u012f\7c\2\2\u012f"+ + "\u0130\7t\2\2\u0130\u0131\7v\2\2\u0131\u0132\7u\2\2\u0132\u0133\7Y\2\2"+ + "\u0133\u0134\7k\2\2\u0134\u0135\7v\2\2\u0135\u0136\7j\2\2\u0136@\3\2\2"+ + "\2\u0137\u0138\7k\2\2\u0138\u0139\7u\2\2\u0139\u013a\7v\2\2\u013a\u013b"+ + "\7c\2\2\u013b\u013c\7t\2\2\u013c\u013d\7v\2\2\u013d\u013e\7u\2\2\u013e"+ + "\u013f\7Y\2\2\u013f\u0140\7k\2\2\u0140\u0141\7v\2\2\u0141\u0142\7j\2\2"+ + "\u0142B\3\2\2\2\u0143\u0144\7g\2\2\u0144\u0145\7p\2\2\u0145\u0146\7f\2"+ + "\2\u0146\u0147\7u\2\2\u0147\u0148\7Y\2\2\u0148\u0149\7k\2\2\u0149\u014a"+ + "\7v\2\2\u014a\u014b\7j\2\2\u014bD\3\2\2\2\u014c\u014d\7k\2\2\u014d\u014e"+ + "\7g\2\2\u014e\u014f\7p\2\2\u014f\u0150\7f\2\2\u0150\u0151\7u\2\2\u0151"+ + "\u0152\7Y\2\2\u0152\u0153\7k\2\2\u0153\u0154\7v\2\2\u0154\u0155\7j\2\2"+ + "\u0155F\3\2\2\2\u0156\u0157\7?\2\2\u0157H\3\2\2\2\u0158\u0159\7g\2\2\u0159"+ + "\u015a\7s\2\2\u015aJ\3\2\2\2\u015b\u015c\7@\2\2\u015cL\3\2\2\2\u015d\u015e"+ + "\7i\2\2\u015e\u015f\7v\2\2\u015fN\3\2\2\2\u0160\u0161\7@\2\2\u0161\u0162"+ + "\7?\2\2\u0162P\3\2\2\2\u0163\u0164\7i\2\2\u0164\u0165\7g\2\2\u0165R\3"+ + "\2\2\2\u0166\u0167\7i\2\2\u0167\u0168\7v\2\2\u0168\u0169\7g\2\2\u0169"+ + "T\3\2\2\2\u016a\u016b\7>\2\2\u016bV\3\2\2\2\u016c\u016d\7n\2\2\u016d\u016e"+ + "\7v\2\2\u016eX\3\2\2\2\u016f\u0170\7>\2\2\u0170\u0171\7?\2\2\u0171Z\3"+ + "\2\2\2\u0172\u0173\7n\2\2\u0173\u0174\7g\2\2\u0174\\\3\2\2\2\u0175\u0176"+ + "\7n\2\2\u0176\u0177\7v\2\2\u0177\u0178\7g\2\2\u0178^\3\2\2\2\u0179\u017a"+ + "\7>\2\2\u017a\u017b\7@\2\2\u017b`\3\2\2\2\u017c\u017d\7#\2\2\u017d\u017e"+ + "\7?\2\2\u017eb\3\2\2\2\u017f\u0180\7p\2\2\u0180\u0181\7g\2\2\u0181d\3"+ + "\2\2\2\u0182\u0183\7k\2\2\u0183\u0184\7g\2\2\u0184\u0185\7s\2\2\u0185"+ + "f\3\2\2\2\u0186\u0187\7<\2\2\u0187\u018b\t\2\2\2\u0188\u018a\t\3\2\2\u0189"+ + "\u0188\3\2\2\2\u018a\u018d\3\2\2\2\u018b\u0189\3\2\2\2\u018b\u018c\3\2"+ + "\2\2\u018ch\3\2\2\2\u018d\u018b\3\2\2\2\u018e\u0192\t\2\2\2\u018f\u0191"+ + "\t\4\2\2\u0190\u018f\3\2\2\2\u0191\u0194\3\2\2\2\u0192\u0190\3\2\2\2\u0192"+ + "\u0193\3\2\2\2\u0193j\3\2\2\2\u0194\u0192\3\2\2\2\u0195\u0196\7v\2\2\u0196"+ + "\u0197\7t\2\2\u0197\u0198\7w\2\2\u0198\u019f\7g\2\2\u0199\u019a\7h\2\2"+ + "\u019a\u019b\7c\2\2\u019b\u019c\7n\2\2\u019c\u019d\7u\2\2\u019d\u019f"+ + "\7g\2\2\u019e\u0195\3\2\2\2\u019e\u0199\3\2\2\2\u019fl\3\2\2\2\u01a0\u01a2"+ + "\7/\2\2\u01a1\u01a0\3\2\2\2\u01a1\u01a2\3\2\2\2\u01a2\u01a3\3\2\2\2\u01a3"+ + "\u01aa\5o8\2\u01a4\u01a6\7/\2\2\u01a5\u01a4\3\2\2\2\u01a5\u01a6\3\2\2"+ + "\2\u01a6\u01a7\3\2\2\2\u01a7\u01aa\5q9\2\u01a8\u01aa\5s:\2\u01a9\u01a1"+ + "\3\2\2\2\u01a9\u01a5\3\2\2\2\u01a9\u01a8\3\2\2\2\u01aan\3\2\2\2\u01ab"+ + "\u01ad\t\5\2\2\u01ac\u01ab\3\2\2\2\u01ad\u01ae\3\2\2\2\u01ae\u01ac\3\2"+ + "\2\2\u01ae\u01af\3\2\2\2\u01af\u01b0\3\2\2\2\u01b0\u01b4\7\60\2\2\u01b1"+ + "\u01b3\t\5\2\2\u01b2\u01b1\3\2\2\2\u01b3\u01b6\3\2\2\2\u01b4\u01b2\3\2"+ + "\2\2\u01b4\u01b5\3\2\2\2\u01b5p\3\2\2\2\u01b6\u01b4\3\2\2\2\u01b7\u01bb"+ + "\t\6\2\2\u01b8\u01ba\t\5\2\2\u01b9\u01b8\3\2\2\2\u01ba\u01bd\3\2\2\2\u01bb"+ + "\u01b9\3\2\2\2\u01bb\u01bc\3\2\2\2\u01bcr\3\2\2\2\u01bd\u01bb\3\2\2\2"+ + "\u01be\u01bf\7\62\2\2\u01bft\3\2\2\2\u01c0\u01c6\7)\2\2\u01c1\u01c5\n"+ + "\7\2\2\u01c2\u01c3\7)\2\2\u01c3\u01c5\7)\2\2\u01c4\u01c1\3\2\2\2\u01c4"+ + "\u01c2\3\2\2\2\u01c5\u01c8\3\2\2\2\u01c6\u01c4\3\2\2\2\u01c6\u01c7\3\2"+ + "\2\2\u01c7\u01c9\3\2\2\2\u01c8\u01c6\3\2\2\2\u01c9\u01ca\7)\2\2\u01ca"+ + "v\3\2\2\2\u01cb\u01cc\t\b\2\2\u01cc\u01cd\3\2\2\2\u01cd\u01ce\b<\2\2\u01ce"+ + "x\3\2\2\2\16\2\u018b\u0192\u019e\u01a1\u01a5\u01a9\u01ae\u01b4\u01bb\u01c4"+ + "\u01c6\3\b\2\2"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { 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 index dfb70e020..6a00e9224 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.tokens +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLLexer.tokens @@ -46,61 +46,65 @@ T__44=45 T__45=46 T__46=47 T__47=48 -INPUT_VARIABLE=49 -PATH_VARIABLE=50 -BOOLEAN_LITERAL=51 -NUMBER_LITERAL=52 -DOUBLE=53 -INT=54 -ZERO=55 -STRING_LITERAL=56 -WS=57 +T__48=49 +T__49=50 +INPUT_VARIABLE=51 +PATH_VARIABLE=52 +BOOLEAN_LITERAL=53 +NUMBER_LITERAL=54 +DOUBLE=55 +INT=56 +ZERO=57 +STRING_LITERAL=58 +WS=59 'select'=1 '('=2 ')'=3 'distinct'=4 'where'=5 -'fetch'=6 -','=7 -'+'=8 -'query'=9 -'lazy'=10 -'or'=11 -'and'=12 -'not'=13 -'in'=14 -'between'=15 -'is'=16 -'null'=17 -'isNull'=18 -'isNotNull'=19 -'notNull'=20 -'empty'=21 -'isEmpty'=22 -'isNotEmpty'=23 -'notEmpty'=24 -'like'=25 -'ilike'=26 -'contains'=27 -'icontains'=28 -'startsWith'=29 -'istartsWith'=30 -'endsWith'=31 -'iendsWith'=32 -'='=33 -'eq'=34 -'>'=35 -'gt'=36 -'>='=37 -'ge'=38 -'gte'=39 -'<'=40 -'lt'=41 -'<='=42 -'le'=43 -'lte'=44 -'<>'=45 -'!='=46 -'ne'=47 -'ieq'=48 -'0'=55 +'limit'=6 +'offset'=7 +'fetch'=8 +','=9 +'+'=10 +'query'=11 +'lazy'=12 +'or'=13 +'and'=14 +'not'=15 +'in'=16 +'between'=17 +'is'=18 +'null'=19 +'isNull'=20 +'isNotNull'=21 +'notNull'=22 +'empty'=23 +'isEmpty'=24 +'isNotEmpty'=25 +'notEmpty'=26 +'like'=27 +'ilike'=28 +'contains'=29 +'icontains'=30 +'startsWith'=31 +'istartsWith'=32 +'endsWith'=33 +'iendsWith'=34 +'='=35 +'eq'=36 +'>'=37 +'gt'=38 +'>='=39 +'ge'=40 +'gte'=41 +'<'=42 +'lt'=43 +'<='=44 +'le'=45 +'lte'=46 +'<>'=47 +'!='=48 +'ne'=49 +'ieq'=50 +'0'=57 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 index 2603f1e21..5c91254dd 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLListener.java +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLListener.java @@ -57,6 +57,26 @@ public interface EQLListener extends ParseTreeListener { * @param ctx the parse tree */ void exitWhere_clause(EQLParser.Where_clauseContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#limit_clause}. + * @param ctx the parse tree + */ + void enterLimit_clause(EQLParser.Limit_clauseContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#limit_clause}. + * @param ctx the parse tree + */ + void exitLimit_clause(EQLParser.Limit_clauseContext ctx); + /** + * Enter a parse tree produced by {@link EQLParser#offset_clause}. + * @param ctx the parse tree + */ + void enterOffset_clause(EQLParser.Offset_clauseContext ctx); + /** + * Exit a parse tree produced by {@link EQLParser#offset_clause}. + * @param ctx the parse tree + */ + void exitOffset_clause(EQLParser.Offset_clauseContext ctx); /** * Enter a parse tree produced by {@link EQLParser#fetch_path}. * @param ctx the parse tree 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 index ca360fb61..b5ab0787c 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLParser.java +++ b/src/main/java/com/avaje/ebeaninternal/server/grammer/antlr/EQLParser.java @@ -23,49 +23,51 @@ public class EQLParser extends Parser { 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, T__44=45, - T__45=46, T__46=47, T__47=48, INPUT_VARIABLE=49, PATH_VARIABLE=50, BOOLEAN_LITERAL=51, - NUMBER_LITERAL=52, DOUBLE=53, INT=54, ZERO=55, STRING_LITERAL=56, WS=57; + T__45=46, T__46=47, T__47=48, T__48=49, T__49=50, INPUT_VARIABLE=51, PATH_VARIABLE=52, + BOOLEAN_LITERAL=53, NUMBER_LITERAL=54, DOUBLE=55, INT=56, ZERO=57, STRING_LITERAL=58, + WS=59; public static final int RULE_select_statement = 0, RULE_select_clause = 1, RULE_distinct = 2, - RULE_fetch_clause = 3, RULE_where_clause = 4, RULE_fetch_path = 5, RULE_fetch_property_set = 6, - RULE_fetch_property_group = 7, RULE_fetch_property = 8, RULE_fetch_query_hint = 9, - RULE_fetch_lazy_hint = 10, RULE_fetch_option = 11, RULE_fetch_query_option = 12, - RULE_fetch_lazy_option = 13, RULE_fetch_batch_size = 14, RULE_conditional_expression = 15, - RULE_conditional_term = 16, RULE_conditional_factor = 17, RULE_conditional_primary = 18, - RULE_any_expression = 19, RULE_in_expression = 20, RULE_in_value = 21, - RULE_between_expression = 22, RULE_propertyBetween_expression = 23, RULE_isNull_expression = 24, - RULE_isNotNull_expression = 25, RULE_isEmpty_expression = 26, RULE_isNotEmpty_expression = 27, - RULE_like_expression = 28, RULE_like_op = 29, RULE_comparison_expression = 30, - RULE_comparison_operator = 31, RULE_value_expression = 32, RULE_literal = 33; + RULE_fetch_clause = 3, RULE_where_clause = 4, RULE_limit_clause = 5, RULE_offset_clause = 6, + RULE_fetch_path = 7, RULE_fetch_property_set = 8, RULE_fetch_property_group = 9, + RULE_fetch_property = 10, RULE_fetch_query_hint = 11, RULE_fetch_lazy_hint = 12, + RULE_fetch_option = 13, RULE_fetch_query_option = 14, RULE_fetch_lazy_option = 15, + RULE_fetch_batch_size = 16, RULE_conditional_expression = 17, RULE_conditional_term = 18, + RULE_conditional_factor = 19, RULE_conditional_primary = 20, RULE_any_expression = 21, + RULE_in_expression = 22, RULE_in_value = 23, RULE_between_expression = 24, + RULE_propertyBetween_expression = 25, RULE_isNull_expression = 26, RULE_isNotNull_expression = 27, + RULE_isEmpty_expression = 28, RULE_isNotEmpty_expression = 29, RULE_like_expression = 30, + RULE_like_op = 31, RULE_comparison_expression = 32, RULE_comparison_operator = 33, + RULE_value_expression = 34, RULE_literal = 35; public static final String[] ruleNames = { "select_statement", "select_clause", "distinct", "fetch_clause", "where_clause", - "fetch_path", "fetch_property_set", "fetch_property_group", "fetch_property", - "fetch_query_hint", "fetch_lazy_hint", "fetch_option", "fetch_query_option", - "fetch_lazy_option", "fetch_batch_size", "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", + "limit_clause", "offset_clause", "fetch_path", "fetch_property_set", "fetch_property_group", + "fetch_property", "fetch_query_hint", "fetch_lazy_hint", "fetch_option", + "fetch_query_option", "fetch_lazy_option", "fetch_batch_size", "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'", "'('", "')'", "'distinct'", "'where'", "'fetch'", "','", - "'+'", "'query'", "'lazy'", "'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'", null, null, null, null, null, - null, "'0'" + null, "'select'", "'('", "')'", "'distinct'", "'where'", "'limit'", "'offset'", + "'fetch'", "','", "'+'", "'query'", "'lazy'", "'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'", + null, null, null, null, null, null, "'0'" }; 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, null, null, null, - null, "INPUT_VARIABLE", "PATH_VARIABLE", "BOOLEAN_LITERAL", "NUMBER_LITERAL", - "DOUBLE", "INT", "ZERO", "STRING_LITERAL", "WS" + null, null, null, "INPUT_VARIABLE", "PATH_VARIABLE", "BOOLEAN_LITERAL", + "NUMBER_LITERAL", "DOUBLE", "INT", "ZERO", "STRING_LITERAL", "WS" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -129,6 +131,9 @@ public class EQLParser extends Parser { public Where_clauseContext where_clause() { return getRuleContext(Where_clauseContext.class,0); } + public Limit_clauseContext limit_clause() { + return getRuleContext(Limit_clauseContext.class,0); + } public Select_statementContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -150,38 +155,47 @@ public class EQLParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(69); + setState(73); _la = _input.LA(1); if (_la==T__0) { { - setState(68); + setState(72); select_clause(); } } - setState(74); + setState(78); _errHandler.sync(this); _la = _input.LA(1); - while (_la==T__5) { + while (_la==T__7) { { { - setState(71); + setState(75); fetch_clause(); } } - setState(76); + setState(80); _errHandler.sync(this); _la = _input.LA(1); } - setState(78); + setState(82); _la = _input.LA(1); if (_la==T__4) { { - setState(77); + setState(81); where_clause(); } } + setState(85); + _la = _input.LA(1); + if (_la==T__5) { + { + setState(84); + limit_clause(); + } + } + } } catch (RecognitionException re) { @@ -223,22 +237,22 @@ public class EQLParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(80); + setState(87); match(T__0); - setState(82); + setState(89); _la = _input.LA(1); if (_la==T__3) { { - setState(81); + setState(88); distinct(); } } - setState(84); + setState(91); match(T__1); - setState(85); + setState(92); fetch_property_group(); - setState(86); + setState(93); match(T__2); } } @@ -274,7 +288,7 @@ public class EQLParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(88); + setState(95); match(T__3); } } @@ -313,7 +327,7 @@ public class EQLParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(90); + setState(97); fetch_path(); } } @@ -352,9 +366,9 @@ public class EQLParser extends Parser { try { enterOuterAlt(_localctx, 1); { - setState(92); + setState(99); match(T__4); - setState(93); + setState(100); conditional_expression(); } } @@ -369,6 +383,97 @@ public class EQLParser extends Parser { return _localctx; } + public static class Limit_clauseContext extends ParserRuleContext { + public TerminalNode NUMBER_LITERAL() { return getToken(EQLParser.NUMBER_LITERAL, 0); } + public Offset_clauseContext offset_clause() { + return getRuleContext(Offset_clauseContext.class,0); + } + public Limit_clauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_limit_clause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterLimit_clause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitLimit_clause(this); + } + } + + public final Limit_clauseContext limit_clause() throws RecognitionException { + Limit_clauseContext _localctx = new Limit_clauseContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_limit_clause); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(102); + match(T__5); + setState(103); + match(NUMBER_LITERAL); + setState(105); + _la = _input.LA(1); + if (_la==T__6) { + { + setState(104); + offset_clause(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Offset_clauseContext extends ParserRuleContext { + public TerminalNode NUMBER_LITERAL() { return getToken(EQLParser.NUMBER_LITERAL, 0); } + public Offset_clauseContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_offset_clause; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).enterOffset_clause(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof EQLListener ) ((EQLListener)listener).exitOffset_clause(this); + } + } + + public final Offset_clauseContext offset_clause() throws RecognitionException { + Offset_clauseContext _localctx = new Offset_clauseContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_offset_clause); + try { + enterOuterAlt(_localctx, 1); + { + setState(107); + match(T__6); + setState(108); + match(NUMBER_LITERAL); + } + } + 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_optionContext fetch_option() { @@ -393,29 +498,29 @@ public class EQLParser extends Parser { public final Fetch_pathContext fetch_path() throws RecognitionException { Fetch_pathContext _localctx = new Fetch_pathContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_fetch_path); + enterRule(_localctx, 14, RULE_fetch_path); int _la; try { enterOuterAlt(_localctx, 1); { - setState(95); - match(T__5); - setState(97); + setState(110); + match(T__7); + setState(112); _la = _input.LA(1); - if (_la==T__8 || _la==T__9) { + if (_la==T__10 || _la==T__11) { { - setState(96); + setState(111); fetch_option(); } } - setState(99); + setState(114); match(PATH_VARIABLE); - setState(101); + setState(116); _la = _input.LA(1); if (_la==T__1) { { - setState(100); + setState(115); fetch_property_set(); } } @@ -453,15 +558,15 @@ public class EQLParser extends Parser { public final Fetch_property_setContext fetch_property_set() throws RecognitionException { Fetch_property_setContext _localctx = new Fetch_property_setContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_fetch_property_set); + enterRule(_localctx, 16, RULE_fetch_property_set); try { enterOuterAlt(_localctx, 1); { - setState(103); + setState(118); match(T__1); - setState(104); + setState(119); fetch_property_group(); - setState(105); + setState(120); match(T__2); } } @@ -499,26 +604,26 @@ public class EQLParser extends Parser { public final Fetch_property_groupContext fetch_property_group() throws RecognitionException { Fetch_property_groupContext _localctx = new Fetch_property_groupContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_fetch_property_group); + enterRule(_localctx, 18, RULE_fetch_property_group); int _la; try { enterOuterAlt(_localctx, 1); { - setState(107); + setState(122); fetch_property(); - setState(112); + setState(127); _errHandler.sync(this); _la = _input.LA(1); - while (_la==T__6) { + while (_la==T__8) { { { - setState(108); - match(T__6); - setState(109); + setState(123); + match(T__8); + setState(124); fetch_property(); } } - setState(114); + setState(129); _errHandler.sync(this); _la = _input.LA(1); } @@ -559,29 +664,29 @@ public class EQLParser extends Parser { public final Fetch_propertyContext fetch_property() throws RecognitionException { Fetch_propertyContext _localctx = new Fetch_propertyContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_fetch_property); + enterRule(_localctx, 20, RULE_fetch_property); try { - setState(118); + setState(133); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,9,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(115); + setState(130); match(PATH_VARIABLE); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(116); + setState(131); fetch_query_hint(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(117); + setState(132); fetch_lazy_hint(); } break; @@ -618,13 +723,13 @@ public class EQLParser extends Parser { public final Fetch_query_hintContext fetch_query_hint() throws RecognitionException { Fetch_query_hintContext _localctx = new Fetch_query_hintContext(_ctx, getState()); - enterRule(_localctx, 18, RULE_fetch_query_hint); + enterRule(_localctx, 22, RULE_fetch_query_hint); try { enterOuterAlt(_localctx, 1); { - setState(120); - match(T__7); - setState(121); + setState(135); + match(T__9); + setState(136); fetch_query_option(); } } @@ -659,13 +764,13 @@ public class EQLParser extends Parser { public final Fetch_lazy_hintContext fetch_lazy_hint() throws RecognitionException { Fetch_lazy_hintContext _localctx = new Fetch_lazy_hintContext(_ctx, getState()); - enterRule(_localctx, 20, RULE_fetch_lazy_hint); + enterRule(_localctx, 24, RULE_fetch_lazy_hint); try { enterOuterAlt(_localctx, 1); { - setState(123); - match(T__7); - setState(124); + setState(138); + match(T__9); + setState(139); fetch_lazy_option(); } } @@ -703,21 +808,21 @@ public class EQLParser extends Parser { public final Fetch_optionContext fetch_option() throws RecognitionException { Fetch_optionContext _localctx = new Fetch_optionContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_fetch_option); + enterRule(_localctx, 26, RULE_fetch_option); try { - setState(128); + setState(143); switch (_input.LA(1)) { - case T__8: + case T__10: enterOuterAlt(_localctx, 1); { - setState(126); + setState(141); fetch_query_option(); } break; - case T__9: + case T__11: enterOuterAlt(_localctx, 2); { - setState(127); + setState(142); fetch_lazy_option(); } break; @@ -756,18 +861,18 @@ public class EQLParser extends Parser { public final Fetch_query_optionContext fetch_query_option() throws RecognitionException { Fetch_query_optionContext _localctx = new Fetch_query_optionContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_fetch_query_option); + enterRule(_localctx, 28, RULE_fetch_query_option); int _la; try { enterOuterAlt(_localctx, 1); { - setState(130); - match(T__8); - setState(132); + setState(145); + match(T__10); + setState(147); _la = _input.LA(1); if (_la==T__1) { { - setState(131); + setState(146); fetch_batch_size(); } } @@ -805,18 +910,18 @@ public class EQLParser extends Parser { public final Fetch_lazy_optionContext fetch_lazy_option() throws RecognitionException { Fetch_lazy_optionContext _localctx = new Fetch_lazy_optionContext(_ctx, getState()); - enterRule(_localctx, 26, RULE_fetch_lazy_option); + enterRule(_localctx, 30, RULE_fetch_lazy_option); int _la; try { enterOuterAlt(_localctx, 1); { - setState(134); - match(T__9); - setState(136); + setState(149); + match(T__11); + setState(151); _la = _input.LA(1); if (_la==T__1) { { - setState(135); + setState(150); fetch_batch_size(); } } @@ -852,15 +957,15 @@ public class EQLParser extends Parser { public final Fetch_batch_sizeContext fetch_batch_size() throws RecognitionException { Fetch_batch_sizeContext _localctx = new Fetch_batch_sizeContext(_ctx, getState()); - enterRule(_localctx, 28, RULE_fetch_batch_size); + enterRule(_localctx, 32, RULE_fetch_batch_size); try { enterOuterAlt(_localctx, 1); { - setState(138); + setState(153); match(T__1); - setState(139); + setState(154); match(NUMBER_LITERAL); - setState(140); + setState(155); match(T__2); } } @@ -898,28 +1003,26 @@ public class EQLParser extends Parser { public final Conditional_expressionContext conditional_expression() throws RecognitionException { Conditional_expressionContext _localctx = new Conditional_expressionContext(_ctx, getState()); - enterRule(_localctx, 30, RULE_conditional_expression); + enterRule(_localctx, 34, RULE_conditional_expression); int _la; try { enterOuterAlt(_localctx, 1); { - { - setState(142); + setState(157); conditional_term(); - } - setState(147); + setState(162); _errHandler.sync(this); _la = _input.LA(1); - while (_la==T__10) { + while (_la==T__12) { { { - setState(143); - match(T__10); - setState(144); + setState(158); + match(T__12); + setState(159); conditional_term(); } } - setState(149); + setState(164); _errHandler.sync(this); _la = _input.LA(1); } @@ -959,28 +1062,26 @@ public class EQLParser extends Parser { public final Conditional_termContext conditional_term() throws RecognitionException { Conditional_termContext _localctx = new Conditional_termContext(_ctx, getState()); - enterRule(_localctx, 32, RULE_conditional_term); + enterRule(_localctx, 36, RULE_conditional_term); int _la; try { enterOuterAlt(_localctx, 1); { - { - setState(150); + setState(165); conditional_factor(); - } - setState(155); + setState(170); _errHandler.sync(this); _la = _input.LA(1); - while (_la==T__11) { + while (_la==T__13) { { { - setState(151); - match(T__11); - setState(152); + setState(166); + match(T__13); + setState(167); conditional_factor(); } } - setState(157); + setState(172); _errHandler.sync(this); _la = _input.LA(1); } @@ -1017,21 +1118,21 @@ public class EQLParser extends Parser { public final Conditional_factorContext conditional_factor() throws RecognitionException { Conditional_factorContext _localctx = new Conditional_factorContext(_ctx, getState()); - enterRule(_localctx, 34, RULE_conditional_factor); + enterRule(_localctx, 38, RULE_conditional_factor); int _la; try { enterOuterAlt(_localctx, 1); { - setState(159); + setState(174); _la = _input.LA(1); - if (_la==T__12) { + if (_la==T__14) { { - setState(158); - match(T__12); + setState(173); + match(T__14); } } - setState(161); + setState(176); conditional_primary(); } } @@ -1069,26 +1170,26 @@ public class EQLParser extends Parser { public final Conditional_primaryContext conditional_primary() throws RecognitionException { Conditional_primaryContext _localctx = new Conditional_primaryContext(_ctx, getState()); - enterRule(_localctx, 36, RULE_conditional_primary); + enterRule(_localctx, 40, RULE_conditional_primary); try { - setState(168); + setState(183); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(163); + setState(178); any_expression(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(164); + setState(179); match(T__1); - setState(165); + setState(180); conditional_expression(); - setState(166); + setState(181); match(T__2); } break; @@ -1152,82 +1253,82 @@ public class EQLParser extends Parser { public final Any_expressionContext any_expression() throws RecognitionException { Any_expressionContext _localctx = new Any_expressionContext(_ctx, getState()); - enterRule(_localctx, 38, RULE_any_expression); + enterRule(_localctx, 42, RULE_any_expression); try { - setState(183); + setState(198); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(170); + setState(185); comparison_expression(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(171); + setState(186); like_expression(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(172); + setState(187); between_expression(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(173); + setState(188); propertyBetween_expression(); } break; case 5: enterOuterAlt(_localctx, 5); { - setState(174); + setState(189); in_expression(); } break; case 6: enterOuterAlt(_localctx, 6); { - setState(175); + setState(190); isNull_expression(); } break; case 7: enterOuterAlt(_localctx, 7); { - setState(176); + setState(191); isNotNull_expression(); } break; case 8: enterOuterAlt(_localctx, 8); { - setState(177); + setState(192); isEmpty_expression(); } break; case 9: enterOuterAlt(_localctx, 9); { - setState(178); + setState(193); isNotEmpty_expression(); } break; case 10: enterOuterAlt(_localctx, 10); { - setState(179); + setState(194); match(T__1); - setState(180); + setState(195); any_expression(); - setState(181); + setState(196); match(T__2); } break; @@ -1265,15 +1366,15 @@ public class EQLParser extends Parser { public final In_expressionContext in_expression() throws RecognitionException { In_expressionContext _localctx = new In_expressionContext(_ctx, getState()); - enterRule(_localctx, 40, RULE_in_expression); + enterRule(_localctx, 44, RULE_in_expression); try { enterOuterAlt(_localctx, 1); { - setState(185); + setState(200); match(PATH_VARIABLE); - setState(186); - match(T__13); - setState(187); + setState(201); + match(T__15); + setState(202); in_value(); } } @@ -1312,42 +1413,42 @@ public class EQLParser extends Parser { public final In_valueContext in_value() throws RecognitionException { In_valueContext _localctx = new In_valueContext(_ctx, getState()); - enterRule(_localctx, 42, RULE_in_value); + enterRule(_localctx, 46, RULE_in_value); int _la; try { - setState(201); + setState(216); switch (_input.LA(1)) { case INPUT_VARIABLE: enterOuterAlt(_localctx, 1); { - setState(189); + setState(204); match(INPUT_VARIABLE); } break; case T__1: enterOuterAlt(_localctx, 2); { - setState(190); + setState(205); match(T__1); - setState(191); + setState(206); value_expression(); - setState(196); + setState(211); _errHandler.sync(this); _la = _input.LA(1); - while (_la==T__6) { + while (_la==T__8) { { { - setState(192); - match(T__6); - setState(193); + setState(207); + match(T__8); + setState(208); value_expression(); } } - setState(198); + setState(213); _errHandler.sync(this); _la = _input.LA(1); } - setState(199); + setState(214); match(T__2); } break; @@ -1390,19 +1491,19 @@ public class EQLParser extends Parser { public final Between_expressionContext between_expression() throws RecognitionException { Between_expressionContext _localctx = new Between_expressionContext(_ctx, getState()); - enterRule(_localctx, 44, RULE_between_expression); + enterRule(_localctx, 48, RULE_between_expression); try { enterOuterAlt(_localctx, 1); { - setState(203); + setState(218); match(PATH_VARIABLE); - setState(204); - match(T__14); - setState(205); + setState(219); + match(T__16); + setState(220); value_expression(); - setState(206); - match(T__11); - setState(207); + setState(221); + match(T__13); + setState(222); value_expression(); } } @@ -1441,19 +1542,19 @@ public class EQLParser extends Parser { public final PropertyBetween_expressionContext propertyBetween_expression() throws RecognitionException { PropertyBetween_expressionContext _localctx = new PropertyBetween_expressionContext(_ctx, getState()); - enterRule(_localctx, 46, RULE_propertyBetween_expression); + enterRule(_localctx, 50, RULE_propertyBetween_expression); try { enterOuterAlt(_localctx, 1); { - setState(209); + setState(224); value_expression(); - setState(210); - match(T__14); - setState(211); + setState(225); + match(T__16); + setState(226); match(PATH_VARIABLE); - setState(212); - match(T__11); - setState(213); + setState(227); + match(T__13); + setState(228); match(PATH_VARIABLE); } } @@ -1486,29 +1587,29 @@ public class EQLParser extends Parser { public final IsNull_expressionContext isNull_expression() throws RecognitionException { IsNull_expressionContext _localctx = new IsNull_expressionContext(_ctx, getState()); - enterRule(_localctx, 48, RULE_isNull_expression); + enterRule(_localctx, 52, RULE_isNull_expression); try { - setState(220); + setState(235); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(215); + setState(230); match(PATH_VARIABLE); - setState(216); - match(T__15); - setState(217); - match(T__16); + setState(231); + match(T__17); + setState(232); + match(T__18); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(218); + setState(233); match(PATH_VARIABLE); - setState(219); - match(T__17); + setState(234); + match(T__19); } break; } @@ -1542,40 +1643,40 @@ public class EQLParser extends Parser { public final IsNotNull_expressionContext isNotNull_expression() throws RecognitionException { IsNotNull_expressionContext _localctx = new IsNotNull_expressionContext(_ctx, getState()); - enterRule(_localctx, 50, RULE_isNotNull_expression); + enterRule(_localctx, 54, RULE_isNotNull_expression); try { - setState(230); + setState(245); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(222); + setState(237); match(PATH_VARIABLE); - setState(223); - match(T__15); - setState(224); - match(T__12); - setState(225); - match(T__16); + setState(238); + match(T__17); + setState(239); + match(T__14); + setState(240); + match(T__18); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(226); + setState(241); match(PATH_VARIABLE); - setState(227); - match(T__18); + setState(242); + match(T__20); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(228); + setState(243); match(PATH_VARIABLE); - setState(229); - match(T__19); + setState(244); + match(T__21); } break; } @@ -1609,29 +1710,29 @@ public class EQLParser extends Parser { public final IsEmpty_expressionContext isEmpty_expression() throws RecognitionException { IsEmpty_expressionContext _localctx = new IsEmpty_expressionContext(_ctx, getState()); - enterRule(_localctx, 52, RULE_isEmpty_expression); + enterRule(_localctx, 56, RULE_isEmpty_expression); try { - setState(237); + setState(252); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(232); + setState(247); match(PATH_VARIABLE); - setState(233); - match(T__15); - setState(234); - match(T__20); + setState(248); + match(T__17); + setState(249); + match(T__22); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(235); + setState(250); match(PATH_VARIABLE); - setState(236); - match(T__21); + setState(251); + match(T__23); } break; } @@ -1665,40 +1766,40 @@ public class EQLParser extends Parser { public final IsNotEmpty_expressionContext isNotEmpty_expression() throws RecognitionException { IsNotEmpty_expressionContext _localctx = new IsNotEmpty_expressionContext(_ctx, getState()); - enterRule(_localctx, 54, RULE_isNotEmpty_expression); + enterRule(_localctx, 58, RULE_isNotEmpty_expression); try { - setState(247); + setState(262); _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { + switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(239); + setState(254); match(PATH_VARIABLE); - setState(240); - match(T__15); - setState(241); - match(T__12); - setState(242); - match(T__20); + setState(255); + match(T__17); + setState(256); + match(T__14); + setState(257); + match(T__22); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(243); + setState(258); match(PATH_VARIABLE); - setState(244); - match(T__22); + setState(259); + match(T__24); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(245); + setState(260); match(PATH_VARIABLE); - setState(246); - match(T__23); + setState(261); + match(T__25); } break; } @@ -1738,15 +1839,15 @@ public class EQLParser extends Parser { public final Like_expressionContext like_expression() throws RecognitionException { Like_expressionContext _localctx = new Like_expressionContext(_ctx, getState()); - enterRule(_localctx, 56, RULE_like_expression); + enterRule(_localctx, 60, RULE_like_expression); try { enterOuterAlt(_localctx, 1); { - setState(249); + setState(264); match(PATH_VARIABLE); - setState(250); + setState(265); like_op(); - setState(251); + setState(266); value_expression(); } } @@ -1778,14 +1879,14 @@ public class EQLParser extends Parser { public final Like_opContext like_op() throws RecognitionException { Like_opContext _localctx = new Like_opContext(_ctx, getState()); - enterRule(_localctx, 58, RULE_like_op); + enterRule(_localctx, 62, RULE_like_op); int _la; try { enterOuterAlt(_localctx, 1); { - setState(253); + setState(268); _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__24) | (1L << T__25) | (1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31))) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__26) | (1L << T__27) | (1L << T__28) | (1L << T__29) | (1L << T__30) | (1L << T__31) | (1L << T__32) | (1L << T__33))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); @@ -1827,15 +1928,15 @@ public class EQLParser extends Parser { public final Comparison_expressionContext comparison_expression() throws RecognitionException { Comparison_expressionContext _localctx = new Comparison_expressionContext(_ctx, getState()); - enterRule(_localctx, 60, RULE_comparison_expression); + enterRule(_localctx, 64, RULE_comparison_expression); try { enterOuterAlt(_localctx, 1); { - setState(255); + setState(270); match(PATH_VARIABLE); - setState(256); + setState(271); comparison_operator(); - setState(257); + setState(272); value_expression(); } } @@ -1867,14 +1968,14 @@ public class EQLParser extends Parser { public final Comparison_operatorContext comparison_operator() throws RecognitionException { Comparison_operatorContext _localctx = new Comparison_operatorContext(_ctx, getState()); - enterRule(_localctx, 62, RULE_comparison_operator); + enterRule(_localctx, 66, RULE_comparison_operator); int _la; try { enterOuterAlt(_localctx, 1); { - setState(259); + setState(274); _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((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) | (1L << T__44) | (1L << T__45) | (1L << T__46) | (1L << T__47))) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((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) | (1L << T__44) | (1L << T__45) | (1L << T__46) | (1L << T__47) | (1L << T__48) | (1L << T__49))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); @@ -1913,23 +2014,23 @@ public class EQLParser extends Parser { public final Value_expressionContext value_expression() throws RecognitionException { Value_expressionContext _localctx = new Value_expressionContext(_ctx, getState()); - enterRule(_localctx, 64, RULE_value_expression); + enterRule(_localctx, 68, RULE_value_expression); try { - setState(263); + setState(278); switch (_input.LA(1)) { case BOOLEAN_LITERAL: case NUMBER_LITERAL: case STRING_LITERAL: enterOuterAlt(_localctx, 1); { - setState(261); + setState(276); literal(); } break; case INPUT_VARIABLE: enterOuterAlt(_localctx, 2); { - setState(262); + setState(277); match(INPUT_VARIABLE); } break; @@ -1968,12 +2069,12 @@ public class EQLParser extends Parser { public final LiteralContext literal() throws RecognitionException { LiteralContext _localctx = new LiteralContext(_ctx, getState()); - enterRule(_localctx, 66, RULE_literal); + enterRule(_localctx, 70, RULE_literal); int _la; try { enterOuterAlt(_localctx, 1); { - setState(265); + setState(280); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN_LITERAL) | (1L << NUMBER_LITERAL) | (1L << STRING_LITERAL))) != 0)) ) { _errHandler.recoverInline(this); @@ -1994,93 +2095,99 @@ public class EQLParser extends Parser { } public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3;\u010e\4\2\t\2\4"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3=\u011d\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#\3\2\5\2H\n\2\3\2\7\2K\n\2\f\2\16\2N\13\2\3\2\5\2Q\n"+ - "\2\3\3\3\3\5\3U\n\3\3\3\3\3\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\6\3\7\3"+ - "\7\5\7d\n\7\3\7\3\7\5\7h\n\7\3\b\3\b\3\b\3\b\3\t\3\t\3\t\7\tq\n\t\f\t"+ - "\16\tt\13\t\3\n\3\n\3\n\5\ny\n\n\3\13\3\13\3\13\3\f\3\f\3\f\3\r\3\r\5"+ - "\r\u0083\n\r\3\16\3\16\5\16\u0087\n\16\3\17\3\17\5\17\u008b\n\17\3\20"+ - "\3\20\3\20\3\20\3\21\3\21\3\21\7\21\u0094\n\21\f\21\16\21\u0097\13\21"+ - "\3\22\3\22\3\22\7\22\u009c\n\22\f\22\16\22\u009f\13\22\3\23\5\23\u00a2"+ - "\n\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\5\24\u00ab\n\24\3\25\3\25\3\25"+ - "\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u00ba\n\25\3\26"+ - "\3\26\3\26\3\26\3\27\3\27\3\27\3\27\3\27\7\27\u00c5\n\27\f\27\16\27\u00c8"+ - "\13\27\3\27\3\27\5\27\u00cc\n\27\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\32\3\32\3\32\3\32\3\32\5\32\u00df\n\32\3\33"+ - "\3\33\3\33\3\33\3\33\3\33\3\33\3\33\5\33\u00e9\n\33\3\34\3\34\3\34\3\34"+ - "\3\34\5\34\u00f0\n\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\5\35\u00fa"+ - "\n\35\3\36\3\36\3\36\3\36\3\37\3\37\3 \3 \3 \3 \3!\3!\3\"\3\"\5\"\u010a"+ - "\n\"\3#\3#\3#\2\2$\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60"+ - "\62\64\668:<>@BD\2\5\3\2\33\"\3\2#\62\4\2\65\66::\u010d\2G\3\2\2\2\4R"+ - "\3\2\2\2\6Z\3\2\2\2\b\\\3\2\2\2\n^\3\2\2\2\fa\3\2\2\2\16i\3\2\2\2\20m"+ - "\3\2\2\2\22x\3\2\2\2\24z\3\2\2\2\26}\3\2\2\2\30\u0082\3\2\2\2\32\u0084"+ - "\3\2\2\2\34\u0088\3\2\2\2\36\u008c\3\2\2\2 \u0090\3\2\2\2\"\u0098\3\2"+ - "\2\2$\u00a1\3\2\2\2&\u00aa\3\2\2\2(\u00b9\3\2\2\2*\u00bb\3\2\2\2,\u00cb"+ - "\3\2\2\2.\u00cd\3\2\2\2\60\u00d3\3\2\2\2\62\u00de\3\2\2\2\64\u00e8\3\2"+ - "\2\2\66\u00ef\3\2\2\28\u00f9\3\2\2\2:\u00fb\3\2\2\2<\u00ff\3\2\2\2>\u0101"+ - "\3\2\2\2@\u0105\3\2\2\2B\u0109\3\2\2\2D\u010b\3\2\2\2FH\5\4\3\2GF\3\2"+ - "\2\2GH\3\2\2\2HL\3\2\2\2IK\5\b\5\2JI\3\2\2\2KN\3\2\2\2LJ\3\2\2\2LM\3\2"+ - "\2\2MP\3\2\2\2NL\3\2\2\2OQ\5\n\6\2PO\3\2\2\2PQ\3\2\2\2Q\3\3\2\2\2RT\7"+ - "\3\2\2SU\5\6\4\2TS\3\2\2\2TU\3\2\2\2UV\3\2\2\2VW\7\4\2\2WX\5\20\t\2XY"+ - "\7\5\2\2Y\5\3\2\2\2Z[\7\6\2\2[\7\3\2\2\2\\]\5\f\7\2]\t\3\2\2\2^_\7\7\2"+ - "\2_`\5 \21\2`\13\3\2\2\2ac\7\b\2\2bd\5\30\r\2cb\3\2\2\2cd\3\2\2\2de\3"+ - "\2\2\2eg\7\64\2\2fh\5\16\b\2gf\3\2\2\2gh\3\2\2\2h\r\3\2\2\2ij\7\4\2\2"+ - "jk\5\20\t\2kl\7\5\2\2l\17\3\2\2\2mr\5\22\n\2no\7\t\2\2oq\5\22\n\2pn\3"+ - "\2\2\2qt\3\2\2\2rp\3\2\2\2rs\3\2\2\2s\21\3\2\2\2tr\3\2\2\2uy\7\64\2\2"+ - "vy\5\24\13\2wy\5\26\f\2xu\3\2\2\2xv\3\2\2\2xw\3\2\2\2y\23\3\2\2\2z{\7"+ - "\n\2\2{|\5\32\16\2|\25\3\2\2\2}~\7\n\2\2~\177\5\34\17\2\177\27\3\2\2\2"+ - "\u0080\u0083\5\32\16\2\u0081\u0083\5\34\17\2\u0082\u0080\3\2\2\2\u0082"+ - "\u0081\3\2\2\2\u0083\31\3\2\2\2\u0084\u0086\7\13\2\2\u0085\u0087\5\36"+ - "\20\2\u0086\u0085\3\2\2\2\u0086\u0087\3\2\2\2\u0087\33\3\2\2\2\u0088\u008a"+ - "\7\f\2\2\u0089\u008b\5\36\20\2\u008a\u0089\3\2\2\2\u008a\u008b\3\2\2\2"+ - "\u008b\35\3\2\2\2\u008c\u008d\7\4\2\2\u008d\u008e\7\66\2\2\u008e\u008f"+ - "\7\5\2\2\u008f\37\3\2\2\2\u0090\u0095\5\"\22\2\u0091\u0092\7\r\2\2\u0092"+ - "\u0094\5\"\22\2\u0093\u0091\3\2\2\2\u0094\u0097\3\2\2\2\u0095\u0093\3"+ - "\2\2\2\u0095\u0096\3\2\2\2\u0096!\3\2\2\2\u0097\u0095\3\2\2\2\u0098\u009d"+ - "\5$\23\2\u0099\u009a\7\16\2\2\u009a\u009c\5$\23\2\u009b\u0099\3\2\2\2"+ - "\u009c\u009f\3\2\2\2\u009d\u009b\3\2\2\2\u009d\u009e\3\2\2\2\u009e#\3"+ - "\2\2\2\u009f\u009d\3\2\2\2\u00a0\u00a2\7\17\2\2\u00a1\u00a0\3\2\2\2\u00a1"+ - "\u00a2\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3\u00a4\5&\24\2\u00a4%\3\2\2\2"+ - "\u00a5\u00ab\5(\25\2\u00a6\u00a7\7\4\2\2\u00a7\u00a8\5 \21\2\u00a8\u00a9"+ - "\7\5\2\2\u00a9\u00ab\3\2\2\2\u00aa\u00a5\3\2\2\2\u00aa\u00a6\3\2\2\2\u00ab"+ - "\'\3\2\2\2\u00ac\u00ba\5> \2\u00ad\u00ba\5:\36\2\u00ae\u00ba\5.\30\2\u00af"+ - "\u00ba\5\60\31\2\u00b0\u00ba\5*\26\2\u00b1\u00ba\5\62\32\2\u00b2\u00ba"+ - "\5\64\33\2\u00b3\u00ba\5\66\34\2\u00b4\u00ba\58\35\2\u00b5\u00b6\7\4\2"+ - "\2\u00b6\u00b7\5(\25\2\u00b7\u00b8\7\5\2\2\u00b8\u00ba\3\2\2\2\u00b9\u00ac"+ - "\3\2\2\2\u00b9\u00ad\3\2\2\2\u00b9\u00ae\3\2\2\2\u00b9\u00af\3\2\2\2\u00b9"+ - "\u00b0\3\2\2\2\u00b9\u00b1\3\2\2\2\u00b9\u00b2\3\2\2\2\u00b9\u00b3\3\2"+ - "\2\2\u00b9\u00b4\3\2\2\2\u00b9\u00b5\3\2\2\2\u00ba)\3\2\2\2\u00bb\u00bc"+ - "\7\64\2\2\u00bc\u00bd\7\20\2\2\u00bd\u00be\5,\27\2\u00be+\3\2\2\2\u00bf"+ - "\u00cc\7\63\2\2\u00c0\u00c1\7\4\2\2\u00c1\u00c6\5B\"\2\u00c2\u00c3\7\t"+ - "\2\2\u00c3\u00c5\5B\"\2\u00c4\u00c2\3\2\2\2\u00c5\u00c8\3\2\2\2\u00c6"+ - "\u00c4\3\2\2\2\u00c6\u00c7\3\2\2\2\u00c7\u00c9\3\2\2\2\u00c8\u00c6\3\2"+ - "\2\2\u00c9\u00ca\7\5\2\2\u00ca\u00cc\3\2\2\2\u00cb\u00bf\3\2\2\2\u00cb"+ - "\u00c0\3\2\2\2\u00cc-\3\2\2\2\u00cd\u00ce\7\64\2\2\u00ce\u00cf\7\21\2"+ - "\2\u00cf\u00d0\5B\"\2\u00d0\u00d1\7\16\2\2\u00d1\u00d2\5B\"\2\u00d2/\3"+ - "\2\2\2\u00d3\u00d4\5B\"\2\u00d4\u00d5\7\21\2\2\u00d5\u00d6\7\64\2\2\u00d6"+ - "\u00d7\7\16\2\2\u00d7\u00d8\7\64\2\2\u00d8\61\3\2\2\2\u00d9\u00da\7\64"+ - "\2\2\u00da\u00db\7\22\2\2\u00db\u00df\7\23\2\2\u00dc\u00dd\7\64\2\2\u00dd"+ - "\u00df\7\24\2\2\u00de\u00d9\3\2\2\2\u00de\u00dc\3\2\2\2\u00df\63\3\2\2"+ - "\2\u00e0\u00e1\7\64\2\2\u00e1\u00e2\7\22\2\2\u00e2\u00e3\7\17\2\2\u00e3"+ - "\u00e9\7\23\2\2\u00e4\u00e5\7\64\2\2\u00e5\u00e9\7\25\2\2\u00e6\u00e7"+ - "\7\64\2\2\u00e7\u00e9\7\26\2\2\u00e8\u00e0\3\2\2\2\u00e8\u00e4\3\2\2\2"+ - "\u00e8\u00e6\3\2\2\2\u00e9\65\3\2\2\2\u00ea\u00eb\7\64\2\2\u00eb\u00ec"+ - "\7\22\2\2\u00ec\u00f0\7\27\2\2\u00ed\u00ee\7\64\2\2\u00ee\u00f0\7\30\2"+ - "\2\u00ef\u00ea\3\2\2\2\u00ef\u00ed\3\2\2\2\u00f0\67\3\2\2\2\u00f1\u00f2"+ - "\7\64\2\2\u00f2\u00f3\7\22\2\2\u00f3\u00f4\7\17\2\2\u00f4\u00fa\7\27\2"+ - "\2\u00f5\u00f6\7\64\2\2\u00f6\u00fa\7\31\2\2\u00f7\u00f8\7\64\2\2\u00f8"+ - "\u00fa\7\32\2\2\u00f9\u00f1\3\2\2\2\u00f9\u00f5\3\2\2\2\u00f9\u00f7\3"+ - "\2\2\2\u00fa9\3\2\2\2\u00fb\u00fc\7\64\2\2\u00fc\u00fd\5<\37\2\u00fd\u00fe"+ - "\5B\"\2\u00fe;\3\2\2\2\u00ff\u0100\t\2\2\2\u0100=\3\2\2\2\u0101\u0102"+ - "\7\64\2\2\u0102\u0103\5@!\2\u0103\u0104\5B\"\2\u0104?\3\2\2\2\u0105\u0106"+ - "\t\3\2\2\u0106A\3\2\2\2\u0107\u010a\5D#\2\u0108\u010a\7\63\2\2\u0109\u0107"+ - "\3\2\2\2\u0109\u0108\3\2\2\2\u010aC\3\2\2\2\u010b\u010c\t\4\2\2\u010c"+ - "E\3\2\2\2\31GLPTcgrx\u0082\u0086\u008a\u0095\u009d\u00a1\u00aa\u00b9\u00c6"+ - "\u00cb\u00de\u00e8\u00ef\u00f9\u0109"; + "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\3\2\5\2L\n\2\3\2\7\2O\n\2\f\2\16\2R\13\2"+ + "\3\2\5\2U\n\2\3\2\5\2X\n\2\3\3\3\3\5\3\\\n\3\3\3\3\3\3\3\3\3\3\4\3\4\3"+ + "\5\3\5\3\6\3\6\3\6\3\7\3\7\3\7\5\7l\n\7\3\b\3\b\3\b\3\t\3\t\5\ts\n\t\3"+ + "\t\3\t\5\tw\n\t\3\n\3\n\3\n\3\n\3\13\3\13\3\13\7\13\u0080\n\13\f\13\16"+ + "\13\u0083\13\13\3\f\3\f\3\f\5\f\u0088\n\f\3\r\3\r\3\r\3\16\3\16\3\16\3"+ + "\17\3\17\5\17\u0092\n\17\3\20\3\20\5\20\u0096\n\20\3\21\3\21\5\21\u009a"+ + "\n\21\3\22\3\22\3\22\3\22\3\23\3\23\3\23\7\23\u00a3\n\23\f\23\16\23\u00a6"+ + "\13\23\3\24\3\24\3\24\7\24\u00ab\n\24\f\24\16\24\u00ae\13\24\3\25\5\25"+ + "\u00b1\n\25\3\25\3\25\3\26\3\26\3\26\3\26\3\26\5\26\u00ba\n\26\3\27\3"+ + "\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\5\27\u00c9"+ + "\n\27\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\7\31\u00d4\n\31\f\31"+ + "\16\31\u00d7\13\31\3\31\3\31\5\31\u00db\n\31\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\34\3\34\3\34\3\34\3\34\5\34\u00ee"+ + "\n\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\5\35\u00f8\n\35\3\36\3\36"+ + "\3\36\3\36\3\36\5\36\u00ff\n\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37"+ + "\5\37\u0109\n\37\3 \3 \3 \3 \3!\3!\3\"\3\"\3\"\3\"\3#\3#\3$\3$\5$\u0119"+ + "\n$\3%\3%\3%\2\2&\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62"+ + "\64\668:<>@BDFH\2\5\3\2\35$\3\2%\64\4\2\678<<\u011c\2K\3\2\2\2\4Y\3\2"+ + "\2\2\6a\3\2\2\2\bc\3\2\2\2\ne\3\2\2\2\fh\3\2\2\2\16m\3\2\2\2\20p\3\2\2"+ + "\2\22x\3\2\2\2\24|\3\2\2\2\26\u0087\3\2\2\2\30\u0089\3\2\2\2\32\u008c"+ + "\3\2\2\2\34\u0091\3\2\2\2\36\u0093\3\2\2\2 \u0097\3\2\2\2\"\u009b\3\2"+ + "\2\2$\u009f\3\2\2\2&\u00a7\3\2\2\2(\u00b0\3\2\2\2*\u00b9\3\2\2\2,\u00c8"+ + "\3\2\2\2.\u00ca\3\2\2\2\60\u00da\3\2\2\2\62\u00dc\3\2\2\2\64\u00e2\3\2"+ + "\2\2\66\u00ed\3\2\2\28\u00f7\3\2\2\2:\u00fe\3\2\2\2<\u0108\3\2\2\2>\u010a"+ + "\3\2\2\2@\u010e\3\2\2\2B\u0110\3\2\2\2D\u0114\3\2\2\2F\u0118\3\2\2\2H"+ + "\u011a\3\2\2\2JL\5\4\3\2KJ\3\2\2\2KL\3\2\2\2LP\3\2\2\2MO\5\b\5\2NM\3\2"+ + "\2\2OR\3\2\2\2PN\3\2\2\2PQ\3\2\2\2QT\3\2\2\2RP\3\2\2\2SU\5\n\6\2TS\3\2"+ + "\2\2TU\3\2\2\2UW\3\2\2\2VX\5\f\7\2WV\3\2\2\2WX\3\2\2\2X\3\3\2\2\2Y[\7"+ + "\3\2\2Z\\\5\6\4\2[Z\3\2\2\2[\\\3\2\2\2\\]\3\2\2\2]^\7\4\2\2^_\5\24\13"+ + "\2_`\7\5\2\2`\5\3\2\2\2ab\7\6\2\2b\7\3\2\2\2cd\5\20\t\2d\t\3\2\2\2ef\7"+ + "\7\2\2fg\5$\23\2g\13\3\2\2\2hi\7\b\2\2ik\78\2\2jl\5\16\b\2kj\3\2\2\2k"+ + "l\3\2\2\2l\r\3\2\2\2mn\7\t\2\2no\78\2\2o\17\3\2\2\2pr\7\n\2\2qs\5\34\17"+ + "\2rq\3\2\2\2rs\3\2\2\2st\3\2\2\2tv\7\66\2\2uw\5\22\n\2vu\3\2\2\2vw\3\2"+ + "\2\2w\21\3\2\2\2xy\7\4\2\2yz\5\24\13\2z{\7\5\2\2{\23\3\2\2\2|\u0081\5"+ + "\26\f\2}~\7\13\2\2~\u0080\5\26\f\2\177}\3\2\2\2\u0080\u0083\3\2\2\2\u0081"+ + "\177\3\2\2\2\u0081\u0082\3\2\2\2\u0082\25\3\2\2\2\u0083\u0081\3\2\2\2"+ + "\u0084\u0088\7\66\2\2\u0085\u0088\5\30\r\2\u0086\u0088\5\32\16\2\u0087"+ + "\u0084\3\2\2\2\u0087\u0085\3\2\2\2\u0087\u0086\3\2\2\2\u0088\27\3\2\2"+ + "\2\u0089\u008a\7\f\2\2\u008a\u008b\5\36\20\2\u008b\31\3\2\2\2\u008c\u008d"+ + "\7\f\2\2\u008d\u008e\5 \21\2\u008e\33\3\2\2\2\u008f\u0092\5\36\20\2\u0090"+ + "\u0092\5 \21\2\u0091\u008f\3\2\2\2\u0091\u0090\3\2\2\2\u0092\35\3\2\2"+ + "\2\u0093\u0095\7\r\2\2\u0094\u0096\5\"\22\2\u0095\u0094\3\2\2\2\u0095"+ + "\u0096\3\2\2\2\u0096\37\3\2\2\2\u0097\u0099\7\16\2\2\u0098\u009a\5\"\22"+ + "\2\u0099\u0098\3\2\2\2\u0099\u009a\3\2\2\2\u009a!\3\2\2\2\u009b\u009c"+ + "\7\4\2\2\u009c\u009d\78\2\2\u009d\u009e\7\5\2\2\u009e#\3\2\2\2\u009f\u00a4"+ + "\5&\24\2\u00a0\u00a1\7\17\2\2\u00a1\u00a3\5&\24\2\u00a2\u00a0\3\2\2\2"+ + "\u00a3\u00a6\3\2\2\2\u00a4\u00a2\3\2\2\2\u00a4\u00a5\3\2\2\2\u00a5%\3"+ + "\2\2\2\u00a6\u00a4\3\2\2\2\u00a7\u00ac\5(\25\2\u00a8\u00a9\7\20\2\2\u00a9"+ + "\u00ab\5(\25\2\u00aa\u00a8\3\2\2\2\u00ab\u00ae\3\2\2\2\u00ac\u00aa\3\2"+ + "\2\2\u00ac\u00ad\3\2\2\2\u00ad\'\3\2\2\2\u00ae\u00ac\3\2\2\2\u00af\u00b1"+ + "\7\21\2\2\u00b0\u00af\3\2\2\2\u00b0\u00b1\3\2\2\2\u00b1\u00b2\3\2\2\2"+ + "\u00b2\u00b3\5*\26\2\u00b3)\3\2\2\2\u00b4\u00ba\5,\27\2\u00b5\u00b6\7"+ + "\4\2\2\u00b6\u00b7\5$\23\2\u00b7\u00b8\7\5\2\2\u00b8\u00ba\3\2\2\2\u00b9"+ + "\u00b4\3\2\2\2\u00b9\u00b5\3\2\2\2\u00ba+\3\2\2\2\u00bb\u00c9\5B\"\2\u00bc"+ + "\u00c9\5> \2\u00bd\u00c9\5\62\32\2\u00be\u00c9\5\64\33\2\u00bf\u00c9\5"+ + ".\30\2\u00c0\u00c9\5\66\34\2\u00c1\u00c9\58\35\2\u00c2\u00c9\5:\36\2\u00c3"+ + "\u00c9\5<\37\2\u00c4\u00c5\7\4\2\2\u00c5\u00c6\5,\27\2\u00c6\u00c7\7\5"+ + "\2\2\u00c7\u00c9\3\2\2\2\u00c8\u00bb\3\2\2\2\u00c8\u00bc\3\2\2\2\u00c8"+ + "\u00bd\3\2\2\2\u00c8\u00be\3\2\2\2\u00c8\u00bf\3\2\2\2\u00c8\u00c0\3\2"+ + "\2\2\u00c8\u00c1\3\2\2\2\u00c8\u00c2\3\2\2\2\u00c8\u00c3\3\2\2\2\u00c8"+ + "\u00c4\3\2\2\2\u00c9-\3\2\2\2\u00ca\u00cb\7\66\2\2\u00cb\u00cc\7\22\2"+ + "\2\u00cc\u00cd\5\60\31\2\u00cd/\3\2\2\2\u00ce\u00db\7\65\2\2\u00cf\u00d0"+ + "\7\4\2\2\u00d0\u00d5\5F$\2\u00d1\u00d2\7\13\2\2\u00d2\u00d4\5F$\2\u00d3"+ + "\u00d1\3\2\2\2\u00d4\u00d7\3\2\2\2\u00d5\u00d3\3\2\2\2\u00d5\u00d6\3\2"+ + "\2\2\u00d6\u00d8\3\2\2\2\u00d7\u00d5\3\2\2\2\u00d8\u00d9\7\5\2\2\u00d9"+ + "\u00db\3\2\2\2\u00da\u00ce\3\2\2\2\u00da\u00cf\3\2\2\2\u00db\61\3\2\2"+ + "\2\u00dc\u00dd\7\66\2\2\u00dd\u00de\7\23\2\2\u00de\u00df\5F$\2\u00df\u00e0"+ + "\7\20\2\2\u00e0\u00e1\5F$\2\u00e1\63\3\2\2\2\u00e2\u00e3\5F$\2\u00e3\u00e4"+ + "\7\23\2\2\u00e4\u00e5\7\66\2\2\u00e5\u00e6\7\20\2\2\u00e6\u00e7\7\66\2"+ + "\2\u00e7\65\3\2\2\2\u00e8\u00e9\7\66\2\2\u00e9\u00ea\7\24\2\2\u00ea\u00ee"+ + "\7\25\2\2\u00eb\u00ec\7\66\2\2\u00ec\u00ee\7\26\2\2\u00ed\u00e8\3\2\2"+ + "\2\u00ed\u00eb\3\2\2\2\u00ee\67\3\2\2\2\u00ef\u00f0\7\66\2\2\u00f0\u00f1"+ + "\7\24\2\2\u00f1\u00f2\7\21\2\2\u00f2\u00f8\7\25\2\2\u00f3\u00f4\7\66\2"+ + "\2\u00f4\u00f8\7\27\2\2\u00f5\u00f6\7\66\2\2\u00f6\u00f8\7\30\2\2\u00f7"+ + "\u00ef\3\2\2\2\u00f7\u00f3\3\2\2\2\u00f7\u00f5\3\2\2\2\u00f89\3\2\2\2"+ + "\u00f9\u00fa\7\66\2\2\u00fa\u00fb\7\24\2\2\u00fb\u00ff\7\31\2\2\u00fc"+ + "\u00fd\7\66\2\2\u00fd\u00ff\7\32\2\2\u00fe\u00f9\3\2\2\2\u00fe\u00fc\3"+ + "\2\2\2\u00ff;\3\2\2\2\u0100\u0101\7\66\2\2\u0101\u0102\7\24\2\2\u0102"+ + "\u0103\7\21\2\2\u0103\u0109\7\31\2\2\u0104\u0105\7\66\2\2\u0105\u0109"+ + "\7\33\2\2\u0106\u0107\7\66\2\2\u0107\u0109\7\34\2\2\u0108\u0100\3\2\2"+ + "\2\u0108\u0104\3\2\2\2\u0108\u0106\3\2\2\2\u0109=\3\2\2\2\u010a\u010b"+ + "\7\66\2\2\u010b\u010c\5@!\2\u010c\u010d\5F$\2\u010d?\3\2\2\2\u010e\u010f"+ + "\t\2\2\2\u010fA\3\2\2\2\u0110\u0111\7\66\2\2\u0111\u0112\5D#\2\u0112\u0113"+ + "\5F$\2\u0113C\3\2\2\2\u0114\u0115\t\3\2\2\u0115E\3\2\2\2\u0116\u0119\5"+ + "H%\2\u0117\u0119\7\65\2\2\u0118\u0116\3\2\2\2\u0118\u0117\3\2\2\2\u0119"+ + "G\3\2\2\2\u011a\u011b\t\4\2\2\u011bI\3\2\2\2\33KPTW[krv\u0081\u0087\u0091"+ + "\u0095\u0099\u00a4\u00ac\u00b0\u00b9\u00c8\u00d5\u00da\u00ed\u00f7\u00fe"+ + "\u0108\u0118"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/test/java/com/avaje/ebeaninternal/server/grammer/EqlParserTest.java b/src/test/java/com/avaje/ebeaninternal/server/grammer/EqlParserTest.java index fcf5e09da..e490ad0e6 100644 --- a/src/test/java/com/avaje/ebeaninternal/server/grammer/EqlParserTest.java +++ b/src/test/java/com/avaje/ebeaninternal/server/grammer/EqlParserTest.java @@ -1,5 +1,6 @@ package com.avaje.ebeaninternal.server.grammer; +import com.avaje.ebean.BaseTestCase; import com.avaje.ebean.Ebean; import com.avaje.ebean.Query; import com.avaje.ebeaninternal.api.SpiQuery; @@ -12,7 +13,7 @@ import java.util.List; import static org.assertj.core.api.Assertions.assertThat; -public class EqlParserTest { +public class EqlParserTest extends BaseTestCase { @Test public void where_eq() throws Exception { @@ -304,6 +305,32 @@ public class EqlParserTest { assertThat(query.getGeneratedSql()).contains("select distinct t0.name c0 from o_customer t0"); } + + @Test + public void limit() throws Exception { + + ResetBasicData.reset(); + + Query query = parse("limit 10"); + query.findList(); + if (isH2()) { + assertThat(query.getGeneratedSql()).contains(" limit 10"); + } + } + + @Test + public void limitOffset() throws Exception { + + ResetBasicData.reset(); + + Query query = parse("limit 10 offset 5"); + query.findList(); + if (isH2()) { + assertThat(query.getGeneratedSql()).contains(" limit 10 offset 5"); + } + } + + private Query parse(String raw) { Query query = Ebean.find(Customer.class); diff --git a/src/test/resources/EQL.g4 b/src/test/resources/EQL.g4 index e798e71a8..f028b3fab 100644 --- a/src/test/resources/EQL.g4 +++ b/src/test/resources/EQL.g4 @@ -1,11 +1,11 @@ grammar EQL; select_statement - : (select_clause)? (fetch_clause)* (where_clause)? + : select_clause? fetch_clause* where_clause? limit_clause? ; select_clause - : 'select' (distinct)? '(' fetch_property_group ')' + : 'select' distinct? '(' fetch_property_group ')' ; distinct @@ -20,6 +20,14 @@ where_clause : 'where' conditional_expression ; +limit_clause + : 'limit' NUMBER_LITERAL offset_clause? + ; + +offset_clause + : 'offset' NUMBER_LITERAL + ; + fetch_path : 'fetch' fetch_option? PATH_VARIABLE fetch_property_set? ; @@ -52,11 +60,11 @@ fetch_option ; fetch_query_option - : 'query' (fetch_batch_size)? + : 'query' fetch_batch_size? ; fetch_lazy_option - : 'lazy' (fetch_batch_size)? + : 'lazy' fetch_batch_size? ; fetch_batch_size @@ -64,15 +72,15 @@ fetch_batch_size ; conditional_expression - : (conditional_term) ('or' conditional_term)* + : conditional_term ('or' conditional_term)* ; conditional_term - : (conditional_factor) ('and' conditional_factor)* + : conditional_factor ('and' conditional_factor)* ; conditional_factor - : ('not')? conditional_primary + : 'not'? conditional_primary ; conditional_primary