This is an automated email from the ASF dual-hosted git repository. ntimofeev pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cayenne.git
The following commit(s) were added to refs/heads/master by this push: new 4d6cabd CAY-2663 Support for custom SQL operators new 518c95e Merge pull request #427 from stariy95/4.2-FEATURE-CAY-2663-sql-operators 4d6cabd is described below commit 4d6cabd77bd94e6c99ab4a285c7bf0127bb2a069 Author: Nikita Timofeev <stari...@gmail.com> AuthorDate: Thu Jun 11 11:27:38 2020 +0300 CAY-2663 Support for custom SQL operators --- RELEASE-NOTES.txt | 3 +- .../translator/select/QualifierTranslator.java | 12 +- .../java/org/apache/cayenne/exp/Expression.java | 5 + .../cayenne/exp/FunctionExpressionFactory.java | 12 + .../cayenne/exp/parser/ASTCustomOperator.java | 108 +++ .../cayenne/exp/parser/ExpressionParser.java | 207 ++-- .../exp/parser/ExpressionParserConstants.java | 87 +- .../exp/parser/ExpressionParserTokenManager.java | 1022 ++++++++++---------- .../exp/parser/ExpressionParserTreeConstants.java | 56 +- .../apache/cayenne/exp/property/BaseProperty.java | 27 +- .../apache/cayenne/exp/parser/ExpressionParser.jjt | 18 +- .../cayenne/exp/FunctionExpressionFactoryTest.java | 14 + .../cayenne/exp/parser/ASTCustomOperatorTest.java | 48 + .../cayenne/exp/property/BasePropertyTest.java | 34 + 14 files changed, 1012 insertions(+), 641 deletions(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 50d546d..03554d7 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -16,7 +16,8 @@ Changes/New Features: CAY-2338 Support comments in cgen and default templates CAY-2656 Modeler: option to download required jars directly from maven central CAY-2659 Use new SQLBuilder utility to generate SQL for batch queries -CAY-2662 Use custom interface for SQL tree processor istead of a Function<Node, Node> +CAY-2662 Use custom interface for SQL tree processor instead of a Function<Node, Node> +CAY-2663 Support for custom SQL operators CAY-2664 Add methods to EntityProperty to allow direct usage of primary key values Bug Fixes: diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/select/QualifierTranslator.java b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/select/QualifierTranslator.java index 64ae657..444d129 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/select/QualifierTranslator.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/select/QualifierTranslator.java @@ -47,6 +47,7 @@ import org.apache.cayenne.access.sqlbuilder.sqltree.OpExpressionNode; import org.apache.cayenne.access.sqlbuilder.sqltree.TextNode; import org.apache.cayenne.exp.Expression; import org.apache.cayenne.exp.TraversalHandler; +import org.apache.cayenne.exp.parser.ASTCustomOperator; import org.apache.cayenne.exp.parser.ASTDbIdPath; import org.apache.cayenne.exp.parser.ASTDbPath; import org.apache.cayenne.exp.parser.ASTFullObject; @@ -211,6 +212,9 @@ class QualifierTranslator implements TraversalHandler { case ASTERISK: return new TextNode(' ' + expToStr(node.getType())); + case CUSTOM_OP: + return new OpExpressionNode(((ASTCustomOperator)node).getOperator()); + case EXISTS: return new FunctionNode("EXISTS", null, false); case NOT_EXISTS: @@ -369,7 +373,7 @@ class QualifierTranslator implements TraversalHandler { case NOT_IN: case IN: case NOT_BETWEEN: case BETWEEN: case NOT: case BITWISE_NOT: case EQUAL_TO: case NOT_EQUAL_TO: case LIKE: case NOT_LIKE: case LIKE_IGNORE_CASE: case NOT_LIKE_IGNORE_CASE: case OBJ_PATH: case DBID_PATH: case DB_PATH: - case FUNCTION_CALL: case ADD: case SUBTRACT: case MULTIPLY: case DIVIDE: case NEGATIVE: + case FUNCTION_CALL: case ADD: case SUBTRACT: case MULTIPLY: case DIVIDE: case NEGATIVE: case CUSTOM_OP: case BITWISE_AND: case BITWISE_LEFT_SHIFT: case BITWISE_OR: case BITWISE_RIGHT_SHIFT: case BITWISE_XOR: case OR: case AND: case LESS_THAN: case LESS_THAN_EQUAL_TO: case GREATER_THAN: case GREATER_THAN_EQUAL_TO: case TRUE: case FALSE: case ASTERISK: case EXISTS: case NOT_EXISTS: case SUBQUERY: case ENCLOSING_OBJECT: case FULL_OBJECT: @@ -466,14 +470,14 @@ class QualifierTranslator implements TraversalHandler { return ">="; case ADD: return "+"; + case NEGATIVE: case SUBTRACT: return "-"; case MULTIPLY: + case ASTERISK: return "*"; case DIVIDE: return "/"; - case NEGATIVE: - return "-"; case BITWISE_AND: return "&"; case BITWISE_OR: @@ -490,8 +494,6 @@ class QualifierTranslator implements TraversalHandler { return "1=1"; case FALSE: return "1=0"; - case ASTERISK: - return "*"; default: return "{other}"; } diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java index 415659f..05debf5 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/Expression.java @@ -189,6 +189,11 @@ public abstract class Expression implements Serializable, XMLSerializable { */ public static final int DBID_PATH = 52; + /** + * @since 4.2 + */ + public static final int CUSTOM_OP = 53; + protected int type; /** diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/FunctionExpressionFactory.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/FunctionExpressionFactory.java index 8e93c7c..cf777d8 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/exp/FunctionExpressionFactory.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/FunctionExpressionFactory.java @@ -27,6 +27,7 @@ import org.apache.cayenne.exp.parser.ASTCurrentDate; import org.apache.cayenne.exp.parser.ASTCurrentTime; import org.apache.cayenne.exp.parser.ASTCurrentTimestamp; import org.apache.cayenne.exp.parser.ASTCustomFunction; +import org.apache.cayenne.exp.parser.ASTCustomOperator; import org.apache.cayenne.exp.parser.ASTDistinct; import org.apache.cayenne.exp.parser.ASTExtract; import org.apache.cayenne.exp.parser.ASTFunctionCall; @@ -538,6 +539,17 @@ public class FunctionExpressionFactory { return new ASTCustomFunction(function, args); } + /** + * @param operator to call + * @param args arguments + * @return expression to use custom "operator" with provided arguments + * + * @since 4.2 + */ + public static Expression operator(String operator, Object... args) { + return new ASTCustomOperator(operator, args); + } + static Expression extractExp(String path, ASTExtract.DateTimePart part) { return extractExp(ExpressionFactory.pathExp(path), part); } diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ASTCustomOperator.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ASTCustomOperator.java new file mode 100644 index 0000000..891f4d9 --- /dev/null +++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ASTCustomOperator.java @@ -0,0 +1,108 @@ +/***************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + ****************************************************************/ +package org.apache.cayenne.exp.parser; + +import java.io.IOException; + +import org.apache.cayenne.exp.Expression; + +/** + * @since 4.2 + */ +public class ASTCustomOperator extends SimpleNode { + + private String operator; + + public ASTCustomOperator(int id) { + super(id); + } + + public ASTCustomOperator(String operator) { + super(ExpressionParser.JJTCUSTOMOPERATOR); + this.operator = operator; + } + + public ASTCustomOperator(String operator, Object[] nodes) { + super(ExpressionParser.JJTCUSTOMOPERATOR); + this.operator = operator; + int len = nodes.length; + for (int i = 0; i < len; i++) { + jjtAddChild(wrapChild(nodes[i]), i); + } + + connectChildren(); + } + + @Override + public void jjtAddChild(Node n, int i) { + // First argument should be used as an operator when created by the expression parser + if(operator == null && i == 0) { + if(!(n instanceof ASTScalar)) { + throw new IllegalArgumentException("ASTScalar expected, got " + n); + } + this.operator = ((ASTScalar) n).getValue().toString(); + return; + } + super.jjtAddChild(n, operator != null ? i : --i); + } + + @Override + protected Object evaluateNode(Object o) throws Exception { + throw new UnsupportedOperationException("Can't evaluate custom operator in memory"); + } + + public void setOperator(String operator) { + this.operator = operator; + } + + @Override + public void appendAsString(Appendable out) throws IOException { + out.append("op(\"").append(operator).append("\""); + if ((children != null) && (children.length > 0)) { + for (Node child : children) { + out.append(", "); + if (child == null) { + out.append("null"); + } else { + ((SimpleNode) child).appendAsString(out); + } + } + } + out.append(")"); + } + + @Override + public int getType() { + return Expression.CUSTOM_OP; + } + + public String getOperator() { + return operator; + } + + @Override + protected String getExpressionOperator(int index) { + return operator; + } + + @Override + public Expression shallowCopy() { + return new ASTCustomOperator(operator); + } +} diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.java index ed46175..764f538 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParser.java @@ -173,7 +173,6 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case MAX: case SUM: case COUNT: - case FUNCTION: case CONCAT: case SUBSTRING: case TRIM: @@ -197,11 +196,13 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case HOUR: case MINUTE: case SECOND: - case 66: + case FUNCTION: + case OPERATOR: case 67: case 68: case 69: case 70: + case 71: case PROPERTY_PATH: case SINGLE_QUOTED_STRING: case DOUBLE_QUOTED_STRING: @@ -252,7 +253,6 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case MAX: case SUM: case COUNT: - case FUNCTION: case CONCAT: case SUBSTRING: case TRIM: @@ -276,11 +276,13 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case HOUR: case MINUTE: case SECOND: - case 66: + case FUNCTION: + case OPERATOR: case 67: case 68: case 69: case 70: + case 71: case PROPERTY_PATH: case SINGLE_QUOTED_STRING: case DOUBLE_QUOTED_STRING: @@ -550,7 +552,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon jjtree.openNodeScope(jjtn011); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 66: + case 67: namedParameter(); break; case 16: @@ -709,7 +711,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon jjtree.openNodeScope(jjtn003); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 66: + case 67: namedParameter(); break; case 16: @@ -824,7 +826,6 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case 25: case 26: case 28: - case FUNCTION: case LENGTH: case LOCATE: case ABS: @@ -840,11 +841,13 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case HOUR: case MINUTE: case SECOND: - case 66: + case FUNCTION: + case OPERATOR: case 67: case 68: case 69: case 70: + case 71: case PROPERTY_PATH: case INT_LITERAL: case FLOAT_LITERAL: @@ -892,10 +895,10 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon final public void stringParameter() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case 67: case 68: case 69: case 70: + case 71: case PROPERTY_PATH: pathExpression(); break; @@ -986,7 +989,6 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case MAX: case SUM: case COUNT: - case FUNCTION: case CONCAT: case SUBSTRING: case TRIM: @@ -1010,11 +1012,13 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case HOUR: case MINUTE: case SECOND: - case 66: + case FUNCTION: + case OPERATOR: case 67: case 68: case 69: case 70: + case 71: case PROPERTY_PATH: case SINGLE_QUOTED_STRING: case DOUBLE_QUOTED_STRING: @@ -1091,7 +1095,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon } } break; - case 66: + case 67: namedParameter(); break; case INT_LITERAL: @@ -1518,7 +1522,6 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case 16: case 25: case 26: - case FUNCTION: case LENGTH: case LOCATE: case ABS: @@ -1534,11 +1537,13 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case HOUR: case MINUTE: case SECOND: - case 66: + case FUNCTION: + case OPERATOR: case 67: case 68: case 69: case 70: + case 71: case PROPERTY_PATH: case INT_LITERAL: case FLOAT_LITERAL: @@ -1582,7 +1587,6 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 16: case 25: - case FUNCTION: case LENGTH: case LOCATE: case ABS: @@ -1598,11 +1602,13 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case HOUR: case MINUTE: case SECOND: - case 66: + case FUNCTION: + case OPERATOR: case 67: case 68: case 69: case 70: + case 71: case PROPERTY_PATH: case INT_LITERAL: case FLOAT_LITERAL: @@ -1687,7 +1693,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon } } break; - case 66: + case 67: namedParameter(); break; case LENGTH: @@ -1707,16 +1713,19 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case SECOND: functionsReturningNumerics(); break; - case 67: case 68: case 69: case 70: + case 71: case PROPERTY_PATH: pathExpression(); break; case FUNCTION: customFunction(); break; + case OPERATOR: + customOperator(); + break; default: jj_la1[32] = jj_gen; jj_consume_token(-1); @@ -1782,7 +1791,6 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case 25: case 26: case 28: - case FUNCTION: case LENGTH: case LOCATE: case ABS: @@ -1798,11 +1806,13 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case HOUR: case MINUTE: case SECOND: - case 66: + case FUNCTION: + case OPERATOR: case 67: case 68: case 69: case 70: + case 71: case PROPERTY_PATH: case INT_LITERAL: case FLOAT_LITERAL: @@ -1836,6 +1846,95 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon } } + final public void customOperator() throws ParseException { + /*@bgen(jjtree) CustomOperator */ + ASTCustomOperator jjtn000 = new ASTCustomOperator(JJTCUSTOMOPERATOR); + boolean jjtc000 = true; + jjtree.openNodeScope(jjtn000); + try { + jj_consume_token(OPERATOR); + jj_consume_token(16); + stringLiteral(); + label_11: + while (true) { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case 19: + ; + break; + default: + jj_la1[36] = jj_gen; + break label_11; + } + jj_consume_token(19); + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case CONCAT: + case SUBSTRING: + case TRIM: + case LOWER: + case UPPER: + case SINGLE_QUOTED_STRING: + case DOUBLE_QUOTED_STRING: + stringExpression(); + break; + case 16: + case 25: + case 26: + case 28: + case LENGTH: + case LOCATE: + case ABS: + case SQRT: + case MOD: + case YEAR: + case MONTH: + case WEEK: + case DAY_OF_YEAR: + case DAY: + case DAY_OF_MONTH: + case DAY_OF_WEEK: + case HOUR: + case MINUTE: + case SECOND: + case FUNCTION: + case OPERATOR: + case 67: + case 68: + case 69: + case 70: + case 71: + case PROPERTY_PATH: + case INT_LITERAL: + case FLOAT_LITERAL: + numericExpression(); + break; + default: + jj_la1[37] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + jj_consume_token(17); + } catch (Throwable jjte000) { + if (jjtc000) { + jjtree.clearNodeScope(jjtn000); + jjtc000 = false; + } else { + jjtree.popNode(); + } + if (jjte000 instanceof RuntimeException) { + {if (true) throw (RuntimeException)jjte000;} + } + if (jjte000 instanceof ParseException) { + {if (true) throw (ParseException)jjte000;} + } + {if (true) throw (Error)jjte000;} + } finally { + if (jjtc000) { + jjtree.closeNodeScope(jjtn000, true); + } + } + } + final public void concat() throws ParseException { /*@bgen(jjtree) Concat */ ASTConcat jjtn000 = new ASTConcat(JJTCONCAT); @@ -1845,15 +1944,15 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon jj_consume_token(CONCAT); jj_consume_token(16); stringParameter(); - label_11: + label_12: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 19: ; break; default: - jj_la1[36] = jj_gen; - break label_11; + jj_la1[38] = jj_gen; + break label_12; } jj_consume_token(19); stringParameter(); @@ -1897,7 +1996,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon numericExpression(); break; default: - jj_la1[37] = jj_gen; + jj_la1[39] = jj_gen; ; } jj_consume_token(17); @@ -2045,7 +2144,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon dateTimeExtractingFunction(); break; default: - jj_la1[38] = jj_gen; + jj_la1[40] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2099,7 +2198,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon numericExpression(); break; default: - jj_la1[39] = jj_gen; + jj_la1[41] = jj_gen; ; } jj_consume_token(17); @@ -2237,7 +2336,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon count(); break; default: - jj_la1[40] = jj_gen; + jj_la1[42] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2269,10 +2368,10 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon case ASTERISK: asterisk(); break; - case 67: case 68: case 69: case 70: + case 71: case PROPERTY_PATH: pathExpression(); break; @@ -2280,7 +2379,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon distinct(); break; default: - jj_la1[41] = jj_gen; + jj_la1[43] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2442,7 +2541,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon currentTimestamp(); break; default: - jj_la1[42] = jj_gen; + jj_la1[44] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2535,7 +2634,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon t = jj_consume_token(SECOND); break; default: - jj_la1[43] = jj_gen; + jj_la1[45] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2597,7 +2696,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon final public void namedParameter() throws ParseException { Token t; - jj_consume_token(66); + jj_consume_token(67); t = jj_consume_token(PROPERTY_PATH); ASTNamedParameter jjtn001 = new ASTNamedParameter(JJTNAMEDPARAMETER); boolean jjtc001 = true; @@ -2631,8 +2730,8 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon } } break; - case 67: - jj_consume_token(67); + case 68: + jj_consume_token(68); t = jj_consume_token(PROPERTY_PATH); ASTObjPath jjtn002 = new ASTObjPath(JJTOBJPATH); boolean jjtc002 = true; @@ -2647,8 +2746,8 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon } } break; - case 68: - jj_consume_token(68); + case 69: + jj_consume_token(69); t = jj_consume_token(PROPERTY_PATH); ASTDbPath jjtn003 = new ASTDbPath(JJTDBPATH); boolean jjtc003 = true; @@ -2663,8 +2762,8 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon } } break; - case 69: - jj_consume_token(69); + case 70: + jj_consume_token(70); t = jj_consume_token(PROPERTY_PATH); ASTEnum jjtn004 = new ASTEnum(JJTENUM); boolean jjtc004 = true; @@ -2679,8 +2778,8 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon } } break; - case 70: - jj_consume_token(70); + case 71: + jj_consume_token(71); t = jj_consume_token(PROPERTY_PATH); ASTDbIdPath jjtn005 = new ASTDbIdPath(JJTDBIDPATH); boolean jjtc005 = true; @@ -2696,7 +2795,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon } break; default: - jj_la1[44] = jj_gen; + jj_la1[46] = jj_gen; jj_consume_token(-1); throw new ParseException(); } @@ -2711,7 +2810,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon public Token jj_nt; private int jj_ntk; private int jj_gen; - final private int[] jj_la1 = new int[45]; + final private int[] jj_la1 = new int[47]; static private int[] jj_la1_0; static private int[] jj_la1_1; static private int[] jj_la1_2; @@ -2721,13 +2820,13 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon jj_la1_init_2(); } private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x2,0x4,0x18,0x16010018,0x60,0x180,0x10000,0x4fff8,0x4fff8,0x16010000,0x18,0x10000,0x4e000,0x80000,0x16010000,0x0,0x0,0x0,0x16010000,0x0,0x100000,0x200000,0x400000,0x1800000,0x1800000,0x6000000,0x6000000,0x8000000,0x8000000,0x16010000,0x2000000,0x6010000,0x10000,0x0,0x80000,0x16010000,0x80000,0x80000,0x0,0x80000,0x0,0x0,0x0,0x0,0x0,}; + jj_la1_0 = new int[] {0x2,0x4,0x18,0x16010018,0x60,0x180,0x10000,0x4fff8,0x4fff8,0x16010000,0x18,0x10000,0x4e000,0x80000,0x16010000,0x0,0x0,0x0,0x16010000,0x0,0x100000,0x200000,0x400000,0x1800000,0x1800000,0x6000000,0x6000000,0x8000000,0x8000000,0x16010000,0x2000000,0x6010000,0x10000,0x0,0x80000,0x16010000,0x80000,0x16010000,0x80000,0x80000,0x0,0x80000,0x0,0x0,0x0,0x0,0x0,}; } private static void jj_la1_init_1() { - jj_la1_1 = new int[] {0x0,0x0,0x0,0xfffffdfe,0x0,0x0,0x0,0x0,0x0,0xfffffdfe,0x0,0x0,0x0,0x0,0xfffffdf2,0xf800,0x0,0xf800,0xfffffdfe,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff1f0400,0x0,0xff1f0400,0xff1f0400,0xf800,0x0,0xff1ffc00,0x0,0x0,0xff1f0000,0x0,0x1f0,0x200,0xe00000,0xff000000,0x0,}; + jj_la1_1 = new int[] {0x0,0x0,0x0,0xfffffdfe,0x0,0x0,0x0,0x0,0x0,0xfffffdfe,0x0,0x0,0x0,0x0,0xfffffdf2,0x7c00,0x0,0x7c00,0xfffffdfe,0xc,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff8f8000,0x0,0xff8f8000,0xff8f8000,0x7c00,0x0,0xff8ffc00,0x0,0xff8ffc00,0x0,0x0,0xff8f8000,0x0,0x1f0,0x200,0x700000,0xff800000,0x0,}; } private static void jj_la1_init_2() { - jj_la1_2 = new int[] {0x0,0x0,0x0,0x39017f,0x0,0x0,0x4,0x0,0x0,0x39017f,0x0,0x4,0x0,0x0,0x39017f,0x90178,0x90000,0x90000,0x39017f,0x390004,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x80,0x30017f,0x0,0x30017f,0x30017f,0x0,0x0,0x39017f,0x0,0x0,0x3,0x0,0x0,0x1f8,0x0,0x3,0x178,}; + jj_la1_2 = new int[] {0x0,0x0,0x0,0x7202ff,0x0,0x0,0x8,0x0,0x0,0x7202ff,0x0,0x8,0x0,0x0,0x7202ff,0x1202f0,0x120000,0x120000,0x7202ff,0x720008,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x100,0x100,0x6002ff,0x0,0x6002ff,0x6002ff,0x0,0x0,0x7202ff,0x0,0x7202ff,0x0,0x0,0x1,0x0,0x0,0x3f0,0x0,0x1,0x2f0,}; } /** Constructor with InputStream. */ @@ -2741,7 +2840,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 45; i++) jj_la1[i] = -1; + for (int i = 0; i < 47; i++) jj_la1[i] = -1; } /** Reinitialise. */ @@ -2756,7 +2855,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon jj_ntk = -1; jjtree.reset(); jj_gen = 0; - for (int i = 0; i < 45; i++) jj_la1[i] = -1; + for (int i = 0; i < 47; i++) jj_la1[i] = -1; } /** Constructor. */ @@ -2766,7 +2865,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 45; i++) jj_la1[i] = -1; + for (int i = 0; i < 47; i++) jj_la1[i] = -1; } /** Reinitialise. */ @@ -2777,7 +2876,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon jj_ntk = -1; jjtree.reset(); jj_gen = 0; - for (int i = 0; i < 45; i++) jj_la1[i] = -1; + for (int i = 0; i < 47; i++) jj_la1[i] = -1; } /** Constructor with generated Token Manager. */ @@ -2786,7 +2885,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon token = new Token(); jj_ntk = -1; jj_gen = 0; - for (int i = 0; i < 45; i++) jj_la1[i] = -1; + for (int i = 0; i < 47; i++) jj_la1[i] = -1; } /** Reinitialise. */ @@ -2796,7 +2895,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon jj_ntk = -1; jjtree.reset(); jj_gen = 0; - for (int i = 0; i < 45; i++) jj_la1[i] = -1; + for (int i = 0; i < 47; i++) jj_la1[i] = -1; } private Token jj_consume_token(int kind) throws ParseException { @@ -2847,12 +2946,12 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon /** Generate ParseException. */ public ParseException generateParseException() { jj_expentries.clear(); - boolean[] la1tokens = new boolean[90]; + boolean[] la1tokens = new boolean[91]; if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } - for (int i = 0; i < 45; i++) { + for (int i = 0; i < 47; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1<<j)) != 0) { @@ -2867,7 +2966,7 @@ public class ExpressionParser/*@bgen(jjtree)*/implements ExpressionParserTreeCon } } } - for (int i = 0; i < 90; i++) { + for (int i = 0; i < 91; i++) { if (la1tokens[i]) { jj_expentry = new int[1]; jj_expentry[0] = i; diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserConstants.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserConstants.java index ee0b22b..8aef2e2 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserConstants.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserConstants.java @@ -49,83 +49,85 @@ public interface ExpressionParserConstants { /** RegularExpression Id. */ int DISTINCT = 41; /** RegularExpression Id. */ - int FUNCTION = 42; + int CONCAT = 42; /** RegularExpression Id. */ - int CONCAT = 43; + int SUBSTRING = 43; /** RegularExpression Id. */ - int SUBSTRING = 44; + int TRIM = 44; /** RegularExpression Id. */ - int TRIM = 45; + int LOWER = 45; /** RegularExpression Id. */ - int LOWER = 46; + int UPPER = 46; /** RegularExpression Id. */ - int UPPER = 47; + int LENGTH = 47; /** RegularExpression Id. */ - int LENGTH = 48; + int LOCATE = 48; /** RegularExpression Id. */ - int LOCATE = 49; + int ABS = 49; /** RegularExpression Id. */ - int ABS = 50; + int SQRT = 50; /** RegularExpression Id. */ - int SQRT = 51; + int MOD = 51; /** RegularExpression Id. */ - int MOD = 52; + int CURRENT_DATE = 52; /** RegularExpression Id. */ - int CURRENT_DATE = 53; + int CURRENT_TIME = 53; /** RegularExpression Id. */ - int CURRENT_TIME = 54; + int CURRENT_TIMESTAMP = 54; /** RegularExpression Id. */ - int CURRENT_TIMESTAMP = 55; + int YEAR = 55; /** RegularExpression Id. */ - int YEAR = 56; + int MONTH = 56; /** RegularExpression Id. */ - int MONTH = 57; + int WEEK = 57; /** RegularExpression Id. */ - int WEEK = 58; + int DAY_OF_YEAR = 58; /** RegularExpression Id. */ - int DAY_OF_YEAR = 59; + int DAY = 59; /** RegularExpression Id. */ - int DAY = 60; + int DAY_OF_MONTH = 60; /** RegularExpression Id. */ - int DAY_OF_MONTH = 61; + int DAY_OF_WEEK = 61; /** RegularExpression Id. */ - int DAY_OF_WEEK = 62; + int HOUR = 62; /** RegularExpression Id. */ - int HOUR = 63; + int MINUTE = 63; /** RegularExpression Id. */ - int MINUTE = 64; + int SECOND = 64; /** RegularExpression Id. */ - int SECOND = 65; + int FUNCTION = 65; /** RegularExpression Id. */ - int ASTERISK = 71; + int OPERATOR = 66; /** RegularExpression Id. */ - int PROPERTY_PATH = 72; + int ASTERISK = 72; /** RegularExpression Id. */ - int IDENTIFIER = 73; + int PROPERTY_PATH = 73; /** RegularExpression Id. */ - int LETTER = 74; + int IDENTIFIER = 74; /** RegularExpression Id. */ - int DIGIT = 75; + int LETTER = 75; /** RegularExpression Id. */ - int ESC = 78; + int DIGIT = 76; /** RegularExpression Id. */ - int SINGLE_QUOTED_STRING = 80; + int ESC = 79; /** RegularExpression Id. */ - int STRING_ESC = 81; + int SINGLE_QUOTED_STRING = 81; /** RegularExpression Id. */ - int DOUBLE_QUOTED_STRING = 83; + int STRING_ESC = 82; /** RegularExpression Id. */ - int INT_LITERAL = 84; + int DOUBLE_QUOTED_STRING = 84; /** RegularExpression Id. */ - int FLOAT_LITERAL = 85; + int INT_LITERAL = 85; /** RegularExpression Id. */ - int DEC_FLT = 86; + int FLOAT_LITERAL = 86; /** RegularExpression Id. */ - int DEC_DIGITS = 87; + int DEC_FLT = 87; /** RegularExpression Id. */ - int EXPONENT = 88; + int DEC_DIGITS = 88; /** RegularExpression Id. */ - int FLT_SUFF = 89; + int EXPONENT = 89; + /** RegularExpression Id. */ + int FLT_SUFF = 90; /** Lexical state. */ int DEFAULT = 0; @@ -178,7 +180,6 @@ public interface ExpressionParserConstants { "\"sum\"", "\"count\"", "\"distinct\"", - "\"fn\"", "\"concat\"", "\"substring\"", "\"trim\"", @@ -202,6 +203,8 @@ public interface ExpressionParserConstants { "\"hour\"", "\"minute\"", "\"second\"", + "\"fn\"", + "\"op\"", "\"$\"", "\"obj:\"", "\"db:\"", @@ -215,10 +218,10 @@ public interface ExpressionParserConstants { "\"\\\'\"", "\"\\\"\"", "<ESC>", - "<token of kind 79>", + "<token of kind 80>", "\"\\\'\"", "<STRING_ESC>", - "<token of kind 82>", + "<token of kind 83>", "\"\\\"\"", "<INT_LITERAL>", "<FLOAT_LITERAL>", diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java index 268e281..e66e7b4 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTokenManager.java @@ -108,132 +108,132 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) switch (pos) { case 0: - if ((active0 & 0x60090000000000L) != 0L) + if ((active0 & 0x30050000000000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; return 36; } if ((active0 & 0x8L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; return 63; } - if ((active0 & 0x200000000000L) != 0L) + if ((active0 & 0x100000000000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; return 6; } - if ((active0 & 0x40000000000L) != 0L) + if ((active1 & 0x2L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; return 15; } - if ((active0 & 0xff1fd2f00004e006L) != 0L || (active1 & 0x7bL) != 0L) + if ((active0 & 0xff8feaf00004e006L) != 0L || (active1 & 0xf5L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; return 83; } return -1; case 1: - if ((active0 & 0x40000008002L) != 0L) + if ((active0 & 0x8002L) != 0L || (active1 & 0x6L) != 0L) return 83; - if ((active0 & 0x200000000000L) != 0L) + if ((active0 & 0x100000000000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 1; return 5; } - if ((active0 & 0xff1fdbf000046004L) != 0L || (active1 & 0x7bL) != 0L) + if ((active0 & 0xff8feff000046004L) != 0L || (active1 & 0xf1L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 1; return 83; } - if ((active0 & 0x60000000000000L) != 0L) + if ((active0 & 0x30000000000000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 1; return 35; } if ((active0 & 0x8L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 1; return 64; } return -1; case 2: - if ((active0 & 0x781400f00000000cL) != 0L || (active1 & 0x1L) != 0L) - return 83; - if ((active0 & 0x60000000000000L) != 0L) + if ((active0 & 0x30000000000000L) != 0L) { if (jjmatchedPos != 2) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 2; } return 34; } - if ((active0 & 0x870bfb0000046000L) != 0L || (active1 & 0x6aL) != 0L) + if ((active0 & 0xbc0a00f00000000cL) != 0L) + return 83; + if ((active0 & 0x4385ff0000046000L) != 0L || (active1 & 0xd1L) != 0L) { if (jjmatchedPos != 2) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 2; } return 83; } return -1; case 3: - if ((active0 & 0x8508200000006000L) != 0L) + if ((active0 & 0x4284100000006000L) != 0L) return 83; - if ((active0 & 0x6a03db0000040000L) != 0L || (active1 & 0x63L) != 0L) + if ((active0 & 0xb501ef0000040000L) != 0L || (active1 & 0xc1L) != 0L) { if (jjmatchedPos != 3) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 3; } return 83; } - if ((active0 & 0x60000000000000L) != 0L) + if ((active0 & 0x30000000000000L) != 0L) { if (jjmatchedPos != 3) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 3; } return 33; } return -1; case 4: - if ((active0 & 0x200c10000000000L) != 0L) + if ((active0 & 0x100610000000000L) != 0L) return 83; - if ((active0 & 0x60000000000000L) != 0L) + if ((active0 & 0x30000000000000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 4; return 32; } - if ((active0 & 0x68031a0000044000L) != 0L || (active1 & 0x3L) != 0L) + if ((active0 & 0xb4018e0000044000L) != 0L || (active1 & 0x1L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 4; return 83; } return -1; case 5: - if ((active0 & 0x6800120000044000L) != 0L) + if ((active0 & 0x34000a0000044000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 5; return 83; } - if ((active0 & 0x3080000000000L) != 0L || (active1 & 0x3L) != 0L) + if ((active0 & 0x8001840000000000L) != 0L || (active1 & 0x1L) != 0L) return 83; - if ((active0 & 0x60000000000000L) != 0L) + if ((active0 & 0x30000000000000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 5; return 31; } @@ -241,75 +241,75 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) case 6: if ((active0 & 0x40000L) != 0L) return 83; - if ((active0 & 0x6800120000004000L) != 0L) + if ((active0 & 0x30000000000000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 6; - return 83; + return 30; } - if ((active0 & 0x60000000000000L) != 0L) + if ((active0 & 0x34000a0000004000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 6; - return 30; + return 83; } return -1; case 7: if ((active0 & 0x20000000000L) != 0L) return 83; - if ((active0 & 0x40000000000000L) != 0L) + if ((active0 & 0x20000000000000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 7; return 29; } - if ((active0 & 0x6820100000004000L) != 0L) + if ((active0 & 0x3410080000004000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 7; return 83; } return -1; case 8: - if ((active0 & 0x4800100000000000L) != 0L) + if ((active0 & 0x2400080000000000L) != 0L) return 83; - if ((active0 & 0x2020000000004000L) != 0L) + if ((active0 & 0x1010000000004000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 8; return 83; } - if ((active0 & 0x40000000000000L) != 0L) + if ((active0 & 0x20000000000000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 8; return 28; } return -1; case 9: - if ((active0 & 0x2000000000000000L) != 0L) + if ((active0 & 0x1000000000000000L) != 0L) return 83; - if ((active0 & 0x40000000000000L) != 0L) + if ((active0 & 0x20000000000000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 9; return 27; } - if ((active0 & 0x20000000004000L) != 0L) + if ((active0 & 0x10000000004000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 9; return 83; } return -1; case 10: - if ((active0 & 0x20000000000000L) != 0L) + if ((active0 & 0x10000000000000L) != 0L) return 83; - if ((active0 & 0x40000000000000L) != 0L) + if ((active0 & 0x20000000000000L) != 0L) return 26; if ((active0 & 0x4000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 10; return 83; } @@ -317,7 +317,7 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) case 11: if ((active0 & 0x4000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 11; return 83; } @@ -325,7 +325,7 @@ private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1) case 12: if ((active0 & 0x4000L) != 0L) { - jjmatchedKind = 72; + jjmatchedKind = 73; jjmatchedPos = 12; return 83; } @@ -352,19 +352,19 @@ private int jjMoveStringLiteralDfa0_0() jjmatchedKind = 4; return jjMoveStringLiteralDfa1_0(0x80L, 0x0L); case 34: - return jjStopAtPos(0, 77); + return jjStopAtPos(0, 78); case 36: - return jjStopAtPos(0, 66); + return jjStopAtPos(0, 67); case 38: return jjStopAtPos(0, 22); case 39: - return jjStopAtPos(0, 76); + return jjStopAtPos(0, 77); case 40: return jjStopAtPos(0, 16); case 41: return jjStopAtPos(0, 17); case 42: - return jjStopAtPos(0, 71); + return jjStopAtPos(0, 72); case 43: return jjStopAtPos(0, 25); case 44: @@ -385,39 +385,39 @@ private int jjMoveStringLiteralDfa0_0() case 94: return jjStopAtPos(0, 21); case 97: - return jjMoveStringLiteralDfa1_0(0x4001000000004L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x2001000000004L, 0x0L); case 98: return jjMoveStringLiteralDfa1_0(0x40000L, 0x0L); case 99: - return jjMoveStringLiteralDfa1_0(0x60090000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x30050000000000L, 0x0L); case 100: - return jjMoveStringLiteralDfa1_0(0x7800020000000000L, 0x50L); + return jjMoveStringLiteralDfa1_0(0x3c00020000000000L, 0xa0L); case 101: - return jjMoveStringLiteralDfa1_0(0x0L, 0x20L); + return jjMoveStringLiteralDfa1_0(0x0L, 0x40L); case 102: - return jjMoveStringLiteralDfa1_0(0x40000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x0L, 0x2L); case 104: - return jjMoveStringLiteralDfa1_0(0x8000000000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x4000000000000000L, 0x0L); case 105: return jjMoveStringLiteralDfa1_0(0x8000L, 0x0L); case 108: - return jjMoveStringLiteralDfa1_0(0x3400000006000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x1a00000006000L, 0x0L); case 109: - return jjMoveStringLiteralDfa1_0(0x210006000000000L, 0x1L); + return jjMoveStringLiteralDfa1_0(0x8108006000000000L, 0x0L); case 110: return jjMoveStringLiteralDfa1_0(0x8L, 0x0L); case 111: - return jjMoveStringLiteralDfa1_0(0x2L, 0x8L); + return jjMoveStringLiteralDfa1_0(0x2L, 0x14L); case 115: - return jjMoveStringLiteralDfa1_0(0x8108000000000L, 0x2L); + return jjMoveStringLiteralDfa1_0(0x4088000000000L, 0x1L); case 116: - return jjMoveStringLiteralDfa1_0(0x200000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x100000000000L, 0x0L); case 117: - return jjMoveStringLiteralDfa1_0(0x800000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x400000000000L, 0x0L); case 119: - return jjMoveStringLiteralDfa1_0(0x400000000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x200000000000000L, 0x0L); case 121: - return jjMoveStringLiteralDfa1_0(0x100000000000000L, 0x0L); + return jjMoveStringLiteralDfa1_0(0x80000000000000L, 0x0L); case 124: return jjStopAtPos(0, 20); case 126: @@ -456,31 +456,33 @@ private int jjMoveStringLiteralDfa1_0(long active0, long active1) return jjStopAtPos(1, 24); break; case 97: - return jjMoveStringLiteralDfa2_0(active0, 0x7800004000000000L, active1, 0L); + return jjMoveStringLiteralDfa2_0(active0, 0x3c00004000000000L, active1, 0L); case 98: - return jjMoveStringLiteralDfa2_0(active0, 0x4000000000000L, active1, 0x58L); + return jjMoveStringLiteralDfa2_0(active0, 0x2000000000000L, active1, 0xb0L); case 101: - return jjMoveStringLiteralDfa2_0(active0, 0x501000000040000L, active1, 0x2L); + return jjMoveStringLiteralDfa2_0(active0, 0x280800000040000L, active1, 0x1L); case 105: - return jjMoveStringLiteralDfa2_0(active0, 0x22000006000L, active1, 0x1L); + return jjMoveStringLiteralDfa2_0(active0, 0x8000022000006000L, active1, 0L); case 110: if ((active0 & 0x8000L) != 0L) return jjStartNfaWithStates_0(1, 15, 83); - else if ((active0 & 0x40000000000L) != 0L) - return jjStartNfaWithStates_0(1, 42, 83); - return jjMoveStringLiteralDfa2_0(active0, 0x4L, active1, 0x20L); + else if ((active1 & 0x2L) != 0L) + return jjStartNfaWithStates_0(1, 65, 83); + return jjMoveStringLiteralDfa2_0(active0, 0x4L, active1, 0x40L); case 111: - return jjMoveStringLiteralDfa2_0(active0, 0x8212490000000008L, active1, 0L); + return jjMoveStringLiteralDfa2_0(active0, 0x4109250000000008L, active1, 0L); case 112: - return jjMoveStringLiteralDfa2_0(active0, 0x800000000000L, active1, 0L); + if ((active1 & 0x4L) != 0L) + return jjStartNfaWithStates_0(1, 66, 83); + return jjMoveStringLiteralDfa2_0(active0, 0x400000000000L, active1, 0L); case 113: - return jjMoveStringLiteralDfa2_0(active0, 0x8000000000000L, active1, 0L); + return jjMoveStringLiteralDfa2_0(active0, 0x4000000000000L, active1, 0L); case 114: if ((active0 & 0x2L) != 0L) return jjStartNfaWithStates_0(1, 1, 83); - return jjMoveStringLiteralDfa2_0(active0, 0x200000000000L, active1, 0L); + return jjMoveStringLiteralDfa2_0(active0, 0x100000000000L, active1, 0L); case 117: - return jjMoveStringLiteralDfa2_0(active0, 0x60108000000000L, active1, 0L); + return jjMoveStringLiteralDfa2_0(active0, 0x30088000000000L, active1, 0L); case 118: return jjMoveStringLiteralDfa2_0(active0, 0x1000000000L, active1, 0L); default : @@ -500,31 +502,31 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long a switch(curChar) { case 58: - if ((active1 & 0x10L) != 0L) - return jjStopAtPos(2, 68); + if ((active1 & 0x20L) != 0L) + return jjStopAtPos(2, 69); break; case 97: - return jjMoveStringLiteralDfa3_0(active0, 0x100000000000000L, active1, 0L); + return jjMoveStringLiteralDfa3_0(active0, 0x80000000000000L, active1, 0L); case 98: - return jjMoveStringLiteralDfa3_0(active0, 0x100000000000L, active1, 0L); + return jjMoveStringLiteralDfa3_0(active0, 0x80000000000L, active1, 0L); case 99: - return jjMoveStringLiteralDfa3_0(active0, 0x2000000000000L, active1, 0x2L); + return jjMoveStringLiteralDfa3_0(active0, 0x1000000000000L, active1, 0x1L); case 100: if ((active0 & 0x4L) != 0L) return jjStartNfaWithStates_0(2, 2, 83); - else if ((active0 & 0x10000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 52, 83); + else if ((active0 & 0x8000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 51, 83); break; case 101: - return jjMoveStringLiteralDfa3_0(active0, 0x400000000000000L, active1, 0L); + return jjMoveStringLiteralDfa3_0(active0, 0x200000000000000L, active1, 0L); case 103: if ((active0 & 0x1000000000L) != 0L) return jjStartNfaWithStates_0(2, 36, 83); break; case 105: - return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L, active1, 0x40L); + return jjMoveStringLiteralDfa3_0(active0, 0x100000000000L, active1, 0x80L); case 106: - return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x8L); + return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x10L); case 107: return jjMoveStringLiteralDfa3_0(active0, 0x6000L, active1, 0L); case 109: @@ -537,34 +539,34 @@ private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long a jjmatchedKind = 37; jjmatchedPos = 2; } - return jjMoveStringLiteralDfa3_0(active0, 0x201080000000000L, active1, 0x1L); + return jjMoveStringLiteralDfa3_0(active0, 0x8100840000000000L, active1, 0L); case 112: - return jjMoveStringLiteralDfa3_0(active0, 0x800000000000L, active1, 0L); + return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L, active1, 0L); case 114: - return jjMoveStringLiteralDfa3_0(active0, 0x68000000000000L, active1, 0L); + return jjMoveStringLiteralDfa3_0(active0, 0x34000000000000L, active1, 0L); case 115: - if ((active0 & 0x4000000000000L) != 0L) - return jjStartNfaWithStates_0(2, 50, 83); + if ((active0 & 0x2000000000000L) != 0L) + return jjStartNfaWithStates_0(2, 49, 83); return jjMoveStringLiteralDfa3_0(active0, 0x20000000000L, active1, 0L); case 116: if ((active0 & 0x8L) != 0L) return jjStartNfaWithStates_0(2, 3, 83); return jjMoveStringLiteralDfa3_0(active0, 0x40000L, active1, 0L); case 117: - return jjMoveStringLiteralDfa3_0(active0, 0x8000010000000000L, active1, 0x20L); + return jjMoveStringLiteralDfa3_0(active0, 0x4000010000000000L, active1, 0x40L); case 119: - return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L, active1, 0L); + return jjMoveStringLiteralDfa3_0(active0, 0x200000000000L, active1, 0L); case 120: if ((active0 & 0x4000000000L) != 0L) return jjStartNfaWithStates_0(2, 38, 83); break; case 121: - if ((active0 & 0x1000000000000000L) != 0L) + if ((active0 & 0x800000000000000L) != 0L) { - jjmatchedKind = 60; + jjmatchedKind = 59; jjmatchedPos = 2; } - return jjMoveStringLiteralDfa3_0(active0, 0x6800000000000000L, active1, 0L); + return jjMoveStringLiteralDfa3_0(active0, 0x3400000000000000L, active1, 0L); default : break; } @@ -582,52 +584,52 @@ private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long a switch(curChar) { case 58: - if ((active1 & 0x8L) != 0L) - return jjStopAtPos(3, 67); + if ((active1 & 0x10L) != 0L) + return jjStopAtPos(3, 68); break; case 79: - return jjMoveStringLiteralDfa4_0(active0, 0x6800000000000000L, active1, 0L); + return jjMoveStringLiteralDfa4_0(active0, 0x3400000000000000L, active1, 0L); case 97: - return jjMoveStringLiteralDfa4_0(active0, 0x2000000000000L, active1, 0L); + return jjMoveStringLiteralDfa4_0(active0, 0x1000000000000L, active1, 0L); case 99: - return jjMoveStringLiteralDfa4_0(active0, 0x80000000000L, active1, 0L); + return jjMoveStringLiteralDfa4_0(active0, 0x40000000000L, active1, 0L); case 100: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x40L); + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x80L); case 101: if ((active0 & 0x2000L) != 0L) { jjmatchedKind = 13; jjmatchedPos = 3; } - return jjMoveStringLiteralDfa4_0(active0, 0xc00000004000L, active1, 0L); + return jjMoveStringLiteralDfa4_0(active0, 0x600000004000L, active1, 0L); case 103: - return jjMoveStringLiteralDfa4_0(active0, 0x1000000000000L, active1, 0L); + return jjMoveStringLiteralDfa4_0(active0, 0x800000000000L, active1, 0L); case 107: - if ((active0 & 0x400000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 58, 83); + if ((active0 & 0x200000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 57, 83); break; case 109: - if ((active0 & 0x200000000000L) != 0L) - return jjStartNfaWithStates_0(3, 45, 83); - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x20L); + if ((active0 & 0x100000000000L) != 0L) + return jjStartNfaWithStates_0(3, 44, 83); + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x40L); case 110: return jjMoveStringLiteralDfa4_0(active0, 0x10000000000L, active1, 0L); case 111: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x2L); + return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x1L); case 114: - if ((active0 & 0x100000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 56, 83); - else if ((active0 & 0x8000000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 63, 83); - return jjMoveStringLiteralDfa4_0(active0, 0x60000000000000L, active1, 0L); + if ((active0 & 0x80000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 55, 83); + else if ((active0 & 0x4000000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 62, 83); + return jjMoveStringLiteralDfa4_0(active0, 0x30000000000000L, active1, 0L); case 115: - return jjMoveStringLiteralDfa4_0(active0, 0x100000000000L, active1, 0L); + return jjMoveStringLiteralDfa4_0(active0, 0x80000000000L, active1, 0L); case 116: - if ((active0 & 0x8000000000000L) != 0L) - return jjStartNfaWithStates_0(3, 51, 83); - return jjMoveStringLiteralDfa4_0(active0, 0x200020000000000L, active1, 0L); + if ((active0 & 0x4000000000000L) != 0L) + return jjStartNfaWithStates_0(3, 50, 83); + return jjMoveStringLiteralDfa4_0(active0, 0x100020000000000L, active1, 0L); case 117: - return jjMoveStringLiteralDfa4_0(active0, 0L, active1, 0x1L); + return jjMoveStringLiteralDfa4_0(active0, 0x8000000000000000L, active1, 0L); case 119: return jjMoveStringLiteralDfa4_0(active0, 0x40000L, active1, 0L); default : @@ -647,37 +649,37 @@ private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long a switch(curChar) { case 58: - if ((active1 & 0x20L) != 0L) - return jjStopAtPos(4, 69); - else if ((active1 & 0x40L) != 0L) + if ((active1 & 0x40L) != 0L) return jjStopAtPos(4, 70); + else if ((active1 & 0x80L) != 0L) + return jjStopAtPos(4, 71); break; case 73: return jjMoveStringLiteralDfa5_0(active0, 0x4000L, active1, 0L); case 97: - return jjMoveStringLiteralDfa5_0(active0, 0x80000000000L, active1, 0L); + return jjMoveStringLiteralDfa5_0(active0, 0x40000000000L, active1, 0L); case 101: - return jjMoveStringLiteralDfa5_0(active0, 0x60000000040000L, active1, 0L); + return jjMoveStringLiteralDfa5_0(active0, 0x30000000040000L, active1, 0L); case 102: - return jjMoveStringLiteralDfa5_0(active0, 0x6800000000000000L, active1, 0L); + return jjMoveStringLiteralDfa5_0(active0, 0x3400000000000000L, active1, 0L); case 104: - if ((active0 & 0x200000000000000L) != 0L) - return jjStartNfaWithStates_0(4, 57, 83); + if ((active0 & 0x100000000000000L) != 0L) + return jjStartNfaWithStates_0(4, 56, 83); break; case 105: return jjMoveStringLiteralDfa5_0(active0, 0x20000000000L, active1, 0L); case 110: - return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x2L); + return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x1L); case 114: - if ((active0 & 0x400000000000L) != 0L) + if ((active0 & 0x200000000000L) != 0L) + return jjStartNfaWithStates_0(4, 45, 83); + else if ((active0 & 0x400000000000L) != 0L) return jjStartNfaWithStates_0(4, 46, 83); - else if ((active0 & 0x800000000000L) != 0L) - return jjStartNfaWithStates_0(4, 47, 83); break; case 116: if ((active0 & 0x10000000000L) != 0L) return jjStartNfaWithStates_0(4, 40, 83); - return jjMoveStringLiteralDfa5_0(active0, 0x3100000000000L, active1, 0x1L); + return jjMoveStringLiteralDfa5_0(active0, 0x8001880000000000L, active1, 0L); default : break; } @@ -695,34 +697,34 @@ private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long a switch(curChar) { case 77: - return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000000L, active1, 0L); + return jjMoveStringLiteralDfa6_0(active0, 0x1000000000000000L, active1, 0L); case 87: - return jjMoveStringLiteralDfa6_0(active0, 0x4000000000000000L, active1, 0L); + return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000000L, active1, 0L); case 89: - return jjMoveStringLiteralDfa6_0(active0, 0x800000000000000L, active1, 0L); + return jjMoveStringLiteralDfa6_0(active0, 0x400000000000000L, active1, 0L); case 100: - if ((active1 & 0x2L) != 0L) - return jjStartNfaWithStates_0(5, 65, 83); + if ((active1 & 0x1L) != 0L) + return jjStartNfaWithStates_0(5, 64, 83); break; case 101: - if ((active0 & 0x2000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 49, 83); - else if ((active1 & 0x1L) != 0L) - return jjStartNfaWithStates_0(5, 64, 83); + if ((active0 & 0x1000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 48, 83); + else if ((active0 & 0x8000000000000000L) != 0L) + return jjStartNfaWithStates_0(5, 63, 83); return jjMoveStringLiteralDfa6_0(active0, 0x40000L, active1, 0L); case 103: return jjMoveStringLiteralDfa6_0(active0, 0x4000L, active1, 0L); case 104: - if ((active0 & 0x1000000000000L) != 0L) - return jjStartNfaWithStates_0(5, 48, 83); + if ((active0 & 0x800000000000L) != 0L) + return jjStartNfaWithStates_0(5, 47, 83); break; case 110: - return jjMoveStringLiteralDfa6_0(active0, 0x60020000000000L, active1, 0L); + return jjMoveStringLiteralDfa6_0(active0, 0x30020000000000L, active1, 0L); case 114: - return jjMoveStringLiteralDfa6_0(active0, 0x100000000000L, active1, 0L); + return jjMoveStringLiteralDfa6_0(active0, 0x80000000000L, active1, 0L); case 116: - if ((active0 & 0x80000000000L) != 0L) - return jjStartNfaWithStates_0(5, 43, 83); + if ((active0 & 0x40000000000L) != 0L) + return jjStartNfaWithStates_0(5, 42, 83); break; default : break; @@ -743,17 +745,17 @@ private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long a case 99: return jjMoveStringLiteralDfa7_0(active0, 0x20000000000L); case 101: - return jjMoveStringLiteralDfa7_0(active0, 0x4800000000000000L); + return jjMoveStringLiteralDfa7_0(active0, 0x2400000000000000L); case 105: - return jjMoveStringLiteralDfa7_0(active0, 0x100000000000L); + return jjMoveStringLiteralDfa7_0(active0, 0x80000000000L); case 110: if ((active0 & 0x40000L) != 0L) return jjStartNfaWithStates_0(6, 18, 83); return jjMoveStringLiteralDfa7_0(active0, 0x4000L); case 111: - return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000000L); + return jjMoveStringLiteralDfa7_0(active0, 0x1000000000000000L); case 116: - return jjMoveStringLiteralDfa7_0(active0, 0x60000000000000L); + return jjMoveStringLiteralDfa7_0(active0, 0x30000000000000L); default : break; } @@ -771,15 +773,15 @@ private int jjMoveStringLiteralDfa7_0(long old0, long active0) switch(curChar) { case 68: - return jjMoveStringLiteralDfa8_0(active0, 0x20000000000000L); + return jjMoveStringLiteralDfa8_0(active0, 0x10000000000000L); case 84: - return jjMoveStringLiteralDfa8_0(active0, 0x40000000000000L); + return jjMoveStringLiteralDfa8_0(active0, 0x20000000000000L); case 97: - return jjMoveStringLiteralDfa8_0(active0, 0x800000000000000L); + return jjMoveStringLiteralDfa8_0(active0, 0x400000000000000L); case 101: - return jjMoveStringLiteralDfa8_0(active0, 0x4000000000000000L); + return jjMoveStringLiteralDfa8_0(active0, 0x2000000000000000L); case 110: - return jjMoveStringLiteralDfa8_0(active0, 0x2000100000000000L); + return jjMoveStringLiteralDfa8_0(active0, 0x1000080000000000L); case 111: return jjMoveStringLiteralDfa8_0(active0, 0x4000L); case 116: @@ -803,23 +805,23 @@ private int jjMoveStringLiteralDfa8_0(long old0, long active0) switch(curChar) { case 97: - return jjMoveStringLiteralDfa9_0(active0, 0x20000000000000L); + return jjMoveStringLiteralDfa9_0(active0, 0x10000000000000L); case 103: - if ((active0 & 0x100000000000L) != 0L) - return jjStartNfaWithStates_0(8, 44, 83); + if ((active0 & 0x80000000000L) != 0L) + return jjStartNfaWithStates_0(8, 43, 83); break; case 105: - return jjMoveStringLiteralDfa9_0(active0, 0x40000000000000L); + return jjMoveStringLiteralDfa9_0(active0, 0x20000000000000L); case 107: - if ((active0 & 0x4000000000000000L) != 0L) - return jjStartNfaWithStates_0(8, 62, 83); + if ((active0 & 0x2000000000000000L) != 0L) + return jjStartNfaWithStates_0(8, 61, 83); break; case 114: - if ((active0 & 0x800000000000000L) != 0L) - return jjStartNfaWithStates_0(8, 59, 83); + if ((active0 & 0x400000000000000L) != 0L) + return jjStartNfaWithStates_0(8, 58, 83); return jjMoveStringLiteralDfa9_0(active0, 0x4000L); case 116: - return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000000L); + return jjMoveStringLiteralDfa9_0(active0, 0x1000000000000000L); default : break; } @@ -839,13 +841,13 @@ private int jjMoveStringLiteralDfa9_0(long old0, long active0) case 101: return jjMoveStringLiteralDfa10_0(active0, 0x4000L); case 104: - if ((active0 & 0x2000000000000000L) != 0L) - return jjStartNfaWithStates_0(9, 61, 83); + if ((active0 & 0x1000000000000000L) != 0L) + return jjStartNfaWithStates_0(9, 60, 83); break; case 109: - return jjMoveStringLiteralDfa10_0(active0, 0x40000000000000L); - case 116: return jjMoveStringLiteralDfa10_0(active0, 0x20000000000000L); + case 116: + return jjMoveStringLiteralDfa10_0(active0, 0x10000000000000L); default : break; } @@ -865,10 +867,10 @@ private int jjMoveStringLiteralDfa10_0(long old0, long active0) case 67: return jjMoveStringLiteralDfa11_0(active0, 0x4000L); case 101: - if ((active0 & 0x20000000000000L) != 0L) - return jjStartNfaWithStates_0(10, 53, 83); - else if ((active0 & 0x40000000000000L) != 0L) - return jjStartNfaWithStates_0(10, 54, 26); + if ((active0 & 0x10000000000000L) != 0L) + return jjStartNfaWithStates_0(10, 52, 83); + else if ((active0 & 0x20000000000000L) != 0L) + return jjStartNfaWithStates_0(10, 53, 26); break; default : break; @@ -960,14 +962,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 33: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -975,14 +977,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -991,14 +993,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 5: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1006,14 +1008,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1022,14 +1024,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 28: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1037,14 +1039,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1053,14 +1055,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 64: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1068,14 +1070,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1084,14 +1086,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 32: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1099,14 +1101,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1115,14 +1117,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 36: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1130,14 +1132,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1146,14 +1148,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 27: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1161,14 +1163,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1181,28 +1183,28 @@ private int jjMoveNfa_0(int startState, int curPos) jjCheckNAdd(42); if ((0x3fe000000000000L & l) != 0L) { - if (kind > 84) - kind = 84; + if (kind > 85) + kind = 85; jjCheckNAddTwoStates(39, 40); } else if (curChar == 48) { - if (kind > 84) - kind = 84; + if (kind > 85) + kind = 85; jjCheckNAddStates(13, 15); } break; case 31: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1210,14 +1212,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1226,14 +1228,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 63: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1241,14 +1243,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1257,14 +1259,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 15: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1272,14 +1274,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1288,14 +1290,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 35: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1303,14 +1305,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1319,14 +1321,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 26: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1334,14 +1336,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1350,14 +1352,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 30: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1365,14 +1367,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1381,14 +1383,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 83: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1396,14 +1398,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1412,14 +1414,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 34: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1427,14 +1429,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1443,14 +1445,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 6: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1458,14 +1460,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1474,14 +1476,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 29: if ((0x3ff000000000000L & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } else if (curChar == 43) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; } else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 80; @@ -1489,14 +1491,14 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 73; if ((0x3ff000000000000L & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } else if (curChar == 43) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); } else if (curChar == 35) @@ -1505,15 +1507,15 @@ private int jjMoveNfa_0(int startState, int curPos) case 38: if ((0x3fe000000000000L & l) == 0L) break; - if (kind > 84) - kind = 84; + if (kind > 85) + kind = 85; jjCheckNAddTwoStates(39, 40); break; case 39: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 84) - kind = 84; + if (kind > 85) + kind = 85; jjCheckNAddTwoStates(39, 40); break; case 41: @@ -1523,8 +1525,8 @@ private int jjMoveNfa_0(int startState, int curPos) case 42: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 85) - kind = 85; + if (kind > 86) + kind = 86; jjCheckNAddStates(16, 18); break; case 44: @@ -1534,8 +1536,8 @@ private int jjMoveNfa_0(int startState, int curPos) case 45: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 85) - kind = 85; + if (kind > 86) + kind = 86; jjCheckNAddTwoStates(45, 46); break; case 47: @@ -1549,15 +1551,15 @@ private int jjMoveNfa_0(int startState, int curPos) case 49: if (curChar != 46) break; - if (kind > 85) - kind = 85; + if (kind > 86) + kind = 86; jjCheckNAddStates(19, 21); break; case 50: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 85) - kind = 85; + if (kind > 86) + kind = 86; jjCheckNAddStates(19, 21); break; case 51: @@ -1571,8 +1573,8 @@ private int jjMoveNfa_0(int startState, int curPos) case 54: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 85) - kind = 85; + if (kind > 86) + kind = 86; jjCheckNAddTwoStates(54, 46); break; case 55: @@ -1582,29 +1584,29 @@ private int jjMoveNfa_0(int startState, int curPos) case 56: if (curChar != 48) break; - if (kind > 84) - kind = 84; + if (kind > 85) + kind = 85; jjCheckNAddStates(13, 15); break; case 57: if ((0xff000000000000L & l) == 0L) break; - if (kind > 84) - kind = 84; + if (kind > 85) + kind = 85; jjCheckNAddTwoStates(57, 40); break; case 59: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 84) - kind = 84; + if (kind > 85) + kind = 85; jjCheckNAddTwoStates(59, 40); break; case 67: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); break; case 68: @@ -1614,15 +1616,15 @@ private int jjMoveNfa_0(int startState, int curPos) case 70: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(22, 24); break; case 71: if (curChar != 43) break; - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAdd(72); break; case 72: @@ -1632,8 +1634,8 @@ private int jjMoveNfa_0(int startState, int curPos) case 74: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(25, 28); break; case 75: @@ -1643,15 +1645,15 @@ private int jjMoveNfa_0(int startState, int curPos) case 77: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(29, 31); break; case 78: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); break; case 79: @@ -1661,13 +1663,13 @@ private int jjMoveNfa_0(int startState, int curPos) case 81: if ((0x3ff000000000000L & l) == 0L) break; - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddTwoStates(81, 82); break; case 82: - if (curChar == 43 && kind > 73) - kind = 73; + if (curChar == 43 && kind > 74) + kind = 74; break; default : break; } @@ -1683,14 +1685,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 33: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 101) @@ -1699,14 +1701,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 5: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 117) @@ -1715,14 +1717,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 28: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 109) @@ -1731,33 +1733,33 @@ private int jjMoveNfa_0(int startState, int curPos) case 64: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 119) { - if (kind > 55) - kind = 55; + if (kind > 54) + kind = 54; } break; case 32: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 110) @@ -1766,14 +1768,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 36: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 117) @@ -1782,14 +1784,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 27: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 101) @@ -1798,8 +1800,8 @@ private int jjMoveNfa_0(int startState, int curPos) case 3: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(32, 38); } if (curChar == 110) @@ -1820,14 +1822,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 31: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 116) @@ -1836,14 +1838,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 63: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 111) @@ -1854,14 +1856,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 15: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 97) @@ -1870,14 +1872,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 35: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 114) @@ -1886,14 +1888,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 26: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 115) @@ -1902,14 +1904,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 30: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 84) @@ -1918,28 +1920,28 @@ private int jjMoveNfa_0(int startState, int curPos) case 83: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } break; case 34: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 114) @@ -1948,14 +1950,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 6: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 114) @@ -1964,14 +1966,14 @@ private int jjMoveNfa_0(int startState, int curPos) case 29: if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); } if ((0x7fffffe87fffffeL & l) != 0L) { - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); } if (curChar == 105) @@ -2050,8 +2052,8 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 20; break; case 22: - if (curChar == 112 && kind > 55) - kind = 55; + if (curChar == 112 && kind > 54) + kind = 54; break; case 23: if (curChar == 109) @@ -2070,16 +2072,16 @@ private int jjMoveNfa_0(int startState, int curPos) jjstateSet[jjnewStateCnt++] = 36; break; case 40: - if ((0x110000001100L & l) != 0L && kind > 84) - kind = 84; + if ((0x110000001100L & l) != 0L && kind > 85) + kind = 85; break; case 43: if ((0x2000000020L & l) != 0L) jjAddStates(41, 42); break; case 46: - if ((0x5400000054L & l) != 0L && kind > 85) - kind = 85; + if ((0x5400000054L & l) != 0L && kind > 86) + kind = 86; break; case 52: if ((0x2000000020L & l) != 0L) @@ -2092,8 +2094,8 @@ private int jjMoveNfa_0(int startState, int curPos) case 59: if ((0x7e0000007eL & l) == 0L) break; - if (kind > 84) - kind = 84; + if (kind > 85) + kind = 85; jjCheckNAddTwoStates(59, 40); break; case 60: @@ -2115,54 +2117,54 @@ private int jjMoveNfa_0(int startState, int curPos) case 66: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(32, 38); break; case 67: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(3, 6); break; case 69: case 70: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(22, 24); break; case 73: case 74: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(25, 28); break; case 76: case 77: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 72) - kind = 72; + if (kind > 73) + kind = 73; jjCheckNAddStates(29, 31); break; case 78: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddStates(0, 2); break; case 80: case 81: if ((0x7fffffe87fffffeL & l) == 0L) break; - if (kind > 73) - kind = 73; + if (kind > 74) + kind = 74; jjCheckNAddTwoStates(81, 82); break; default : break; @@ -2214,7 +2216,7 @@ private int jjMoveStringLiteralDfa0_1() switch(curChar) { case 39: - return jjStopAtPos(0, 80); + return jjStopAtPos(0, 81); default : return jjMoveNfa_1(0, 0); } @@ -2244,12 +2246,12 @@ private int jjMoveNfa_1(int startState, int curPos) switch(jjstateSet[--i]) { case 0: - if ((0xffffff7fffffffffL & l) != 0L && kind > 79) - kind = 79; + if ((0xffffff7fffffffffL & l) != 0L && kind > 80) + kind = 80; break; case 1: - if ((0x8400000000L & l) != 0L && kind > 78) - kind = 78; + if ((0x8400000000L & l) != 0L && kind > 79) + kind = 79; break; case 2: if ((0xf000000000000L & l) != 0L) @@ -2258,13 +2260,13 @@ private int jjMoveNfa_1(int startState, int curPos) case 3: if ((0xff000000000000L & l) == 0L) break; - if (kind > 78) - kind = 78; + if (kind > 79) + kind = 79; jjstateSet[jjnewStateCnt++] = 4; break; case 4: - if ((0xff000000000000L & l) != 0L && kind > 78) - kind = 78; + if ((0xff000000000000L & l) != 0L && kind > 79) + kind = 79; break; default : break; } @@ -2280,19 +2282,19 @@ private int jjMoveNfa_1(int startState, int curPos) case 0: if ((0xffffffffefffffffL & l) != 0L) { - if (kind > 79) - kind = 79; + if (kind > 80) + kind = 80; } else if (curChar == 92) jjAddStates(45, 47); break; case 1: - if ((0x14404510000000L & l) != 0L && kind > 78) - kind = 78; + if ((0x14404510000000L & l) != 0L && kind > 79) + kind = 79; break; case 5: - if ((0xffffffffefffffffL & l) != 0L && kind > 79) - kind = 79; + if ((0xffffffffefffffffL & l) != 0L && kind > 80) + kind = 80; break; default : break; } @@ -2310,8 +2312,8 @@ private int jjMoveNfa_1(int startState, int curPos) switch(jjstateSet[--i]) { case 0: - if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 79) - kind = 79; + if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 80) + kind = 80; break; default : break; } @@ -2347,7 +2349,7 @@ private int jjMoveStringLiteralDfa0_2() switch(curChar) { case 34: - return jjStopAtPos(0, 83); + return jjStopAtPos(0, 84); default : return jjMoveNfa_2(0, 0); } @@ -2371,12 +2373,12 @@ private int jjMoveNfa_2(int startState, int curPos) switch(jjstateSet[--i]) { case 0: - if ((0xfffffffbffffffffL & l) != 0L && kind > 82) - kind = 82; + if ((0xfffffffbffffffffL & l) != 0L && kind > 83) + kind = 83; break; case 1: - if ((0x8400000000L & l) != 0L && kind > 81) - kind = 81; + if ((0x8400000000L & l) != 0L && kind > 82) + kind = 82; break; case 2: if ((0xf000000000000L & l) != 0L) @@ -2385,13 +2387,13 @@ private int jjMoveNfa_2(int startState, int curPos) case 3: if ((0xff000000000000L & l) == 0L) break; - if (kind > 81) - kind = 81; + if (kind > 82) + kind = 82; jjstateSet[jjnewStateCnt++] = 4; break; case 4: - if ((0xff000000000000L & l) != 0L && kind > 81) - kind = 81; + if ((0xff000000000000L & l) != 0L && kind > 82) + kind = 82; break; default : break; } @@ -2407,19 +2409,19 @@ private int jjMoveNfa_2(int startState, int curPos) case 0: if ((0xffffffffefffffffL & l) != 0L) { - if (kind > 82) - kind = 82; + if (kind > 83) + kind = 83; } else if (curChar == 92) jjAddStates(45, 47); break; case 1: - if ((0x14404510000000L & l) != 0L && kind > 81) - kind = 81; + if ((0x14404510000000L & l) != 0L && kind > 82) + kind = 82; break; case 5: - if ((0xffffffffefffffffL & l) != 0L && kind > 82) - kind = 82; + if ((0xffffffffefffffffL & l) != 0L && kind > 83) + kind = 83; break; default : break; } @@ -2437,8 +2439,8 @@ private int jjMoveNfa_2(int startState, int curPos) switch(jjstateSet[--i]) { case 0: - if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 82) - kind = 82; + if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 83) + kind = 83; break; default : break; } @@ -2482,14 +2484,14 @@ public static final String[] jjstrLiteralImages = { "\154\151\153\145\111\147\156\157\162\145\103\141\163\145", "\151\156", "\50", "\51", "\142\145\164\167\145\145\156", "\54", "\174", "\136", "\46", "\74\74", "\76\76", "\53", "\55", "\57", "\176", null, null, null, null, null, null, null, "\141\166\147", "\155\151\156", "\155\141\170", "\163\165\155", -"\143\157\165\156\164", "\144\151\163\164\151\156\143\164", "\146\156", "\143\157\156\143\141\164", +"\143\157\165\156\164", "\144\151\163\164\151\156\143\164", "\143\157\156\143\141\164", "\163\165\142\163\164\162\151\156\147", "\164\162\151\155", "\154\157\167\145\162", "\165\160\160\145\162", "\154\145\156\147\164\150", "\154\157\143\141\164\145", "\141\142\163", "\163\161\162\164", "\155\157\144", "\143\165\162\162\145\156\164\104\141\164\145", "\143\165\162\162\145\156\164\124\151\155\145", null, "\171\145\141\162", "\155\157\156\164\150", "\167\145\145\153", "\144\141\171\117\146\131\145\141\162", "\144\141\171", "\144\141\171\117\146\115\157\156\164\150", "\144\141\171\117\146\127\145\145\153", "\150\157\165\162", "\155\151\156\165\164\145", "\163\145\143\157\156\144", -"\44", "\157\142\152\72", "\144\142\72", "\145\156\165\155\72", +"\146\156", "\157\160", "\44", "\157\142\152\72", "\144\142\72", "\145\156\165\155\72", "\144\142\151\144\72", "\52", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, }; @@ -2505,16 +2507,16 @@ public static final int[] jjnewLexState = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 1, 2, -1, -1, 0, -1, -1, 0, -1, -1, -1, -1, -1, -1, + -1, -1, 1, 2, -1, -1, 0, -1, -1, 0, -1, -1, -1, -1, -1, -1, }; static final long[] jjtoToken = { - 0xfffffffe1fffffffL, 0x3903ffL, + 0xfffffffe1fffffffL, 0x7207ffL, }; static final long[] jjtoSkip = { 0x1e0000000L, 0x0L, }; static final long[] jjtoMore = { - 0x0L, 0x6f000L, + 0x0L, 0xde000L, }; protected JavaCharStream input_stream; private final int[] jjrounds = new int[83]; @@ -2706,32 +2708,32 @@ void MoreLexicalActions() jjimageLen += (lengthOfMatch = jjmatchedPos + 1); switch(jjmatchedKind) { - case 76 : + case 77 : image.append(input_stream.GetSuffix(jjimageLen)); jjimageLen = 0; stringBuffer = new StringBuffer(); break; - case 77 : + case 78 : image.append(input_stream.GetSuffix(jjimageLen)); jjimageLen = 0; stringBuffer = new StringBuffer(); break; - case 78 : + case 79 : image.append(input_stream.GetSuffix(jjimageLen)); jjimageLen = 0; stringBuffer.append( escapeChar() ); break; - case 79 : + case 80 : image.append(input_stream.GetSuffix(jjimageLen)); jjimageLen = 0; stringBuffer.append( image.charAt(image.length()-1) ); break; - case 81 : + case 82 : image.append(input_stream.GetSuffix(jjimageLen)); jjimageLen = 0; stringBuffer.append( escapeChar() ); break; - case 82 : + case 83 : image.append(input_stream.GetSuffix(jjimageLen)); jjimageLen = 0; stringBuffer.append( image.charAt(image.length()-1) ); @@ -2744,19 +2746,19 @@ void TokenLexicalActions(Token matchedToken) { switch(jjmatchedKind) { - case 80 : + case 81 : image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); literalValue = stringBuffer.toString(); break; - case 83 : + case 84 : image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); literalValue = stringBuffer.toString(); break; - case 84 : + case 85 : image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); literalValue = makeInt(); break; - case 85 : + case 86 : image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); literalValue = makeFloat(); break; diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java index b23f38b..4938f04 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/parser/ExpressionParserTreeConstants.java @@ -37,32 +37,33 @@ public interface ExpressionParserTreeConstants public int JJTBITWISENOT = 31; public int JJTNEGATE = 32; public int JJTCUSTOMFUNCTION = 33; - public int JJTCONCAT = 34; - public int JJTSUBSTRING = 35; - public int JJTTRIM = 36; - public int JJTLOWER = 37; - public int JJTUPPER = 38; - public int JJTLENGTH = 39; - public int JJTLOCATE = 40; - public int JJTABS = 41; - public int JJTSQRT = 42; - public int JJTMOD = 43; - public int JJTASTERISK = 44; - public int JJTCOUNT = 45; - public int JJTAVG = 46; - public int JJTMAX = 47; - public int JJTMIN = 48; - public int JJTSUM = 49; - public int JJTCURRENTDATE = 50; - public int JJTCURRENTTIME = 51; - public int JJTCURRENTTIMESTAMP = 52; - public int JJTEXTRACT = 53; - public int JJTDISTINCT = 54; - public int JJTNAMEDPARAMETER = 55; - public int JJTOBJPATH = 56; - public int JJTDBPATH = 57; - public int JJTENUM = 58; - public int JJTDBIDPATH = 59; + public int JJTCUSTOMOPERATOR = 34; + public int JJTCONCAT = 35; + public int JJTSUBSTRING = 36; + public int JJTTRIM = 37; + public int JJTLOWER = 38; + public int JJTUPPER = 39; + public int JJTLENGTH = 40; + public int JJTLOCATE = 41; + public int JJTABS = 42; + public int JJTSQRT = 43; + public int JJTMOD = 44; + public int JJTASTERISK = 45; + public int JJTCOUNT = 46; + public int JJTAVG = 47; + public int JJTMAX = 48; + public int JJTMIN = 49; + public int JJTSUM = 50; + public int JJTCURRENTDATE = 51; + public int JJTCURRENTTIME = 52; + public int JJTCURRENTTIMESTAMP = 53; + public int JJTEXTRACT = 54; + public int JJTDISTINCT = 55; + public int JJTNAMEDPARAMETER = 56; + public int JJTOBJPATH = 57; + public int JJTDBPATH = 58; + public int JJTENUM = 59; + public int JJTDBIDPATH = 60; public String[] jjtNodeName = { @@ -100,6 +101,7 @@ public interface ExpressionParserTreeConstants "BitwiseNot", "Negate", "CustomFunction", + "CustomOperator", "Concat", "Substring", "Trim", @@ -128,4 +130,4 @@ public interface ExpressionParserTreeConstants "DbIdPath", }; } -/* JavaCC - OriginalChecksum=d21da7d665d0ef7c43630d13a09f2c1d (do not edit this line) */ +/* JavaCC - OriginalChecksum=f2cfb85aec04b89e51d38e9c241ae471 (do not edit this line) */ diff --git a/cayenne-server/src/main/java/org/apache/cayenne/exp/property/BaseProperty.java b/cayenne-server/src/main/java/org/apache/cayenne/exp/property/BaseProperty.java index af46649..2e1a05f 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/exp/property/BaseProperty.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/exp/property/BaseProperty.java @@ -428,7 +428,7 @@ public class BaseProperty<E> implements Property<E> { Object[] expressions = new Expression[arguments.length + 1]; expressions[0] = getExpression(); for(int i=1; i<=arguments.length; i++) { - expressions[i] = arguments[i].getExpression(); + expressions[i] = arguments[i-1].getExpression(); } return PropertyFactory.createBase(FunctionExpressionFactory.functionCall(functionName, expressions), returnType); } @@ -443,4 +443,29 @@ public class BaseProperty<E> implements Property<E> { System.arraycopy(arguments, 0, expressions, 1, arguments.length); return PropertyFactory.createBase(FunctionExpressionFactory.functionCall(functionName, expressions), returnType); } + + /** + * @return An expression for using operator with first argument equals to <b>this</b> property + * and provided additional arguments + */ + public <T> BaseProperty<T> operator(String operator, Class<T> returnType, BaseProperty<?>... arguments) { + Object[] expressions = new Expression[arguments.length + 1]; + expressions[0] = getExpression(); + for(int i=1; i<=arguments.length; i++) { + expressions[i] = arguments[i-1].getExpression(); + } + return PropertyFactory.createBase(FunctionExpressionFactory.operator(operator, expressions), returnType); + } + + /** + * @return An expression for using operator with first argument equals to <b>this</b> property + * and provided additional arguments + */ + public <T> BaseProperty<T> operator(String operator, Class<T> returnType, Object... arguments) { + Object[] expressions = new Object[arguments.length + 1]; + expressions[0] = getExpression(); + System.arraycopy(arguments, 0, expressions, 1, arguments.length); + return PropertyFactory.createBase(FunctionExpressionFactory.operator(operator, expressions), returnType); + } + } diff --git a/cayenne-server/src/main/jjtree/org/apache/cayenne/exp/parser/ExpressionParser.jjt b/cayenne-server/src/main/jjtree/org/apache/cayenne/exp/parser/ExpressionParser.jjt index 38afc39..5e57b75 100644 --- a/cayenne-server/src/main/jjtree/org/apache/cayenne/exp/parser/ExpressionParser.jjt +++ b/cayenne-server/src/main/jjtree/org/apache/cayenne/exp/parser/ExpressionParser.jjt @@ -287,6 +287,8 @@ void numericPrimary() : {} pathExpression() | customFunction() + | + customOperator() } void functionsReturningStrings() : { } @@ -299,6 +301,11 @@ void customFunction() #CustomFunction : { } <FUNCTION> "(" stringLiteral() ( "," ( stringExpression() | numericExpression() ) )* ")" } +void customOperator() #CustomOperator : { } +{ + <OPERATOR> "(" stringLiteral() ( "," ( stringExpression() | numericExpression() ) )* ")" +} + void concat() #Concat : { } { <CONCAT> "(" stringParameter() ( "," stringParameter() )* ")" @@ -533,7 +540,6 @@ TOKEN : /* aggregates */ | <SUM: "sum" > | <COUNT: "count" > | <DISTINCT: "distinct"> - | <FUNCTION: "fn" > } TOKEN : /* functions returning strings */ @@ -579,6 +585,16 @@ TOKEN : | <SECOND: "second"> } +/* +Special operations +*/ +TOKEN : +{ + <FUNCTION: "fn" > + | + <OPERATOR: "op" > +} + void namedParameter() :{ Token t; } diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/FunctionExpressionFactoryTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/FunctionExpressionFactoryTest.java index db914ae..529231a 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/exp/FunctionExpressionFactoryTest.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/FunctionExpressionFactoryTest.java @@ -27,12 +27,14 @@ import org.apache.cayenne.exp.parser.ASTCount; import org.apache.cayenne.exp.parser.ASTCurrentDate; import org.apache.cayenne.exp.parser.ASTCurrentTime; import org.apache.cayenne.exp.parser.ASTCurrentTimestamp; +import org.apache.cayenne.exp.parser.ASTCustomOperator; import org.apache.cayenne.exp.parser.ASTLength; import org.apache.cayenne.exp.parser.ASTLocate; import org.apache.cayenne.exp.parser.ASTLower; import org.apache.cayenne.exp.parser.ASTMax; import org.apache.cayenne.exp.parser.ASTMin; import org.apache.cayenne.exp.parser.ASTMod; +import org.apache.cayenne.exp.parser.ASTObjPath; import org.apache.cayenne.exp.parser.ASTScalar; import org.apache.cayenne.exp.parser.ASTSqrt; import org.apache.cayenne.exp.parser.ASTSubstring; @@ -264,4 +266,16 @@ public class FunctionExpressionFactoryTest { Expression exp = FunctionExpressionFactory.currentTimestamp(); assertTrue(exp instanceof ASTCurrentTimestamp); } + + @Test + public void customOpTest() { + Expression exp = FunctionExpressionFactory.operator("==>", 123, Artist.ARTIST_NAME.getExpression()); + assertTrue(exp instanceof ASTCustomOperator); + ASTCustomOperator operator = (ASTCustomOperator) exp; + assertEquals("==>", operator.getOperator()); + assertEquals(2, operator.jjtGetNumChildren()); + + assertEquals(123, operator.getOperand(0)); + assertEquals(Artist.ARTIST_NAME.getExpression(), operator.getOperand(1)); + } } \ No newline at end of file diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTCustomOperatorTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTCustomOperatorTest.java new file mode 100644 index 0000000..b5b45ab --- /dev/null +++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/parser/ASTCustomOperatorTest.java @@ -0,0 +1,48 @@ +/***************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + ****************************************************************/ + +package org.apache.cayenne.exp.parser; + +import org.apache.cayenne.exp.Expression; +import org.apache.cayenne.exp.ExpressionException; +import org.apache.cayenne.exp.ExpressionFactory; +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * @since 4.2 + */ +public class ASTCustomOperatorTest { + + @Test + public void testParse() { + Expression exp = ExpressionFactory.exp("op('~~>', test, 'abc')"); + + assertTrue(exp instanceof ASTCustomOperator); + assertEquals("~~>", ((ASTCustomOperator) exp).getOperator()); + assertEquals("op(\"~~>\", test, \"abc\")", exp.toString()); + } + + @Test(expected = ExpressionException.class) + public void testEvaluate() { + new ASTCustomOperator("op").evaluate(new Object()); + } + +} \ No newline at end of file diff --git a/cayenne-server/src/test/java/org/apache/cayenne/exp/property/BasePropertyTest.java b/cayenne-server/src/test/java/org/apache/cayenne/exp/property/BasePropertyTest.java index 99ed791..38c003a 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/exp/property/BasePropertyTest.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/exp/property/BasePropertyTest.java @@ -265,4 +265,38 @@ public class BasePropertyTest { assertNotEquals(INT_FIELD.hashCode(), INT_FIELD3.hashCode()); } + @Test + public void testFunctionProperty() { + BaseProperty<Integer> property = new BaseProperty<>("intField", null, Integer.class); + BaseProperty<Integer> arg = new BaseProperty<>("intField2", null, Integer.class); + + BaseProperty<Integer> operator = property.function("%", Integer.class, arg); + assertEquals(ExpressionFactory.exp("fn('%', intField, intField2)"), operator.getExpression()); + } + + @Test + public void testFunctionScalar() { + BaseProperty<Integer> property = new BaseProperty<>("intField", null, Integer.class); + + BaseProperty<Integer> operator = property.function("%", Integer.class, 10); + assertEquals(ExpressionFactory.exp("fn('%', intField, 10)"), operator.getExpression()); + } + + @Test + public void testOperatorProperty() { + BaseProperty<Integer> property = new BaseProperty<>("intField", null, Integer.class); + BaseProperty<Integer> arg = new BaseProperty<>("intField2", null, Integer.class); + + BaseProperty<Integer> operator = property.operator("%", Integer.class, arg); + assertEquals(ExpressionFactory.exp("op('%', intField, intField2)"), operator.getExpression()); + } + + @Test + public void testOperatorScalar() { + BaseProperty<Integer> property = new BaseProperty<>("intField", null, Integer.class); + + BaseProperty<Integer> operator = property.operator("%", Integer.class, 10); + assertEquals(ExpressionFactory.exp("op('%', intField, 10)"), operator.getExpression()); + } + } \ No newline at end of file