You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@metron.apache.org by ce...@apache.org on 2016/06/16 16:02:54 UTC
[3/4] incubator-metron git commit: METRON-204: Field Transformation
Domain Specific Language. This closes apache/incubator-metron#142
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/PredicateToken.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/PredicateToken.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/PredicateToken.java
deleted file mode 100644
index 54ac17d..0000000
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/PredicateToken.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * 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.metron.common.query;
-
-public class PredicateToken<T> {
- T value;
- Class<T> underlyingType;
- public PredicateToken(T value, Class<T> clazz) {
- this.value = value;
- this.underlyingType = clazz;
- }
- public T getValue() {
- return value;
- }
- public Class<T> getUnderlyingType() {
- return underlyingType;
- }
-
- @Override
- public String toString() {
- return value.toString();
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- PredicateToken<?> predicateToken = (PredicateToken<?>) o;
-
- if (getValue() != null ? !getValue().equals(predicateToken.getValue()) : predicateToken.getValue() != null) return false;
- return getUnderlyingType() != null ? getUnderlyingType().equals(predicateToken.getUnderlyingType()) : predicateToken.getUnderlyingType() == null;
-
- }
-
- @Override
- public int hashCode() {
- int result = getValue() != null ? getValue().hashCode() : 0;
- result = 31 * result + (getUnderlyingType() != null ? getUnderlyingType().hashCode() : 0);
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/QueryCompiler.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/QueryCompiler.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/QueryCompiler.java
index 3d85d9e..3e074dc 100644
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/QueryCompiler.java
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/QueryCompiler.java
@@ -18,17 +18,19 @@
package org.apache.metron.common.query;
-import com.google.common.base.Function;
import com.google.common.base.Joiner;
+import com.google.common.collect.ImmutableSet;
+import org.apache.metron.common.dsl.*;
import org.apache.metron.common.query.generated.PredicateBaseListener;
import org.apache.metron.common.query.generated.PredicateParser;
import java.util.*;
+import java.util.function.Function;
import java.util.function.Predicate;
class QueryCompiler extends PredicateBaseListener {
private VariableResolver resolver = null;
- private Stack<PredicateToken> tokenStack = new Stack<>();
+ private Stack<Token> tokenStack = new Stack<>();
public QueryCompiler(VariableResolver resolver) {
this.resolver = resolver;
@@ -45,20 +47,20 @@ class QueryCompiler extends PredicateBaseListener {
@Override
public void exitLogicalExpressionAnd(PredicateParser.LogicalExpressionAndContext ctx) {
- PredicateToken<?> left = popStack();
- PredicateToken<?> right = popStack();
- tokenStack.push(new PredicateToken<>(booleanOp(left, right, (l, r) -> l && r, "&&"), Boolean.class));
+ Token<?> left = popStack();
+ Token<?> right = popStack();
+ tokenStack.push(new Token<>(booleanOp(left, right, (l, r) -> l && r, "&&"), Boolean.class));
}
@Override
public void exitLogicalExpressionOr(PredicateParser.LogicalExpressionOrContext ctx) {
- PredicateToken<?> left = popStack();
- PredicateToken<?> right = popStack();
+ Token<?> left = popStack();
+ Token<?> right = popStack();
- tokenStack.push(new PredicateToken<>(booleanOp(left, right, (l, r) -> l || r, "||"), Boolean.class));
+ tokenStack.push(new Token<>(booleanOp(left, right, (l, r) -> l || r, "||"), Boolean.class));
}
- private boolean booleanOp(PredicateToken<?> left, PredicateToken<?> right, BooleanOp op, String opName)
+ private boolean booleanOp(Token<?> left, Token<?> right, BooleanOp op, String opName)
{
if(left.getUnderlyingType().equals(right.getUnderlyingType()) && left.getUnderlyingType().equals(Boolean.class)) {
Boolean l = (Boolean) left.getValue();
@@ -87,24 +89,63 @@ class QueryCompiler extends PredicateBaseListener {
default:
throw new ParseException("Unable to process " + ctx.getText() + " as a boolean constant");
}
- tokenStack.push(new PredicateToken<>(b, Boolean.class));
+ tokenStack.push(new Token<>(b, Boolean.class));
+ }
+
+
+ @Override
+ public void exitDoubleLiteral(PredicateParser.DoubleLiteralContext ctx) {
+ tokenStack.push(new Token<>(Double.parseDouble(ctx.getText()), Double.class));
+ }
+
+
+ @Override
+ public void exitIntegerLiteral(PredicateParser.IntegerLiteralContext ctx) {
+ tokenStack.push(new Token<>(Integer.parseInt(ctx.getText()), Integer.class));
+ }
+
+ private <T extends Comparable<T>> boolean compare(T l, T r, String op) {
+ if(op.equals("==")) {
+ return l.compareTo(r) == 0;
+ }
+ else if(op.equals("!=")) {
+ return l.compareTo(r) != 0;
+ }
+ else if(op.equals("<")) {
+ return l.compareTo(r) < 0;
+ }
+ else if(op.equals(">")) {
+ return l.compareTo(r) > 0;
+ }
+ else if(op.equals(">=")) {
+ return l.compareTo(r) >= 0;
+ }
+ else {
+ return l.compareTo(r) <= 0;
+ }
}
@Override
public void exitComparisonExpressionWithOperator(PredicateParser.ComparisonExpressionWithOperatorContext ctx) {
- boolean isEqualsOp = ctx.getChild(1).getText().equals("==");
- PredicateToken<?> left = popStack();
- PredicateToken<?> right = popStack();
- if(left.getUnderlyingType().equals(right.getUnderlyingType())) {
- boolean isEquals = left.equals(right);
- tokenStack.push(new PredicateToken<>(isEqualsOp?isEquals:!isEquals, Boolean.class));
+ String op = ctx.getChild(1).getText();
+ Token<?> right = popStack();
+ Token<?> left = popStack();
+ if(left.getValue() instanceof Number
+ && right.getValue() instanceof Number
+ ) {
+ Double l = ((Number)left.getValue()).doubleValue();
+ Double r = ((Number)right.getValue()).doubleValue();
+ tokenStack.push(new Token<>(compare(l, r, op), Boolean.class));
+
}
else {
- throw new ParseException("Unable to compare " + left.getValue() + " " + ctx.getText() + " " + right.getValue());
+ String l = left.getValue() == null?"":left.getValue().toString();
+ String r = right.getValue() == null?"":right.getValue().toString();
+ tokenStack.push(new Token<>(compare(l, r, op), Boolean.class));
}
}
- public PredicateToken<?> popStack() {
+ public Token<?> popStack() {
if(tokenStack.empty()) {
throw new ParseException("Unable to pop an empty stack");
}
@@ -113,107 +154,101 @@ class QueryCompiler extends PredicateBaseListener {
@Override
public void exitLogicalVariable(PredicateParser.LogicalVariableContext ctx) {
- tokenStack.push(new PredicateToken<>(resolver.resolve(ctx.getText()), String.class));
+ tokenStack.push(new Token<>(resolver.resolve(ctx.getText()), Object.class));
}
@Override
public void exitStringLiteral(PredicateParser.StringLiteralContext ctx) {
String val = ctx.getText();
- tokenStack.push(new PredicateToken<>(val.substring(1, val.length() - 1), String.class));
+ tokenStack.push(new Token<>(val.substring(1, val.length() - 1), String.class));
}
+
@Override
public void enterList_entity(PredicateParser.List_entityContext ctx) {
- tokenStack.push(new PredicateToken<>(new FunctionMarker(), FunctionMarker.class));
+ tokenStack.push(new Token<>(new FunctionMarker(), FunctionMarker.class));
}
@Override
public void exitList_entity(PredicateParser.List_entityContext ctx) {
- Set<String> inSet = new HashSet<>();
+ LinkedList<String> args = new LinkedList<>();
while(true) {
- PredicateToken<?> token = popStack();
+ Token<?> token = popStack();
if(token.getUnderlyingType().equals(FunctionMarker.class)) {
break;
}
else {
- inSet.add((String)token.getValue());
+ args.addFirst((String)token.getValue());
}
}
- tokenStack.push(new PredicateToken<>(inSet, Set.class));
+ tokenStack.push(new Token<>(args, List.class));
}
@Override
public void enterFunc_args(PredicateParser.Func_argsContext ctx) {
- tokenStack.push(new PredicateToken<>(new FunctionMarker(), FunctionMarker.class));
+ tokenStack.push(new Token<>(new FunctionMarker(), FunctionMarker.class));
}
@Override
public void exitFunc_args(PredicateParser.Func_argsContext ctx) {
- LinkedList<String> args = new LinkedList<>();
+ LinkedList<Object> args = new LinkedList<>();
while(true) {
- PredicateToken<?> token = popStack();
+ Token<?> token = popStack();
if(token.getUnderlyingType().equals(FunctionMarker.class)) {
break;
}
else {
- args.addFirst((String)token.getValue());
+ args.addFirst(token.getValue());
}
}
- tokenStack.push(new PredicateToken<>(args, List.class));
+ tokenStack.push(new Token<>(args, List.class));
}
- @Override
- public void exitInExpression(PredicateParser.InExpressionContext ctx) {
- PredicateToken<?> left = popStack();
- PredicateToken<?> right = popStack();
- String key = null;
- Set<String> set = null;
- if(left.getUnderlyingType().equals(Set.class)) {
- set = (Set<String>) left.getValue();
- }
- else {
- throw new ParseException("Unable to process in clause because " + left.getValue() + " is not a set");
+ private boolean handleIn(Token<?> left, Token<?> right) {
+ Object key = null;
+ Set<Object> set = null;
+ if(left.getValue() instanceof Collection) {
+ set = new HashSet<>((List<Object>) left.getValue());
}
- if(right.getUnderlyingType().equals(String.class)) {
- key = (String) right.getValue();
+ else if(left.getValue() != null) {
+ set = ImmutableSet.of(left.getValue());
}
else {
- throw new ParseException("Unable to process in clause because " + right.getValue() + " is not a string");
+ set = new HashSet<>();
+ }
+
+
+ key = right.getValue();
+ if(key == null || set.isEmpty()) {
+ return false;
}
- tokenStack.push(new PredicateToken<>(set.contains(key), Boolean.class));
+ return set.contains(key);
}
@Override
- public void exitNInExpression(PredicateParser.NInExpressionContext ctx) {
- PredicateToken<?> left = popStack();
- PredicateToken<?> right = popStack();
- String key = null;
- Set<String> set = null;
- if(left.getUnderlyingType().equals(Set.class)) {
- set = (Set<String>) left.getValue();
- }
- else {
- throw new ParseException("Unable to process in clause because " + left.getValue() + " is not a set");
- }
- if(right.getUnderlyingType().equals(String.class)) {
- key = (String) right.getValue();
- }
- else {
- throw new ParseException("Unable to process in clause because " + right.getValue() + " is not a string");
- }
- tokenStack.push(new PredicateToken<>(!set.contains(key), Boolean.class));
+ public void exitInExpression(PredicateParser.InExpressionContext ctx) {
+ Token<?> left = popStack();
+ Token<?> right = popStack();
+ tokenStack.push(new Token<>(handleIn(left, right), Boolean.class));
}
@Override
+ public void exitNInExpression(PredicateParser.NInExpressionContext ctx) {
+ Token<?> left = popStack();
+ Token<?> right = popStack();
+ tokenStack.push(new Token<>(!handleIn(left, right), Boolean.class));
+ }
+
+ @Override
public void exitLogicalFunc(PredicateParser.LogicalFuncContext ctx) {
String funcName = ctx.getChild(0).getText();
- Predicate<List<String>> func;
+ Predicate<List<Object>> func;
try {
func = LogicalFunctions.valueOf(funcName);
}
@@ -222,60 +257,69 @@ class QueryCompiler extends PredicateBaseListener {
+ Joiner.on(',').join(LogicalFunctions.values())
);
}
- PredicateToken<?> left = popStack();
- List<String> argList = null;
- if(left.getUnderlyingType().equals(List.class)) {
- argList = (List<String>) left.getValue();
+ Token<?> left = popStack();
+ List<Object> argList = null;
+ if(left.getValue() instanceof List) {
+ argList = (List<Object>) left.getValue();
}
else {
throw new ParseException("Unable to process in clause because " + left.getValue() + " is not a set");
}
Boolean result = func.test(argList);
- tokenStack.push(new PredicateToken<>(result, Boolean.class));
+ tokenStack.push(new Token<>(result, Boolean.class));
}
+ /**
+ * {@inheritDoc}
+ * <p/>
+ * <p>The default implementation does nothing.</p>
+ *
+ * @param ctx
+ */
@Override
- public void exitStringFunc(PredicateParser.StringFuncContext ctx) {
+ public void exitTransformationFunc(PredicateParser.TransformationFuncContext ctx) {
String funcName = ctx.getChild(0).getText();
- Function<List<String>, String> func;
+ Function<List<Object>, Object> func;
try {
- func = StringFunctions.valueOf(funcName);
+ func = TransformationFunctions.valueOf(funcName);
}
catch(IllegalArgumentException iae) {
throw new ParseException("Unable to find string function " + funcName + ". Valid functions are "
- + Joiner.on(',').join(StringFunctions.values())
+ + Joiner.on(',').join(TransformationFunctions.values())
);
}
- PredicateToken<?> left = popStack();
- List<String> argList = null;
+ Token<?> left = popStack();
+ List<Object> argList = null;
if(left.getUnderlyingType().equals(List.class)) {
- argList = (List<String>) left.getValue();
+ argList = (List<Object>) left.getValue();
}
else {
throw new ParseException("Unable to process in clause because " + left.getValue() + " is not a set");
}
- String result = func.apply(argList);
- tokenStack.push(new PredicateToken<>(result, String.class));
+ Object result = func.apply(argList);
+ tokenStack.push(new Token<>(result, Object.class));
}
+
+
@Override
public void exitExistsFunc(PredicateParser.ExistsFuncContext ctx) {
String variable = ctx.getChild(2).getText();
boolean exists = resolver.resolve(variable) != null;
- tokenStack.push(new PredicateToken<>(exists, Boolean.class));
+ tokenStack.push(new Token<>(exists, Boolean.class));
}
@Override
public void exitNotFunc(PredicateParser.NotFuncContext ctx) {
- PredicateToken<Boolean> arg = (PredicateToken<Boolean>) popStack();
- tokenStack.push(new PredicateToken<>(!arg.getValue(), Boolean.class));
+ Token<Boolean> arg = (Token<Boolean>) popStack();
+ tokenStack.push(new Token<>(!arg.getValue(), Boolean.class));
}
public boolean getResult() throws ParseException {
if(tokenStack.empty()) {
throw new ParseException("Invalid predicate: Empty stack.");
}
- PredicateToken<?> token = popStack();
+ Token<?> token = popStack();
if(token.getUnderlyingType().equals(Boolean.class) && tokenStack.empty()) {
return (Boolean)token.getValue();
}
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/StringFunctions.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/StringFunctions.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/StringFunctions.java
deleted file mode 100644
index 911063e..0000000
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/StringFunctions.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * 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.metron.common.query;
-
-
-import com.google.common.base.Function;
-
-import javax.annotation.Nullable;
-import java.util.List;
-
-public enum StringFunctions implements Function<List<String>, String> {
- TO_LOWER(strings -> strings.get(0)==null?null:strings.get(0).toLowerCase())
- ,TO_UPPER(strings -> strings.get(0) == null?null:strings.get(0).toUpperCase())
- ,TRIM(strings -> strings.get(0) == null?null:strings.get(0).trim())
- ;
- Function<List<String>, String> func;
- StringFunctions(Function<List<String>, String> func) {
- this.func = func;
- }
-
- @Nullable
- @Override
- public String apply(@Nullable List<String> input) {
- return func.apply(input);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/VariableResolver.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/VariableResolver.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/VariableResolver.java
deleted file mode 100644
index d0a6625..0000000
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/VariableResolver.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * 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.metron.common.query;
-
-public interface VariableResolver {
- String resolve(String variable);
-}
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateBaseListener.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateBaseListener.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateBaseListener.java
index ca7ac84..5c41d0c 100644
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateBaseListener.java
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateBaseListener.java
@@ -241,6 +241,18 @@ public class PredicateBaseListener implements PredicateListener {
*
* <p>The default implementation does nothing.</p>
*/
+ @Override public void enterTransformationFunc(PredicateParser.TransformationFuncContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * <p>The default implementation does nothing.</p>
+ */
+ @Override public void exitTransformationFunc(PredicateParser.TransformationFuncContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * <p>The default implementation does nothing.</p>
+ */
@Override public void enterStringLiteral(PredicateParser.StringLiteralContext ctx) { }
/**
* {@inheritDoc}
@@ -265,13 +277,49 @@ public class PredicateBaseListener implements PredicateListener {
*
* <p>The default implementation does nothing.</p>
*/
- @Override public void enterStringFunc(PredicateParser.StringFuncContext ctx) { }
+ @Override public void enterId_tfunc(PredicateParser.Id_tfuncContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * <p>The default implementation does nothing.</p>
+ */
+ @Override public void exitId_tfunc(PredicateParser.Id_tfuncContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * <p>The default implementation does nothing.</p>
+ */
+ @Override public void enterIntegerLiteral(PredicateParser.IntegerLiteralContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * <p>The default implementation does nothing.</p>
+ */
+ @Override public void exitIntegerLiteral(PredicateParser.IntegerLiteralContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * <p>The default implementation does nothing.</p>
+ */
+ @Override public void enterDoubleLiteral(PredicateParser.DoubleLiteralContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * <p>The default implementation does nothing.</p>
+ */
+ @Override public void exitDoubleLiteral(PredicateParser.DoubleLiteralContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * <p>The default implementation does nothing.</p>
+ */
+ @Override public void enterList(PredicateParser.ListContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
- @Override public void exitStringFunc(PredicateParser.StringFuncContext ctx) { }
+ @Override public void exitList(PredicateParser.ListContext ctx) { }
/**
* {@inheritDoc}
*
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateLexer.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateLexer.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateLexer.java
index ebc0b00..2bcf114 100644
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateLexer.java
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateLexer.java
@@ -37,26 +37,30 @@ public class PredicateLexer extends Lexer {
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
- AND=1, OR=2, NOT=3, TRUE=4, FALSE=5, EQ=6, NEQ=7, COMMA=8, LBRACKET=9,
- RBRACKET=10, LPAREN=11, RPAREN=12, IN=13, NIN=14, EXISTS=15, IDENTIFIER=16,
- STRING_LITERAL=17, SEMI=18, COMMENT=19, WS=20;
+ AND=1, OR=2, NOT=3, TRUE=4, FALSE=5, EQ=6, NEQ=7, LT=8, LTE=9, GT=10,
+ GTE=11, COMMA=12, LBRACKET=13, RBRACKET=14, LPAREN=15, RPAREN=16, IN=17,
+ NIN=18, EXISTS=19, INT_LITERAL=20, DOUBLE_LITERAL=21, IDENTIFIER=22, STRING_LITERAL=23,
+ SEMI=24, COMMENT=25, WS=26;
public static String[] modeNames = {
"DEFAULT_MODE"
};
public static final String[] ruleNames = {
- "AND", "OR", "NOT", "TRUE", "FALSE", "EQ", "NEQ", "COMMA", "LBRACKET",
- "RBRACKET", "LPAREN", "RPAREN", "IN", "NIN", "EXISTS", "IDENTIFIER", "SCHAR",
- "STRING_LITERAL", "SEMI", "COMMENT", "WS"
+ "AND", "OR", "NOT", "TRUE", "FALSE", "EQ", "NEQ", "LT", "LTE", "GT", "GTE",
+ "COMMA", "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", "IN", "NIN", "EXISTS",
+ "INT_LITERAL", "DOUBLE_LITERAL", "IDENTIFIER", "SCHAR", "STRING_LITERAL",
+ "SEMI", "COMMENT", "WS"
};
private static final String[] _LITERAL_NAMES = {
- null, null, null, null, null, null, "'=='", "'!='", "','", "'['", "']'",
- "'('", "')'", "'in'", "'not in'", "'exists'", null, null, "';'"
+ null, null, null, null, null, null, "'=='", "'!='", "'<'", "'<='", "'>'",
+ "'>='", "','", "'['", "']'", "'('", "')'", "'in'", "'not in'", "'exists'",
+ null, null, null, null, "';'"
};
private static final String[] _SYMBOLIC_NAMES = {
- null, "AND", "OR", "NOT", "TRUE", "FALSE", "EQ", "NEQ", "COMMA", "LBRACKET",
- "RBRACKET", "LPAREN", "RPAREN", "IN", "NIN", "EXISTS", "IDENTIFIER", "STRING_LITERAL",
+ null, "AND", "OR", "NOT", "TRUE", "FALSE", "EQ", "NEQ", "LT", "LTE", "GT",
+ "GTE", "COMMA", "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", "IN", "NIN",
+ "EXISTS", "INT_LITERAL", "DOUBLE_LITERAL", "IDENTIFIER", "STRING_LITERAL",
"SEMI", "COMMENT", "WS"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
@@ -114,59 +118,74 @@ public class PredicateLexer extends Lexer {
public ATN getATN() { return _ATN; }
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\26\u00af\b\1\4\2"+
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\34\u00d5\b\1\4\2"+
"\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4"+
"\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+
- "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\3\2\3\2\3\2\3\2\3\2\3\2"+
- "\3\2\3\2\5\2\66\n\2\3\3\3\3\3\3\3\3\3\3\3\3\5\3>\n\3\3\4\3\4\3\4\3\4\3"+
- "\4\3\4\5\4F\n\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5P\n\5\3\6\3\6\3\6\3"+
- "\6\3\6\3\6\3\6\3\6\3\6\3\6\5\6\\\n\6\3\7\3\7\3\7\3\b\3\b\3\b\3\t\3\t\3"+
- "\n\3\n\3\13\3\13\3\f\3\f\3\r\3\r\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3"+
- "\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\7\21\u0081"+
- "\n\21\f\21\16\21\u0084\13\21\3\22\3\22\3\23\3\23\7\23\u008a\n\23\f\23"+
- "\16\23\u008d\13\23\3\23\3\23\3\23\7\23\u0092\n\23\f\23\16\23\u0095\13"+
- "\23\3\23\5\23\u0098\n\23\3\24\3\24\3\25\3\25\3\25\3\25\6\25\u00a0\n\25"+
- "\r\25\16\25\u00a1\3\25\5\25\u00a5\n\25\3\25\3\25\3\26\6\26\u00aa\n\26"+
- "\r\26\16\26\u00ab\3\26\3\26\3\u00a1\2\27\3\3\5\4\7\5\t\6\13\7\r\b\17\t"+
- "\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\2%\23\'\24)\25+\26"+
- "\3\2\7\5\2C\\aac|\b\2\60\60\62;C\\^^aac|\7\2\f\f\17\17$$))^^\3\3\f\f\5"+
- "\2\13\f\16\17\"\"\u00ba\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2"+
- "\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25"+
- "\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2"+
- "\2\2\2!\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\3\65\3\2"+
- "\2\2\5=\3\2\2\2\7E\3\2\2\2\tO\3\2\2\2\13[\3\2\2\2\r]\3\2\2\2\17`\3\2\2"+
- "\2\21c\3\2\2\2\23e\3\2\2\2\25g\3\2\2\2\27i\3\2\2\2\31k\3\2\2\2\33m\3\2"+
- "\2\2\35p\3\2\2\2\37w\3\2\2\2!~\3\2\2\2#\u0085\3\2\2\2%\u0097\3\2\2\2\'"+
- "\u0099\3\2\2\2)\u009b\3\2\2\2+\u00a9\3\2\2\2-.\7c\2\2./\7p\2\2/\66\7f"+
- "\2\2\60\61\7(\2\2\61\66\7(\2\2\62\63\7C\2\2\63\64\7P\2\2\64\66\7F\2\2"+
- "\65-\3\2\2\2\65\60\3\2\2\2\65\62\3\2\2\2\66\4\3\2\2\2\678\7q\2\28>\7t"+
- "\2\29:\7~\2\2:>\7~\2\2;<\7Q\2\2<>\7T\2\2=\67\3\2\2\2=9\3\2\2\2=;\3\2\2"+
- "\2>\6\3\2\2\2?@\7p\2\2@A\7q\2\2AF\7v\2\2BC\7P\2\2CD\7Q\2\2DF\7V\2\2E?"+
- "\3\2\2\2EB\3\2\2\2F\b\3\2\2\2GH\7v\2\2HI\7t\2\2IJ\7w\2\2JP\7g\2\2KL\7"+
- "V\2\2LM\7T\2\2MN\7W\2\2NP\7G\2\2OG\3\2\2\2OK\3\2\2\2P\n\3\2\2\2QR\7h\2"+
- "\2RS\7c\2\2ST\7n\2\2TU\7u\2\2U\\\7g\2\2VW\7H\2\2WX\7C\2\2XY\7N\2\2YZ\7"+
- "U\2\2Z\\\7G\2\2[Q\3\2\2\2[V\3\2\2\2\\\f\3\2\2\2]^\7?\2\2^_\7?\2\2_\16"+
- "\3\2\2\2`a\7#\2\2ab\7?\2\2b\20\3\2\2\2cd\7.\2\2d\22\3\2\2\2ef\7]\2\2f"+
- "\24\3\2\2\2gh\7_\2\2h\26\3\2\2\2ij\7*\2\2j\30\3\2\2\2kl\7+\2\2l\32\3\2"+
- "\2\2mn\7k\2\2no\7p\2\2o\34\3\2\2\2pq\7p\2\2qr\7q\2\2rs\7v\2\2st\7\"\2"+
- "\2tu\7k\2\2uv\7p\2\2v\36\3\2\2\2wx\7g\2\2xy\7z\2\2yz\7k\2\2z{\7u\2\2{"+
- "|\7v\2\2|}\7u\2\2} \3\2\2\2~\u0082\t\2\2\2\177\u0081\t\3\2\2\u0080\177"+
- "\3\2\2\2\u0081\u0084\3\2\2\2\u0082\u0080\3\2\2\2\u0082\u0083\3\2\2\2\u0083"+
- "\"\3\2\2\2\u0084\u0082\3\2\2\2\u0085\u0086\n\4\2\2\u0086$\3\2\2\2\u0087"+
- "\u008b\7$\2\2\u0088\u008a\5#\22\2\u0089\u0088\3\2\2\2\u008a\u008d\3\2"+
- "\2\2\u008b\u0089\3\2\2\2\u008b\u008c\3\2\2\2\u008c\u008e\3\2\2\2\u008d"+
- "\u008b\3\2\2\2\u008e\u0098\7$\2\2\u008f\u0093\7)\2\2\u0090\u0092\5#\22"+
- "\2\u0091\u0090\3\2\2\2\u0092\u0095\3\2\2\2\u0093\u0091\3\2\2\2\u0093\u0094"+
- "\3\2\2\2\u0094\u0096\3\2\2\2\u0095\u0093\3\2\2\2\u0096\u0098\7)\2\2\u0097"+
- "\u0087\3\2\2\2\u0097\u008f\3\2\2\2\u0098&\3\2\2\2\u0099\u009a\7=\2\2\u009a"+
- "(\3\2\2\2\u009b\u009c\7\61\2\2\u009c\u009d\7\61\2\2\u009d\u009f\3\2\2"+
- "\2\u009e\u00a0\13\2\2\2\u009f\u009e\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1"+
- "\u00a2\3\2\2\2\u00a1\u009f\3\2\2\2\u00a2\u00a4\3\2\2\2\u00a3\u00a5\t\5"+
- "\2\2\u00a4\u00a3\3\2\2\2\u00a5\u00a6\3\2\2\2\u00a6\u00a7\b\25\2\2\u00a7"+
- "*\3\2\2\2\u00a8\u00aa\t\6\2\2\u00a9\u00a8\3\2\2\2\u00aa\u00ab\3\2\2\2"+
- "\u00ab\u00a9\3\2\2\2\u00ab\u00ac\3\2\2\2\u00ac\u00ad\3\2\2\2\u00ad\u00ae"+
- "\b\26\2\2\u00ae,\3\2\2\2\17\2\65=EO[\u0082\u008b\u0093\u0097\u00a1\u00a4"+
- "\u00ab\3\b\2\2";
+ "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+
+ "\t\31\4\32\t\32\4\33\t\33\4\34\t\34\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\2\5"+
+ "\2B\n\2\3\3\3\3\3\3\3\3\3\3\3\3\5\3J\n\3\3\4\3\4\3\4\3\4\3\4\3\4\5\4R"+
+ "\n\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5\\\n\5\3\6\3\6\3\6\3\6\3\6\3\6"+
+ "\3\6\3\6\3\6\3\6\5\6h\n\6\3\7\3\7\3\7\3\b\3\b\3\b\3\t\3\t\3\n\3\n\3\n"+
+ "\3\13\3\13\3\f\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\20\3\20\3\21\3\21"+
+ "\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24"+
+ "\3\24\3\24\3\24\3\25\6\25\u0096\n\25\r\25\16\25\u0097\3\26\6\26\u009b"+
+ "\n\26\r\26\16\26\u009c\3\26\3\26\6\26\u00a1\n\26\r\26\16\26\u00a2\3\27"+
+ "\3\27\7\27\u00a7\n\27\f\27\16\27\u00aa\13\27\3\30\3\30\3\31\3\31\7\31"+
+ "\u00b0\n\31\f\31\16\31\u00b3\13\31\3\31\3\31\3\31\7\31\u00b8\n\31\f\31"+
+ "\16\31\u00bb\13\31\3\31\5\31\u00be\n\31\3\32\3\32\3\33\3\33\3\33\3\33"+
+ "\6\33\u00c6\n\33\r\33\16\33\u00c7\3\33\5\33\u00cb\n\33\3\33\3\33\3\34"+
+ "\6\34\u00d0\n\34\r\34\16\34\u00d1\3\34\3\34\3\u00c7\2\35\3\3\5\4\7\5\t"+
+ "\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23"+
+ "%\24\'\25)\26+\27-\30/\2\61\31\63\32\65\33\67\34\3\2\7\5\2C\\aac|\b\2"+
+ "\60\60\62;C\\^^aac|\7\2\f\f\17\17$$))^^\3\3\f\f\5\2\13\f\16\17\"\"\u00e3"+
+ "\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2"+
+ "\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2"+
+ "\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2"+
+ "\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2\61\3\2"+
+ "\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\3A\3\2\2\2\5I\3\2\2\2\7Q\3"+
+ "\2\2\2\t[\3\2\2\2\13g\3\2\2\2\ri\3\2\2\2\17l\3\2\2\2\21o\3\2\2\2\23q\3"+
+ "\2\2\2\25t\3\2\2\2\27v\3\2\2\2\31y\3\2\2\2\33{\3\2\2\2\35}\3\2\2\2\37"+
+ "\177\3\2\2\2!\u0081\3\2\2\2#\u0083\3\2\2\2%\u0086\3\2\2\2\'\u008d\3\2"+
+ "\2\2)\u0095\3\2\2\2+\u009a\3\2\2\2-\u00a4\3\2\2\2/\u00ab\3\2\2\2\61\u00bd"+
+ "\3\2\2\2\63\u00bf\3\2\2\2\65\u00c1\3\2\2\2\67\u00cf\3\2\2\29:\7c\2\2:"+
+ ";\7p\2\2;B\7f\2\2<=\7(\2\2=B\7(\2\2>?\7C\2\2?@\7P\2\2@B\7F\2\2A9\3\2\2"+
+ "\2A<\3\2\2\2A>\3\2\2\2B\4\3\2\2\2CD\7q\2\2DJ\7t\2\2EF\7~\2\2FJ\7~\2\2"+
+ "GH\7Q\2\2HJ\7T\2\2IC\3\2\2\2IE\3\2\2\2IG\3\2\2\2J\6\3\2\2\2KL\7p\2\2L"+
+ "M\7q\2\2MR\7v\2\2NO\7P\2\2OP\7Q\2\2PR\7V\2\2QK\3\2\2\2QN\3\2\2\2R\b\3"+
+ "\2\2\2ST\7v\2\2TU\7t\2\2UV\7w\2\2V\\\7g\2\2WX\7V\2\2XY\7T\2\2YZ\7W\2\2"+
+ "Z\\\7G\2\2[S\3\2\2\2[W\3\2\2\2\\\n\3\2\2\2]^\7h\2\2^_\7c\2\2_`\7n\2\2"+
+ "`a\7u\2\2ah\7g\2\2bc\7H\2\2cd\7C\2\2de\7N\2\2ef\7U\2\2fh\7G\2\2g]\3\2"+
+ "\2\2gb\3\2\2\2h\f\3\2\2\2ij\7?\2\2jk\7?\2\2k\16\3\2\2\2lm\7#\2\2mn\7?"+
+ "\2\2n\20\3\2\2\2op\7>\2\2p\22\3\2\2\2qr\7>\2\2rs\7?\2\2s\24\3\2\2\2tu"+
+ "\7@\2\2u\26\3\2\2\2vw\7@\2\2wx\7?\2\2x\30\3\2\2\2yz\7.\2\2z\32\3\2\2\2"+
+ "{|\7]\2\2|\34\3\2\2\2}~\7_\2\2~\36\3\2\2\2\177\u0080\7*\2\2\u0080 \3\2"+
+ "\2\2\u0081\u0082\7+\2\2\u0082\"\3\2\2\2\u0083\u0084\7k\2\2\u0084\u0085"+
+ "\7p\2\2\u0085$\3\2\2\2\u0086\u0087\7p\2\2\u0087\u0088\7q\2\2\u0088\u0089"+
+ "\7v\2\2\u0089\u008a\7\"\2\2\u008a\u008b\7k\2\2\u008b\u008c\7p\2\2\u008c"+
+ "&\3\2\2\2\u008d\u008e\7g\2\2\u008e\u008f\7z\2\2\u008f\u0090\7k\2\2\u0090"+
+ "\u0091\7u\2\2\u0091\u0092\7v\2\2\u0092\u0093\7u\2\2\u0093(\3\2\2\2\u0094"+
+ "\u0096\4\62;\2\u0095\u0094\3\2\2\2\u0096\u0097\3\2\2\2\u0097\u0095\3\2"+
+ "\2\2\u0097\u0098\3\2\2\2\u0098*\3\2\2\2\u0099\u009b\4\62;\2\u009a\u0099"+
+ "\3\2\2\2\u009b\u009c\3\2\2\2\u009c\u009a\3\2\2\2\u009c\u009d\3\2\2\2\u009d"+
+ "\u009e\3\2\2\2\u009e\u00a0\7\60\2\2\u009f\u00a1\4\62;\2\u00a0\u009f\3"+
+ "\2\2\2\u00a1\u00a2\3\2\2\2\u00a2\u00a0\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3"+
+ ",\3\2\2\2\u00a4\u00a8\t\2\2\2\u00a5\u00a7\t\3\2\2\u00a6\u00a5\3\2\2\2"+
+ "\u00a7\u00aa\3\2\2\2\u00a8\u00a6\3\2\2\2\u00a8\u00a9\3\2\2\2\u00a9.\3"+
+ "\2\2\2\u00aa\u00a8\3\2\2\2\u00ab\u00ac\n\4\2\2\u00ac\60\3\2\2\2\u00ad"+
+ "\u00b1\7$\2\2\u00ae\u00b0\5/\30\2\u00af\u00ae\3\2\2\2\u00b0\u00b3\3\2"+
+ "\2\2\u00b1\u00af\3\2\2\2\u00b1\u00b2\3\2\2\2\u00b2\u00b4\3\2\2\2\u00b3"+
+ "\u00b1\3\2\2\2\u00b4\u00be\7$\2\2\u00b5\u00b9\7)\2\2\u00b6\u00b8\5/\30"+
+ "\2\u00b7\u00b6\3\2\2\2\u00b8\u00bb\3\2\2\2\u00b9\u00b7\3\2\2\2\u00b9\u00ba"+
+ "\3\2\2\2\u00ba\u00bc\3\2\2\2\u00bb\u00b9\3\2\2\2\u00bc\u00be\7)\2\2\u00bd"+
+ "\u00ad\3\2\2\2\u00bd\u00b5\3\2\2\2\u00be\62\3\2\2\2\u00bf\u00c0\7=\2\2"+
+ "\u00c0\64\3\2\2\2\u00c1\u00c2\7\61\2\2\u00c2\u00c3\7\61\2\2\u00c3\u00c5"+
+ "\3\2\2\2\u00c4\u00c6\13\2\2\2\u00c5\u00c4\3\2\2\2\u00c6\u00c7\3\2\2\2"+
+ "\u00c7\u00c8\3\2\2\2\u00c7\u00c5\3\2\2\2\u00c8\u00ca\3\2\2\2\u00c9\u00cb"+
+ "\t\5\2\2\u00ca\u00c9\3\2\2\2\u00cb\u00cc\3\2\2\2\u00cc\u00cd\b\33\2\2"+
+ "\u00cd\66\3\2\2\2\u00ce\u00d0\t\6\2\2\u00cf\u00ce\3\2\2\2\u00d0\u00d1"+
+ "\3\2\2\2\u00d1\u00cf\3\2\2\2\u00d1\u00d2\3\2\2\2\u00d2\u00d3\3\2\2\2\u00d3"+
+ "\u00d4\b\34\2\2\u00d48\3\2\2\2\22\2AIQ[g\u0097\u009c\u00a2\u00a8\u00b1"+
+ "\u00b9\u00bd\u00c7\u00ca\u00d1\3\b\2\2";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateListener.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateListener.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateListener.java
index 6a8b669..c39c678 100644
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateListener.java
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateListener.java
@@ -225,6 +225,18 @@ public interface PredicateListener extends ParseTreeListener {
*/
void exitOp_list(PredicateParser.Op_listContext ctx);
/**
+ * Enter a parse tree produced by the {@code TransformationFunc}
+ * labeled alternative in {@link PredicateParser#t_func}.
+ * @param ctx the parse tree
+ */
+ void enterTransformationFunc(PredicateParser.TransformationFuncContext ctx);
+ /**
+ * Exit a parse tree produced by the {@code TransformationFunc}
+ * labeled alternative in {@link PredicateParser#t_func}.
+ * @param ctx the parse tree
+ */
+ void exitTransformationFunc(PredicateParser.TransformationFuncContext ctx);
+ /**
* Enter a parse tree produced by the {@code StringLiteral}
* labeled alternative in {@link PredicateParser#identifier_operand}.
* @param ctx the parse tree
@@ -249,17 +261,53 @@ public interface PredicateListener extends ParseTreeListener {
*/
void exitLogicalVariable(PredicateParser.LogicalVariableContext ctx);
/**
- * Enter a parse tree produced by the {@code StringFunc}
+ * Enter a parse tree produced by the {@code id_tfunc}
+ * labeled alternative in {@link PredicateParser#identifier_operand}.
+ * @param ctx the parse tree
+ */
+ void enterId_tfunc(PredicateParser.Id_tfuncContext ctx);
+ /**
+ * Exit a parse tree produced by the {@code id_tfunc}
+ * labeled alternative in {@link PredicateParser#identifier_operand}.
+ * @param ctx the parse tree
+ */
+ void exitId_tfunc(PredicateParser.Id_tfuncContext ctx);
+ /**
+ * Enter a parse tree produced by the {@code IntegerLiteral}
+ * labeled alternative in {@link PredicateParser#identifier_operand}.
+ * @param ctx the parse tree
+ */
+ void enterIntegerLiteral(PredicateParser.IntegerLiteralContext ctx);
+ /**
+ * Exit a parse tree produced by the {@code IntegerLiteral}
+ * labeled alternative in {@link PredicateParser#identifier_operand}.
+ * @param ctx the parse tree
+ */
+ void exitIntegerLiteral(PredicateParser.IntegerLiteralContext ctx);
+ /**
+ * Enter a parse tree produced by the {@code DoubleLiteral}
+ * labeled alternative in {@link PredicateParser#identifier_operand}.
+ * @param ctx the parse tree
+ */
+ void enterDoubleLiteral(PredicateParser.DoubleLiteralContext ctx);
+ /**
+ * Exit a parse tree produced by the {@code DoubleLiteral}
+ * labeled alternative in {@link PredicateParser#identifier_operand}.
+ * @param ctx the parse tree
+ */
+ void exitDoubleLiteral(PredicateParser.DoubleLiteralContext ctx);
+ /**
+ * Enter a parse tree produced by the {@code List}
* labeled alternative in {@link PredicateParser#identifier_operand}.
* @param ctx the parse tree
*/
- void enterStringFunc(PredicateParser.StringFuncContext ctx);
+ void enterList(PredicateParser.ListContext ctx);
/**
- * Exit a parse tree produced by the {@code StringFunc}
+ * Exit a parse tree produced by the {@code List}
* labeled alternative in {@link PredicateParser#identifier_operand}.
* @param ctx the parse tree
*/
- void exitStringFunc(PredicateParser.StringFuncContext ctx);
+ void exitList(PredicateParser.ListContext ctx);
/**
* Enter a parse tree produced by the {@code IdentifierOperand}
* labeled alternative in {@link PredicateParser#comparison_operand}.
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateParser.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateParser.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateParser.java
index 3586f01..1bc67a6 100644
--- a/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateParser.java
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/query/generated/PredicateParser.java
@@ -37,25 +37,30 @@ public class PredicateParser extends Parser {
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
- AND=1, OR=2, NOT=3, TRUE=4, FALSE=5, EQ=6, NEQ=7, COMMA=8, LBRACKET=9,
- RBRACKET=10, LPAREN=11, RPAREN=12, IN=13, NIN=14, EXISTS=15, IDENTIFIER=16,
- STRING_LITERAL=17, SEMI=18, COMMENT=19, WS=20;
+ AND=1, OR=2, NOT=3, TRUE=4, FALSE=5, EQ=6, NEQ=7, LT=8, LTE=9, GT=10,
+ GTE=11, COMMA=12, LBRACKET=13, RBRACKET=14, LPAREN=15, RPAREN=16, IN=17,
+ NIN=18, EXISTS=19, INT_LITERAL=20, DOUBLE_LITERAL=21, IDENTIFIER=22, STRING_LITERAL=23,
+ SEMI=24, COMMENT=25, WS=26;
public static final int
RULE_single_rule = 0, RULE_logical_expr = 1, RULE_comparison_expr = 2,
RULE_logical_entity = 3, RULE_list_entity = 4, RULE_func_args = 5, RULE_op_list = 6,
- RULE_identifier_operand = 7, RULE_comparison_operand = 8, RULE_comp_operator = 9;
+ RULE_t_func = 7, RULE_identifier_operand = 8, RULE_comparison_operand = 9,
+ RULE_comp_operator = 10;
public static final String[] ruleNames = {
"single_rule", "logical_expr", "comparison_expr", "logical_entity", "list_entity",
- "func_args", "op_list", "identifier_operand", "comparison_operand", "comp_operator"
+ "func_args", "op_list", "t_func", "identifier_operand", "comparison_operand",
+ "comp_operator"
};
private static final String[] _LITERAL_NAMES = {
- null, null, null, null, null, null, "'=='", "'!='", "','", "'['", "']'",
- "'('", "')'", "'in'", "'not in'", "'exists'", null, null, "';'"
+ null, null, null, null, null, null, "'=='", "'!='", "'<'", "'<='", "'>'",
+ "'>='", "','", "'['", "']'", "'('", "')'", "'in'", "'not in'", "'exists'",
+ null, null, null, null, "';'"
};
private static final String[] _SYMBOLIC_NAMES = {
- null, "AND", "OR", "NOT", "TRUE", "FALSE", "EQ", "NEQ", "COMMA", "LBRACKET",
- "RBRACKET", "LPAREN", "RPAREN", "IN", "NIN", "EXISTS", "IDENTIFIER", "STRING_LITERAL",
+ null, "AND", "OR", "NOT", "TRUE", "FALSE", "EQ", "NEQ", "LT", "LTE", "GT",
+ "GTE", "COMMA", "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", "IN", "NIN",
+ "EXISTS", "INT_LITERAL", "DOUBLE_LITERAL", "IDENTIFIER", "STRING_LITERAL",
"SEMI", "COMMENT", "WS"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
@@ -132,9 +137,9 @@ public class PredicateParser extends Parser {
try {
enterOuterAlt(_localctx, 1);
{
- setState(20);
+ setState(22);
logical_expr(0);
- setState(21);
+ setState(23);
match(EOF);
}
}
@@ -273,7 +278,7 @@ public class PredicateParser extends Parser {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(35);
+ setState(37);
switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) {
case 1:
{
@@ -281,7 +286,7 @@ public class PredicateParser extends Parser {
_ctx = _localctx;
_prevctx = _localctx;
- setState(24);
+ setState(26);
comparison_expr();
}
break;
@@ -290,11 +295,11 @@ public class PredicateParser extends Parser {
_localctx = new LogicalExpressionInParenContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(25);
+ setState(27);
match(LPAREN);
- setState(26);
+ setState(28);
logical_expr(0);
- setState(27);
+ setState(29);
match(RPAREN);
}
break;
@@ -303,13 +308,13 @@ public class PredicateParser extends Parser {
_localctx = new NotFuncContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(29);
+ setState(31);
match(NOT);
- setState(30);
+ setState(32);
match(LPAREN);
- setState(31);
+ setState(33);
logical_expr(0);
- setState(32);
+ setState(34);
match(RPAREN);
}
break;
@@ -318,13 +323,13 @@ public class PredicateParser extends Parser {
_localctx = new LogicalEntityContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(34);
+ setState(36);
logical_entity();
}
break;
}
_ctx.stop = _input.LT(-1);
- setState(45);
+ setState(47);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,2,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
@@ -332,17 +337,17 @@ public class PredicateParser extends Parser {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
- setState(43);
+ setState(45);
switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
case 1:
{
_localctx = new LogicalExpressionAndContext(new Logical_exprContext(_parentctx, _parentState));
pushNewRecursionContext(_localctx, _startState, RULE_logical_expr);
- setState(37);
+ setState(39);
if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)");
- setState(38);
+ setState(40);
match(AND);
- setState(39);
+ setState(41);
logical_expr(7);
}
break;
@@ -350,18 +355,18 @@ public class PredicateParser extends Parser {
{
_localctx = new LogicalExpressionOrContext(new Logical_exprContext(_parentctx, _parentState));
pushNewRecursionContext(_localctx, _startState, RULE_logical_expr);
- setState(40);
+ setState(42);
if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)");
- setState(41);
+ setState(43);
match(OR);
- setState(42);
+ setState(44);
logical_expr(6);
}
break;
}
}
}
- setState(47);
+ setState(49);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,2,_ctx);
}
@@ -406,13 +411,13 @@ public class PredicateParser extends Parser {
}
}
public static class InExpressionContext extends Comparison_exprContext {
- public Identifier_operandContext identifier_operand() {
- return getRuleContext(Identifier_operandContext.class,0);
+ public List<Identifier_operandContext> identifier_operand() {
+ return getRuleContexts(Identifier_operandContext.class);
}
- public TerminalNode IN() { return getToken(PredicateParser.IN, 0); }
- public List_entityContext list_entity() {
- return getRuleContext(List_entityContext.class,0);
+ public Identifier_operandContext identifier_operand(int i) {
+ return getRuleContext(Identifier_operandContext.class,i);
}
+ public TerminalNode IN() { return getToken(PredicateParser.IN, 0); }
public InExpressionContext(Comparison_exprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
@@ -444,13 +449,13 @@ public class PredicateParser extends Parser {
}
}
public static class NInExpressionContext extends Comparison_exprContext {
- public Identifier_operandContext identifier_operand() {
- return getRuleContext(Identifier_operandContext.class,0);
+ public List<Identifier_operandContext> identifier_operand() {
+ return getRuleContexts(Identifier_operandContext.class);
}
- public TerminalNode NIN() { return getToken(PredicateParser.NIN, 0); }
- public List_entityContext list_entity() {
- return getRuleContext(List_entityContext.class,0);
+ public Identifier_operandContext identifier_operand(int i) {
+ return getRuleContext(Identifier_operandContext.class,i);
}
+ public TerminalNode NIN() { return getToken(PredicateParser.NIN, 0); }
public NInExpressionContext(Comparison_exprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
@@ -466,17 +471,17 @@ public class PredicateParser extends Parser {
Comparison_exprContext _localctx = new Comparison_exprContext(_ctx, getState());
enterRule(_localctx, 4, RULE_comparison_expr);
try {
- setState(64);
+ setState(66);
switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) {
case 1:
_localctx = new ComparisonExpressionWithOperatorContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(48);
+ setState(50);
comparison_operand();
- setState(49);
+ setState(51);
comp_operator();
- setState(50);
+ setState(52);
comparison_operand();
}
break;
@@ -484,35 +489,35 @@ public class PredicateParser extends Parser {
_localctx = new InExpressionContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(52);
+ setState(54);
identifier_operand();
- setState(53);
+ setState(55);
match(IN);
- setState(54);
- list_entity();
+ setState(56);
+ identifier_operand();
}
break;
case 3:
_localctx = new NInExpressionContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(56);
+ setState(58);
identifier_operand();
- setState(57);
+ setState(59);
match(NIN);
- setState(58);
- list_entity();
+ setState(60);
+ identifier_operand();
}
break;
case 4:
_localctx = new ComparisonExpressionParensContext(_localctx);
enterOuterAlt(_localctx, 4);
{
- setState(60);
+ setState(62);
match(LPAREN);
- setState(61);
+ setState(63);
comparison_expr();
- setState(62);
+ setState(64);
match(RPAREN);
}
break;
@@ -591,14 +596,14 @@ public class PredicateParser extends Parser {
enterRule(_localctx, 6, RULE_logical_entity);
int _la;
try {
- setState(76);
+ setState(78);
switch (_input.LA(1)) {
case TRUE:
case FALSE:
_localctx = new LogicalConstContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(66);
+ setState(68);
_la = _input.LA(1);
if ( !(_la==TRUE || _la==FALSE) ) {
_errHandler.recoverInline(this);
@@ -611,13 +616,13 @@ public class PredicateParser extends Parser {
_localctx = new ExistsFuncContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(67);
+ setState(69);
match(EXISTS);
- setState(68);
+ setState(70);
match(LPAREN);
- setState(69);
+ setState(71);
match(IDENTIFIER);
- setState(70);
+ setState(72);
match(RPAREN);
}
break;
@@ -625,13 +630,13 @@ public class PredicateParser extends Parser {
_localctx = new LogicalFuncContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(71);
+ setState(73);
match(IDENTIFIER);
- setState(72);
+ setState(74);
match(LPAREN);
- setState(73);
+ setState(75);
func_args();
- setState(74);
+ setState(76);
match(RPAREN);
}
break;
@@ -676,11 +681,11 @@ public class PredicateParser extends Parser {
try {
enterOuterAlt(_localctx, 1);
{
- setState(78);
+ setState(80);
match(LBRACKET);
- setState(79);
+ setState(81);
op_list(0);
- setState(80);
+ setState(82);
match(RBRACKET);
}
}
@@ -719,7 +724,7 @@ public class PredicateParser extends Parser {
try {
enterOuterAlt(_localctx, 1);
{
- setState(82);
+ setState(84);
op_list(0);
}
}
@@ -772,11 +777,11 @@ public class PredicateParser extends Parser {
enterOuterAlt(_localctx, 1);
{
{
- setState(85);
+ setState(87);
identifier_operand();
}
_ctx.stop = _input.LT(-1);
- setState(92);
+ setState(94);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,5,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
@@ -787,16 +792,16 @@ public class PredicateParser extends Parser {
{
_localctx = new Op_listContext(_parentctx, _parentState);
pushNewRecursionContext(_localctx, _startState, RULE_op_list);
- setState(87);
+ setState(89);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
- setState(88);
+ setState(90);
match(COMMA);
- setState(89);
+ setState(91);
identifier_operand();
}
}
}
- setState(94);
+ setState(96);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,5,_ctx);
}
@@ -813,6 +818,63 @@ public class PredicateParser extends Parser {
return _localctx;
}
+ public static class T_funcContext extends ParserRuleContext {
+ public T_funcContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_t_func; }
+
+ public T_funcContext() { }
+ public void copyFrom(T_funcContext ctx) {
+ super.copyFrom(ctx);
+ }
+ }
+ public static class TransformationFuncContext extends T_funcContext {
+ public TerminalNode IDENTIFIER() { return getToken(PredicateParser.IDENTIFIER, 0); }
+ public TerminalNode LPAREN() { return getToken(PredicateParser.LPAREN, 0); }
+ public Func_argsContext func_args() {
+ return getRuleContext(Func_argsContext.class,0);
+ }
+ public TerminalNode RPAREN() { return getToken(PredicateParser.RPAREN, 0); }
+ public TransformationFuncContext(T_funcContext ctx) { copyFrom(ctx); }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof PredicateListener ) ((PredicateListener)listener).enterTransformationFunc(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof PredicateListener ) ((PredicateListener)listener).exitTransformationFunc(this);
+ }
+ }
+
+ public final T_funcContext t_func() throws RecognitionException {
+ T_funcContext _localctx = new T_funcContext(_ctx, getState());
+ enterRule(_localctx, 14, RULE_t_func);
+ try {
+ _localctx = new TransformationFuncContext(_localctx);
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(97);
+ match(IDENTIFIER);
+ setState(98);
+ match(LPAREN);
+ setState(99);
+ func_args();
+ setState(100);
+ match(RPAREN);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
public static class Identifier_operandContext extends ParserRuleContext {
public Identifier_operandContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
@@ -848,35 +910,70 @@ public class PredicateParser extends Parser {
if ( listener instanceof PredicateListener ) ((PredicateListener)listener).exitStringLiteral(this);
}
}
- public static class StringFuncContext extends Identifier_operandContext {
- public TerminalNode IDENTIFIER() { return getToken(PredicateParser.IDENTIFIER, 0); }
- public TerminalNode LPAREN() { return getToken(PredicateParser.LPAREN, 0); }
- public Func_argsContext func_args() {
- return getRuleContext(Func_argsContext.class,0);
+ public static class ListContext extends Identifier_operandContext {
+ public List_entityContext list_entity() {
+ return getRuleContext(List_entityContext.class,0);
}
- public TerminalNode RPAREN() { return getToken(PredicateParser.RPAREN, 0); }
- public StringFuncContext(Identifier_operandContext ctx) { copyFrom(ctx); }
+ public ListContext(Identifier_operandContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof PredicateListener ) ((PredicateListener)listener).enterStringFunc(this);
+ if ( listener instanceof PredicateListener ) ((PredicateListener)listener).enterList(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof PredicateListener ) ((PredicateListener)listener).exitStringFunc(this);
+ if ( listener instanceof PredicateListener ) ((PredicateListener)listener).exitList(this);
+ }
+ }
+ public static class DoubleLiteralContext extends Identifier_operandContext {
+ public TerminalNode DOUBLE_LITERAL() { return getToken(PredicateParser.DOUBLE_LITERAL, 0); }
+ public DoubleLiteralContext(Identifier_operandContext ctx) { copyFrom(ctx); }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof PredicateListener ) ((PredicateListener)listener).enterDoubleLiteral(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof PredicateListener ) ((PredicateListener)listener).exitDoubleLiteral(this);
+ }
+ }
+ public static class Id_tfuncContext extends Identifier_operandContext {
+ public T_funcContext t_func() {
+ return getRuleContext(T_funcContext.class,0);
+ }
+ public Id_tfuncContext(Identifier_operandContext ctx) { copyFrom(ctx); }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof PredicateListener ) ((PredicateListener)listener).enterId_tfunc(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof PredicateListener ) ((PredicateListener)listener).exitId_tfunc(this);
+ }
+ }
+ public static class IntegerLiteralContext extends Identifier_operandContext {
+ public TerminalNode INT_LITERAL() { return getToken(PredicateParser.INT_LITERAL, 0); }
+ public IntegerLiteralContext(Identifier_operandContext ctx) { copyFrom(ctx); }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof PredicateListener ) ((PredicateListener)listener).enterIntegerLiteral(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof PredicateListener ) ((PredicateListener)listener).exitIntegerLiteral(this);
}
}
public final Identifier_operandContext identifier_operand() throws RecognitionException {
Identifier_operandContext _localctx = new Identifier_operandContext(_ctx, getState());
- enterRule(_localctx, 14, RULE_identifier_operand);
+ enterRule(_localctx, 16, RULE_identifier_operand);
try {
- setState(102);
+ setState(108);
switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) {
case 1:
_localctx = new StringLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(95);
+ setState(102);
match(STRING_LITERAL);
}
break;
@@ -884,22 +981,40 @@ public class PredicateParser extends Parser {
_localctx = new LogicalVariableContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(96);
+ setState(103);
match(IDENTIFIER);
}
break;
case 3:
- _localctx = new StringFuncContext(_localctx);
+ _localctx = new Id_tfuncContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(97);
- match(IDENTIFIER);
- setState(98);
- match(LPAREN);
- setState(99);
- func_args();
- setState(100);
- match(RPAREN);
+ setState(104);
+ t_func();
+ }
+ break;
+ case 4:
+ _localctx = new IntegerLiteralContext(_localctx);
+ enterOuterAlt(_localctx, 4);
+ {
+ setState(105);
+ match(INT_LITERAL);
+ }
+ break;
+ case 5:
+ _localctx = new DoubleLiteralContext(_localctx);
+ enterOuterAlt(_localctx, 5);
+ {
+ setState(106);
+ match(DOUBLE_LITERAL);
+ }
+ break;
+ case 6:
+ _localctx = new ListContext(_localctx);
+ enterOuterAlt(_localctx, 6);
+ {
+ setState(107);
+ list_entity();
}
break;
}
@@ -957,15 +1072,15 @@ public class PredicateParser extends Parser {
public final Comparison_operandContext comparison_operand() throws RecognitionException {
Comparison_operandContext _localctx = new Comparison_operandContext(_ctx, getState());
- enterRule(_localctx, 16, RULE_comparison_operand);
+ enterRule(_localctx, 18, RULE_comparison_operand);
try {
- setState(106);
+ setState(112);
switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) {
case 1:
_localctx = new IdentifierOperandContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(104);
+ setState(110);
identifier_operand();
}
break;
@@ -973,7 +1088,7 @@ public class PredicateParser extends Parser {
_localctx = new LogicalConstComparisonContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(105);
+ setState(111);
logical_entity();
}
break;
@@ -1004,6 +1119,10 @@ public class PredicateParser extends Parser {
public static class ComparisonOpContext extends Comp_operatorContext {
public TerminalNode EQ() { return getToken(PredicateParser.EQ, 0); }
public TerminalNode NEQ() { return getToken(PredicateParser.NEQ, 0); }
+ public TerminalNode LT() { return getToken(PredicateParser.LT, 0); }
+ public TerminalNode LTE() { return getToken(PredicateParser.LTE, 0); }
+ public TerminalNode GT() { return getToken(PredicateParser.GT, 0); }
+ public TerminalNode GTE() { return getToken(PredicateParser.GTE, 0); }
public ComparisonOpContext(Comp_operatorContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
@@ -1017,15 +1136,15 @@ public class PredicateParser extends Parser {
public final Comp_operatorContext comp_operator() throws RecognitionException {
Comp_operatorContext _localctx = new Comp_operatorContext(_ctx, getState());
- enterRule(_localctx, 18, RULE_comp_operator);
+ enterRule(_localctx, 20, RULE_comp_operator);
int _la;
try {
_localctx = new ComparisonOpContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(108);
+ setState(114);
_la = _input.LA(1);
- if ( !(_la==EQ || _la==NEQ) ) {
+ if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << EQ) | (1L << NEQ) | (1L << LT) | (1L << LTE) | (1L << GT) | (1L << GTE))) != 0)) ) {
_errHandler.recoverInline(this);
} else {
consume();
@@ -1070,33 +1189,35 @@ public class PredicateParser extends Parser {
}
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\26q\4\2\t\2\4\3\t"+
- "\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\3"+
- "\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3&\n\3\3"+
- "\3\3\3\3\3\3\3\3\3\3\3\7\3.\n\3\f\3\16\3\61\13\3\3\4\3\4\3\4\3\4\3\4\3"+
- "\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4C\n\4\3\5\3\5\3\5\3\5\3"+
- "\5\3\5\3\5\3\5\3\5\3\5\5\5O\n\5\3\6\3\6\3\6\3\6\3\7\3\7\3\b\3\b\3\b\3"+
- "\b\3\b\3\b\7\b]\n\b\f\b\16\b`\13\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\5\ti\n"+
- "\t\3\n\3\n\5\nm\n\n\3\13\3\13\3\13\2\4\4\16\f\2\4\6\b\n\f\16\20\22\24"+
- "\2\4\3\2\6\7\3\2\b\tt\2\26\3\2\2\2\4%\3\2\2\2\6B\3\2\2\2\bN\3\2\2\2\n"+
- "P\3\2\2\2\fT\3\2\2\2\16V\3\2\2\2\20h\3\2\2\2\22l\3\2\2\2\24n\3\2\2\2\26"+
- "\27\5\4\3\2\27\30\7\2\2\3\30\3\3\2\2\2\31\32\b\3\1\2\32&\5\6\4\2\33\34"+
- "\7\r\2\2\34\35\5\4\3\2\35\36\7\16\2\2\36&\3\2\2\2\37 \7\5\2\2 !\7\r\2"+
- "\2!\"\5\4\3\2\"#\7\16\2\2#&\3\2\2\2$&\5\b\5\2%\31\3\2\2\2%\33\3\2\2\2"+
- "%\37\3\2\2\2%$\3\2\2\2&/\3\2\2\2\'(\f\b\2\2()\7\3\2\2).\5\4\3\t*+\f\7"+
- "\2\2+,\7\4\2\2,.\5\4\3\b-\'\3\2\2\2-*\3\2\2\2.\61\3\2\2\2/-\3\2\2\2/\60"+
- "\3\2\2\2\60\5\3\2\2\2\61/\3\2\2\2\62\63\5\22\n\2\63\64\5\24\13\2\64\65"+
- "\5\22\n\2\65C\3\2\2\2\66\67\5\20\t\2\678\7\17\2\289\5\n\6\29C\3\2\2\2"+
- ":;\5\20\t\2;<\7\20\2\2<=\5\n\6\2=C\3\2\2\2>?\7\r\2\2?@\5\6\4\2@A\7\16"+
- "\2\2AC\3\2\2\2B\62\3\2\2\2B\66\3\2\2\2B:\3\2\2\2B>\3\2\2\2C\7\3\2\2\2"+
- "DO\t\2\2\2EF\7\21\2\2FG\7\r\2\2GH\7\22\2\2HO\7\16\2\2IJ\7\22\2\2JK\7\r"+
- "\2\2KL\5\f\7\2LM\7\16\2\2MO\3\2\2\2ND\3\2\2\2NE\3\2\2\2NI\3\2\2\2O\t\3"+
- "\2\2\2PQ\7\13\2\2QR\5\16\b\2RS\7\f\2\2S\13\3\2\2\2TU\5\16\b\2U\r\3\2\2"+
- "\2VW\b\b\1\2WX\5\20\t\2X^\3\2\2\2YZ\f\3\2\2Z[\7\n\2\2[]\5\20\t\2\\Y\3"+
- "\2\2\2]`\3\2\2\2^\\\3\2\2\2^_\3\2\2\2_\17\3\2\2\2`^\3\2\2\2ai\7\23\2\2"+
- "bi\7\22\2\2cd\7\22\2\2de\7\r\2\2ef\5\f\7\2fg\7\16\2\2gi\3\2\2\2ha\3\2"+
- "\2\2hb\3\2\2\2hc\3\2\2\2i\21\3\2\2\2jm\5\20\t\2km\5\b\5\2lj\3\2\2\2lk"+
- "\3\2\2\2m\23\3\2\2\2no\t\3\2\2o\25\3\2\2\2\n%-/BN^hl";
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\34w\4\2\t\2\4\3\t"+
+ "\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4"+
+ "\f\t\f\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3"+
+ "(\n\3\3\3\3\3\3\3\3\3\3\3\3\3\7\3\60\n\3\f\3\16\3\63\13\3\3\4\3\4\3\4"+
+ "\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4E\n\4\3\5\3\5"+
+ "\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\5\5Q\n\5\3\6\3\6\3\6\3\6\3\7\3\7\3\b"+
+ "\3\b\3\b\3\b\3\b\3\b\7\b_\n\b\f\b\16\bb\13\b\3\t\3\t\3\t\3\t\3\t\3\n\3"+
+ "\n\3\n\3\n\3\n\3\n\5\no\n\n\3\13\3\13\5\13s\n\13\3\f\3\f\3\f\2\4\4\16"+
+ "\r\2\4\6\b\n\f\16\20\22\24\26\2\4\3\2\6\7\3\2\b\r|\2\30\3\2\2\2\4\'\3"+
+ "\2\2\2\6D\3\2\2\2\bP\3\2\2\2\nR\3\2\2\2\fV\3\2\2\2\16X\3\2\2\2\20c\3\2"+
+ "\2\2\22n\3\2\2\2\24r\3\2\2\2\26t\3\2\2\2\30\31\5\4\3\2\31\32\7\2\2\3\32"+
+ "\3\3\2\2\2\33\34\b\3\1\2\34(\5\6\4\2\35\36\7\21\2\2\36\37\5\4\3\2\37 "+
+ "\7\22\2\2 (\3\2\2\2!\"\7\5\2\2\"#\7\21\2\2#$\5\4\3\2$%\7\22\2\2%(\3\2"+
+ "\2\2&(\5\b\5\2\'\33\3\2\2\2\'\35\3\2\2\2\'!\3\2\2\2\'&\3\2\2\2(\61\3\2"+
+ "\2\2)*\f\b\2\2*+\7\3\2\2+\60\5\4\3\t,-\f\7\2\2-.\7\4\2\2.\60\5\4\3\b/"+
+ ")\3\2\2\2/,\3\2\2\2\60\63\3\2\2\2\61/\3\2\2\2\61\62\3\2\2\2\62\5\3\2\2"+
+ "\2\63\61\3\2\2\2\64\65\5\24\13\2\65\66\5\26\f\2\66\67\5\24\13\2\67E\3"+
+ "\2\2\289\5\22\n\29:\7\23\2\2:;\5\22\n\2;E\3\2\2\2<=\5\22\n\2=>\7\24\2"+
+ "\2>?\5\22\n\2?E\3\2\2\2@A\7\21\2\2AB\5\6\4\2BC\7\22\2\2CE\3\2\2\2D\64"+
+ "\3\2\2\2D8\3\2\2\2D<\3\2\2\2D@\3\2\2\2E\7\3\2\2\2FQ\t\2\2\2GH\7\25\2\2"+
+ "HI\7\21\2\2IJ\7\30\2\2JQ\7\22\2\2KL\7\30\2\2LM\7\21\2\2MN\5\f\7\2NO\7"+
+ "\22\2\2OQ\3\2\2\2PF\3\2\2\2PG\3\2\2\2PK\3\2\2\2Q\t\3\2\2\2RS\7\17\2\2"+
+ "ST\5\16\b\2TU\7\20\2\2U\13\3\2\2\2VW\5\16\b\2W\r\3\2\2\2XY\b\b\1\2YZ\5"+
+ "\22\n\2Z`\3\2\2\2[\\\f\3\2\2\\]\7\16\2\2]_\5\22\n\2^[\3\2\2\2_b\3\2\2"+
+ "\2`^\3\2\2\2`a\3\2\2\2a\17\3\2\2\2b`\3\2\2\2cd\7\30\2\2de\7\21\2\2ef\5"+
+ "\f\7\2fg\7\22\2\2g\21\3\2\2\2ho\7\31\2\2io\7\30\2\2jo\5\20\t\2ko\7\26"+
+ "\2\2lo\7\27\2\2mo\5\n\6\2nh\3\2\2\2ni\3\2\2\2nj\3\2\2\2nk\3\2\2\2nl\3"+
+ "\2\2\2nm\3\2\2\2o\23\3\2\2\2ps\5\22\n\2qs\5\b\5\2rp\3\2\2\2rq\3\2\2\2"+
+ "s\25\3\2\2\2tu\t\3\2\2u\27\3\2\2\2\n\'/\61DP`nr";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/TransformationCompiler.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/TransformationCompiler.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/TransformationCompiler.java
new file mode 100644
index 0000000..2d9f0bd
--- /dev/null
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/TransformationCompiler.java
@@ -0,0 +1,160 @@
+/**
+ * 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.metron.common.transformation;
+
+import com.google.common.base.Joiner;
+import org.apache.metron.common.dsl.Token;
+import org.apache.metron.common.dsl.TransformationFunctions;
+import org.apache.metron.common.dsl.FunctionMarker;
+import org.apache.metron.common.dsl.ParseException;
+import org.apache.metron.common.dsl.VariableResolver;
+import org.apache.metron.common.transformation.generated.TransformationBaseListener;
+import org.apache.metron.common.transformation.generated.TransformationParser;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Stack;
+import java.util.function.Function;
+
+public class TransformationCompiler extends TransformationBaseListener {
+ private VariableResolver resolver = null;
+ private Stack<Token> tokenStack = new Stack<>();
+ public TransformationCompiler(VariableResolver resolver) {
+ this.resolver = resolver;
+ }
+
+ @Override
+ public void enterTransformation(TransformationParser.TransformationContext ctx) {
+ tokenStack.clear();
+ }
+
+
+ @Override
+ public void exitVariable(TransformationParser.VariableContext ctx) {
+ tokenStack.push(new Token<>(resolver.resolve(ctx.getText()), Object.class));
+ }
+
+ @Override
+ public void exitStringLiteral(TransformationParser.StringLiteralContext ctx) {
+ tokenStack.push(new Token<>(ctx.getText().substring(1, ctx.getText().length() - 1), String.class));
+ }
+
+
+ @Override
+ public void exitIntegerLiteral(TransformationParser.IntegerLiteralContext ctx) {
+ tokenStack.push(new Token<>(Integer.parseInt(ctx.getText()), Integer.class));
+ }
+
+
+ @Override
+ public void exitDoubleLiteral(TransformationParser.DoubleLiteralContext ctx) {
+ tokenStack.push(new Token<>(Double.parseDouble(ctx.getText()), Double.class));
+ }
+
+
+ @Override
+ public void exitTransformationFunc(TransformationParser.TransformationFuncContext ctx) {
+ String funcName = ctx.getChild(0).getText();
+ Function<List<Object>, Object> func;
+ try {
+ func = TransformationFunctions.valueOf(funcName);
+ }
+ catch(IllegalArgumentException iae) {
+ throw new ParseException("Unable to find string function " + funcName + ". Valid functions are "
+ + Joiner.on(',').join(TransformationFunctions.values())
+ );
+ }
+ Token<?> left = popStack();
+ List<Object> argList = null;
+ if(left.getUnderlyingType().equals(List.class)) {
+ argList = (List<Object>) left.getValue();
+ }
+ else {
+ throw new ParseException("Unable to process in clause because " + left.getValue() + " is not a set");
+ }
+ Object result = func.apply(argList);
+ tokenStack.push(new Token<>(result, Object.class));
+ }
+
+
+ @Override
+ public void enterFunc_args(TransformationParser.Func_argsContext ctx) {
+ tokenStack.push(new Token<>(new FunctionMarker(), FunctionMarker.class));
+ }
+
+
+ @Override
+ public void exitFunc_args(TransformationParser.Func_argsContext ctx) {
+ LinkedList<Object> args = new LinkedList<>();
+ while(true) {
+ Token<?> token = popStack();
+ if(token.getUnderlyingType().equals(FunctionMarker.class)) {
+ break;
+ }
+ else {
+ args.addFirst(token.getValue());
+ }
+ }
+ tokenStack.push(new Token<>(args, List.class));
+ }
+
+
+ @Override
+ public void exitList_entity(TransformationParser.List_entityContext ctx) {
+ LinkedList<Object> args = new LinkedList<>();
+ while(true) {
+ Token<?> token = popStack();
+ if(token.getUnderlyingType().equals(FunctionMarker.class)) {
+ break;
+ }
+ else {
+ args.addFirst(token.getValue());
+ }
+ }
+ tokenStack.push(new Token<>(args, List.class));
+ }
+
+ @Override
+ public void enterList_entity(TransformationParser.List_entityContext ctx) {
+ tokenStack.push(new Token<>(new FunctionMarker(), FunctionMarker.class));
+ }
+
+ public Token<?> popStack() {
+ if(tokenStack.empty()) {
+ throw new ParseException("Unable to pop an empty stack");
+ }
+ return tokenStack.pop();
+ }
+
+ public Object getResult() throws ParseException {
+ if(tokenStack.empty()) {
+ throw new ParseException("Invalid predicate: Empty stack.");
+ }
+ Token<?> token = popStack();
+ if(tokenStack.empty()) {
+ return token.getValue();
+ }
+ if(tokenStack.empty()) {
+ throw new ParseException("Invalid parse, stack not empty: " + Joiner.on(',').join(tokenStack));
+ }
+ else {
+ throw new ParseException("Invalid parse, found " + token);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/TransformationProcessor.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/TransformationProcessor.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/TransformationProcessor.java
new file mode 100644
index 0000000..83082c0
--- /dev/null
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/TransformationProcessor.java
@@ -0,0 +1,70 @@
+/**
+ * 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.metron.common.transformation;
+
+import org.antlr.v4.runtime.ANTLRInputStream;
+import org.antlr.v4.runtime.CommonTokenStream;
+import org.antlr.v4.runtime.TokenStream;
+import org.apache.metron.common.dsl.ErrorListener;
+import org.apache.metron.common.dsl.ParseException;
+import org.apache.metron.common.dsl.VariableResolver;
+import org.apache.metron.common.transformation.generated.TransformationLexer;
+import org.apache.metron.common.transformation.generated.TransformationParser;
+
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+
+public class TransformationProcessor {
+
+ public Object parse(String rule, VariableResolver resolver) {
+ if (rule == null || isEmpty(rule.trim())) {
+ return null;
+ }
+ ANTLRInputStream input = new ANTLRInputStream(rule);
+ TransformationLexer lexer = new TransformationLexer(input);
+ lexer.removeErrorListeners();
+ lexer.addErrorListener(new ErrorListener());
+ TokenStream tokens = new CommonTokenStream(lexer);
+ TransformationParser parser = new TransformationParser(tokens);
+
+ TransformationCompiler treeBuilder = new TransformationCompiler(resolver);
+ parser.addParseListener(treeBuilder);
+ parser.removeErrorListeners();
+ parser.addErrorListener(new ErrorListener());
+ parser.transformation();
+ return treeBuilder.getResult();
+ }
+
+ public boolean validate(String rule) throws ParseException {
+ return validate(rule, true);
+ }
+ public boolean validate(String rule, boolean throwException) throws ParseException {
+ try {
+ parse(rule, x -> null);
+ return true;
+ }
+ catch(Throwable t) {
+ if(throwException) {
+ throw new ParseException("Unable to parse " + rule + ": " + t.getMessage(), t);
+ }
+ else {
+ return false;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-metron/blob/bdbf33a9/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/generated/PredicateLexer.java
----------------------------------------------------------------------
diff --git a/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/generated/PredicateLexer.java b/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/generated/PredicateLexer.java
new file mode 100644
index 0000000..321cbea
--- /dev/null
+++ b/metron-platform/metron-common/src/main/java/org/apache/metron/common/transformation/generated/PredicateLexer.java
@@ -0,0 +1,146 @@
+// Generated from org/apache/metron/common/transformation/generated/Transformation.g4 by ANTLR 4.5
+package org.apache.metron.common.transformation.generated;
+
+//CHECKSTYLE:OFF
+/**
+ * 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.
+ */
+
+import org.antlr.v4.runtime.Lexer;
+import org.antlr.v4.runtime.CharStream;
+import org.antlr.v4.runtime.Token;
+import org.antlr.v4.runtime.TokenStream;
+import org.antlr.v4.runtime.*;
+import org.antlr.v4.runtime.atn.*;
+import org.antlr.v4.runtime.dfa.DFA;
+import org.antlr.v4.runtime.misc.*;
+
+@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
+public class PredicateLexer extends Lexer {
+ static { RuntimeMetaData.checkVersion("4.5", RuntimeMetaData.VERSION); }
+
+ protected static final DFA[] _decisionToDFA;
+ protected static final PredictionContextCache _sharedContextCache =
+ new PredictionContextCache();
+ public static final int
+ COMMA=1, LPAREN=2, RPAREN=3, INT_LITERAL=4, DOUBLE_LITERAL=5, IDENTIFIER=6,
+ STRING_LITERAL=7, COMMENT=8, WS=9;
+ public static String[] modeNames = {
+ "DEFAULT_MODE"
+ };
+
+ public static final String[] ruleNames = {
+ "COMMA", "LPAREN", "RPAREN", "INT_LITERAL", "DOUBLE_LITERAL", "IDENTIFIER",
+ "SCHAR", "STRING_LITERAL", "COMMENT", "WS"
+ };
+
+ private static final String[] _LITERAL_NAMES = {
+ null, "','", "'('", "')'"
+ };
+ private static final String[] _SYMBOLIC_NAMES = {
+ null, "COMMA", "LPAREN", "RPAREN", "INT_LITERAL", "DOUBLE_LITERAL", "IDENTIFIER",
+ "STRING_LITERAL", "COMMENT", "WS"
+ };
+ public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
+
+ /**
+ * @deprecated Use {@link #VOCABULARY} instead.
+ */
+ @Deprecated
+ public static final String[] tokenNames;
+ static {
+ tokenNames = new String[_SYMBOLIC_NAMES.length];
+ for (int i = 0; i < tokenNames.length; i++) {
+ tokenNames[i] = VOCABULARY.getLiteralName(i);
+ if (tokenNames[i] == null) {
+ tokenNames[i] = VOCABULARY.getSymbolicName(i);
+ }
+
+ if (tokenNames[i] == null) {
+ tokenNames[i] = "<INVALID>";
+ }
+ }
+ }
+
+ @Override
+ @Deprecated
+ public String[] getTokenNames() {
+ return tokenNames;
+ }
+
+ @Override
+
+ public Vocabulary getVocabulary() {
+ return VOCABULARY;
+ }
+
+
+ public PredicateLexer(CharStream input) {
+ super(input);
+ _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
+ }
+
+ @Override
+ public String getGrammarFileName() { return "Transformation.g4"; }
+
+ @Override
+ public String[] getRuleNames() { return ruleNames; }
+
+ @Override
+ public String getSerializedATN() { return _serializedATN; }
+
+ @Override
+ public String[] getModeNames() { return modeNames; }
+
+ @Override
+ public ATN getATN() { return _ATN; }
+
+ public static final String _serializedATN =
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\13\\\b\1\4\2\t\2"+
+ "\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+
+ "\t\13\3\2\3\2\3\3\3\3\3\4\3\4\3\5\6\5\37\n\5\r\5\16\5 \3\6\6\6$\n\6\r"+
+ "\6\16\6%\3\6\3\6\6\6*\n\6\r\6\16\6+\3\7\3\7\7\7\60\n\7\f\7\16\7\63\13"+
+ "\7\3\b\3\b\3\t\3\t\7\t9\n\t\f\t\16\t<\13\t\3\t\3\t\3\t\7\tA\n\t\f\t\16"+
+ "\tD\13\t\3\t\5\tG\n\t\3\n\3\n\3\n\3\n\6\nM\n\n\r\n\16\nN\3\n\5\nR\n\n"+
+ "\3\n\3\n\3\13\6\13W\n\13\r\13\16\13X\3\13\3\13\3N\2\f\3\3\5\4\7\5\t\6"+
+ "\13\7\r\b\17\2\21\t\23\n\25\13\3\2\7\5\2C\\aac|\b\2\60\60\62;C\\^^aac"+
+ "|\7\2\f\f\17\17$$))^^\3\3\f\f\5\2\13\f\16\17\"\"c\2\3\3\2\2\2\2\5\3\2"+
+ "\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\21\3\2\2\2\2\23"+
+ "\3\2\2\2\2\25\3\2\2\2\3\27\3\2\2\2\5\31\3\2\2\2\7\33\3\2\2\2\t\36\3\2"+
+ "\2\2\13#\3\2\2\2\r-\3\2\2\2\17\64\3\2\2\2\21F\3\2\2\2\23H\3\2\2\2\25V"+
+ "\3\2\2\2\27\30\7.\2\2\30\4\3\2\2\2\31\32\7*\2\2\32\6\3\2\2\2\33\34\7+"+
+ "\2\2\34\b\3\2\2\2\35\37\4\62;\2\36\35\3\2\2\2\37 \3\2\2\2 \36\3\2\2\2"+
+ " !\3\2\2\2!\n\3\2\2\2\"$\4\62;\2#\"\3\2\2\2$%\3\2\2\2%#\3\2\2\2%&\3\2"+
+ "\2\2&\'\3\2\2\2\')\7\60\2\2(*\4\62;\2)(\3\2\2\2*+\3\2\2\2+)\3\2\2\2+,"+
+ "\3\2\2\2,\f\3\2\2\2-\61\t\2\2\2.\60\t\3\2\2/.\3\2\2\2\60\63\3\2\2\2\61"+
+ "/\3\2\2\2\61\62\3\2\2\2\62\16\3\2\2\2\63\61\3\2\2\2\64\65\n\4\2\2\65\20"+
+ "\3\2\2\2\66:\7$\2\2\679\5\17\b\28\67\3\2\2\29<\3\2\2\2:8\3\2\2\2:;\3\2"+
+ "\2\2;=\3\2\2\2<:\3\2\2\2=G\7$\2\2>B\7)\2\2?A\5\17\b\2@?\3\2\2\2AD\3\2"+
+ "\2\2B@\3\2\2\2BC\3\2\2\2CE\3\2\2\2DB\3\2\2\2EG\7)\2\2F\66\3\2\2\2F>\3"+
+ "\2\2\2G\22\3\2\2\2HI\7\61\2\2IJ\7\61\2\2JL\3\2\2\2KM\13\2\2\2LK\3\2\2"+
+ "\2MN\3\2\2\2NO\3\2\2\2NL\3\2\2\2OQ\3\2\2\2PR\t\5\2\2QP\3\2\2\2RS\3\2\2"+
+ "\2ST\b\n\2\2T\24\3\2\2\2UW\t\6\2\2VU\3\2\2\2WX\3\2\2\2XV\3\2\2\2XY\3\2"+
+ "\2\2YZ\3\2\2\2Z[\b\13\2\2[\26\3\2\2\2\r\2 %+\61:BFNQX\3\b\2\2";
+ public static final ATN _ATN =
+ new ATNDeserializer().deserialize(_serializedATN.toCharArray());
+ static {
+ _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
+ for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
+ _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
+ }
+ }
+}
\ No newline at end of file