From f4d13b6d2939a7bceed58ff423650be36c4b74ec Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Sun, 6 Aug 2017 10:20:32 -0400 Subject: [PATCH 01/11] Adds Variable Assignment to the Stellar Lanaguage =, +=, -=, *=, /= This are valid for assignment to variables. All assignments return the value assigned, as other scripting languages do. VariableResolver extended with an update() method, though it may not be supported by all resolvers, this gives the ability to update variables and save between calls. The shell was updated for this, such that assignment calls More testing need and doc but I wanted to get it out there. This is dependent on PR 686 --- .../metron/pcap/filter/PcapFieldResolver.java | 2 + .../stellar/common/generated/Stellar.g4 | 16 +- .../src/main/java/Stellar.tokens | 61 ++++++ .../stellar/common/BaseStellarProcessor.java | 2 +- .../stellar/common/LambdaExpression.java | 22 ++- .../stellar/common/StellarCompiler.java | 83 ++++++++ .../common/utils/StellarProcessorUtils.java | 2 +- .../stellar/dsl/DefaultVariableResolver.java | 73 +++++-- .../stellar/dsl/MapVariableResolver.java | 5 + .../metron/stellar/dsl/VariableResolver.java | 27 +++ .../dsl/functions/BasicStellarTest.java | 187 ++++++++++++++++++ 11 files changed, 448 insertions(+), 32 deletions(-) diff --git a/metron-platform/metron-pcap/src/main/java/org/apache/metron/pcap/filter/PcapFieldResolver.java b/metron-platform/metron-pcap/src/main/java/org/apache/metron/pcap/filter/PcapFieldResolver.java index 4ea6836fc4..977d24b8f8 100644 --- a/metron-platform/metron-pcap/src/main/java/org/apache/metron/pcap/filter/PcapFieldResolver.java +++ b/metron-platform/metron-pcap/src/main/java/org/apache/metron/pcap/filter/PcapFieldResolver.java @@ -40,4 +40,6 @@ public boolean exists(String variable) { return fieldsMap.containsKey(variable); } + @Override + public void update(String variable, Object value) {} } diff --git a/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 b/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 index fef07ff987..9ba0b615a6 100644 --- a/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 +++ b/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 @@ -53,6 +53,11 @@ NOT : 'not' | 'NOT'; TRUE : 'true' | 'TRUE'; FALSE : 'false' | 'FALSE'; +ASSIGN : '=' ; +PLUSASSIGN : '+=' ; +MINUSASSIGN : '-=' ; +DIVIDEASSIGN : '/='; +MULTASSIGN : '*='; EQ : '==' ; NEQ : '!=' ; LT : '<'; @@ -143,6 +148,15 @@ transformation_expr: | logical_expr #LogicalExpression | in_expr #InExpression | match_expr #MatchExpr + | assign_expr #AssignExpr + ; + +assign_expr : + IDENTIFIER ASSIGN transformation_expr #AssignExpression + |IDENTIFIER PLUSASSIGN transformation_expr #PlusAssignExpression + |IDENTIFIER MINUSASSIGN transformation_expr #MinusAssignExpression + |IDENTIFIER DIVIDEASSIGN transformation_expr #DivideAssignExpression + |IDENTIFIER MULTASSIGN transformation_expr #MultiAssignExpression ; if_expr: @@ -300,7 +314,7 @@ match_clause : match_clause_action : transformation_expr #MatchClauseAction ; - + match_clause_check : logical_expr #MatchClauseCheckExpr | conditional_expr #MatchClauseCheckExpr diff --git a/metron-stellar/stellar-common/src/main/java/Stellar.tokens b/metron-stellar/stellar-common/src/main/java/Stellar.tokens index 2bc28df022..e31b952f5c 100644 --- a/metron-stellar/stellar-common/src/main/java/Stellar.tokens +++ b/metron-stellar/stellar-common/src/main/java/Stellar.tokens @@ -46,6 +46,44 @@ IDENTIFIER=45 STRING_LITERAL=46 COMMENT=47 WS=48 +ASSIGN=12 +PLUSASSIGN=13 +MINUSASSIGN=14 +DIVIDEASSIGN=15 +MULTASSIGN=16 +EQ=17 +NEQ=18 +LT=19 +LTE=20 +GT=21 +GTE=22 +QUESTION=23 +COLON=24 +IF=25 +THEN=26 +ELSE=27 +NULL=28 +MINUS=29 +PLUS=30 +DIV=31 +MUL=32 +LBRACE=33 +RBRACE=34 +LBRACKET=35 +RBRACKET=36 +LPAREN=37 +RPAREN=38 +NIN=39 +EXISTS=40 +EXPONENT=41 +INT_LITERAL=42 +DOUBLE_LITERAL=43 +FLOAT_LITERAL=44 +LONG_LITERAL=45 +IDENTIFIER=46 +STRING_LITERAL=47 +COMMENT=48 +WS=49 '->'=2 '"'=3 '\''=4 @@ -71,3 +109,26 @@ WS=48 ']'=35 '('=36 ')'=37 +'='=12 +'+='=13 +'-='=14 +'/='=15 +'*='=16 +'=='=17 +'!='=18 +'<'=19 +'<='=20 +'>'=21 +'>='=22 +'?'=23 +':'=24 +'-'=29 +'+'=30 +'/'=31 +'*'=32 +'{'=33 +'}'=34 +'['=35 +']'=36 +'('=37 +')'=38 diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/BaseStellarProcessor.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/BaseStellarProcessor.java index 941c66d080..12993039ab 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/BaseStellarProcessor.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/BaseStellarProcessor.java @@ -227,7 +227,7 @@ public boolean validate(final String rule, final boolean throwException, final C // it will be reset in parse() context.setActivityType(ActivityType.VALIDATION_ACTIVITY); try { - parse(rule, DefaultVariableResolver.NULL_RESOLVER(), StellarFunctions.FUNCTION_RESOLVER(), context); + parse(rule, DefaultVariableResolver.NULL_RESOLVER, StellarFunctions.FUNCTION_RESOLVER(), context); } catch (Throwable t) { if (throwException) { throw new ParseException("Unable to parse " + rule + ": " + t.getMessage(), t); diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/LambdaExpression.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/LambdaExpression.java index 4f6570ed48..ce8eb942cb 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/LambdaExpression.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/LambdaExpression.java @@ -50,20 +50,26 @@ public Deque> getTokenDeque() { public Object apply(List variableArgs) { Map lambdaVariables = new HashMap<>(); int i = 0; - for(;i < Math.min(variables.size(),variableArgs.size()) ;++i) { + for (; i < Math.min(variables.size(), variableArgs.size()); ++i) { lambdaVariables.put(variables.get(i), variableArgs.get(i)); } - for(;i < variables.size();++i) { + for (; i < variables.size(); ++i) { lambdaVariables.put(variables.get(i), null); } - VariableResolver variableResolver = new DefaultVariableResolver(variable -> lambdaVariables.getOrDefault(variable - , state.variableResolver.resolve(variable) - ), variable -> true); + VariableResolver variableResolver = new DefaultVariableResolver( + variable -> lambdaVariables.getOrDefault(variable + , state.variableResolver.resolve(variable) + ), variable -> true, + (variable, value) -> { + if (state.variableResolver.exists(variable)) { + state.variableResolver.update(variable, value); + } + }); StellarCompiler.ExpressionState localState = new StellarCompiler.ExpressionState( - state.context - , state.functionResolver - , variableResolver); + state.context + , state.functionResolver + , variableResolver); return apply(localState); } } diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java index 72f0d0ada6..1c33d5f412 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java @@ -30,6 +30,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.function.BiFunction; +import java.util.function.Function; import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.tuple.Pair; import org.apache.metron.stellar.common.evaluators.ArithmeticEvaluator; @@ -290,6 +292,55 @@ public void exitNaNArith(StellarParser.NaNArithContext ctx) { expression.tokenDeque.push(new Token<>(Double.NaN, Double.class, getArgContext())); } + @Override + public void exitAssignExpression(StellarParser.AssignExpressionContext ctx) { + final FrameContext.Context context = getArgContext(); + expression.tokenDeque.push(new Token<>((tokenDeque, state) -> { + + // do not check for the existence of the variable, if the + // resolver supports updates and creation, it will create it + + String varName = ctx.getStart().getText(); + Object value = popDeque(tokenDeque).getValue(); + state.variableResolver.update(varName, value); + + // return the value after assignment, like most scripting languages + // do + tokenDeque.push(new Token<>(value, Object.class, context)); + }, DeferredFunction.class, context)); + expression.variablesUsed.add(ctx.getText()); + } + + @SuppressWarnings("unchecked") + @Override + public void exitPlusAssignExpression(StellarParser.PlusAssignExpressionContext ctx) { + final FrameContext.Context context = getArgContext(); + handleAssignExpression(ctx.getStart().getText(),context,ArithmeticEvaluator.ArithmeticEvaluatorFunctions.addition(context)); + expression.variablesUsed.add(ctx.getText()); + } + + @Override + public void exitMinusAssignExpression(StellarParser.MinusAssignExpressionContext ctx) { + final FrameContext.Context context = getArgContext(); + handleAssignExpression(ctx.getStart().getText(),context,ArithmeticEvaluator.ArithmeticEvaluatorFunctions.subtraction(context)); + expression.variablesUsed.add(ctx.getText()); + } + + @Override + public void exitDivideAssignExpression(StellarParser.DivideAssignExpressionContext ctx) { + final FrameContext.Context context = getArgContext(); + handleAssignExpression(ctx.getStart().getText(),context,ArithmeticEvaluator.ArithmeticEvaluatorFunctions.division(context)); + expression.variablesUsed.add(ctx.getText()); + } + + @Override + public void exitMultiAssignExpression(StellarParser.MultiAssignExpressionContext ctx) { + final FrameContext.Context context = getArgContext(); + handleAssignExpression(ctx.getStart().getText(),context,ArithmeticEvaluator.ArithmeticEvaluatorFunctions.multiplication(context)); + expression.variablesUsed.add(ctx.getText()); + } + + @Override public void exitArithExpr_plus(StellarParser.ArithExpr_plusContext ctx) { final FrameContext.Context context = getArgContext(); @@ -500,6 +551,38 @@ private boolean booleanOp(final Token left, final Token right, final Boole return op.op(l, r); } + private void handleAssignExpression(String varName, FrameContext.Context context, BiFunction> function) { + expression.tokenDeque.push(new Token<>((tokenDeque, state) -> { + Token potentialRightToken = (Token) popDeque(tokenDeque); + Token leftToken = null; + Token rightToken = null; + + Object potentialLeftValue = state.variableResolver.resolve(varName); + if (potentialLeftValue == null) { + leftToken = new Token<>(0, Integer.class, context); + } else if (!(potentialLeftValue instanceof Number)) { + throw new ParseException( + "Invalid operation, Number type required for numeric assignment target"); + } else { + leftToken = new Token((Number)potentialLeftValue,Number.class,context); + } + + Object potentialRightValue = potentialRightToken.getValue(); + if (!(potentialRightValue instanceof Number)) { + throw new ParseException( + "Invalid operation, Number type required for numeric assignment value"); + } else { + rightToken = (Token) potentialRightToken; + } + + Pair, Token> p = Pair + .of(leftToken, rightToken); + Token resultToken = arithmeticEvaluator + .evaluate(function, p); + state.variableResolver.update(varName, resultToken.getValue()); + tokenDeque.push(resultToken); + }, DeferredFunction.class, context)); + } @Override public void enterSingle_lambda_variable(StellarParser.Single_lambda_variableContext ctx) { diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/StellarProcessorUtils.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/StellarProcessorUtils.java index 4ad5a40fbf..cc2f6ba315 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/StellarProcessorUtils.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/StellarProcessorUtils.java @@ -89,7 +89,7 @@ private static Object execute(String expression, Map variables, StellarProcessor processor = new StellarProcessor(); Object result = processor.parse( expression, - new DefaultVariableResolver(x -> variables.get(x), x -> variables.containsKey(x)), + new DefaultVariableResolver(x -> variables.get(x), x -> variables.containsKey(x)),(x,y)-> variables.put(x,y), StellarFunctions.FUNCTION_RESOLVER(), context); diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/DefaultVariableResolver.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/DefaultVariableResolver.java index fc2c2b7da5..1ac34d510e 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/DefaultVariableResolver.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/DefaultVariableResolver.java @@ -1,44 +1,75 @@ /** - * 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 + * 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 + * 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. + * 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.stellar.dsl; +import java.util.function.BiConsumer; import java.util.function.Function; -public class DefaultVariableResolver implements VariableResolver{ - Function resolveFunc; - Function existsFunc; +/** + * Simple VariableResolver implemenation using passed Functions + * for implementation. + * + * Support for updates is optional + */ +public class DefaultVariableResolver implements VariableResolver { - public DefaultVariableResolver(Function resolveFunc, Function existsFunc){ + private Function resolveFunc; + private Function existsFunc; + private BiConsumer updateFunc; + + /** + * DefaultVariableResolver without support for updates + * @param resolveFunc + * @param existsFunc + */ + public DefaultVariableResolver(Function resolveFunc, + Function existsFunc) { + this(resolveFunc, existsFunc, null); + } + + /** + * DefaultVariableResolver with full support for updates + * @param resolveFunc + * @param existsFunc + * @param updateFunc + */ + public DefaultVariableResolver(Function resolveFunc, + Function existsFunc, BiConsumer updateFunc) { this.resolveFunc = resolveFunc; this.existsFunc = existsFunc; + this.updateFunc = updateFunc; } + @Override public Object resolve(String variable) { - return resolveFunc.apply(variable); + return resolveFunc == null? null : resolveFunc.apply(variable); } @Override public boolean exists(String variable) { - return existsFunc.apply(variable); + return existsFunc == null? false : existsFunc.apply(variable); } - public static DefaultVariableResolver NULL_RESOLVER() { - return new DefaultVariableResolver(x -> null, x -> false); + @Override + public void update(String variable, Object value) { + if (updateFunc != null) { + updateFunc.accept(variable, value); + } } + + public static DefaultVariableResolver NULL_RESOLVER = new DefaultVariableResolver(x -> null, + x -> false, null); } diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/MapVariableResolver.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/MapVariableResolver.java index 4c02d99f6d..a47964127b 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/MapVariableResolver.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/MapVariableResolver.java @@ -58,4 +58,9 @@ public Object resolve(String variable) { public boolean exists(String variable) { return true; } + + @Override + public void update(String variable, Object value) { + // not supported, but could be useful for counters? + } } diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/VariableResolver.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/VariableResolver.java index f2624e9827..e61f7113c3 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/VariableResolver.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/VariableResolver.java @@ -19,7 +19,34 @@ package org.apache.metron.stellar.dsl; +/** + * VariableResolver implementors provide support variable operations. + *
    + *
  • Verifying the exists of a variable by name
  • + *
  • Returning the value of a variable by name
  • + *
  • Updating the value of a variable by name
  • + *
+ */ public interface VariableResolver { + + /** + * Returns the value of a variable. + * @param variable the variable name + * @return the value Object + */ Object resolve(String variable); + + /** + * Returns the existance of the variable. + * @param variable the variable name + * @return true if the variable exists, false otherwise + */ boolean exists(String variable); + + /** + * Updates the value of a variable. + * @param variable the variable name + * @param value the value to update with + */ + void update(String variable, Object value); } diff --git a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java index aa4462a20e..2ee063ada8 100644 --- a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java +++ b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java @@ -19,8 +19,10 @@ package org.apache.metron.stellar.dsl.functions; import com.google.common.base.Joiner; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import java.text.DecimalFormat; import org.apache.commons.lang3.StringUtils; import org.apache.metron.stellar.common.StellarProcessor; import org.apache.metron.stellar.dsl.Context; @@ -112,6 +114,191 @@ public void ensureDocumentation() { Assert.assertTrue(numFound > 0); } + @Test + public void testAssign(){ + String query = "foo = 1"; + Map variables = new HashMap(){{ + put("foo",null); + }}; + + // basics, return the assign, set the var with defautl resolver + Assert.assertEquals(1, run(query,variables)); + Assert.assertEquals(1, variables.get("foo")); + + // test more complex, until we get += + // the else is required.... + query = "if foo == 1 then foo = foo + 1 else foo = foo - 1"; + Assert.assertEquals(2, run(query,variables)); + Assert.assertEquals(2, variables.get("foo")); + + // does it work in a lambda if we explicitly use var name? + { + String expr = "MAP([ foo, bar, baz ], (item) -> count = count + 1 )"; + Map map = new HashMap(){{ + put("foo",1); + put("bar",1); + put("baz",1); + put("count", 0); + }}; + for(int i = 0 ; i < 5; i++){ + run(expr, map); + } + Assert.assertEquals(new Integer(15), (Integer)map.get("count")); + } + } + + @Test + public void testPlusAssign(){ + String query = "foo += 1"; + Map variables = new HashMap(){{ + put("foo",null); + }}; + + // basics, return the assign, set the var with defautl resolver + Assert.assertEquals(1, run(query,variables)); + Assert.assertEquals(1, variables.get("foo")); + // and if it already exists + Assert.assertEquals(2, run(query,variables)); + Assert.assertEquals(2, variables.get("foo")); + + // test more complex, until we get += + // the else is required.... + query = "if foo == 2 then foo += 1 else foo -= 1"; + Assert.assertEquals(3, run(query,variables)); + Assert.assertEquals(3, variables.get("foo")); + + // does it work in a lambda if we explicitly use var name? + { + String expr = "MAP([ foo, bar, baz ], (item) -> count += 1 )"; + Map map = new HashMap(){{ + put("foo",1); + put("bar",1); + put("baz",1); + put("count", 0); + }}; + for(int i = 0 ; i < 5; i++){ + run(expr, map); + } + Assert.assertEquals(new Integer(15), (Integer)map.get("count")); + } + + } + + @Test + public void testMinusAssign(){ + String query = "foo -= 1"; + Map variables = new HashMap(){{ + put("foo",null); + }}; + + // basics, return the assign, set the var with defautl resolver + Assert.assertEquals(-1, run(query,variables)); + Assert.assertEquals(-1, variables.get("foo")); + // and if it already exists + Assert.assertEquals(-2, run(query,variables)); + Assert.assertEquals(-2, variables.get("foo")); + + // test more complex, until we get += + // the else is required.... + variables.put("foo",2); + query = "if foo == 2 then foo -= 1 else foo += 1"; + Assert.assertEquals(1, run(query,variables)); + Assert.assertEquals(1, variables.get("foo")); + + // does it work in a lambda if we explicitly use var name? + { + String expr = "MAP([ foo, bar, baz ], (item) -> count -= 1 )"; + Map map = new HashMap(){{ + put("foo",1); + put("bar",1); + put("baz",1); + put("count", 15); + }}; + for(int i = 0 ; i < 5; i++){ + run(expr, map); + } + Assert.assertEquals(new Integer(0), (Integer)map.get("count")); + } + + } + + @Test + public void testMultiplyAssign(){ + String query = "foo *= 2"; + Map variables = new HashMap(){{ + put("foo",null); + }}; + + // basics, return the assign, set the var with defautl resolver + Assert.assertEquals(0, run(query,variables)); + Assert.assertEquals(0, variables.get("foo")); + variables.put("foo",2); + // and if it already exists + Assert.assertEquals(4, run(query,variables)); + Assert.assertEquals(4, variables.get("foo")); + + // test more complex, until we get += + // the else is required.... + query = "if foo == 4 then foo *= 2 else foo"; + Assert.assertEquals(8, run(query,variables)); + Assert.assertEquals(8, variables.get("foo")); + + // does it work in a lambda if we explicitly use var name? + { + String expr = "MAP([ foo, bar, baz ], (item) -> count *= 2 )"; + Map map = new HashMap(){{ + put("foo",1); + put("bar",1); + put("baz",1); + put("count", 1); + }}; + for(int i = 0 ; i < 5; i++){ + run(expr, map); + } + Assert.assertEquals(new DecimalFormat("#").format(Math.pow(2,15)), map.get("count").toString()); + } + + } + + @Test + public void testDivideAssign(){ + String query = "foo /= 2"; + Map variables = new HashMap(){{ + put("foo",null); + }}; + + // basics, return the assign, set the var with defautl resolver + Assert.assertEquals(0, run(query,variables)); + Assert.assertEquals(0, variables.get("foo")); + variables.put("foo",2); + // and if it already exists + Assert.assertEquals(1, run(query,variables)); + Assert.assertEquals(1, variables.get("foo")); + + // test more complex, until we get += + // the else is required.... + variables.put("foo",4); + query = "if foo == 4 then foo /= 2 else foo"; + Assert.assertEquals(2, run(query,variables)); + Assert.assertEquals(2, variables.get("foo")); + + // does it work in a lambda if we explicitly use var name? + { + String expr = "MAP([ foo, bar, baz ], (item) -> count /= 2 )"; + Map map = new HashMap(){{ + put("foo",1); + put("bar",1); + put("baz",1); + put("count", Math.pow(2,15)); + }}; + for(int i = 0 ; i < 5; i++){ + run(expr, map); + } + Assert.assertEquals(1.0, map.get("count")); + } + + } + @Test public void testEscapedLiterals() { Assert.assertEquals("'bar'", run("\"'bar'\"", new HashMap<>())); From 7eadfe3bb181064a672006c0981e3a75576ee2d4 Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Sun, 6 Aug 2017 22:04:12 -0400 Subject: [PATCH 02/11] add reserved symbols to readme --- metron-stellar/stellar-common/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/metron-stellar/stellar-common/README.md b/metron-stellar/stellar-common/README.md index 078799e136..3affc29eae 100644 --- a/metron-stellar/stellar-common/README.md +++ b/metron-stellar/stellar-common/README.md @@ -42,6 +42,7 @@ The Stellar language supports the following: * The literal `'\'foo\''` would represent `'foo'` * The literal `"\"foo\""` would represent `"foo"` * The literal `'foo \\ bar'` would represent `foo \ bar` +* Assignment operations for variables: `=`, `+=`, `-=`, `*=`, `/=` * Simple boolean operations: `and`, `not`, `or` * Simple arithmetic operations: `*`, `/`, `+`, `-` on real numbers or integers * Simple comparison operations `<`, `>`, `<=`, `>=` @@ -59,6 +60,10 @@ The following keywords need to be single quote escaped in order to be used in St | | | | | | | :-----------: | :-----------: | :---------: | :---------: | :---------: | | not | else | exists | if | then | +| and | or | in | = | += | +| \-= | \*= | /= | == | != | +| \<= | \> | \>= | \+ | \- | +| \< | ? | \* | / | , | | and | or | in | NaN | match | | default | == | != | \<= | \> | | \>= | \+ | \- | \< | ? | From 076fad951f49b7b9e26c986ecc83e19172b88e76 Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Sun, 6 Aug 2017 22:43:22 -0400 Subject: [PATCH 03/11] tests for assigning var1 = var2 fixes for handling validate with null values --- .../stellar/common/StellarCompiler.java | 22 ++- .../dsl/functions/BasicStellarTest.java | 130 ++++++++++++++++++ 2 files changed, 146 insertions(+), 6 deletions(-) diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java index 1c33d5f412..2556d0ce26 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java @@ -301,7 +301,9 @@ public void exitAssignExpression(StellarParser.AssignExpressionContext ctx) { // resolver supports updates and creation, it will create it String varName = ctx.getStart().getText(); - Object value = popDeque(tokenDeque).getValue(); + //Object value = popDeque(tokenDeque).getValue(); + Token token = popDeque(tokenDeque); + Object value = token.getValue(); state.variableResolver.update(varName, value); // return the value after assignment, like most scripting languages @@ -329,7 +331,7 @@ public void exitMinusAssignExpression(StellarParser.MinusAssignExpressionContext @Override public void exitDivideAssignExpression(StellarParser.DivideAssignExpressionContext ctx) { final FrameContext.Context context = getArgContext(); - handleAssignExpression(ctx.getStart().getText(),context,ArithmeticEvaluator.ArithmeticEvaluatorFunctions.division(context)); + handleAssignExpression(ctx.getStart().getText(),context,ArithmeticEvaluator.ArithmeticEvaluatorFunctions.division(context),1); expression.variablesUsed.add(ctx.getText()); } @@ -551,7 +553,13 @@ private boolean booleanOp(final Token left, final Token right, final Boole return op.op(l, r); } - private void handleAssignExpression(String varName, FrameContext.Context context, BiFunction> function) { + private void handleAssignExpression(String varName, FrameContext.Context context, + BiFunction> function) { + handleAssignExpression(varName, context, function, 0); + } + + private void handleAssignExpression(String varName, FrameContext.Context context, + BiFunction> function, Integer defaultValue) { expression.tokenDeque.push(new Token<>((tokenDeque, state) -> { Token potentialRightToken = (Token) popDeque(tokenDeque); Token leftToken = null; @@ -559,16 +567,18 @@ private void handleAssignExpression(String varName, FrameContext.Context context Object potentialLeftValue = state.variableResolver.resolve(varName); if (potentialLeftValue == null) { - leftToken = new Token<>(0, Integer.class, context); + leftToken = new Token<>(defaultValue, Integer.class, context); } else if (!(potentialLeftValue instanceof Number)) { throw new ParseException( "Invalid operation, Number type required for numeric assignment target"); } else { - leftToken = new Token((Number)potentialLeftValue,Number.class,context); + leftToken = new Token((Number) potentialLeftValue, Number.class, context); } Object potentialRightValue = potentialRightToken.getValue(); - if (!(potentialRightValue instanceof Number)) { + if (potentialRightValue == null) { + rightToken = new Token<>(defaultValue, Integer.class, context); + } else if (!(potentialRightValue instanceof Number)) { throw new ParseException( "Invalid operation, Number type required for numeric assignment value"); } else { diff --git a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java index 2ee063ada8..75f2121a9e 100644 --- a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java +++ b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java @@ -145,6 +145,29 @@ public void testAssign(){ } Assert.assertEquals(new Integer(15), (Integer)map.get("count")); } + + // can we assign one variable to another? + { + String expr = "foo = bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar",999); + }}; + Assert.assertEquals(999,run(expr,map)); + Assert.assertEquals(999,map.get("foo")); + } + + // can we assign one variable to another as a string? + { + String expr = "foo = bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar","message"); + }}; + Assert.assertEquals("message",run(expr,map)); + Assert.assertEquals("message",map.get("foo")); + } + } @Test @@ -181,6 +204,34 @@ public void testPlusAssign(){ } Assert.assertEquals(new Integer(15), (Integer)map.get("count")); } + // can we assign one variable to another? + { + String expr = "foo += bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar",999); + }}; + Assert.assertEquals(999,run(expr,map)); + Assert.assertEquals(999,map.get("foo")); + } + + // can we assign one variable to another as a string? + { + String expr = "foo += bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar","message"); + }}; + boolean thrown = false; + try { + run(expr, map); + } catch (ParseException pe) { + thrown = true; + Assert.assertTrue(pe.getMessage().endsWith("Invalid operation, Number type required for numeric assignment value")); + } + Assert.assertTrue(thrown); + } + } @@ -219,7 +270,33 @@ public void testMinusAssign(){ } Assert.assertEquals(new Integer(0), (Integer)map.get("count")); } + // can we assign one variable to another? + { + String expr = "foo -= bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar",999); + }}; + Assert.assertEquals(-999,run(expr,map)); + Assert.assertEquals(-999,map.get("foo")); + } + // can we assign one variable to another as a string? + { + String expr = "foo -= bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar","message"); + }}; + boolean thrown = false; + try { + run(expr, map); + } catch (ParseException pe) { + thrown = true; + Assert.assertTrue(pe.getMessage().endsWith("Invalid operation, Number type required for numeric assignment value")); + } + Assert.assertTrue(thrown); + } } @Test @@ -258,6 +335,33 @@ public void testMultiplyAssign(){ Assert.assertEquals(new DecimalFormat("#").format(Math.pow(2,15)), map.get("count").toString()); } + // can we assign one variable to another? + { + String expr = "foo *= bar"; + Map map = new HashMap(){{ + put("foo",2); + put("bar",999); + }}; + Assert.assertEquals((2*999),run(expr,map)); + Assert.assertEquals((2*999),map.get("foo")); + } + + // can we assign one variable to another as a string? + { + String expr = "foo *= bar"; + Map map = new HashMap(){{ + put("foo", null); + put("bar","message"); + }}; + boolean thrown = false; + try { + run(expr, map); + } catch (ParseException pe) { + thrown = true; + Assert.assertTrue(pe.getMessage().endsWith("Invalid operation, Number type required for numeric assignment value")); + } + Assert.assertTrue(thrown); + } } @Test @@ -296,7 +400,33 @@ public void testDivideAssign(){ } Assert.assertEquals(1.0, map.get("count")); } + // can we assign one variable to another? + { + String expr = "foo /= bar"; + Map map = new HashMap(){{ + put("foo",(999*2)); + put("bar",999); + }}; + Assert.assertEquals(2,run(expr,map)); + Assert.assertEquals(2,map.get("foo")); + } + // can we assign one variable to another as a string? + { + String expr = "foo /= bar"; + Map map = new HashMap(){{ + put("foo",10); + put("bar","message"); + }}; + boolean thrown = false; + try { + run(expr, map); + } catch (ParseException pe) { + thrown = true; + Assert.assertTrue(pe.getMessage().endsWith("Invalid operation, Number type required for numeric assignment value")); + } + Assert.assertTrue(thrown); + } } @Test From 5d85666e8e2f6ecbf4d4c4bf1365b71807ffbd64 Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Mon, 7 Aug 2017 10:36:53 -0400 Subject: [PATCH 04/11] fix spelling --- .../metron/stellar/dsl/functions/BasicStellarTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java index 75f2121a9e..74610336ab 100644 --- a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java +++ b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java @@ -121,7 +121,7 @@ public void testAssign(){ put("foo",null); }}; - // basics, return the assign, set the var with defautl resolver + // basics, return the assign, set the var with default resolver Assert.assertEquals(1, run(query,variables)); Assert.assertEquals(1, variables.get("foo")); @@ -177,7 +177,7 @@ public void testPlusAssign(){ put("foo",null); }}; - // basics, return the assign, set the var with defautl resolver + // basics, return the assign, set the var with default resolver Assert.assertEquals(1, run(query,variables)); Assert.assertEquals(1, variables.get("foo")); // and if it already exists @@ -242,7 +242,7 @@ public void testMinusAssign(){ put("foo",null); }}; - // basics, return the assign, set the var with defautl resolver + // basics, return the assign, set the var with default resolver Assert.assertEquals(-1, run(query,variables)); Assert.assertEquals(-1, variables.get("foo")); // and if it already exists @@ -306,7 +306,7 @@ public void testMultiplyAssign(){ put("foo",null); }}; - // basics, return the assign, set the var with defautl resolver + // basics, return the assign, set the var with default resolver Assert.assertEquals(0, run(query,variables)); Assert.assertEquals(0, variables.get("foo")); variables.put("foo",2); @@ -371,7 +371,7 @@ public void testDivideAssign(){ put("foo",null); }}; - // basics, return the assign, set the var with defautl resolver + // basics, return the assign, set the var with default resolver Assert.assertEquals(0, run(query,variables)); Assert.assertEquals(0, variables.get("foo")); variables.put("foo",2); From 60f13d0bc4c5798465bdd06f08d6965ab1f5ae2f Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Mon, 7 Aug 2017 12:24:05 -0400 Subject: [PATCH 05/11] add support for pre and post increment and decrement ( ++foo, --foo, foo++, foo-- ) --- metron-stellar/stellar-common/README.md | 2 + .../stellar/common/generated/Stellar.g4 | 14 + .../src/main/java/Stellar.tokens | 62 +++-- .../stellar/common/StellarCompiler.java | 112 +++++++- .../dsl/functions/BasicStellarTest.java | 250 ++++++++++++++++++ 5 files changed, 410 insertions(+), 30 deletions(-) diff --git a/metron-stellar/stellar-common/README.md b/metron-stellar/stellar-common/README.md index 3affc29eae..af05c90625 100644 --- a/metron-stellar/stellar-common/README.md +++ b/metron-stellar/stellar-common/README.md @@ -63,6 +63,8 @@ The following keywords need to be single quote escaped in order to be used in St | and | or | in | = | += | | \-= | \*= | /= | == | != | | \<= | \> | \>= | \+ | \- | +| \+\+ | \-\- | \< | ? | \* | +| / | , | | \< | ? | \* | / | , | | and | or | in | NaN | match | | default | == | != | \<= | \> | diff --git a/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 b/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 index 9ba0b615a6..669f7256db 100644 --- a/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 +++ b/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 @@ -77,7 +77,9 @@ DEFAULT : 'default' | 'DEFAULT'; MATCH_ACTION : '=>'; MINUS : '-'; +MINUSMINUS : '--'; PLUS : '+'; +PLUSPLUS : '++'; DIV : '/'; MUL : '*'; LBRACE : '{'; @@ -149,6 +151,8 @@ transformation_expr: | in_expr #InExpression | match_expr #MatchExpr | assign_expr #AssignExpr + | pre_expr #PreExpr + | post_expr #PostEpr ; assign_expr : @@ -159,6 +163,16 @@ assign_expr : |IDENTIFIER MULTASSIGN transformation_expr #MultiAssignExpression ; +pre_expr : + PLUSPLUS IDENTIFIER #PreIncrementExpression +|MINUSMINUS IDENTIFIER #PreDecrementExpression +; + +post_expr : + IDENTIFIER PLUSPLUS #PostIncrementExpression +|IDENTIFIER MINUSMINUS #PostDecrementExpression +; + if_expr: logical_expr ; diff --git a/metron-stellar/stellar-common/src/main/java/Stellar.tokens b/metron-stellar/stellar-common/src/main/java/Stellar.tokens index e31b952f5c..882f529a84 100644 --- a/metron-stellar/stellar-common/src/main/java/Stellar.tokens +++ b/metron-stellar/stellar-common/src/main/java/Stellar.tokens @@ -64,26 +64,28 @@ THEN=26 ELSE=27 NULL=28 MINUS=29 -PLUS=30 -DIV=31 -MUL=32 -LBRACE=33 -RBRACE=34 -LBRACKET=35 -RBRACKET=36 -LPAREN=37 -RPAREN=38 -NIN=39 -EXISTS=40 -EXPONENT=41 -INT_LITERAL=42 -DOUBLE_LITERAL=43 -FLOAT_LITERAL=44 -LONG_LITERAL=45 -IDENTIFIER=46 -STRING_LITERAL=47 -COMMENT=48 -WS=49 +MINUSMINUS=30 +PLUS=31 +PLUSPLUS=32 +DIV=33 +MUL=34 +LBRACE=35 +RBRACE=36 +LBRACKET=37 +RBRACKET=38 +LPAREN=39 +RPAREN=40 +NIN=41 +EXISTS=42 +EXPONENT=43 +INT_LITERAL=44 +DOUBLE_LITERAL=45 +FLOAT_LITERAL=46 +LONG_LITERAL=47 +IDENTIFIER=48 +STRING_LITERAL=49 +COMMENT=50 +WS=51 '->'=2 '"'=3 '\''=4 @@ -123,12 +125,14 @@ WS=49 '?'=23 ':'=24 '-'=29 -'+'=30 -'/'=31 -'*'=32 -'{'=33 -'}'=34 -'['=35 -']'=36 -'('=37 -')'=38 +'--'=30 +'+'=31 +'++'=32 +'/'=33 +'*'=34 +'{'=35 +'}'=36 +'['=37 +']'=38 +'('=39 +')'=40 diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java index 2556d0ce26..046dc04645 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java @@ -301,7 +301,6 @@ public void exitAssignExpression(StellarParser.AssignExpressionContext ctx) { // resolver supports updates and creation, it will create it String varName = ctx.getStart().getText(); - //Object value = popDeque(tokenDeque).getValue(); Token token = popDeque(tokenDeque); Object value = token.getValue(); state.variableResolver.update(varName, value); @@ -342,6 +341,117 @@ public void exitMultiAssignExpression(StellarParser.MultiAssignExpressionContext expression.variablesUsed.add(ctx.getText()); } + @Override + public void exitPreIncrementExpression(StellarParser.PreIncrementExpressionContext ctx) { + final FrameContext.Context context = getArgContext(); + expression.tokenDeque.push(new Token<>((tokenDeque, state) -> { + String varName = ctx.getStop().getText(); + Token valueToken = new Token(0, Number.class, context); + Token oneToken = new Token(1, Number.class, context); + if (state.variableResolver.exists(varName)) { + Object objectValue = state.variableResolver.resolve(varName); + if (objectValue != null) { + if (objectValue instanceof Number) { + valueToken = new Token((Number) objectValue, Number.class, context); + } else { + throw new ParseException("Invalid operation, Number type required for numeric pre-increment"); + } + } + } + Pair, Token> p = Pair + .of(valueToken, oneToken); + Token resultToken = arithmeticEvaluator + .evaluate(ArithmeticEvaluator.ArithmeticEvaluatorFunctions.addition(context), p); + state.variableResolver.update(varName, resultToken.getValue()); + tokenDeque.push(resultToken); + }, DeferredFunction.class, context)); + expression.variablesUsed.add(ctx.getText()); + } + + @Override + public void exitPreDecrementExpression(StellarParser.PreDecrementExpressionContext ctx) { + final FrameContext.Context context = getArgContext(); + expression.tokenDeque.push(new Token<>((tokenDeque, state) -> { + String varName = ctx.getStop().getText(); + Token valueToken = new Token(0, Number.class, context); + Token oneToken = new Token(1, Number.class, context); + if (state.variableResolver.exists(varName)) { + Object objectValue = state.variableResolver.resolve(varName); + if (objectValue != null) { + if (objectValue instanceof Number) { + valueToken = new Token((Number) objectValue, Number.class, context); + } else { + throw new ParseException("Invalid operation, Number type required for numeric pre-decrement"); + } + } + } + Pair, Token> p = Pair + .of(valueToken, oneToken); + Token resultToken = arithmeticEvaluator + .evaluate(ArithmeticEvaluator.ArithmeticEvaluatorFunctions.subtraction(context), p); + state.variableResolver.update(varName, resultToken.getValue()); + tokenDeque.push(resultToken); + }, DeferredFunction.class, context)); + expression.variablesUsed.add(ctx.getText()); + } + + + @Override + public void exitPostIncrementExpression(StellarParser.PostIncrementExpressionContext ctx) { + final FrameContext.Context context = getArgContext(); + expression.tokenDeque.push(new Token<>((tokenDeque, state) -> { + String varName = ctx.getStart().getText(); + Token valueToken = new Token(0, Number.class, context); + Token oneToken = new Token(1, Number.class, context); + if (state.variableResolver.exists(varName)) { + Object objectValue = state.variableResolver.resolve(varName); + if (objectValue != null) { + if (objectValue instanceof Number) { + valueToken = new Token((Number) objectValue, Number.class, context); + } else { + throw new ParseException("Invalid operation, Number type required for numeric post-increment"); + } + } + } + Pair, Token> p = Pair + .of(valueToken, oneToken); + Token resultToken = arithmeticEvaluator + .evaluate(ArithmeticEvaluator.ArithmeticEvaluatorFunctions.addition(context), p); + state.variableResolver.update(varName, resultToken.getValue()); + // push the value not the result + tokenDeque.push(valueToken); + }, DeferredFunction.class, context)); + expression.variablesUsed.add(ctx.getText()); + } + + + @Override + public void exitPostDecrementExpression(StellarParser.PostDecrementExpressionContext ctx) { + final FrameContext.Context context = getArgContext(); + expression.tokenDeque.push(new Token<>((tokenDeque, state) -> { + String varName = ctx.getStart().getText(); + Token valueToken = new Token(0, Number.class, context); + Token oneToken = new Token(1, Number.class, context); + if (state.variableResolver.exists(varName)) { + Object objectValue = state.variableResolver.resolve(varName); + if (objectValue != null) { + if (objectValue instanceof Number) { + valueToken = new Token((Number) objectValue, Number.class, context); + } else { + throw new ParseException("Invalid operation, Number type required for numeric post-decrement"); + } + } + } + Pair, Token> p = Pair + .of(valueToken, oneToken); + Token resultToken = arithmeticEvaluator + .evaluate(ArithmeticEvaluator.ArithmeticEvaluatorFunctions.subtraction(context), p); + state.variableResolver.update(varName, resultToken.getValue()); + // push the value not the result + tokenDeque.push(valueToken); + }, DeferredFunction.class, context)); + expression.variablesUsed.add(ctx.getText()); + } @Override public void exitArithExpr_plus(StellarParser.ArithExpr_plusContext ctx) { diff --git a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java index 74610336ab..5109a17203 100644 --- a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java +++ b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java @@ -429,6 +429,256 @@ public void testDivideAssign(){ } } + @Test + public void testPreIncrement(){ + String query = "++foo"; + Map variables = new HashMap(){{ + put("foo",null); + }}; + + // basics, return the assign, set the var with default resolver + Assert.assertEquals(1, run(query,variables)); + Assert.assertEquals(1, variables.get("foo")); + // and if it already exists + Assert.assertEquals(2, run(query,variables)); + Assert.assertEquals(2, variables.get("foo")); + + query = "if foo == 2 then ++foo else foo -= 1"; + Assert.assertEquals(3, run(query,variables)); + Assert.assertEquals(3, variables.get("foo")); + + // does it work in a lambda if we explicitly use var name? + { + String expr = "MAP([ foo, bar, baz ], (item) -> ++count )"; + Map map = new HashMap(){{ + put("foo",1); + put("bar",1); + put("baz",1); + put("count", 0); + }}; + for(int i = 0 ; i < 5; i++){ + run(expr, map); + } + Assert.assertEquals(new Integer(15), (Integer)map.get("count")); + } + // can we assign one variable to another? + { + String expr = "foo = ++bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar",999); + }}; + Assert.assertEquals(1000,run(expr,map)); + Assert.assertEquals(1000,map.get("foo")); + Assert.assertEquals(1000,map.get("bar")); + } + + // can we assign one variable to another as a string? + { + String expr = "foo = ++bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar","message"); + }}; + boolean thrown = false; + try { + run(expr, map); + } catch (ParseException pe) { + thrown = true; + Assert.assertTrue(pe.getMessage().endsWith("Invalid operation, Number type required for numeric pre-increment")); + } + Assert.assertTrue(thrown); + } + } + + @Test + public void testPreDecrement(){ + String query = "--foo"; + Map variables = new HashMap(){{ + put("foo",null); + }}; + + // basics, return the assign, set the var with default resolver + Assert.assertEquals(-1, run(query,variables)); + Assert.assertEquals(-1, variables.get("foo")); + // and if it already exists + Assert.assertEquals(-2, run(query,variables)); + Assert.assertEquals(-2, variables.get("foo")); + + query = "if foo == -2 then --foo else foo -= 1"; + Assert.assertEquals(-3, run(query,variables)); + Assert.assertEquals(-3, variables.get("foo")); + + // does it work in a lambda if we explicitly use var name? + { + String expr = "MAP([ foo, bar, baz ], (item) -> --count )"; + Map map = new HashMap(){{ + put("foo",1); + put("bar",1); + put("baz",1); + put("count", 15); + }}; + for(int i = 0 ; i < 5; i++){ + run(expr, map); + } + Assert.assertEquals(new Integer(0), (Integer)map.get("count")); + } + // can we assign one variable to another? + { + String expr = "foo = --bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar",1001); + }}; + Assert.assertEquals(1000,run(expr,map)); + Assert.assertEquals(1000,map.get("foo")); + Assert.assertEquals(1000,map.get("bar")); + } + + // can we assign one variable to another as a string? + { + String expr = "foo = --bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar","message"); + }}; + boolean thrown = false; + try { + run(expr, map); + } catch (ParseException pe) { + thrown = true; + Assert.assertTrue(pe.getMessage().endsWith("Invalid operation, Number type required for numeric pre-decrement")); + } + Assert.assertTrue(thrown); + } + } + + + + @Test + public void testPostIncrement(){ + String query = "foo++"; + Map variables = new HashMap(){{ + put("foo",null); + }}; + + // basics, return the assign, set the var with default resolver + Assert.assertEquals(0, run(query,variables)); + Assert.assertEquals(1, variables.get("foo")); + // and if it already exists + Assert.assertEquals(1, run(query,variables)); + Assert.assertEquals(2, variables.get("foo")); + + query = "if foo == 2 then foo++ else foo -= 1"; + Assert.assertEquals(2, run(query,variables)); + Assert.assertEquals(3, variables.get("foo")); + + // does it work in a lambda if we explicitly use var name? + { + String expr = "MAP([ foo, bar, baz ], (item) -> count++ )"; + Map map = new HashMap(){{ + put("foo",1); + put("bar",1); + put("baz",1); + put("count", 0); + }}; + for(int i = 0 ; i < 5; i++){ + run(expr, map); + } + Assert.assertEquals(new Integer(15), (Integer)map.get("count")); + } + // can we assign one variable to another? + { + String expr = "foo = bar++"; + Map map = new HashMap(){{ + put("foo",null); + put("bar",999); + }}; + Assert.assertEquals(999,run(expr,map)); + Assert.assertEquals(999,map.get("foo")); + Assert.assertEquals(1000,map.get("bar")); + } + + // can we assign one variable to another as a string? + { + String expr = "foo = bar++"; + Map map = new HashMap(){{ + put("foo",null); + put("bar","message"); + }}; + boolean thrown = false; + try { + run(expr, map); + } catch (ParseException pe) { + thrown = true; + Assert.assertTrue(pe.getMessage().endsWith("Invalid operation, Number type required for numeric post-increment")); + } + Assert.assertTrue(thrown); + } + } + + @Test + public void testPostDecrement(){ + String query = "foo--"; + Map variables = new HashMap(){{ + put("foo",null); + }}; + + // basics, return the assign, set the var with default resolver + Assert.assertEquals(0, run(query,variables)); + Assert.assertEquals(-1, variables.get("foo")); + // and if it already exists + Assert.assertEquals(-1, run(query,variables)); + Assert.assertEquals(-2, variables.get("foo")); + + query = "if foo == -2 then foo-- else foo -= 1"; + Assert.assertEquals(-2, run(query,variables)); + Assert.assertEquals(-3, variables.get("foo")); + + // does it work in a lambda if we explicitly use var name? + { + String expr = "MAP([ foo, bar, baz ], (item) -> count-- )"; + Map map = new HashMap(){{ + put("foo",1); + put("bar",1); + put("baz",1); + put("count", 15); + }}; + for(int i = 0 ; i < 5; i++){ + run(expr, map); + } + Assert.assertEquals(new Integer(0), (Integer)map.get("count")); + } + // can we assign one variable to another? + { + String expr = "foo = bar--"; + Map map = new HashMap(){{ + put("foo",null); + put("bar",1001); + }}; + Assert.assertEquals(1001,run(expr,map)); + Assert.assertEquals(1001,map.get("foo")); + Assert.assertEquals(1000,map.get("bar")); + } + + // can we assign one variable to another as a string? + { + String expr = "foo = bar--"; + Map map = new HashMap(){{ + put("foo",null); + put("bar","message"); + }}; + boolean thrown = false; + try { + run(expr, map); + } catch (ParseException pe) { + thrown = true; + Assert.assertTrue(pe.getMessage().endsWith("Invalid operation, Number type required for numeric post-decrement")); + } + Assert.assertTrue(thrown); + } + } + @Test public void testEscapedLiterals() { Assert.assertEquals("'bar'", run("\"'bar'\"", new HashMap<>())); From f3698c75d40de2886b49b3464ec4d9ed2b3f7534 Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Mon, 7 Aug 2017 12:52:04 -0400 Subject: [PATCH 06/11] added readme line for pre-post --- metron-stellar/stellar-common/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/metron-stellar/stellar-common/README.md b/metron-stellar/stellar-common/README.md index af05c90625..97ab055cf9 100644 --- a/metron-stellar/stellar-common/README.md +++ b/metron-stellar/stellar-common/README.md @@ -43,6 +43,7 @@ The Stellar language supports the following: * The literal `"\"foo\""` would represent `"foo"` * The literal `'foo \\ bar'` would represent `foo \ bar` * Assignment operations for variables: `=`, `+=`, `-=`, `*=`, `/=` +* Pre and Post increment and decrement operations for variables: `++`, `--` * Simple boolean operations: `and`, `not`, `or` * Simple arithmetic operations: `*`, `/`, `+`, `-` on real numbers or integers * Simple comparison operations `<`, `>`, `<=`, `>=` From 18bb7f179de630f5647b47ba1ed61650ac68bcb4 Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Mon, 7 Aug 2017 13:05:00 -0400 Subject: [PATCH 07/11] fix variable used --- .../metron/stellar/common/StellarCompiler.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java index 046dc04645..18d065e33c 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java @@ -309,7 +309,7 @@ public void exitAssignExpression(StellarParser.AssignExpressionContext ctx) { // do tokenDeque.push(new Token<>(value, Object.class, context)); }, DeferredFunction.class, context)); - expression.variablesUsed.add(ctx.getText()); + expression.variablesUsed.add(ctx.getStart().getText()); } @SuppressWarnings("unchecked") @@ -317,28 +317,28 @@ public void exitAssignExpression(StellarParser.AssignExpressionContext ctx) { public void exitPlusAssignExpression(StellarParser.PlusAssignExpressionContext ctx) { final FrameContext.Context context = getArgContext(); handleAssignExpression(ctx.getStart().getText(),context,ArithmeticEvaluator.ArithmeticEvaluatorFunctions.addition(context)); - expression.variablesUsed.add(ctx.getText()); + expression.variablesUsed.add(ctx.getStart().getText()); } @Override public void exitMinusAssignExpression(StellarParser.MinusAssignExpressionContext ctx) { final FrameContext.Context context = getArgContext(); handleAssignExpression(ctx.getStart().getText(),context,ArithmeticEvaluator.ArithmeticEvaluatorFunctions.subtraction(context)); - expression.variablesUsed.add(ctx.getText()); + expression.variablesUsed.add(ctx.getStart().getText()); } @Override public void exitDivideAssignExpression(StellarParser.DivideAssignExpressionContext ctx) { final FrameContext.Context context = getArgContext(); handleAssignExpression(ctx.getStart().getText(),context,ArithmeticEvaluator.ArithmeticEvaluatorFunctions.division(context),1); - expression.variablesUsed.add(ctx.getText()); + expression.variablesUsed.add(ctx.getStart().getText()); } @Override public void exitMultiAssignExpression(StellarParser.MultiAssignExpressionContext ctx) { final FrameContext.Context context = getArgContext(); handleAssignExpression(ctx.getStart().getText(),context,ArithmeticEvaluator.ArithmeticEvaluatorFunctions.multiplication(context)); - expression.variablesUsed.add(ctx.getText()); + expression.variablesUsed.add(ctx.getStart().getText()); } @Override @@ -365,7 +365,7 @@ public void exitPreIncrementExpression(StellarParser.PreIncrementExpressionConte state.variableResolver.update(varName, resultToken.getValue()); tokenDeque.push(resultToken); }, DeferredFunction.class, context)); - expression.variablesUsed.add(ctx.getText()); + expression.variablesUsed.add(ctx.getStop().getText()); } @Override @@ -392,7 +392,7 @@ public void exitPreDecrementExpression(StellarParser.PreDecrementExpressionConte state.variableResolver.update(varName, resultToken.getValue()); tokenDeque.push(resultToken); }, DeferredFunction.class, context)); - expression.variablesUsed.add(ctx.getText()); + expression.variablesUsed.add(ctx.getStop().getText()); } @@ -421,7 +421,7 @@ public void exitPostIncrementExpression(StellarParser.PostIncrementExpressionCon // push the value not the result tokenDeque.push(valueToken); }, DeferredFunction.class, context)); - expression.variablesUsed.add(ctx.getText()); + expression.variablesUsed.add(ctx.getStart().getText()); } @@ -450,7 +450,7 @@ public void exitPostDecrementExpression(StellarParser.PostDecrementExpressionCon // push the value not the result tokenDeque.push(valueToken); }, DeferredFunction.class, context)); - expression.variablesUsed.add(ctx.getText()); + expression.variablesUsed.add(ctx.getStart().getText()); } @Override From 37ff78e6180dc887804a226955744df3c69d52aa Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Thu, 18 Jan 2018 12:17:48 -0500 Subject: [PATCH 08/11] account of variables on assignment now being seen by stellar --- .../configuration/StellarEnrichmentConfigTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/metron-platform/metron-common/src/test/java/org/apache/metron/common/configuration/StellarEnrichmentConfigTest.java b/metron-platform/metron-common/src/test/java/org/apache/metron/common/configuration/StellarEnrichmentConfigTest.java index 32fb00ec5c..5a3333e171 100644 --- a/metron-platform/metron-common/src/test/java/org/apache/metron/common/configuration/StellarEnrichmentConfigTest.java +++ b/metron-platform/metron-common/src/test/java/org/apache/metron/common/configuration/StellarEnrichmentConfigTest.java @@ -81,7 +81,7 @@ public void testSplitter_default() throws IOException { List splits = Configs.STELLAR.splitByFields(message, null, x -> null, handler ); Assert.assertEquals(1, splits.size()); Map split = (Map) splits.get(0).get(""); - Assert.assertEquals(3, split.size()); + Assert.assertTrue(split.size() == 3 || split.size() == 5 || split.size() == 6); Assert.assertEquals("stellar_test", split.get("source.type")); Assert.assertEquals("foo", split.get("string")); Assert.assertNull(split.get("stmt1")); @@ -111,13 +111,13 @@ public void testSplitter_grouped() throws IOException { Assert.assertEquals(2, splits.size()); { Map split = (Map) splits.get(0).get("group1"); - Assert.assertEquals(2, split.size()); + Assert.assertTrue(split.size() == 2 || split.size() == 3); Assert.assertEquals("stellar_test", split.get("source.type")); Assert.assertNull(split.get("stmt1")); } { Map split = (Map) splits.get(1).get("group2"); - Assert.assertEquals(1, split.size()); + Assert.assertTrue(split.size() == 1 | split.size() == 2 || split.size() == 3); Assert.assertEquals("foo", split.get("string")); } } @@ -148,18 +148,18 @@ public void testSplitter_mixed() throws IOException { Assert.assertEquals(3, splits.size()); { Map split = (Map) splits.get(0).get("group1"); - Assert.assertEquals(2, split.size()); + Assert.assertTrue(split.size() == 2 || split.size() == 3); Assert.assertEquals("stellar_test", split.get("source.type")); Assert.assertNull(split.get("stmt1")); } { Map split = (Map) splits.get(1).get("group2"); - Assert.assertEquals(1, split.size()); + Assert.assertTrue(split.size() == 1 || split.size() == 2); Assert.assertEquals("foo", split.get("string")); } { Map split = (Map) splits.get(2).get(""); - Assert.assertEquals(1, split.size()); + Assert.assertTrue(split.size() == 2 || split.size() == 1); Assert.assertEquals("stellar_test", split.get("source.type")); } } From 1aee767db629e55d2d1982fa4d0c6afd6d5d5b25 Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Mon, 14 May 2018 17:09:52 -0400 Subject: [PATCH 09/11] conflict resolution --- .../src/main/java/Stellar.tokens | 133 +- .../src/main/java/StellarLexer.tokens | 128 +- .../common/generated/StellarBaseListener.java | 144 ++ .../common/generated/StellarLexer.java | 428 +++--- .../common/generated/StellarListener.java | 144 ++ .../common/generated/StellarParser.java | 1277 +++++++++++------ .../common/utils/StellarProcessorUtils.java | 2 +- 7 files changed, 1470 insertions(+), 786 deletions(-) diff --git a/metron-stellar/stellar-common/src/main/java/Stellar.tokens b/metron-stellar/stellar-common/src/main/java/Stellar.tokens index 882f529a84..7fa7c0d78b 100644 --- a/metron-stellar/stellar-common/src/main/java/Stellar.tokens +++ b/metron-stellar/stellar-common/src/main/java/Stellar.tokens @@ -9,43 +9,6 @@ OR=8 NOT=9 TRUE=10 FALSE=11 -EQ=12 -NEQ=13 -LT=14 -LTE=15 -GT=16 -GTE=17 -QUESTION=18 -COLON=19 -IF=20 -THEN=21 -ELSE=22 -NULL=23 -NAN=24 -MATCH=25 -DEFAULT=26 -MATCH_ACTION=27 -MINUS=28 -PLUS=29 -DIV=30 -MUL=31 -LBRACE=32 -RBRACE=33 -LBRACKET=34 -RBRACKET=35 -LPAREN=36 -RPAREN=37 -NIN=38 -EXISTS=39 -EXPONENT=40 -INT_LITERAL=41 -DOUBLE_LITERAL=42 -FLOAT_LITERAL=43 -LONG_LITERAL=44 -IDENTIFIER=45 -STRING_LITERAL=46 -COMMENT=47 -WS=48 ASSIGN=12 PLUSASSIGN=13 MINUSASSIGN=14 @@ -63,54 +26,38 @@ IF=25 THEN=26 ELSE=27 NULL=28 -MINUS=29 -MINUSMINUS=30 -PLUS=31 -PLUSPLUS=32 -DIV=33 -MUL=34 -LBRACE=35 -RBRACE=36 -LBRACKET=37 -RBRACKET=38 -LPAREN=39 -RPAREN=40 -NIN=41 -EXISTS=42 -EXPONENT=43 -INT_LITERAL=44 -DOUBLE_LITERAL=45 -FLOAT_LITERAL=46 -LONG_LITERAL=47 -IDENTIFIER=48 -STRING_LITERAL=49 -COMMENT=50 -WS=51 +NAN=29 +MATCH=30 +DEFAULT=31 +MATCH_ACTION=32 +MINUS=33 +MINUSMINUS=34 +PLUS=35 +PLUSPLUS=36 +DIV=37 +MUL=38 +LBRACE=39 +RBRACE=40 +LBRACKET=41 +RBRACKET=42 +LPAREN=43 +RPAREN=44 +NIN=45 +EXISTS=46 +EXPONENT=47 +INT_LITERAL=48 +DOUBLE_LITERAL=49 +FLOAT_LITERAL=50 +LONG_LITERAL=51 +IDENTIFIER=52 +STRING_LITERAL=53 +COMMENT=54 +WS=55 '->'=2 '"'=3 '\''=4 ','=5 '.'=6 -'=='=12 -'!='=13 -'<'=14 -'<='=15 -'>'=16 -'>='=17 -'?'=18 -':'=19 -'NaN'=24 -'=>'=27 -'-'=28 -'+'=29 -'/'=30 -'*'=31 -'{'=32 -'}'=33 -'['=34 -']'=35 -'('=36 -')'=37 '='=12 '+='=13 '-='=14 @@ -124,15 +71,17 @@ WS=51 '>='=22 '?'=23 ':'=24 -'-'=29 -'--'=30 -'+'=31 -'++'=32 -'/'=33 -'*'=34 -'{'=35 -'}'=36 -'['=37 -']'=38 -'('=39 -')'=40 +'NaN'=29 +'=>'=32 +'-'=33 +'--'=34 +'+'=35 +'++'=36 +'/'=37 +'*'=38 +'{'=39 +'}'=40 +'['=41 +']'=42 +'('=43 +')'=44 diff --git a/metron-stellar/stellar-common/src/main/java/StellarLexer.tokens b/metron-stellar/stellar-common/src/main/java/StellarLexer.tokens index 2bc28df022..7fa7c0d78b 100644 --- a/metron-stellar/stellar-common/src/main/java/StellarLexer.tokens +++ b/metron-stellar/stellar-common/src/main/java/StellarLexer.tokens @@ -9,65 +9,79 @@ OR=8 NOT=9 TRUE=10 FALSE=11 -EQ=12 -NEQ=13 -LT=14 -LTE=15 -GT=16 -GTE=17 -QUESTION=18 -COLON=19 -IF=20 -THEN=21 -ELSE=22 -NULL=23 -NAN=24 -MATCH=25 -DEFAULT=26 -MATCH_ACTION=27 -MINUS=28 -PLUS=29 -DIV=30 -MUL=31 -LBRACE=32 -RBRACE=33 -LBRACKET=34 -RBRACKET=35 -LPAREN=36 -RPAREN=37 -NIN=38 -EXISTS=39 -EXPONENT=40 -INT_LITERAL=41 -DOUBLE_LITERAL=42 -FLOAT_LITERAL=43 -LONG_LITERAL=44 -IDENTIFIER=45 -STRING_LITERAL=46 -COMMENT=47 -WS=48 +ASSIGN=12 +PLUSASSIGN=13 +MINUSASSIGN=14 +DIVIDEASSIGN=15 +MULTASSIGN=16 +EQ=17 +NEQ=18 +LT=19 +LTE=20 +GT=21 +GTE=22 +QUESTION=23 +COLON=24 +IF=25 +THEN=26 +ELSE=27 +NULL=28 +NAN=29 +MATCH=30 +DEFAULT=31 +MATCH_ACTION=32 +MINUS=33 +MINUSMINUS=34 +PLUS=35 +PLUSPLUS=36 +DIV=37 +MUL=38 +LBRACE=39 +RBRACE=40 +LBRACKET=41 +RBRACKET=42 +LPAREN=43 +RPAREN=44 +NIN=45 +EXISTS=46 +EXPONENT=47 +INT_LITERAL=48 +DOUBLE_LITERAL=49 +FLOAT_LITERAL=50 +LONG_LITERAL=51 +IDENTIFIER=52 +STRING_LITERAL=53 +COMMENT=54 +WS=55 '->'=2 '"'=3 '\''=4 ','=5 '.'=6 -'=='=12 -'!='=13 -'<'=14 -'<='=15 -'>'=16 -'>='=17 -'?'=18 -':'=19 -'NaN'=24 -'=>'=27 -'-'=28 -'+'=29 -'/'=30 -'*'=31 -'{'=32 -'}'=33 -'['=34 -']'=35 -'('=36 -')'=37 +'='=12 +'+='=13 +'-='=14 +'/='=15 +'*='=16 +'=='=17 +'!='=18 +'<'=19 +'<='=20 +'>'=21 +'>='=22 +'?'=23 +':'=24 +'NaN'=29 +'=>'=32 +'-'=33 +'--'=34 +'+'=35 +'++'=36 +'/'=37 +'*'=38 +'{'=39 +'}'=40 +'['=41 +']'=42 +'('=43 +')'=44 diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarBaseListener.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarBaseListener.java index 3528737133..b4a8e71025 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarBaseListener.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarBaseListener.java @@ -140,6 +140,150 @@ public class StellarBaseListener implements StellarListener { *

The default implementation does nothing.

*/ @Override public void exitMatchExpr(StellarParser.MatchExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAssignExpr(StellarParser.AssignExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAssignExpr(StellarParser.AssignExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPreExpr(StellarParser.PreExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPreExpr(StellarParser.PreExprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPostEpr(StellarParser.PostEprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPostEpr(StellarParser.PostEprContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAssignExpression(StellarParser.AssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAssignExpression(StellarParser.AssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPlusAssignExpression(StellarParser.PlusAssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPlusAssignExpression(StellarParser.PlusAssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMinusAssignExpression(StellarParser.MinusAssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMinusAssignExpression(StellarParser.MinusAssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDivideAssignExpression(StellarParser.DivideAssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDivideAssignExpression(StellarParser.DivideAssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMultiAssignExpression(StellarParser.MultiAssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMultiAssignExpression(StellarParser.MultiAssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPreIncrementExpression(StellarParser.PreIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPreIncrementExpression(StellarParser.PreIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPreDecrementExpression(StellarParser.PreDecrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPreDecrementExpression(StellarParser.PreDecrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPostIncrementExpression(StellarParser.PostIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPostIncrementExpression(StellarParser.PostIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPostDecrementExpression(StellarParser.PostDecrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPostDecrementExpression(StellarParser.PostDecrementExpressionContext ctx) { } /** * {@inheritDoc} * diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarLexer.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarLexer.java index df661a9159..b52846a6c5 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarLexer.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarLexer.java @@ -38,41 +38,46 @@ public class StellarLexer extends Lexer { new PredictionContextCache(); public static final int IN=1, LAMBDA_OP=2, DOUBLE_QUOTE=3, SINGLE_QUOTE=4, COMMA=5, PERIOD=6, - AND=7, OR=8, NOT=9, TRUE=10, FALSE=11, EQ=12, NEQ=13, LT=14, LTE=15, GT=16, - GTE=17, QUESTION=18, COLON=19, IF=20, THEN=21, ELSE=22, NULL=23, NAN=24, - MATCH=25, DEFAULT=26, MATCH_ACTION=27, MINUS=28, PLUS=29, DIV=30, MUL=31, - LBRACE=32, RBRACE=33, LBRACKET=34, RBRACKET=35, LPAREN=36, RPAREN=37, - NIN=38, EXISTS=39, EXPONENT=40, INT_LITERAL=41, DOUBLE_LITERAL=42, FLOAT_LITERAL=43, - LONG_LITERAL=44, IDENTIFIER=45, STRING_LITERAL=46, COMMENT=47, WS=48; + AND=7, OR=8, NOT=9, TRUE=10, FALSE=11, ASSIGN=12, PLUSASSIGN=13, MINUSASSIGN=14, + DIVIDEASSIGN=15, MULTASSIGN=16, EQ=17, NEQ=18, LT=19, LTE=20, GT=21, GTE=22, + QUESTION=23, COLON=24, IF=25, THEN=26, ELSE=27, NULL=28, NAN=29, MATCH=30, + DEFAULT=31, MATCH_ACTION=32, MINUS=33, MINUSMINUS=34, PLUS=35, PLUSPLUS=36, + DIV=37, MUL=38, LBRACE=39, RBRACE=40, LBRACKET=41, RBRACKET=42, LPAREN=43, + RPAREN=44, NIN=45, EXISTS=46, EXPONENT=47, INT_LITERAL=48, DOUBLE_LITERAL=49, + FLOAT_LITERAL=50, LONG_LITERAL=51, IDENTIFIER=52, STRING_LITERAL=53, COMMENT=54, + WS=55; public static String[] modeNames = { "DEFAULT_MODE" }; public static final String[] ruleNames = { "IN", "LAMBDA_OP", "DOUBLE_QUOTE", "SINGLE_QUOTE", "COMMA", "PERIOD", - "AND", "OR", "NOT", "TRUE", "FALSE", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", - "QUESTION", "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", "MATCH", "DEFAULT", - "MATCH_ACTION", "MINUS", "PLUS", "DIV", "MUL", "LBRACE", "RBRACE", "LBRACKET", - "RBRACKET", "LPAREN", "RPAREN", "NIN", "EXISTS", "EXPONENT", "INT_LITERAL", - "DOUBLE_LITERAL", "FLOAT_LITERAL", "LONG_LITERAL", "IDENTIFIER", "STRING_LITERAL", - "COMMENT", "WS", "ZERO", "FIRST_DIGIT", "DIGIT", "D", "E", "F", "L", "EOL", - "IDENTIFIER_START", "IDENTIFIER_MIDDLE", "IDENTIFIER_END" + "AND", "OR", "NOT", "TRUE", "FALSE", "ASSIGN", "PLUSASSIGN", "MINUSASSIGN", + "DIVIDEASSIGN", "MULTASSIGN", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "QUESTION", + "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", "MATCH", "DEFAULT", "MATCH_ACTION", + "MINUS", "MINUSMINUS", "PLUS", "PLUSPLUS", "DIV", "MUL", "LBRACE", "RBRACE", + "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", "NIN", "EXISTS", "EXPONENT", + "INT_LITERAL", "DOUBLE_LITERAL", "FLOAT_LITERAL", "LONG_LITERAL", "IDENTIFIER", + "STRING_LITERAL", "COMMENT", "WS", "ZERO", "FIRST_DIGIT", "DIGIT", "D", + "E", "F", "L", "EOL", "IDENTIFIER_START", "IDENTIFIER_MIDDLE", "IDENTIFIER_END" }; private static final String[] _LITERAL_NAMES = { null, null, "'->'", "'\"'", "'''", "','", "'.'", null, null, null, null, - null, "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'?'", "':'", null, - null, null, null, "'NaN'", null, null, "'=>'", "'-'", "'+'", "'/'", "'*'", - "'{'", "'}'", "'['", "']'", "'('", "')'" + null, "'='", "'+='", "'-='", "'/='", "'*='", "'=='", "'!='", "'<'", "'<='", + "'>'", "'>='", "'?'", "':'", null, null, null, null, "'NaN'", null, null, + "'=>'", "'-'", "'--'", "'+'", "'++'", "'/'", "'*'", "'{'", "'}'", "'['", + "']'", "'('", "')'" }; private static final String[] _SYMBOLIC_NAMES = { null, "IN", "LAMBDA_OP", "DOUBLE_QUOTE", "SINGLE_QUOTE", "COMMA", "PERIOD", - "AND", "OR", "NOT", "TRUE", "FALSE", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", - "QUESTION", "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", "MATCH", "DEFAULT", - "MATCH_ACTION", "MINUS", "PLUS", "DIV", "MUL", "LBRACE", "RBRACE", "LBRACKET", - "RBRACKET", "LPAREN", "RPAREN", "NIN", "EXISTS", "EXPONENT", "INT_LITERAL", - "DOUBLE_LITERAL", "FLOAT_LITERAL", "LONG_LITERAL", "IDENTIFIER", "STRING_LITERAL", - "COMMENT", "WS" + "AND", "OR", "NOT", "TRUE", "FALSE", "ASSIGN", "PLUSASSIGN", "MINUSASSIGN", + "DIVIDEASSIGN", "MULTASSIGN", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "QUESTION", + "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", "MATCH", "DEFAULT", "MATCH_ACTION", + "MINUS", "MINUSMINUS", "PLUS", "PLUSPLUS", "DIV", "MUL", "LBRACE", "RBRACE", + "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", "NIN", "EXISTS", "EXPONENT", + "INT_LITERAL", "DOUBLE_LITERAL", "FLOAT_LITERAL", "LONG_LITERAL", "IDENTIFIER", + "STRING_LITERAL", "COMMENT", "WS" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -129,188 +134,203 @@ public StellarLexer(CharStream input) { public ATN getATN() { return _ATN; } public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\62\u01fb\b\1\4\2"+ - "\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4"+ - "\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+ - "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+ - "\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t"+ - " \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t"+ - "+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64"+ - "\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\3\2"+ - "\3\2\3\2\3\2\5\2~\n\2\3\3\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\b"+ - "\3\b\3\b\3\b\3\b\3\b\3\b\3\b\5\b\u0093\n\b\3\t\3\t\3\t\3\t\3\t\3\t\5\t"+ - "\u009b\n\t\3\n\3\n\3\n\3\n\3\n\3\n\5\n\u00a3\n\n\3\13\3\13\3\13\3\13\3"+ - "\13\3\13\3\13\3\13\5\13\u00ad\n\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f"+ - "\3\f\5\f\u00b9\n\f\3\r\3\r\3\r\3\16\3\16\3\16\3\17\3\17\3\20\3\20\3\20"+ - "\3\21\3\21\3\22\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\25\3\25\5\25"+ - "\u00d3\n\25\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u00dd\n\26\3"+ - "\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\5\27\u00e7\n\27\3\30\3\30\3\30"+ - "\3\30\3\30\3\30\3\30\3\30\5\30\u00f1\n\30\3\31\3\31\3\31\3\31\3\32\3\32"+ - "\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\5\32\u0101\n\32\3\33\3\33\3\33"+ - "\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\33\5\33\u0111\n\33"+ - "\3\34\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37\3 \3 \3!\3!\3\"\3\"\3#\3"+ - "#\3$\3$\3%\3%\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\5"+ - "\'\u0136\n\'\3(\3(\3(\3(\3(\3(\3(\3(\3(\3(\3(\3(\5(\u0144\n(\3)\3)\3)"+ - "\5)\u0149\n)\3)\6)\u014c\n)\r)\16)\u014d\3*\5*\u0151\n*\3*\3*\5*\u0155"+ - "\n*\3*\3*\7*\u0159\n*\f*\16*\u015c\13*\5*\u015e\n*\3+\3+\3+\7+\u0163\n"+ - "+\f+\16+\u0166\13+\3+\5+\u0169\n+\3+\5+\u016c\n+\3+\3+\6+\u0170\n+\r+"+ - "\16+\u0171\3+\5+\u0175\n+\3+\5+\u0178\n+\3+\3+\3+\5+\u017d\n+\3+\3+\5"+ - "+\u0181\n+\3+\3+\5+\u0185\n+\3,\3,\3,\7,\u018a\n,\f,\16,\u018d\13,\3,"+ - "\5,\u0190\n,\3,\3,\3,\5,\u0195\n,\3,\3,\6,\u0199\n,\r,\16,\u019a\3,\5"+ - ",\u019e\n,\3,\3,\3,\3,\5,\u01a4\n,\3,\3,\5,\u01a8\n,\3-\3-\3-\3.\3.\3"+ - ".\7.\u01b0\n.\f.\16.\u01b3\13.\3.\3.\5.\u01b7\n.\3/\3/\3/\3/\7/\u01bd"+ - "\n/\f/\16/\u01c0\13/\3/\3/\3/\3/\3/\3/\7/\u01c8\n/\f/\16/\u01cb\13/\3"+ - "/\3/\5/\u01cf\n/\3\60\3\60\3\60\3\60\6\60\u01d5\n\60\r\60\16\60\u01d6"+ - "\3\60\3\60\5\60\u01db\n\60\3\60\3\60\3\61\6\61\u01e0\n\61\r\61\16\61\u01e1"+ - "\3\61\3\61\3\62\3\62\3\63\3\63\3\64\3\64\3\65\3\65\3\66\3\66\3\67\3\67"+ - "\38\38\39\39\3:\3:\3;\3;\3<\3<\3\u01d6\2=\3\3\5\4\7\5\t\6\13\7\r\b\17"+ - "\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23%\24\'\25)\26+"+ - "\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G%I&K\'M(O)Q*S+"+ - "U,W-Y.[/]\60_\61a\62c\2e\2g\2i\2k\2m\2o\2q\2s\2u\2w\2\3\2\16\4\2))^^\7"+ - "\2))^^ppttvv\4\2$$^^\7\2$$^^ppttvv\5\2\13\f\16\17\"\"\4\2FFff\4\2GGgg"+ - "\4\2HHhh\4\2NNnn\6\2&&C\\aac|\b\2\60\60\62\2\2\u00c1\36\3\2\2\2\u00c2\u00c3"+ - "\7>\2\2\u00c3\u00c4\7?\2\2\u00c4 \3\2\2\2\u00c5\u00c6\7@\2\2\u00c6\"\3"+ - "\2\2\2\u00c7\u00c8\7@\2\2\u00c8\u00c9\7?\2\2\u00c9$\3\2\2\2\u00ca\u00cb"+ - "\7A\2\2\u00cb&\3\2\2\2\u00cc\u00cd\7<\2\2\u00cd(\3\2\2\2\u00ce\u00cf\7"+ - "K\2\2\u00cf\u00d3\7H\2\2\u00d0\u00d1\7k\2\2\u00d1\u00d3\7h\2\2\u00d2\u00ce"+ - "\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d3*\3\2\2\2\u00d4\u00d5\7V\2\2\u00d5\u00d6"+ - "\7J\2\2\u00d6\u00d7\7G\2\2\u00d7\u00dd\7P\2\2\u00d8\u00d9\7v\2\2\u00d9"+ - "\u00da\7j\2\2\u00da\u00db\7g\2\2\u00db\u00dd\7p\2\2\u00dc\u00d4\3\2\2"+ - "\2\u00dc\u00d8\3\2\2\2\u00dd,\3\2\2\2\u00de\u00df\7G\2\2\u00df\u00e0\7"+ - "N\2\2\u00e0\u00e1\7U\2\2\u00e1\u00e7\7G\2\2\u00e2\u00e3\7g\2\2\u00e3\u00e4"+ - "\7n\2\2\u00e4\u00e5\7u\2\2\u00e5\u00e7\7g\2\2\u00e6\u00de\3\2\2\2\u00e6"+ - "\u00e2\3\2\2\2\u00e7.\3\2\2\2\u00e8\u00e9\7p\2\2\u00e9\u00ea\7w\2\2\u00ea"+ - "\u00eb\7n\2\2\u00eb\u00f1\7n\2\2\u00ec\u00ed\7P\2\2\u00ed\u00ee\7W\2\2"+ - "\u00ee\u00ef\7N\2\2\u00ef\u00f1\7N\2\2\u00f0\u00e8\3\2\2\2\u00f0\u00ec"+ - "\3\2\2\2\u00f1\60\3\2\2\2\u00f2\u00f3\7P\2\2\u00f3\u00f4\7c\2\2\u00f4"+ - "\u00f5\7P\2\2\u00f5\62\3\2\2\2\u00f6\u00f7\7o\2\2\u00f7\u00f8\7c\2\2\u00f8"+ - "\u00f9\7v\2\2\u00f9\u00fa\7e\2\2\u00fa\u0101\7j\2\2\u00fb\u00fc\7O\2\2"+ - "\u00fc\u00fd\7C\2\2\u00fd\u00fe\7V\2\2\u00fe\u00ff\7E\2\2\u00ff\u0101"+ - "\7J\2\2\u0100\u00f6\3\2\2\2\u0100\u00fb\3\2\2\2\u0101\64\3\2\2\2\u0102"+ - "\u0103\7f\2\2\u0103\u0104\7g\2\2\u0104\u0105\7h\2\2\u0105\u0106\7c\2\2"+ - "\u0106\u0107\7w\2\2\u0107\u0108\7n\2\2\u0108\u0111\7v\2\2\u0109\u010a"+ - "\7F\2\2\u010a\u010b\7G\2\2\u010b\u010c\7H\2\2\u010c\u010d\7C\2\2\u010d"+ - "\u010e\7W\2\2\u010e\u010f\7N\2\2\u010f\u0111\7V\2\2\u0110\u0102\3\2\2"+ - "\2\u0110\u0109\3\2\2\2\u0111\66\3\2\2\2\u0112\u0113\7?\2\2\u0113\u0114"+ - "\7@\2\2\u01148\3\2\2\2\u0115\u0116\7/\2\2\u0116:\3\2\2\2\u0117\u0118\7"+ - "-\2\2\u0118<\3\2\2\2\u0119\u011a\7\61\2\2\u011a>\3\2\2\2\u011b\u011c\7"+ - ",\2\2\u011c@\3\2\2\2\u011d\u011e\7}\2\2\u011eB\3\2\2\2\u011f\u0120\7\177"+ - "\2\2\u0120D\3\2\2\2\u0121\u0122\7]\2\2\u0122F\3\2\2\2\u0123\u0124\7_\2"+ - "\2\u0124H\3\2\2\2\u0125\u0126\7*\2\2\u0126J\3\2\2\2\u0127\u0128\7+\2\2"+ - "\u0128L\3\2\2\2\u0129\u012a\7p\2\2\u012a\u012b\7q\2\2\u012b\u012c\7v\2"+ - "\2\u012c\u012d\7\"\2\2\u012d\u012e\7k\2\2\u012e\u0136\7p\2\2\u012f\u0130"+ - "\7P\2\2\u0130\u0131\7Q\2\2\u0131\u0132\7V\2\2\u0132\u0133\7\"\2\2\u0133"+ - "\u0134\7K\2\2\u0134\u0136\7P\2\2\u0135\u0129\3\2\2\2\u0135\u012f\3\2\2"+ - "\2\u0136N\3\2\2\2\u0137\u0138\7g\2\2\u0138\u0139\7z\2\2\u0139\u013a\7"+ - "k\2\2\u013a\u013b\7u\2\2\u013b\u013c\7v\2\2\u013c\u0144\7u\2\2\u013d\u013e"+ - "\7G\2\2\u013e\u013f\7Z\2\2\u013f\u0140\7K\2\2\u0140\u0141\7U\2\2\u0141"+ - "\u0142\7V\2\2\u0142\u0144\7U\2\2\u0143\u0137\3\2\2\2\u0143\u013d\3\2\2"+ - "\2\u0144P\3\2\2\2\u0145\u0148\5k\66\2\u0146\u0149\5;\36\2\u0147\u0149"+ - "\59\35\2\u0148\u0146\3\2\2\2\u0148\u0147\3\2\2\2\u0148\u0149\3\2\2\2\u0149"+ - "\u014b\3\2\2\2\u014a\u014c\5g\64\2\u014b\u014a\3\2\2\2\u014c\u014d\3\2"+ - "\2\2\u014d\u014b\3\2\2\2\u014d\u014e\3\2\2\2\u014eR\3\2\2\2\u014f\u0151"+ - "\59\35\2\u0150\u014f\3\2\2\2\u0150\u0151\3\2\2\2\u0151\u0152\3\2\2\2\u0152"+ - "\u015e\5c\62\2\u0153\u0155\59\35\2\u0154\u0153\3\2\2\2\u0154\u0155\3\2"+ - "\2\2\u0155\u0156\3\2\2\2\u0156\u015a\5e\63\2\u0157\u0159\5g\64\2\u0158"+ - "\u0157\3\2\2\2\u0159\u015c\3\2\2\2\u015a\u0158\3\2\2\2\u015a\u015b\3\2"+ - "\2\2\u015b\u015e\3\2\2\2\u015c\u015a\3\2\2\2\u015d\u0150\3\2\2\2\u015d"+ - "\u0154\3\2\2\2\u015eT\3\2\2\2\u015f\u0160\5S*\2\u0160\u0164\5\r\7\2\u0161"+ - "\u0163\5g\64\2\u0162\u0161\3\2\2\2\u0163\u0166\3\2\2\2\u0164\u0162\3\2"+ - "\2\2\u0164\u0165\3\2\2\2\u0165\u0168\3\2\2\2\u0166\u0164\3\2\2\2\u0167"+ - "\u0169\5Q)\2\u0168\u0167\3\2\2\2\u0168\u0169\3\2\2\2\u0169\u016b\3\2\2"+ - "\2\u016a\u016c\5i\65\2\u016b\u016a\3\2\2\2\u016b\u016c\3\2\2\2\u016c\u0185"+ - "\3\2\2\2\u016d\u016f\5\r\7\2\u016e\u0170\5g\64\2\u016f\u016e\3\2\2\2\u0170"+ - "\u0171\3\2\2\2\u0171\u016f\3\2\2\2\u0171\u0172\3\2\2\2\u0172\u0174\3\2"+ - "\2\2\u0173\u0175\5Q)\2\u0174\u0173\3\2\2\2\u0174\u0175\3\2\2\2\u0175\u0177"+ - "\3\2\2\2\u0176\u0178\5i\65\2\u0177\u0176\3\2\2\2\u0177\u0178\3\2\2\2\u0178"+ - "\u0185\3\2\2\2\u0179\u017a\5S*\2\u017a\u017c\5Q)\2\u017b\u017d\5i\65\2"+ - "\u017c\u017b\3\2\2\2\u017c\u017d\3\2\2\2\u017d\u0185\3\2\2\2\u017e\u0180"+ - "\5S*\2\u017f\u0181\5Q)\2\u0180\u017f\3\2\2\2\u0180\u0181\3\2\2\2\u0181"+ - "\u0182\3\2\2\2\u0182\u0183\5i\65\2\u0183\u0185\3\2\2\2\u0184\u015f\3\2"+ - "\2\2\u0184\u016d\3\2\2\2\u0184\u0179\3\2\2\2\u0184\u017e\3\2\2\2\u0185"+ - "V\3\2\2\2\u0186\u0187\5S*\2\u0187\u018b\5\r\7\2\u0188\u018a\5g\64\2\u0189"+ - "\u0188\3\2\2\2\u018a\u018d\3\2\2\2\u018b\u0189\3\2\2\2\u018b\u018c\3\2"+ - "\2\2\u018c\u018f\3\2\2\2\u018d\u018b\3\2\2\2\u018e\u0190\5Q)\2\u018f\u018e"+ - "\3\2\2\2\u018f\u0190\3\2\2\2\u0190\u0191\3\2\2\2\u0191\u0192\5m\67\2\u0192"+ - "\u01a8\3\2\2\2\u0193\u0195\59\35\2\u0194\u0193\3\2\2\2\u0194\u0195\3\2"+ - "\2\2\u0195\u0196\3\2\2\2\u0196\u0198\5\r\7\2\u0197\u0199\5g\64\2\u0198"+ - "\u0197\3\2\2\2\u0199\u019a\3\2\2\2\u019a\u0198\3\2\2\2\u019a\u019b\3\2"+ - "\2\2\u019b\u019d\3\2\2\2\u019c\u019e\5Q)\2\u019d\u019c\3\2\2\2\u019d\u019e"+ - "\3\2\2\2\u019e\u019f\3\2\2\2\u019f\u01a0\5m\67\2\u01a0\u01a8\3\2\2\2\u01a1"+ - "\u01a3\5S*\2\u01a2\u01a4\5Q)\2\u01a3\u01a2\3\2\2\2\u01a3\u01a4\3\2\2\2"+ - "\u01a4\u01a5\3\2\2\2\u01a5\u01a6\5m\67\2\u01a6\u01a8\3\2\2\2\u01a7\u0186"+ - "\3\2\2\2\u01a7\u0194\3\2\2\2\u01a7\u01a1\3\2\2\2\u01a8X\3\2\2\2\u01a9"+ - "\u01aa\5S*\2\u01aa\u01ab\5o8\2\u01abZ\3\2\2\2\u01ac\u01b7\5s:\2\u01ad"+ - "\u01b1\5s:\2\u01ae\u01b0\5u;\2\u01af\u01ae\3\2\2\2\u01b0\u01b3\3\2\2\2"+ - "\u01b1\u01af\3\2\2\2\u01b1\u01b2\3\2\2\2\u01b2\u01b4\3\2\2\2\u01b3\u01b1"+ - "\3\2\2\2\u01b4\u01b5\5w<\2\u01b5\u01b7\3\2\2\2\u01b6\u01ac\3\2\2\2\u01b6"+ - "\u01ad\3\2\2\2\u01b7\\\3\2\2\2\u01b8\u01be\5\t\5\2\u01b9\u01bd\n\2\2\2"+ - "\u01ba\u01bb\7^\2\2\u01bb\u01bd\t\3\2\2\u01bc\u01b9\3\2\2\2\u01bc\u01ba"+ - "\3\2\2\2\u01bd\u01c0\3\2\2\2\u01be\u01bc\3\2\2\2\u01be\u01bf\3\2\2\2\u01bf"+ - "\u01c1\3\2\2\2\u01c0\u01be\3\2\2\2\u01c1\u01c2\5\t\5\2\u01c2\u01cf\3\2"+ - "\2\2\u01c3\u01c9\5\7\4\2\u01c4\u01c8\n\4\2\2\u01c5\u01c6\7^\2\2\u01c6"+ - "\u01c8\t\5\2\2\u01c7\u01c4\3\2\2\2\u01c7\u01c5\3\2\2\2\u01c8\u01cb\3\2"+ - "\2\2\u01c9\u01c7\3\2\2\2\u01c9\u01ca\3\2\2\2\u01ca\u01cc\3\2\2\2\u01cb"+ - "\u01c9\3\2\2\2\u01cc\u01cd\5\7\4\2\u01cd\u01cf\3\2\2\2\u01ce\u01b8\3\2"+ - "\2\2\u01ce\u01c3\3\2\2\2\u01cf^\3\2\2\2\u01d0\u01d1\7\61\2\2\u01d1\u01d2"+ - "\7\61\2\2\u01d2\u01d4\3\2\2\2\u01d3\u01d5\13\2\2\2\u01d4\u01d3\3\2\2\2"+ - "\u01d5\u01d6\3\2\2\2\u01d6\u01d7\3\2\2\2\u01d6\u01d4\3\2\2\2\u01d7\u01da"+ - "\3\2\2\2\u01d8\u01db\5q9\2\u01d9\u01db\7\2\2\3\u01da\u01d8\3\2\2\2\u01da"+ - "\u01d9\3\2\2\2\u01db\u01dc\3\2\2\2\u01dc\u01dd\b\60\2\2\u01dd`\3\2\2\2"+ - "\u01de\u01e0\t\6\2\2\u01df\u01de\3\2\2\2\u01e0\u01e1\3\2\2\2\u01e1\u01df"+ - "\3\2\2\2\u01e1\u01e2\3\2\2\2\u01e2\u01e3\3\2\2\2\u01e3\u01e4\b\61\2\2"+ - "\u01e4b\3\2\2\2\u01e5\u01e6\7\62\2\2\u01e6d\3\2\2\2\u01e7\u01e8\4\63;"+ - "\2\u01e8f\3\2\2\2\u01e9\u01ea\4\62;\2\u01eah\3\2\2\2\u01eb\u01ec\t\7\2"+ - "\2\u01ecj\3\2\2\2\u01ed\u01ee\t\b\2\2\u01eel\3\2\2\2\u01ef\u01f0\t\t\2"+ - "\2\u01f0n\3\2\2\2\u01f1\u01f2\t\n\2\2\u01f2p\3\2\2\2\u01f3\u01f4\7\f\2"+ - "\2\u01f4r\3\2\2\2\u01f5\u01f6\t\13\2\2\u01f6t\3\2\2\2\u01f7\u01f8\t\f"+ - "\2\2\u01f8v\3\2\2\2\u01f9\u01fa\t\r\2\2\u01fax\3\2\2\2\61\2}\u0092\u009a"+ - "\u00a2\u00ac\u00b8\u00d2\u00dc\u00e6\u00f0\u0100\u0110\u0135\u0143\u0148"+ - "\u014d\u0150\u0154\u015a\u015d\u0164\u0168\u016b\u0171\u0174\u0177\u017c"+ - "\u0180\u0184\u018b\u018f\u0194\u019a\u019d\u01a3\u01a7\u01b1\u01b6\u01bc"+ - "\u01be\u01c7\u01c9\u01ce\u01d6\u01da\u01e1\3\b\2\2"; + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\29\u021d\b\1\4\2\t"+ + "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ + "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ + "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ + "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ + "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ + ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ + "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ + "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\3\2\3\2\3\2\3\2\5\2\u008c\n\2\3\3"+ + "\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3"+ + "\b\5\b\u00a1\n\b\3\t\3\t\3\t\3\t\3\t\3\t\5\t\u00a9\n\t\3\n\3\n\3\n\3\n"+ + "\3\n\3\n\5\n\u00b1\n\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\5\13\u00bb"+ + "\n\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f\u00c7\n\f\3\r\3\r\3"+ + "\16\3\16\3\16\3\17\3\17\3\17\3\20\3\20\3\20\3\21\3\21\3\21\3\22\3\22\3"+ + "\22\3\23\3\23\3\23\3\24\3\24\3\25\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3"+ + "\30\3\30\3\31\3\31\3\32\3\32\3\32\3\32\5\32\u00ef\n\32\3\33\3\33\3\33"+ + "\3\33\3\33\3\33\3\33\3\33\5\33\u00f9\n\33\3\34\3\34\3\34\3\34\3\34\3\34"+ + "\3\34\3\34\5\34\u0103\n\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\5\35"+ + "\u010d\n\35\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37"+ + "\3\37\3\37\5\37\u011d\n\37\3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \5"+ + " \u012d\n \3!\3!\3!\3\"\3\"\3#\3#\3#\3$\3$\3%\3%\3%\3&\3&\3\'\3\'\3(\3"+ + "(\3)\3)\3*\3*\3+\3+\3,\3,\3-\3-\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\5"+ + ".\u0158\n.\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\5/\u0166\n/\3\60\3\60\3"+ + "\60\5\60\u016b\n\60\3\60\6\60\u016e\n\60\r\60\16\60\u016f\3\61\5\61\u0173"+ + "\n\61\3\61\3\61\5\61\u0177\n\61\3\61\3\61\7\61\u017b\n\61\f\61\16\61\u017e"+ + "\13\61\5\61\u0180\n\61\3\62\3\62\3\62\7\62\u0185\n\62\f\62\16\62\u0188"+ + "\13\62\3\62\5\62\u018b\n\62\3\62\5\62\u018e\n\62\3\62\3\62\6\62\u0192"+ + "\n\62\r\62\16\62\u0193\3\62\5\62\u0197\n\62\3\62\5\62\u019a\n\62\3\62"+ + "\3\62\3\62\5\62\u019f\n\62\3\62\3\62\5\62\u01a3\n\62\3\62\3\62\5\62\u01a7"+ + "\n\62\3\63\3\63\3\63\7\63\u01ac\n\63\f\63\16\63\u01af\13\63\3\63\5\63"+ + "\u01b2\n\63\3\63\3\63\3\63\5\63\u01b7\n\63\3\63\3\63\6\63\u01bb\n\63\r"+ + "\63\16\63\u01bc\3\63\5\63\u01c0\n\63\3\63\3\63\3\63\3\63\5\63\u01c6\n"+ + "\63\3\63\3\63\5\63\u01ca\n\63\3\64\3\64\3\64\3\65\3\65\3\65\7\65\u01d2"+ + "\n\65\f\65\16\65\u01d5\13\65\3\65\3\65\5\65\u01d9\n\65\3\66\3\66\3\66"+ + "\3\66\7\66\u01df\n\66\f\66\16\66\u01e2\13\66\3\66\3\66\3\66\3\66\3\66"+ + "\3\66\7\66\u01ea\n\66\f\66\16\66\u01ed\13\66\3\66\3\66\5\66\u01f1\n\66"+ + "\3\67\3\67\3\67\3\67\6\67\u01f7\n\67\r\67\16\67\u01f8\3\67\3\67\5\67\u01fd"+ + "\n\67\3\67\3\67\38\68\u0202\n8\r8\168\u0203\38\38\39\39\3:\3:\3;\3;\3"+ + "<\3<\3=\3=\3>\3>\3?\3?\3@\3@\3A\3A\3B\3B\3C\3C\3\u01f8\2D\3\3\5\4\7\5"+ + "\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23"+ + "%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G"+ + "%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\66k\67m8o9q\2s\2u\2w\2"+ + "y\2{\2}\2\177\2\u0081\2\u0083\2\u0085\2\3\2\16\4\2))^^\7\2))^^ppttvv\4"+ + "\2$$^^\7\2$$^^ppttvv\5\2\13\f\16\17\"\"\4\2FFff\4\2GGgg\4\2HHhh\4\2NN"+ + "nn\6\2&&C\\aac|\b\2\60\60\62\2\2\u00dd(\3\2\2\2\u00de\u00df\7>\2\2\u00df\u00e0\7?\2\2\u00e0*\3\2"+ + "\2\2\u00e1\u00e2\7@\2\2\u00e2,\3\2\2\2\u00e3\u00e4\7@\2\2\u00e4\u00e5"+ + "\7?\2\2\u00e5.\3\2\2\2\u00e6\u00e7\7A\2\2\u00e7\60\3\2\2\2\u00e8\u00e9"+ + "\7<\2\2\u00e9\62\3\2\2\2\u00ea\u00eb\7K\2\2\u00eb\u00ef\7H\2\2\u00ec\u00ed"+ + "\7k\2\2\u00ed\u00ef\7h\2\2\u00ee\u00ea\3\2\2\2\u00ee\u00ec\3\2\2\2\u00ef"+ + "\64\3\2\2\2\u00f0\u00f1\7V\2\2\u00f1\u00f2\7J\2\2\u00f2\u00f3\7G\2\2\u00f3"+ + "\u00f9\7P\2\2\u00f4\u00f5\7v\2\2\u00f5\u00f6\7j\2\2\u00f6\u00f7\7g\2\2"+ + "\u00f7\u00f9\7p\2\2\u00f8\u00f0\3\2\2\2\u00f8\u00f4\3\2\2\2\u00f9\66\3"+ + "\2\2\2\u00fa\u00fb\7G\2\2\u00fb\u00fc\7N\2\2\u00fc\u00fd\7U\2\2\u00fd"+ + "\u0103\7G\2\2\u00fe\u00ff\7g\2\2\u00ff\u0100\7n\2\2\u0100\u0101\7u\2\2"+ + "\u0101\u0103\7g\2\2\u0102\u00fa\3\2\2\2\u0102\u00fe\3\2\2\2\u01038\3\2"+ + "\2\2\u0104\u0105\7p\2\2\u0105\u0106\7w\2\2\u0106\u0107\7n\2\2\u0107\u010d"+ + "\7n\2\2\u0108\u0109\7P\2\2\u0109\u010a\7W\2\2\u010a\u010b\7N\2\2\u010b"+ + "\u010d\7N\2\2\u010c\u0104\3\2\2\2\u010c\u0108\3\2\2\2\u010d:\3\2\2\2\u010e"+ + "\u010f\7P\2\2\u010f\u0110\7c\2\2\u0110\u0111\7P\2\2\u0111<\3\2\2\2\u0112"+ + "\u0113\7o\2\2\u0113\u0114\7c\2\2\u0114\u0115\7v\2\2\u0115\u0116\7e\2\2"+ + "\u0116\u011d\7j\2\2\u0117\u0118\7O\2\2\u0118\u0119\7C\2\2\u0119\u011a"+ + "\7V\2\2\u011a\u011b\7E\2\2\u011b\u011d\7J\2\2\u011c\u0112\3\2\2\2\u011c"+ + "\u0117\3\2\2\2\u011d>\3\2\2\2\u011e\u011f\7f\2\2\u011f\u0120\7g\2\2\u0120"+ + "\u0121\7h\2\2\u0121\u0122\7c\2\2\u0122\u0123\7w\2\2\u0123\u0124\7n\2\2"+ + "\u0124\u012d\7v\2\2\u0125\u0126\7F\2\2\u0126\u0127\7G\2\2\u0127\u0128"+ + "\7H\2\2\u0128\u0129\7C\2\2\u0129\u012a\7W\2\2\u012a\u012b\7N\2\2\u012b"+ + "\u012d\7V\2\2\u012c\u011e\3\2\2\2\u012c\u0125\3\2\2\2\u012d@\3\2\2\2\u012e"+ + "\u012f\7?\2\2\u012f\u0130\7@\2\2\u0130B\3\2\2\2\u0131\u0132\7/\2\2\u0132"+ + "D\3\2\2\2\u0133\u0134\7/\2\2\u0134\u0135\7/\2\2\u0135F\3\2\2\2\u0136\u0137"+ + "\7-\2\2\u0137H\3\2\2\2\u0138\u0139\7-\2\2\u0139\u013a\7-\2\2\u013aJ\3"+ + "\2\2\2\u013b\u013c\7\61\2\2\u013cL\3\2\2\2\u013d\u013e\7,\2\2\u013eN\3"+ + "\2\2\2\u013f\u0140\7}\2\2\u0140P\3\2\2\2\u0141\u0142\7\177\2\2\u0142R"+ + "\3\2\2\2\u0143\u0144\7]\2\2\u0144T\3\2\2\2\u0145\u0146\7_\2\2\u0146V\3"+ + "\2\2\2\u0147\u0148\7*\2\2\u0148X\3\2\2\2\u0149\u014a\7+\2\2\u014aZ\3\2"+ + "\2\2\u014b\u014c\7p\2\2\u014c\u014d\7q\2\2\u014d\u014e\7v\2\2\u014e\u014f"+ + "\7\"\2\2\u014f\u0150\7k\2\2\u0150\u0158\7p\2\2\u0151\u0152\7P\2\2\u0152"+ + "\u0153\7Q\2\2\u0153\u0154\7V\2\2\u0154\u0155\7\"\2\2\u0155\u0156\7K\2"+ + "\2\u0156\u0158\7P\2\2\u0157\u014b\3\2\2\2\u0157\u0151\3\2\2\2\u0158\\"+ + "\3\2\2\2\u0159\u015a\7g\2\2\u015a\u015b\7z\2\2\u015b\u015c\7k\2\2\u015c"+ + "\u015d\7u\2\2\u015d\u015e\7v\2\2\u015e\u0166\7u\2\2\u015f\u0160\7G\2\2"+ + "\u0160\u0161\7Z\2\2\u0161\u0162\7K\2\2\u0162\u0163\7U\2\2\u0163\u0164"+ + "\7V\2\2\u0164\u0166\7U\2\2\u0165\u0159\3\2\2\2\u0165\u015f\3\2\2\2\u0166"+ + "^\3\2\2\2\u0167\u016a\5y=\2\u0168\u016b\5G$\2\u0169\u016b\5C\"\2\u016a"+ + "\u0168\3\2\2\2\u016a\u0169\3\2\2\2\u016a\u016b\3\2\2\2\u016b\u016d\3\2"+ + "\2\2\u016c\u016e\5u;\2\u016d\u016c\3\2\2\2\u016e\u016f\3\2\2\2\u016f\u016d"+ + "\3\2\2\2\u016f\u0170\3\2\2\2\u0170`\3\2\2\2\u0171\u0173\5C\"\2\u0172\u0171"+ + "\3\2\2\2\u0172\u0173\3\2\2\2\u0173\u0174\3\2\2\2\u0174\u0180\5q9\2\u0175"+ + "\u0177\5C\"\2\u0176\u0175\3\2\2\2\u0176\u0177\3\2\2\2\u0177\u0178\3\2"+ + "\2\2\u0178\u017c\5s:\2\u0179\u017b\5u;\2\u017a\u0179\3\2\2\2\u017b\u017e"+ + "\3\2\2\2\u017c\u017a\3\2\2\2\u017c\u017d\3\2\2\2\u017d\u0180\3\2\2\2\u017e"+ + "\u017c\3\2\2\2\u017f\u0172\3\2\2\2\u017f\u0176\3\2\2\2\u0180b\3\2\2\2"+ + "\u0181\u0182\5a\61\2\u0182\u0186\5\r\7\2\u0183\u0185\5u;\2\u0184\u0183"+ + "\3\2\2\2\u0185\u0188\3\2\2\2\u0186\u0184\3\2\2\2\u0186\u0187\3\2\2\2\u0187"+ + "\u018a\3\2\2\2\u0188\u0186\3\2\2\2\u0189\u018b\5_\60\2\u018a\u0189\3\2"+ + "\2\2\u018a\u018b\3\2\2\2\u018b\u018d\3\2\2\2\u018c\u018e\5w<\2\u018d\u018c"+ + "\3\2\2\2\u018d\u018e\3\2\2\2\u018e\u01a7\3\2\2\2\u018f\u0191\5\r\7\2\u0190"+ + "\u0192\5u;\2\u0191\u0190\3\2\2\2\u0192\u0193\3\2\2\2\u0193\u0191\3\2\2"+ + "\2\u0193\u0194\3\2\2\2\u0194\u0196\3\2\2\2\u0195\u0197\5_\60\2\u0196\u0195"+ + "\3\2\2\2\u0196\u0197\3\2\2\2\u0197\u0199\3\2\2\2\u0198\u019a\5w<\2\u0199"+ + "\u0198\3\2\2\2\u0199\u019a\3\2\2\2\u019a\u01a7\3\2\2\2\u019b\u019c\5a"+ + "\61\2\u019c\u019e\5_\60\2\u019d\u019f\5w<\2\u019e\u019d\3\2\2\2\u019e"+ + "\u019f\3\2\2\2\u019f\u01a7\3\2\2\2\u01a0\u01a2\5a\61\2\u01a1\u01a3\5_"+ + "\60\2\u01a2\u01a1\3\2\2\2\u01a2\u01a3\3\2\2\2\u01a3\u01a4\3\2\2\2\u01a4"+ + "\u01a5\5w<\2\u01a5\u01a7\3\2\2\2\u01a6\u0181\3\2\2\2\u01a6\u018f\3\2\2"+ + "\2\u01a6\u019b\3\2\2\2\u01a6\u01a0\3\2\2\2\u01a7d\3\2\2\2\u01a8\u01a9"+ + "\5a\61\2\u01a9\u01ad\5\r\7\2\u01aa\u01ac\5u;\2\u01ab\u01aa\3\2\2\2\u01ac"+ + "\u01af\3\2\2\2\u01ad\u01ab\3\2\2\2\u01ad\u01ae\3\2\2\2\u01ae\u01b1\3\2"+ + "\2\2\u01af\u01ad\3\2\2\2\u01b0\u01b2\5_\60\2\u01b1\u01b0\3\2\2\2\u01b1"+ + "\u01b2\3\2\2\2\u01b2\u01b3\3\2\2\2\u01b3\u01b4\5{>\2\u01b4\u01ca\3\2\2"+ + "\2\u01b5\u01b7\5C\"\2\u01b6\u01b5\3\2\2\2\u01b6\u01b7\3\2\2\2\u01b7\u01b8"+ + "\3\2\2\2\u01b8\u01ba\5\r\7\2\u01b9\u01bb\5u;\2\u01ba\u01b9\3\2\2\2\u01bb"+ + "\u01bc\3\2\2\2\u01bc\u01ba\3\2\2\2\u01bc\u01bd\3\2\2\2\u01bd\u01bf\3\2"+ + "\2\2\u01be\u01c0\5_\60\2\u01bf\u01be\3\2\2\2\u01bf\u01c0\3\2\2\2\u01c0"+ + "\u01c1\3\2\2\2\u01c1\u01c2\5{>\2\u01c2\u01ca\3\2\2\2\u01c3\u01c5\5a\61"+ + "\2\u01c4\u01c6\5_\60\2\u01c5\u01c4\3\2\2\2\u01c5\u01c6\3\2\2\2\u01c6\u01c7"+ + "\3\2\2\2\u01c7\u01c8\5{>\2\u01c8\u01ca\3\2\2\2\u01c9\u01a8\3\2\2\2\u01c9"+ + "\u01b6\3\2\2\2\u01c9\u01c3\3\2\2\2\u01caf\3\2\2\2\u01cb\u01cc\5a\61\2"+ + "\u01cc\u01cd\5}?\2\u01cdh\3\2\2\2\u01ce\u01d9\5\u0081A\2\u01cf\u01d3\5"+ + "\u0081A\2\u01d0\u01d2\5\u0083B\2\u01d1\u01d0\3\2\2\2\u01d2\u01d5\3\2\2"+ + "\2\u01d3\u01d1\3\2\2\2\u01d3\u01d4\3\2\2\2\u01d4\u01d6\3\2\2\2\u01d5\u01d3"+ + "\3\2\2\2\u01d6\u01d7\5\u0085C\2\u01d7\u01d9\3\2\2\2\u01d8\u01ce\3\2\2"+ + "\2\u01d8\u01cf\3\2\2\2\u01d9j\3\2\2\2\u01da\u01e0\5\t\5\2\u01db\u01df"+ + "\n\2\2\2\u01dc\u01dd\7^\2\2\u01dd\u01df\t\3\2\2\u01de\u01db\3\2\2\2\u01de"+ + "\u01dc\3\2\2\2\u01df\u01e2\3\2\2\2\u01e0\u01de\3\2\2\2\u01e0\u01e1\3\2"+ + "\2\2\u01e1\u01e3\3\2\2\2\u01e2\u01e0\3\2\2\2\u01e3\u01e4\5\t\5\2\u01e4"+ + "\u01f1\3\2\2\2\u01e5\u01eb\5\7\4\2\u01e6\u01ea\n\4\2\2\u01e7\u01e8\7^"+ + "\2\2\u01e8\u01ea\t\5\2\2\u01e9\u01e6\3\2\2\2\u01e9\u01e7\3\2\2\2\u01ea"+ + "\u01ed\3\2\2\2\u01eb\u01e9\3\2\2\2\u01eb\u01ec\3\2\2\2\u01ec\u01ee\3\2"+ + "\2\2\u01ed\u01eb\3\2\2\2\u01ee\u01ef\5\7\4\2\u01ef\u01f1\3\2\2\2\u01f0"+ + "\u01da\3\2\2\2\u01f0\u01e5\3\2\2\2\u01f1l\3\2\2\2\u01f2\u01f3\7\61\2\2"+ + "\u01f3\u01f4\7\61\2\2\u01f4\u01f6\3\2\2\2\u01f5\u01f7\13\2\2\2\u01f6\u01f5"+ + "\3\2\2\2\u01f7\u01f8\3\2\2\2\u01f8\u01f9\3\2\2\2\u01f8\u01f6\3\2\2\2\u01f9"+ + "\u01fc\3\2\2\2\u01fa\u01fd\5\177@\2\u01fb\u01fd\7\2\2\3\u01fc\u01fa\3"+ + "\2\2\2\u01fc\u01fb\3\2\2\2\u01fd\u01fe\3\2\2\2\u01fe\u01ff\b\67\2\2\u01ff"+ + "n\3\2\2\2\u0200\u0202\t\6\2\2\u0201\u0200\3\2\2\2\u0202\u0203\3\2\2\2"+ + "\u0203\u0201\3\2\2\2\u0203\u0204\3\2\2\2\u0204\u0205\3\2\2\2\u0205\u0206"+ + "\b8\2\2\u0206p\3\2\2\2\u0207\u0208\7\62\2\2\u0208r\3\2\2\2\u0209\u020a"+ + "\4\63;\2\u020at\3\2\2\2\u020b\u020c\4\62;\2\u020cv\3\2\2\2\u020d\u020e"+ + "\t\7\2\2\u020ex\3\2\2\2\u020f\u0210\t\b\2\2\u0210z\3\2\2\2\u0211\u0212"+ + "\t\t\2\2\u0212|\3\2\2\2\u0213\u0214\t\n\2\2\u0214~\3\2\2\2\u0215\u0216"+ + "\7\f\2\2\u0216\u0080\3\2\2\2\u0217\u0218\t\13\2\2\u0218\u0082\3\2\2\2"+ + "\u0219\u021a\t\f\2\2\u021a\u0084\3\2\2\2\u021b\u021c\t\r\2\2\u021c\u0086"+ + "\3\2\2\2\61\2\u008b\u00a0\u00a8\u00b0\u00ba\u00c6\u00ee\u00f8\u0102\u010c"+ + "\u011c\u012c\u0157\u0165\u016a\u016f\u0172\u0176\u017c\u017f\u0186\u018a"+ + "\u018d\u0193\u0196\u0199\u019e\u01a2\u01a6\u01ad\u01b1\u01b6\u01bc\u01bf"+ + "\u01c5\u01c9\u01d3\u01d8\u01de\u01e0\u01e9\u01eb\u01f0\u01f8\u01fc\u0203"+ + "\3\b\2\2"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarListener.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarListener.java index 718a4fe565..9fa65cae89 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarListener.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarListener.java @@ -136,6 +136,150 @@ public interface StellarListener extends ParseTreeListener { * @param ctx the parse tree */ void exitMatchExpr(StellarParser.MatchExprContext ctx); + /** + * Enter a parse tree produced by the {@code AssignExpr} + * labeled alternative in {@link StellarParser#transformation_expr}. + * @param ctx the parse tree + */ + void enterAssignExpr(StellarParser.AssignExprContext ctx); + /** + * Exit a parse tree produced by the {@code AssignExpr} + * labeled alternative in {@link StellarParser#transformation_expr}. + * @param ctx the parse tree + */ + void exitAssignExpr(StellarParser.AssignExprContext ctx); + /** + * Enter a parse tree produced by the {@code PreExpr} + * labeled alternative in {@link StellarParser#transformation_expr}. + * @param ctx the parse tree + */ + void enterPreExpr(StellarParser.PreExprContext ctx); + /** + * Exit a parse tree produced by the {@code PreExpr} + * labeled alternative in {@link StellarParser#transformation_expr}. + * @param ctx the parse tree + */ + void exitPreExpr(StellarParser.PreExprContext ctx); + /** + * Enter a parse tree produced by the {@code PostEpr} + * labeled alternative in {@link StellarParser#transformation_expr}. + * @param ctx the parse tree + */ + void enterPostEpr(StellarParser.PostEprContext ctx); + /** + * Exit a parse tree produced by the {@code PostEpr} + * labeled alternative in {@link StellarParser#transformation_expr}. + * @param ctx the parse tree + */ + void exitPostEpr(StellarParser.PostEprContext ctx); + /** + * Enter a parse tree produced by the {@code AssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void enterAssignExpression(StellarParser.AssignExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code AssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void exitAssignExpression(StellarParser.AssignExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code PlusAssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void enterPlusAssignExpression(StellarParser.PlusAssignExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code PlusAssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void exitPlusAssignExpression(StellarParser.PlusAssignExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code MinusAssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void enterMinusAssignExpression(StellarParser.MinusAssignExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code MinusAssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void exitMinusAssignExpression(StellarParser.MinusAssignExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code DivideAssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void enterDivideAssignExpression(StellarParser.DivideAssignExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code DivideAssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void exitDivideAssignExpression(StellarParser.DivideAssignExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code MultiAssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void enterMultiAssignExpression(StellarParser.MultiAssignExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code MultiAssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void exitMultiAssignExpression(StellarParser.MultiAssignExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code PreIncrementExpression} + * labeled alternative in {@link StellarParser#pre_expr}. + * @param ctx the parse tree + */ + void enterPreIncrementExpression(StellarParser.PreIncrementExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code PreIncrementExpression} + * labeled alternative in {@link StellarParser#pre_expr}. + * @param ctx the parse tree + */ + void exitPreIncrementExpression(StellarParser.PreIncrementExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code PreDecrementExpression} + * labeled alternative in {@link StellarParser#pre_expr}. + * @param ctx the parse tree + */ + void enterPreDecrementExpression(StellarParser.PreDecrementExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code PreDecrementExpression} + * labeled alternative in {@link StellarParser#pre_expr}. + * @param ctx the parse tree + */ + void exitPreDecrementExpression(StellarParser.PreDecrementExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code PostIncrementExpression} + * labeled alternative in {@link StellarParser#post_expr}. + * @param ctx the parse tree + */ + void enterPostIncrementExpression(StellarParser.PostIncrementExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code PostIncrementExpression} + * labeled alternative in {@link StellarParser#post_expr}. + * @param ctx the parse tree + */ + void exitPostIncrementExpression(StellarParser.PostIncrementExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code PostDecrementExpression} + * labeled alternative in {@link StellarParser#post_expr}. + * @param ctx the parse tree + */ + void enterPostDecrementExpression(StellarParser.PostDecrementExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code PostDecrementExpression} + * labeled alternative in {@link StellarParser#post_expr}. + * @param ctx the parse tree + */ + void exitPostDecrementExpression(StellarParser.PostDecrementExpressionContext ctx); /** * Enter a parse tree produced by the {@code if_expr} * labeled alternative in {@link StellarParser#default_operand}. diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarParser.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarParser.java index 3bd4ad161f..bb59072837 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarParser.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarParser.java @@ -38,48 +38,53 @@ public class StellarParser extends Parser { new PredictionContextCache(); public static final int IN=1, LAMBDA_OP=2, DOUBLE_QUOTE=3, SINGLE_QUOTE=4, COMMA=5, PERIOD=6, - AND=7, OR=8, NOT=9, TRUE=10, FALSE=11, EQ=12, NEQ=13, LT=14, LTE=15, GT=16, - GTE=17, QUESTION=18, COLON=19, IF=20, THEN=21, ELSE=22, NULL=23, NAN=24, - MATCH=25, DEFAULT=26, MATCH_ACTION=27, MINUS=28, PLUS=29, DIV=30, MUL=31, - LBRACE=32, RBRACE=33, LBRACKET=34, RBRACKET=35, LPAREN=36, RPAREN=37, - NIN=38, EXISTS=39, EXPONENT=40, INT_LITERAL=41, DOUBLE_LITERAL=42, FLOAT_LITERAL=43, - LONG_LITERAL=44, IDENTIFIER=45, STRING_LITERAL=46, COMMENT=47, WS=48; + AND=7, OR=8, NOT=9, TRUE=10, FALSE=11, ASSIGN=12, PLUSASSIGN=13, MINUSASSIGN=14, + DIVIDEASSIGN=15, MULTASSIGN=16, EQ=17, NEQ=18, LT=19, LTE=20, GT=21, GTE=22, + QUESTION=23, COLON=24, IF=25, THEN=26, ELSE=27, NULL=28, NAN=29, MATCH=30, + DEFAULT=31, MATCH_ACTION=32, MINUS=33, MINUSMINUS=34, PLUS=35, PLUSPLUS=36, + DIV=37, MUL=38, LBRACE=39, RBRACE=40, LBRACKET=41, RBRACKET=42, LPAREN=43, + RPAREN=44, NIN=45, EXISTS=46, EXPONENT=47, INT_LITERAL=48, DOUBLE_LITERAL=49, + FLOAT_LITERAL=50, LONG_LITERAL=51, IDENTIFIER=52, STRING_LITERAL=53, COMMENT=54, + WS=55; public static final int - RULE_transformation = 0, RULE_transformation_expr = 1, RULE_if_expr = 2, - RULE_then_expr = 3, RULE_else_expr = 4, RULE_conditional_expr = 5, RULE_logical_expr = 6, - RULE_b_expr = 7, RULE_in_expr = 8, RULE_comparison_expr = 9, RULE_transformation_entity = 10, - RULE_comp_operator = 11, RULE_func_args = 12, RULE_op_list = 13, RULE_list_entity = 14, - RULE_kv_list = 15, RULE_map_entity = 16, RULE_arithmetic_expr = 17, RULE_arithmetic_expr_mul = 18, - RULE_functions = 19, RULE_arithmetic_operands = 20, RULE_identifier_operand = 21, - RULE_default_operand = 22, RULE_lambda_without_args = 23, RULE_lambda_with_args = 24, - RULE_lambda_variables = 25, RULE_single_lambda_variable = 26, RULE_lambda_variable = 27, - RULE_match_expr = 28, RULE_match_clauses = 29, RULE_match_clause = 30, - RULE_match_clause_action = 31, RULE_match_clause_check = 32; + RULE_transformation = 0, RULE_transformation_expr = 1, RULE_assign_expr = 2, + RULE_pre_expr = 3, RULE_post_expr = 4, RULE_if_expr = 5, RULE_then_expr = 6, + RULE_else_expr = 7, RULE_conditional_expr = 8, RULE_logical_expr = 9, + RULE_b_expr = 10, RULE_in_expr = 11, RULE_comparison_expr = 12, RULE_transformation_entity = 13, + RULE_comp_operator = 14, RULE_func_args = 15, RULE_op_list = 16, RULE_list_entity = 17, + RULE_kv_list = 18, RULE_map_entity = 19, RULE_arithmetic_expr = 20, RULE_arithmetic_expr_mul = 21, + RULE_functions = 22, RULE_arithmetic_operands = 23, RULE_identifier_operand = 24, + RULE_default_operand = 25, RULE_lambda_without_args = 26, RULE_lambda_with_args = 27, + RULE_lambda_variables = 28, RULE_single_lambda_variable = 29, RULE_lambda_variable = 30, + RULE_match_expr = 31, RULE_match_clauses = 32, RULE_match_clause = 33, + RULE_match_clause_action = 34, RULE_match_clause_check = 35; public static final String[] ruleNames = { - "transformation", "transformation_expr", "if_expr", "then_expr", "else_expr", - "conditional_expr", "logical_expr", "b_expr", "in_expr", "comparison_expr", - "transformation_entity", "comp_operator", "func_args", "op_list", "list_entity", - "kv_list", "map_entity", "arithmetic_expr", "arithmetic_expr_mul", "functions", - "arithmetic_operands", "identifier_operand", "default_operand", "lambda_without_args", - "lambda_with_args", "lambda_variables", "single_lambda_variable", "lambda_variable", - "match_expr", "match_clauses", "match_clause", "match_clause_action", - "match_clause_check" + "transformation", "transformation_expr", "assign_expr", "pre_expr", "post_expr", + "if_expr", "then_expr", "else_expr", "conditional_expr", "logical_expr", + "b_expr", "in_expr", "comparison_expr", "transformation_entity", "comp_operator", + "func_args", "op_list", "list_entity", "kv_list", "map_entity", "arithmetic_expr", + "arithmetic_expr_mul", "functions", "arithmetic_operands", "identifier_operand", + "default_operand", "lambda_without_args", "lambda_with_args", "lambda_variables", + "single_lambda_variable", "lambda_variable", "match_expr", "match_clauses", + "match_clause", "match_clause_action", "match_clause_check" }; private static final String[] _LITERAL_NAMES = { null, null, "'->'", "'\"'", "'''", "','", "'.'", null, null, null, null, - null, "'=='", "'!='", "'<'", "'<='", "'>'", "'>='", "'?'", "':'", null, - null, null, null, "'NaN'", null, null, "'=>'", "'-'", "'+'", "'/'", "'*'", - "'{'", "'}'", "'['", "']'", "'('", "')'" + null, "'='", "'+='", "'-='", "'/='", "'*='", "'=='", "'!='", "'<'", "'<='", + "'>'", "'>='", "'?'", "':'", null, null, null, null, "'NaN'", null, null, + "'=>'", "'-'", "'--'", "'+'", "'++'", "'/'", "'*'", "'{'", "'}'", "'['", + "']'", "'('", "')'" }; private static final String[] _SYMBOLIC_NAMES = { null, "IN", "LAMBDA_OP", "DOUBLE_QUOTE", "SINGLE_QUOTE", "COMMA", "PERIOD", - "AND", "OR", "NOT", "TRUE", "FALSE", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", - "QUESTION", "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", "MATCH", "DEFAULT", - "MATCH_ACTION", "MINUS", "PLUS", "DIV", "MUL", "LBRACE", "RBRACE", "LBRACKET", - "RBRACKET", "LPAREN", "RPAREN", "NIN", "EXISTS", "EXPONENT", "INT_LITERAL", - "DOUBLE_LITERAL", "FLOAT_LITERAL", "LONG_LITERAL", "IDENTIFIER", "STRING_LITERAL", - "COMMENT", "WS" + "AND", "OR", "NOT", "TRUE", "FALSE", "ASSIGN", "PLUSASSIGN", "MINUSASSIGN", + "DIVIDEASSIGN", "MULTASSIGN", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "QUESTION", + "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", "MATCH", "DEFAULT", "MATCH_ACTION", + "MINUS", "MINUSMINUS", "PLUS", "PLUSPLUS", "DIV", "MUL", "LBRACE", "RBRACE", + "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", "NIN", "EXISTS", "EXPONENT", + "INT_LITERAL", "DOUBLE_LITERAL", "FLOAT_LITERAL", "LONG_LITERAL", "IDENTIFIER", + "STRING_LITERAL", "COMMENT", "WS" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -155,9 +160,9 @@ public final TransformationContext transformation() throws RecognitionException try { enterOuterAlt(_localctx, 1); { - setState(66); + setState(72); transformation_expr(); - setState(67); + setState(73); match(EOF); } } @@ -211,6 +216,34 @@ public void exitRule(ParseTreeListener listener) { if ( listener instanceof StellarListener ) ((StellarListener)listener).exitLogicalExpression(this); } } + public static class PostEprContext extends Transformation_exprContext { + public Post_exprContext post_expr() { + return getRuleContext(Post_exprContext.class,0); + } + public PostEprContext(Transformation_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterPostEpr(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitPostEpr(this); + } + } + public static class PreExprContext extends Transformation_exprContext { + public Pre_exprContext pre_expr() { + return getRuleContext(Pre_exprContext.class,0); + } + public PreExprContext(Transformation_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterPreExpr(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitPreExpr(this); + } + } public static class TransformationEntityContext extends Transformation_exprContext { public Transformation_entityContext transformation_entity() { return getRuleContext(Transformation_entityContext.class,0); @@ -297,18 +330,32 @@ public void exitRule(ParseTreeListener listener) { if ( listener instanceof StellarListener ) ((StellarListener)listener).exitMatchExpr(this); } } + public static class AssignExprContext extends Transformation_exprContext { + public Assign_exprContext assign_expr() { + return getRuleContext(Assign_exprContext.class,0); + } + public AssignExprContext(Transformation_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterAssignExpr(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitAssignExpr(this); + } + } public final Transformation_exprContext transformation_expr() throws RecognitionException { Transformation_exprContext _localctx = new Transformation_exprContext(_ctx, getState()); enterRule(_localctx, 2, RULE_transformation_expr); try { - setState(80); + setState(89); switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) { case 1: _localctx = new ConditionalExprContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(69); + setState(75); conditional_expr(); } break; @@ -316,11 +363,11 @@ public final Transformation_exprContext transformation_expr() throws Recognition _localctx = new TransformationExprContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(70); + setState(76); match(LPAREN); - setState(71); + setState(77); transformation_expr(); - setState(72); + setState(78); match(RPAREN); } break; @@ -328,7 +375,7 @@ public final Transformation_exprContext transformation_expr() throws Recognition _localctx = new ArithExpressionContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(74); + setState(80); arithmetic_expr(0); } break; @@ -336,7 +383,7 @@ public final Transformation_exprContext transformation_expr() throws Recognition _localctx = new TransformationEntityContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(75); + setState(81); transformation_entity(); } break; @@ -344,7 +391,7 @@ public final Transformation_exprContext transformation_expr() throws Recognition _localctx = new ComparisonExpressionContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(76); + setState(82); comparison_expr(0); } break; @@ -352,7 +399,7 @@ public final Transformation_exprContext transformation_expr() throws Recognition _localctx = new LogicalExpressionContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(77); + setState(83); logical_expr(); } break; @@ -360,7 +407,7 @@ public final Transformation_exprContext transformation_expr() throws Recognition _localctx = new InExpressionContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(78); + setState(84); in_expr(); } break; @@ -368,10 +415,361 @@ public final Transformation_exprContext transformation_expr() throws Recognition _localctx = new MatchExprContext(_localctx); enterOuterAlt(_localctx, 8); { - setState(79); + setState(85); match_expr(); } break; + case 9: + _localctx = new AssignExprContext(_localctx); + enterOuterAlt(_localctx, 9); + { + setState(86); + assign_expr(); + } + break; + case 10: + _localctx = new PreExprContext(_localctx); + enterOuterAlt(_localctx, 10); + { + setState(87); + pre_expr(); + } + break; + case 11: + _localctx = new PostEprContext(_localctx); + enterOuterAlt(_localctx, 11); + { + setState(88); + post_expr(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Assign_exprContext extends ParserRuleContext { + public Assign_exprContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assign_expr; } + + public Assign_exprContext() { } + public void copyFrom(Assign_exprContext ctx) { + super.copyFrom(ctx); + } + } + public static class AssignExpressionContext extends Assign_exprContext { + public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } + public TerminalNode ASSIGN() { return getToken(StellarParser.ASSIGN, 0); } + public Transformation_exprContext transformation_expr() { + return getRuleContext(Transformation_exprContext.class,0); + } + public AssignExpressionContext(Assign_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterAssignExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitAssignExpression(this); + } + } + public static class DivideAssignExpressionContext extends Assign_exprContext { + public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } + public TerminalNode DIVIDEASSIGN() { return getToken(StellarParser.DIVIDEASSIGN, 0); } + public Transformation_exprContext transformation_expr() { + return getRuleContext(Transformation_exprContext.class,0); + } + public DivideAssignExpressionContext(Assign_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterDivideAssignExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitDivideAssignExpression(this); + } + } + public static class PlusAssignExpressionContext extends Assign_exprContext { + public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } + public TerminalNode PLUSASSIGN() { return getToken(StellarParser.PLUSASSIGN, 0); } + public Transformation_exprContext transformation_expr() { + return getRuleContext(Transformation_exprContext.class,0); + } + public PlusAssignExpressionContext(Assign_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterPlusAssignExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitPlusAssignExpression(this); + } + } + public static class MultiAssignExpressionContext extends Assign_exprContext { + public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } + public TerminalNode MULTASSIGN() { return getToken(StellarParser.MULTASSIGN, 0); } + public Transformation_exprContext transformation_expr() { + return getRuleContext(Transformation_exprContext.class,0); + } + public MultiAssignExpressionContext(Assign_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterMultiAssignExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitMultiAssignExpression(this); + } + } + public static class MinusAssignExpressionContext extends Assign_exprContext { + public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } + public TerminalNode MINUSASSIGN() { return getToken(StellarParser.MINUSASSIGN, 0); } + public Transformation_exprContext transformation_expr() { + return getRuleContext(Transformation_exprContext.class,0); + } + public MinusAssignExpressionContext(Assign_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterMinusAssignExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitMinusAssignExpression(this); + } + } + + public final Assign_exprContext assign_expr() throws RecognitionException { + Assign_exprContext _localctx = new Assign_exprContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_assign_expr); + try { + setState(106); + switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { + case 1: + _localctx = new AssignExpressionContext(_localctx); + enterOuterAlt(_localctx, 1); + { + setState(91); + match(IDENTIFIER); + setState(92); + match(ASSIGN); + setState(93); + transformation_expr(); + } + break; + case 2: + _localctx = new PlusAssignExpressionContext(_localctx); + enterOuterAlt(_localctx, 2); + { + setState(94); + match(IDENTIFIER); + setState(95); + match(PLUSASSIGN); + setState(96); + transformation_expr(); + } + break; + case 3: + _localctx = new MinusAssignExpressionContext(_localctx); + enterOuterAlt(_localctx, 3); + { + setState(97); + match(IDENTIFIER); + setState(98); + match(MINUSASSIGN); + setState(99); + transformation_expr(); + } + break; + case 4: + _localctx = new DivideAssignExpressionContext(_localctx); + enterOuterAlt(_localctx, 4); + { + setState(100); + match(IDENTIFIER); + setState(101); + match(DIVIDEASSIGN); + setState(102); + transformation_expr(); + } + break; + case 5: + _localctx = new MultiAssignExpressionContext(_localctx); + enterOuterAlt(_localctx, 5); + { + setState(103); + match(IDENTIFIER); + setState(104); + match(MULTASSIGN); + setState(105); + transformation_expr(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Pre_exprContext extends ParserRuleContext { + public Pre_exprContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_pre_expr; } + + public Pre_exprContext() { } + public void copyFrom(Pre_exprContext ctx) { + super.copyFrom(ctx); + } + } + public static class PreDecrementExpressionContext extends Pre_exprContext { + public TerminalNode MINUSMINUS() { return getToken(StellarParser.MINUSMINUS, 0); } + public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } + public PreDecrementExpressionContext(Pre_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterPreDecrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitPreDecrementExpression(this); + } + } + public static class PreIncrementExpressionContext extends Pre_exprContext { + public TerminalNode PLUSPLUS() { return getToken(StellarParser.PLUSPLUS, 0); } + public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } + public PreIncrementExpressionContext(Pre_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterPreIncrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitPreIncrementExpression(this); + } + } + + public final Pre_exprContext pre_expr() throws RecognitionException { + Pre_exprContext _localctx = new Pre_exprContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_pre_expr); + try { + setState(112); + switch (_input.LA(1)) { + case PLUSPLUS: + _localctx = new PreIncrementExpressionContext(_localctx); + enterOuterAlt(_localctx, 1); + { + setState(108); + match(PLUSPLUS); + setState(109); + match(IDENTIFIER); + } + break; + case MINUSMINUS: + _localctx = new PreDecrementExpressionContext(_localctx); + enterOuterAlt(_localctx, 2); + { + setState(110); + match(MINUSMINUS); + setState(111); + match(IDENTIFIER); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class Post_exprContext extends ParserRuleContext { + public Post_exprContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_post_expr; } + + public Post_exprContext() { } + public void copyFrom(Post_exprContext ctx) { + super.copyFrom(ctx); + } + } + public static class PostIncrementExpressionContext extends Post_exprContext { + public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } + public TerminalNode PLUSPLUS() { return getToken(StellarParser.PLUSPLUS, 0); } + public PostIncrementExpressionContext(Post_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterPostIncrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitPostIncrementExpression(this); + } + } + public static class PostDecrementExpressionContext extends Post_exprContext { + public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } + public TerminalNode MINUSMINUS() { return getToken(StellarParser.MINUSMINUS, 0); } + public PostDecrementExpressionContext(Post_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterPostDecrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitPostDecrementExpression(this); + } + } + + public final Post_exprContext post_expr() throws RecognitionException { + Post_exprContext _localctx = new Post_exprContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_post_expr); + try { + setState(118); + switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { + case 1: + _localctx = new PostIncrementExpressionContext(_localctx); + enterOuterAlt(_localctx, 1); + { + setState(114); + match(IDENTIFIER); + setState(115); + match(PLUSPLUS); + } + break; + case 2: + _localctx = new PostDecrementExpressionContext(_localctx); + enterOuterAlt(_localctx, 2); + { + setState(116); + match(IDENTIFIER); + setState(117); + match(MINUSMINUS); + } + break; } } catch (RecognitionException re) { @@ -405,11 +803,11 @@ public void exitRule(ParseTreeListener listener) { public final If_exprContext if_expr() throws RecognitionException { If_exprContext _localctx = new If_exprContext(_ctx, getState()); - enterRule(_localctx, 4, RULE_if_expr); + enterRule(_localctx, 10, RULE_if_expr); try { enterOuterAlt(_localctx, 1); { - setState(82); + setState(120); logical_expr(); } } @@ -444,11 +842,11 @@ public void exitRule(ParseTreeListener listener) { public final Then_exprContext then_expr() throws RecognitionException { Then_exprContext _localctx = new Then_exprContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_then_expr); + enterRule(_localctx, 12, RULE_then_expr); try { enterOuterAlt(_localctx, 1); { - setState(84); + setState(122); transformation_expr(); } } @@ -483,11 +881,11 @@ public void exitRule(ParseTreeListener listener) { public final Else_exprContext else_expr() throws RecognitionException { Else_exprContext _localctx = new Else_exprContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_else_expr); + enterRule(_localctx, 14, RULE_else_expr); try { enterOuterAlt(_localctx, 1); { - setState(86); + setState(124); transformation_expr(); } } @@ -561,9 +959,9 @@ public void exitRule(ParseTreeListener listener) { public final Conditional_exprContext conditional_expr() throws RecognitionException { Conditional_exprContext _localctx = new Conditional_exprContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_conditional_expr); + enterRule(_localctx, 16, RULE_conditional_expr); try { - setState(101); + setState(139); switch (_input.LA(1)) { case NOT: case TRUE: @@ -583,15 +981,15 @@ public final Conditional_exprContext conditional_expr() throws RecognitionExcept _localctx = new TernaryFuncWithoutIfContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(88); + setState(126); if_expr(); - setState(89); + setState(127); match(QUESTION); - setState(90); + setState(128); then_expr(); - setState(91); + setState(129); match(COLON); - setState(92); + setState(130); else_expr(); } break; @@ -599,17 +997,17 @@ public final Conditional_exprContext conditional_expr() throws RecognitionExcept _localctx = new TernaryFuncWithIfContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(94); + setState(132); match(IF); - setState(95); + setState(133); if_expr(); - setState(96); + setState(134); match(THEN); - setState(97); + setState(135); then_expr(); - setState(98); + setState(136); match(ELSE); - setState(99); + setState(137); else_expr(); } break; @@ -692,19 +1090,19 @@ public void exitRule(ParseTreeListener listener) { public final Logical_exprContext logical_expr() throws RecognitionException { Logical_exprContext _localctx = new Logical_exprContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_logical_expr); + enterRule(_localctx, 18, RULE_logical_expr); try { - setState(112); - switch ( getInterpreter().adaptivePredict(_input,2,_ctx) ) { + setState(150); + switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) { case 1: _localctx = new LogicalExpressionAndContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(103); + setState(141); b_expr(); - setState(104); + setState(142); match(AND); - setState(105); + setState(143); logical_expr(); } break; @@ -712,11 +1110,11 @@ public final Logical_exprContext logical_expr() throws RecognitionException { _localctx = new LogicalExpressionOrContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(107); + setState(145); b_expr(); - setState(108); + setState(146); match(OR); - setState(109); + setState(147); logical_expr(); } break; @@ -724,7 +1122,7 @@ public final Logical_exprContext logical_expr() throws RecognitionException { _localctx = new BoleanExpressionContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(111); + setState(149); b_expr(); } break; @@ -764,21 +1162,21 @@ public void exitRule(ParseTreeListener listener) { public final B_exprContext b_expr() throws RecognitionException { B_exprContext _localctx = new B_exprContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_b_expr); + enterRule(_localctx, 20, RULE_b_expr); try { - setState(116); - switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { + setState(154); + switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(114); + setState(152); comparison_expr(0); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(115); + setState(153); in_expr(); } break; @@ -845,19 +1243,19 @@ public void exitRule(ParseTreeListener listener) { public final In_exprContext in_expr() throws RecognitionException { In_exprContext _localctx = new In_exprContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_in_expr); + enterRule(_localctx, 22, RULE_in_expr); try { - setState(126); - switch ( getInterpreter().adaptivePredict(_input,4,_ctx) ) { + setState(164); + switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) { case 1: _localctx = new InExpressionStatementContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(118); + setState(156); identifier_operand(); - setState(119); + setState(157); match(IN); - setState(120); + setState(158); b_expr(); } break; @@ -865,11 +1263,11 @@ public final In_exprContext in_expr() throws RecognitionException { _localctx = new NInExpressionStatementContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(122); + setState(160); identifier_operand(); - setState(123); + setState(161); match(NIN); - setState(124); + setState(162); b_expr(); } break; @@ -974,27 +1372,27 @@ private Comparison_exprContext comparison_expr(int _p) throws RecognitionExcepti int _parentState = getState(); Comparison_exprContext _localctx = new Comparison_exprContext(_ctx, _parentState); Comparison_exprContext _prevctx = _localctx; - int _startState = 18; - enterRecursionRule(_localctx, 18, RULE_comparison_expr, _p); + int _startState = 24; + enterRecursionRule(_localctx, 24, RULE_comparison_expr, _p); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(139); - switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) { + setState(177); + switch ( getInterpreter().adaptivePredict(_input,8,_ctx) ) { case 1: { _localctx = new NotFuncContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(129); + setState(167); match(NOT); - setState(130); + setState(168); match(LPAREN); - setState(131); + setState(169); logical_expr(); - setState(132); + setState(170); match(RPAREN); } break; @@ -1003,11 +1401,11 @@ private Comparison_exprContext comparison_expr(int _p) throws RecognitionExcepti _localctx = new ComparisonExpressionParensContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(134); + setState(172); match(LPAREN); - setState(135); + setState(173); logical_expr(); - setState(136); + setState(174); match(RPAREN); } break; @@ -1016,15 +1414,15 @@ private Comparison_exprContext comparison_expr(int _p) throws RecognitionExcepti _localctx = new OperandContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(138); + setState(176); identifier_operand(); } break; } _ctx.stop = _input.LT(-1); - setState(147); + setState(185); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,6,_ctx); + _alt = getInterpreter().adaptivePredict(_input,9,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); @@ -1033,18 +1431,18 @@ private Comparison_exprContext comparison_expr(int _p) throws RecognitionExcepti { _localctx = new ComparisonExpressionWithOperatorContext(new Comparison_exprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_comparison_expr); - setState(141); + setState(179); if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); - setState(142); + setState(180); comp_operator(); - setState(143); + setState(181); comparison_expr(5); } } } - setState(149); + setState(187); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,6,_ctx); + _alt = getInterpreter().adaptivePredict(_input,9,_ctx); } } } @@ -1079,11 +1477,11 @@ public void exitRule(ParseTreeListener listener) { public final Transformation_entityContext transformation_entity() throws RecognitionException { Transformation_entityContext _localctx = new Transformation_entityContext(_ctx, getState()); - enterRule(_localctx, 20, RULE_transformation_entity); + enterRule(_localctx, 26, RULE_transformation_entity); try { enterOuterAlt(_localctx, 1); { - setState(150); + setState(188); identifier_operand(); } } @@ -1129,13 +1527,13 @@ public void exitRule(ParseTreeListener listener) { public final Comp_operatorContext comp_operator() throws RecognitionException { Comp_operatorContext _localctx = new Comp_operatorContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_comp_operator); + enterRule(_localctx, 28, RULE_comp_operator); int _la; try { _localctx = new ComparisonOpContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(152); + setState(190); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << EQ) | (1L << NEQ) | (1L << LT) | (1L << LTE) | (1L << GT) | (1L << GTE))) != 0)) ) { _errHandler.recoverInline(this); @@ -1177,27 +1575,27 @@ public void exitRule(ParseTreeListener listener) { public final Func_argsContext func_args() throws RecognitionException { Func_argsContext _localctx = new Func_argsContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_func_args); + enterRule(_localctx, 30, RULE_func_args); try { - setState(160); - switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) { + setState(198); + switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(154); + setState(192); match(LPAREN); - setState(155); + setState(193); op_list(0); - setState(156); + setState(194); match(RPAREN); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(158); + setState(196); match(LPAREN); - setState(159); + setState(197); match(RPAREN); } break; @@ -1251,53 +1649,53 @@ private Op_listContext op_list(int _p) throws RecognitionException { int _parentState = getState(); Op_listContext _localctx = new Op_listContext(_ctx, _parentState); Op_listContext _prevctx = _localctx; - int _startState = 26; - enterRecursionRule(_localctx, 26, RULE_op_list, _p); + int _startState = 32; + enterRecursionRule(_localctx, 32, RULE_op_list, _p); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(166); - switch ( getInterpreter().adaptivePredict(_input,8,_ctx) ) { + setState(204); + switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) { case 1: { - setState(163); + setState(201); identifier_operand(); } break; case 2: { - setState(164); + setState(202); conditional_expr(); } break; case 3: { - setState(165); + setState(203); comparison_expr(0); } break; } _ctx.stop = _input.LT(-1); - setState(179); + setState(217); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,10,_ctx); + _alt = getInterpreter().adaptivePredict(_input,13,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(177); - switch ( getInterpreter().adaptivePredict(_input,9,_ctx) ) { + setState(215); + switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) { case 1: { _localctx = new Op_listContext(_parentctx, _parentState); pushNewRecursionContext(_localctx, _startState, RULE_op_list); - setState(168); + setState(206); if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); - setState(169); + setState(207); match(COMMA); - setState(170); + setState(208); identifier_operand(); } break; @@ -1305,11 +1703,11 @@ private Op_listContext op_list(int _p) throws RecognitionException { { _localctx = new Op_listContext(_parentctx, _parentState); pushNewRecursionContext(_localctx, _startState, RULE_op_list); - setState(171); + setState(209); if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); - setState(172); + setState(210); match(COMMA); - setState(173); + setState(211); conditional_expr(); } break; @@ -1317,20 +1715,20 @@ private Op_listContext op_list(int _p) throws RecognitionException { { _localctx = new Op_listContext(_parentctx, _parentState); pushNewRecursionContext(_localctx, _startState, RULE_op_list); - setState(174); + setState(212); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(175); + setState(213); match(COMMA); - setState(176); + setState(214); comparison_expr(0); } break; } } } - setState(181); + setState(219); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,10,_ctx); + _alt = getInterpreter().adaptivePredict(_input,13,_ctx); } } } @@ -1367,27 +1765,27 @@ public void exitRule(ParseTreeListener listener) { public final List_entityContext list_entity() throws RecognitionException { List_entityContext _localctx = new List_entityContext(_ctx, getState()); - enterRule(_localctx, 28, RULE_list_entity); + enterRule(_localctx, 34, RULE_list_entity); try { - setState(188); - switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) { + setState(226); + switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(182); + setState(220); match(LBRACKET); - setState(183); + setState(221); match(RBRACKET); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(184); + setState(222); match(LBRACKET); - setState(185); + setState(223); op_list(0); - setState(186); + setState(224); match(RBRACKET); } break; @@ -1442,59 +1840,59 @@ private Kv_listContext kv_list(int _p) throws RecognitionException { int _parentState = getState(); Kv_listContext _localctx = new Kv_listContext(_ctx, _parentState); Kv_listContext _prevctx = _localctx; - int _startState = 30; - enterRecursionRule(_localctx, 30, RULE_kv_list, _p); + int _startState = 36; + enterRecursionRule(_localctx, 36, RULE_kv_list, _p); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(199); - switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) { + setState(237); + switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { case 1: { - setState(191); + setState(229); identifier_operand(); - setState(192); + setState(230); match(COLON); - setState(193); + setState(231); transformation_expr(); } break; case 2: { - setState(195); + setState(233); comparison_expr(0); - setState(196); + setState(234); match(COLON); - setState(197); + setState(235); transformation_expr(); } break; } _ctx.stop = _input.LT(-1); - setState(215); + setState(253); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,14,_ctx); + _alt = getInterpreter().adaptivePredict(_input,17,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(213); - switch ( getInterpreter().adaptivePredict(_input,13,_ctx) ) { + setState(251); + switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) { case 1: { _localctx = new Kv_listContext(_parentctx, _parentState); pushNewRecursionContext(_localctx, _startState, RULE_kv_list); - setState(201); + setState(239); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(202); + setState(240); match(COMMA); - setState(203); + setState(241); identifier_operand(); - setState(204); + setState(242); match(COLON); - setState(205); + setState(243); transformation_expr(); } break; @@ -1502,24 +1900,24 @@ private Kv_listContext kv_list(int _p) throws RecognitionException { { _localctx = new Kv_listContext(_parentctx, _parentState); pushNewRecursionContext(_localctx, _startState, RULE_kv_list); - setState(207); + setState(245); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(208); + setState(246); match(COMMA); - setState(209); + setState(247); comparison_expr(0); - setState(210); + setState(248); match(COLON); - setState(211); + setState(249); transformation_expr(); } break; } } } - setState(217); + setState(255); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,14,_ctx); + _alt = getInterpreter().adaptivePredict(_input,17,_ctx); } } } @@ -1556,27 +1954,27 @@ public void exitRule(ParseTreeListener listener) { public final Map_entityContext map_entity() throws RecognitionException { Map_entityContext _localctx = new Map_entityContext(_ctx, getState()); - enterRule(_localctx, 32, RULE_map_entity); + enterRule(_localctx, 38, RULE_map_entity); try { - setState(224); - switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { + setState(262); + switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(218); + setState(256); match(LBRACE); - setState(219); + setState(257); kv_list(0); - setState(220); + setState(258); match(RBRACE); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(222); + setState(260); match(LBRACE); - setState(223); + setState(261); match(RBRACE); } break; @@ -1664,8 +2062,8 @@ private Arithmetic_exprContext arithmetic_expr(int _p) throws RecognitionExcepti int _parentState = getState(); Arithmetic_exprContext _localctx = new Arithmetic_exprContext(_ctx, _parentState); Arithmetic_exprContext _prevctx = _localctx; - int _startState = 34; - enterRecursionRule(_localctx, 34, RULE_arithmetic_expr, _p); + int _startState = 40; + enterRecursionRule(_localctx, 40, RULE_arithmetic_expr, _p); try { int _alt; enterOuterAlt(_localctx, 1); @@ -1675,29 +2073,29 @@ private Arithmetic_exprContext arithmetic_expr(int _p) throws RecognitionExcepti _ctx = _localctx; _prevctx = _localctx; - setState(227); + setState(265); arithmetic_expr_mul(0); } _ctx.stop = _input.LT(-1); - setState(237); + setState(275); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,17,_ctx); + _alt = getInterpreter().adaptivePredict(_input,20,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(235); - switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) { + setState(273); + switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) { case 1: { _localctx = new ArithExpr_plusContext(new Arithmetic_exprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_arithmetic_expr); - setState(229); + setState(267); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(230); + setState(268); match(PLUS); - setState(231); + setState(269); arithmetic_expr_mul(0); } break; @@ -1705,20 +2103,20 @@ private Arithmetic_exprContext arithmetic_expr(int _p) throws RecognitionExcepti { _localctx = new ArithExpr_minusContext(new Arithmetic_exprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_arithmetic_expr); - setState(232); + setState(270); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(233); + setState(271); match(MINUS); - setState(234); + setState(272); arithmetic_expr_mul(0); } break; } } } - setState(239); + setState(277); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,17,_ctx); + _alt = getInterpreter().adaptivePredict(_input,20,_ctx); } } } @@ -1804,8 +2202,8 @@ private Arithmetic_expr_mulContext arithmetic_expr_mul(int _p) throws Recognitio int _parentState = getState(); Arithmetic_expr_mulContext _localctx = new Arithmetic_expr_mulContext(_ctx, _parentState); Arithmetic_expr_mulContext _prevctx = _localctx; - int _startState = 36; - enterRecursionRule(_localctx, 36, RULE_arithmetic_expr_mul, _p); + int _startState = 42; + enterRecursionRule(_localctx, 42, RULE_arithmetic_expr_mul, _p); try { int _alt; enterOuterAlt(_localctx, 1); @@ -1815,29 +2213,29 @@ private Arithmetic_expr_mulContext arithmetic_expr_mul(int _p) throws Recognitio _ctx = _localctx; _prevctx = _localctx; - setState(241); + setState(279); arithmetic_operands(); } _ctx.stop = _input.LT(-1); - setState(251); + setState(289); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,19,_ctx); + _alt = getInterpreter().adaptivePredict(_input,22,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(249); - switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { + setState(287); + switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { case 1: { _localctx = new ArithExpr_mulContext(new Arithmetic_expr_mulContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_arithmetic_expr_mul); - setState(243); + setState(281); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(244); + setState(282); match(MUL); - setState(245); + setState(283); arithmetic_expr_mul(3); } break; @@ -1845,20 +2243,20 @@ private Arithmetic_expr_mulContext arithmetic_expr_mul(int _p) throws Recognitio { _localctx = new ArithExpr_divContext(new Arithmetic_expr_mulContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_arithmetic_expr_mul); - setState(246); + setState(284); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(247); + setState(285); match(DIV); - setState(248); + setState(286); arithmetic_expr_mul(2); } break; } } } - setState(253); + setState(291); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,19,_ctx); + _alt = getInterpreter().adaptivePredict(_input,22,_ctx); } } } @@ -1902,14 +2300,14 @@ public void exitRule(ParseTreeListener listener) { public final FunctionsContext functions() throws RecognitionException { FunctionsContext _localctx = new FunctionsContext(_ctx, getState()); - enterRule(_localctx, 38, RULE_functions); + enterRule(_localctx, 44, RULE_functions); try { _localctx = new TransformationFuncContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(254); + setState(292); match(IDENTIFIER); - setState(255); + setState(293); func_args(); } } @@ -2056,15 +2454,15 @@ public void exitRule(ParseTreeListener listener) { public final Arithmetic_operandsContext arithmetic_operands() throws RecognitionException { Arithmetic_operandsContext _localctx = new Arithmetic_operandsContext(_ctx, getState()); - enterRule(_localctx, 40, RULE_arithmetic_operands); + enterRule(_localctx, 46, RULE_arithmetic_operands); try { - setState(272); - switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) { + setState(310); + switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { case 1: _localctx = new NumericFunctionsContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(257); + setState(295); functions(); } break; @@ -2072,7 +2470,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new DoubleLiteralContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(258); + setState(296); match(DOUBLE_LITERAL); } break; @@ -2080,7 +2478,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new IntLiteralContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(259); + setState(297); match(INT_LITERAL); } break; @@ -2088,7 +2486,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new LongLiteralContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(260); + setState(298); match(LONG_LITERAL); } break; @@ -2096,7 +2494,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new FloatLiteralContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(261); + setState(299); match(FLOAT_LITERAL); } break; @@ -2104,7 +2502,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new VariableContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(262); + setState(300); match(IDENTIFIER); } break; @@ -2112,7 +2510,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new NaNArithContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(263); + setState(301); match(NAN); } break; @@ -2120,11 +2518,11 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new ParenArithContext(_localctx); enterOuterAlt(_localctx, 8); { - setState(264); + setState(302); match(LPAREN); - setState(265); + setState(303); arithmetic_expr(0); - setState(266); + setState(304); match(RPAREN); } break; @@ -2132,11 +2530,11 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new CondExprContext(_localctx); enterOuterAlt(_localctx, 9); { - setState(268); + setState(306); match(LPAREN); - setState(269); + setState(307); conditional_expr(); - setState(270); + setState(308); match(RPAREN); } break; @@ -2319,16 +2717,16 @@ public void exitRule(ParseTreeListener listener) { public final Identifier_operandContext identifier_operand() throws RecognitionException { Identifier_operandContext _localctx = new Identifier_operandContext(_ctx, getState()); - enterRule(_localctx, 42, RULE_identifier_operand); + enterRule(_localctx, 48, RULE_identifier_operand); int _la; try { - setState(291); - switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { + setState(329); + switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) { case 1: _localctx = new LogicalConstContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(274); + setState(312); _la = _input.LA(1); if ( !(_la==TRUE || _la==FALSE) ) { _errHandler.recoverInline(this); @@ -2341,7 +2739,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new LambdaWithArgsExprContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(275); + setState(313); lambda_with_args(); } break; @@ -2349,7 +2747,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new LambdaWithoutArgsExprContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(276); + setState(314); lambda_without_args(); } break; @@ -2357,7 +2755,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new ArithmeticOperandsContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(277); + setState(315); arithmetic_expr(0); } break; @@ -2365,7 +2763,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new StringLiteralContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(278); + setState(316); match(STRING_LITERAL); } break; @@ -2373,7 +2771,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new ListContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(279); + setState(317); list_entity(); } break; @@ -2381,7 +2779,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new MapConstContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(280); + setState(318); map_entity(); } break; @@ -2389,7 +2787,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new NullConstContext(_localctx); enterOuterAlt(_localctx, 8); { - setState(281); + setState(319); match(NULL); } break; @@ -2397,13 +2795,13 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new ExistsFuncContext(_localctx); enterOuterAlt(_localctx, 9); { - setState(282); + setState(320); match(EXISTS); - setState(283); + setState(321); match(LPAREN); - setState(284); + setState(322); match(IDENTIFIER); - setState(285); + setState(323); match(RPAREN); } break; @@ -2411,11 +2809,11 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new CondExpr_parenContext(_localctx); enterOuterAlt(_localctx, 10); { - setState(286); + setState(324); match(LPAREN); - setState(287); + setState(325); conditional_expr(); - setState(288); + setState(326); match(RPAREN); } break; @@ -2423,7 +2821,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new FuncContext(_localctx); enterOuterAlt(_localctx, 11); { - setState(290); + setState(328); functions(); } break; @@ -2466,12 +2864,12 @@ public void exitRule(ParseTreeListener listener) { public final Default_operandContext default_operand() throws RecognitionException { Default_operandContext _localctx = new Default_operandContext(_ctx, getState()); - enterRule(_localctx, 44, RULE_default_operand); + enterRule(_localctx, 50, RULE_default_operand); try { _localctx = new DefaultContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(293); + setState(331); match(DEFAULT); } } @@ -2509,17 +2907,17 @@ public void exitRule(ParseTreeListener listener) { public final Lambda_without_argsContext lambda_without_args() throws RecognitionException { Lambda_without_argsContext _localctx = new Lambda_without_argsContext(_ctx, getState()); - enterRule(_localctx, 46, RULE_lambda_without_args); + enterRule(_localctx, 52, RULE_lambda_without_args); try { enterOuterAlt(_localctx, 1); { - setState(295); + setState(333); match(LPAREN); - setState(296); + setState(334); match(RPAREN); - setState(297); + setState(335); match(LAMBDA_OP); - setState(298); + setState(336); transformation_expr(); } } @@ -2563,33 +2961,33 @@ public void exitRule(ParseTreeListener listener) { public final Lambda_with_argsContext lambda_with_args() throws RecognitionException { Lambda_with_argsContext _localctx = new Lambda_with_argsContext(_ctx, getState()); - enterRule(_localctx, 48, RULE_lambda_with_args); + enterRule(_localctx, 54, RULE_lambda_with_args); try { - setState(310); + setState(348); switch (_input.LA(1)) { case LPAREN: enterOuterAlt(_localctx, 1); { - setState(300); + setState(338); match(LPAREN); - setState(301); + setState(339); lambda_variables(); - setState(302); + setState(340); match(RPAREN); - setState(303); + setState(341); match(LAMBDA_OP); - setState(304); + setState(342); transformation_expr(); } break; case IDENTIFIER: enterOuterAlt(_localctx, 2); { - setState(306); + setState(344); single_lambda_variable(); - setState(307); + setState(345); match(LAMBDA_OP); - setState(308); + setState(346); transformation_expr(); } break; @@ -2635,26 +3033,26 @@ public void exitRule(ParseTreeListener listener) { public final Lambda_variablesContext lambda_variables() throws RecognitionException { Lambda_variablesContext _localctx = new Lambda_variablesContext(_ctx, getState()); - enterRule(_localctx, 50, RULE_lambda_variables); + enterRule(_localctx, 56, RULE_lambda_variables); int _la; try { enterOuterAlt(_localctx, 1); { - setState(312); + setState(350); lambda_variable(); - setState(317); + setState(355); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(313); + setState(351); match(COMMA); - setState(314); + setState(352); lambda_variable(); } } - setState(319); + setState(357); _errHandler.sync(this); _la = _input.LA(1); } @@ -2691,11 +3089,11 @@ public void exitRule(ParseTreeListener listener) { public final Single_lambda_variableContext single_lambda_variable() throws RecognitionException { Single_lambda_variableContext _localctx = new Single_lambda_variableContext(_ctx, getState()); - enterRule(_localctx, 52, RULE_single_lambda_variable); + enterRule(_localctx, 58, RULE_single_lambda_variable); try { enterOuterAlt(_localctx, 1); { - setState(320); + setState(358); lambda_variable(); } } @@ -2728,11 +3126,11 @@ public void exitRule(ParseTreeListener listener) { public final Lambda_variableContext lambda_variable() throws RecognitionException { Lambda_variableContext _localctx = new Lambda_variableContext(_ctx, getState()); - enterRule(_localctx, 54, RULE_lambda_variable); + enterRule(_localctx, 60, RULE_lambda_variable); try { enterOuterAlt(_localctx, 1); { - setState(322); + setState(360); match(IDENTIFIER); } } @@ -2784,26 +3182,26 @@ public void exitRule(ParseTreeListener listener) { public final Match_exprContext match_expr() throws RecognitionException { Match_exprContext _localctx = new Match_exprContext(_ctx, getState()); - enterRule(_localctx, 56, RULE_match_expr); + enterRule(_localctx, 62, RULE_match_expr); try { _localctx = new MatchClausesContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(324); + setState(362); match(MATCH); - setState(325); + setState(363); match(LBRACE); - setState(326); + setState(364); match_clauses(); - setState(327); + setState(365); match(COMMA); - setState(328); + setState(366); match(DEFAULT); - setState(329); + setState(367); match(MATCH_ACTION); - setState(330); + setState(368); match_clause_action(); - setState(331); + setState(369); match(RBRACE); } } @@ -2845,30 +3243,30 @@ public void exitRule(ParseTreeListener listener) { public final Match_clausesContext match_clauses() throws RecognitionException { Match_clausesContext _localctx = new Match_clausesContext(_ctx, getState()); - enterRule(_localctx, 58, RULE_match_clauses); + enterRule(_localctx, 64, RULE_match_clauses); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(333); + setState(371); match_clause(); - setState(338); + setState(376); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,24,_ctx); + _alt = getInterpreter().adaptivePredict(_input,27,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(334); + setState(372); match(COMMA); - setState(335); + setState(373); match_clause(); } } } - setState(340); + setState(378); _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,24,_ctx); + _alt = getInterpreter().adaptivePredict(_input,27,_ctx); } } } @@ -2907,15 +3305,15 @@ public void exitRule(ParseTreeListener listener) { public final Match_clauseContext match_clause() throws RecognitionException { Match_clauseContext _localctx = new Match_clauseContext(_ctx, getState()); - enterRule(_localctx, 60, RULE_match_clause); + enterRule(_localctx, 66, RULE_match_clause); try { enterOuterAlt(_localctx, 1); { - setState(341); + setState(379); match_clause_check(); - setState(342); + setState(380); match(MATCH_ACTION); - setState(343); + setState(381); match_clause_action(); } } @@ -2958,12 +3356,12 @@ public void exitRule(ParseTreeListener listener) { public final Match_clause_actionContext match_clause_action() throws RecognitionException { Match_clause_actionContext _localctx = new Match_clause_actionContext(_ctx, getState()); - enterRule(_localctx, 62, RULE_match_clause_action); + enterRule(_localctx, 68, RULE_match_clause_action); try { _localctx = new MatchClauseActionContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(345); + setState(383); transformation_expr(); } } @@ -3009,15 +3407,15 @@ public void exitRule(ParseTreeListener listener) { public final Match_clause_checkContext match_clause_check() throws RecognitionException { Match_clause_checkContext _localctx = new Match_clause_checkContext(_ctx, getState()); - enterRule(_localctx, 64, RULE_match_clause_check); + enterRule(_localctx, 70, RULE_match_clause_check); try { - setState(349); - switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) { + setState(387); + switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { case 1: _localctx = new MatchClauseCheckExprContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(347); + setState(385); logical_expr(); } break; @@ -3025,7 +3423,7 @@ public final Match_clause_checkContext match_clause_check() throws RecognitionEx _localctx = new MatchClauseCheckExprContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(348); + setState(386); conditional_expr(); } break; @@ -3044,15 +3442,15 @@ public final Match_clause_checkContext match_clause_check() throws RecognitionEx public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { switch (ruleIndex) { - case 9: + case 12: return comparison_expr_sempred((Comparison_exprContext)_localctx, predIndex); - case 13: + case 16: return op_list_sempred((Op_listContext)_localctx, predIndex); - case 15: + case 18: return kv_list_sempred((Kv_listContext)_localctx, predIndex); - case 17: + case 20: return arithmetic_expr_sempred((Arithmetic_exprContext)_localctx, predIndex); - case 18: + case 21: return arithmetic_expr_mul_sempred((Arithmetic_expr_mulContext)_localctx, predIndex); } return true; @@ -3104,128 +3502,143 @@ private boolean arithmetic_expr_mul_sempred(Arithmetic_expr_mulContext _localctx } public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\62\u0162\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"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\39\u0188\4\2\t\2\4"+ + "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+ + "\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ - "\t!\4\"\t\"\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\5"+ - "\3S\n\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3\7\3"+ - "\7\3\7\3\7\3\7\5\7h\n\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\5\bs\n\b\3"+ - "\t\3\t\5\tw\n\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\5\n\u0081\n\n\3\13\3\13"+ - "\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\5\13\u008e\n\13\3\13\3\13"+ - "\3\13\3\13\7\13\u0094\n\13\f\13\16\13\u0097\13\13\3\f\3\f\3\r\3\r\3\16"+ - "\3\16\3\16\3\16\3\16\3\16\5\16\u00a3\n\16\3\17\3\17\3\17\3\17\5\17\u00a9"+ - "\n\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\7\17\u00b4\n\17\f\17"+ - "\16\17\u00b7\13\17\3\20\3\20\3\20\3\20\3\20\3\20\5\20\u00bf\n\20\3\21"+ - "\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\5\21\u00ca\n\21\3\21\3\21\3\21"+ - "\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\7\21\u00d8\n\21\f\21\16"+ - "\21\u00db\13\21\3\22\3\22\3\22\3\22\3\22\3\22\5\22\u00e3\n\22\3\23\3\23"+ - "\3\23\3\23\3\23\3\23\3\23\3\23\3\23\7\23\u00ee\n\23\f\23\16\23\u00f1\13"+ - "\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\7\24\u00fc\n\24\f\24"+ - "\16\24\u00ff\13\24\3\25\3\25\3\25\3\26\3\26\3\26\3\26\3\26\3\26\3\26\3"+ - "\26\3\26\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u0113\n\26\3\27\3\27\3\27"+ - "\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27"+ - "\5\27\u0126\n\27\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32"+ - "\3\32\3\32\3\32\3\32\3\32\3\32\5\32\u0139\n\32\3\33\3\33\3\33\7\33\u013e"+ - "\n\33\f\33\16\33\u0141\13\33\3\34\3\34\3\35\3\35\3\36\3\36\3\36\3\36\3"+ - "\36\3\36\3\36\3\36\3\36\3\37\3\37\3\37\7\37\u0153\n\37\f\37\16\37\u0156"+ - "\13\37\3 \3 \3 \3 \3!\3!\3\"\3\"\5\"\u0160\n\"\3\"\2\7\24\34 $&#\2\4\6"+ - "\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<>@B\2\4\3\2\16"+ - "\23\3\2\f\r\u0174\2D\3\2\2\2\4R\3\2\2\2\6T\3\2\2\2\bV\3\2\2\2\nX\3\2\2"+ - "\2\fg\3\2\2\2\16r\3\2\2\2\20v\3\2\2\2\22\u0080\3\2\2\2\24\u008d\3\2\2"+ - "\2\26\u0098\3\2\2\2\30\u009a\3\2\2\2\32\u00a2\3\2\2\2\34\u00a8\3\2\2\2"+ - "\36\u00be\3\2\2\2 \u00c9\3\2\2\2\"\u00e2\3\2\2\2$\u00e4\3\2\2\2&\u00f2"+ - "\3\2\2\2(\u0100\3\2\2\2*\u0112\3\2\2\2,\u0125\3\2\2\2.\u0127\3\2\2\2\60"+ - "\u0129\3\2\2\2\62\u0138\3\2\2\2\64\u013a\3\2\2\2\66\u0142\3\2\2\28\u0144"+ - "\3\2\2\2:\u0146\3\2\2\2<\u014f\3\2\2\2>\u0157\3\2\2\2@\u015b\3\2\2\2B"+ - "\u015f\3\2\2\2DE\5\4\3\2EF\7\2\2\3F\3\3\2\2\2GS\5\f\7\2HI\7&\2\2IJ\5\4"+ - "\3\2JK\7\'\2\2KS\3\2\2\2LS\5$\23\2MS\5\26\f\2NS\5\24\13\2OS\5\16\b\2P"+ - "S\5\22\n\2QS\5:\36\2RG\3\2\2\2RH\3\2\2\2RL\3\2\2\2RM\3\2\2\2RN\3\2\2\2"+ - "RO\3\2\2\2RP\3\2\2\2RQ\3\2\2\2S\5\3\2\2\2TU\5\16\b\2U\7\3\2\2\2VW\5\4"+ - "\3\2W\t\3\2\2\2XY\5\4\3\2Y\13\3\2\2\2Z[\5\6\4\2[\\\7\24\2\2\\]\5\b\5\2"+ - "]^\7\25\2\2^_\5\n\6\2_h\3\2\2\2`a\7\26\2\2ab\5\6\4\2bc\7\27\2\2cd\5\b"+ - "\5\2de\7\30\2\2ef\5\n\6\2fh\3\2\2\2gZ\3\2\2\2g`\3\2\2\2h\r\3\2\2\2ij\5"+ - "\20\t\2jk\7\t\2\2kl\5\16\b\2ls\3\2\2\2mn\5\20\t\2no\7\n\2\2op\5\16\b\2"+ - "ps\3\2\2\2qs\5\20\t\2ri\3\2\2\2rm\3\2\2\2rq\3\2\2\2s\17\3\2\2\2tw\5\24"+ - "\13\2uw\5\22\n\2vt\3\2\2\2vu\3\2\2\2w\21\3\2\2\2xy\5,\27\2yz\7\3\2\2z"+ - "{\5\20\t\2{\u0081\3\2\2\2|}\5,\27\2}~\7(\2\2~\177\5\20\t\2\177\u0081\3"+ - "\2\2\2\u0080x\3\2\2\2\u0080|\3\2\2\2\u0081\23\3\2\2\2\u0082\u0083\b\13"+ - "\1\2\u0083\u0084\7\13\2\2\u0084\u0085\7&\2\2\u0085\u0086\5\16\b\2\u0086"+ - "\u0087\7\'\2\2\u0087\u008e\3\2\2\2\u0088\u0089\7&\2\2\u0089\u008a\5\16"+ - "\b\2\u008a\u008b\7\'\2\2\u008b\u008e\3\2\2\2\u008c\u008e\5,\27\2\u008d"+ - "\u0082\3\2\2\2\u008d\u0088\3\2\2\2\u008d\u008c\3\2\2\2\u008e\u0095\3\2"+ - "\2\2\u008f\u0090\f\6\2\2\u0090\u0091\5\30\r\2\u0091\u0092\5\24\13\7\u0092"+ - "\u0094\3\2\2\2\u0093\u008f\3\2\2\2\u0094\u0097\3\2\2\2\u0095\u0093\3\2"+ - "\2\2\u0095\u0096\3\2\2\2\u0096\25\3\2\2\2\u0097\u0095\3\2\2\2\u0098\u0099"+ - "\5,\27\2\u0099\27\3\2\2\2\u009a\u009b\t\2\2\2\u009b\31\3\2\2\2\u009c\u009d"+ - "\7&\2\2\u009d\u009e\5\34\17\2\u009e\u009f\7\'\2\2\u009f\u00a3\3\2\2\2"+ - "\u00a0\u00a1\7&\2\2\u00a1\u00a3\7\'\2\2\u00a2\u009c\3\2\2\2\u00a2\u00a0"+ - "\3\2\2\2\u00a3\33\3\2\2\2\u00a4\u00a5\b\17\1\2\u00a5\u00a9\5,\27\2\u00a6"+ - "\u00a9\5\f\7\2\u00a7\u00a9\5\24\13\2\u00a8\u00a4\3\2\2\2\u00a8\u00a6\3"+ - "\2\2\2\u00a8\u00a7\3\2\2\2\u00a9\u00b5\3\2\2\2\u00aa\u00ab\f\7\2\2\u00ab"+ - "\u00ac\7\7\2\2\u00ac\u00b4\5,\27\2\u00ad\u00ae\f\5\2\2\u00ae\u00af\7\7"+ - "\2\2\u00af\u00b4\5\f\7\2\u00b0\u00b1\f\3\2\2\u00b1\u00b2\7\7\2\2\u00b2"+ - "\u00b4\5\24\13\2\u00b3\u00aa\3\2\2\2\u00b3\u00ad\3\2\2\2\u00b3\u00b0\3"+ - "\2\2\2\u00b4\u00b7\3\2\2\2\u00b5\u00b3\3\2\2\2\u00b5\u00b6\3\2\2\2\u00b6"+ - "\35\3\2\2\2\u00b7\u00b5\3\2\2\2\u00b8\u00b9\7$\2\2\u00b9\u00bf\7%\2\2"+ - "\u00ba\u00bb\7$\2\2\u00bb\u00bc\5\34\17\2\u00bc\u00bd\7%\2\2\u00bd\u00bf"+ - "\3\2\2\2\u00be\u00b8\3\2\2\2\u00be\u00ba\3\2\2\2\u00bf\37\3\2\2\2\u00c0"+ - "\u00c1\b\21\1\2\u00c1\u00c2\5,\27\2\u00c2\u00c3\7\25\2\2\u00c3\u00c4\5"+ - "\4\3\2\u00c4\u00ca\3\2\2\2\u00c5\u00c6\5\24\13\2\u00c6\u00c7\7\25\2\2"+ - "\u00c7\u00c8\5\4\3\2\u00c8\u00ca\3\2\2\2\u00c9\u00c0\3\2\2\2\u00c9\u00c5"+ - "\3\2\2\2\u00ca\u00d9\3\2\2\2\u00cb\u00cc\f\4\2\2\u00cc\u00cd\7\7\2\2\u00cd"+ - "\u00ce\5,\27\2\u00ce\u00cf\7\25\2\2\u00cf\u00d0\5\4\3\2\u00d0\u00d8\3"+ - "\2\2\2\u00d1\u00d2\f\3\2\2\u00d2\u00d3\7\7\2\2\u00d3\u00d4\5\24\13\2\u00d4"+ - "\u00d5\7\25\2\2\u00d5\u00d6\5\4\3\2\u00d6\u00d8\3\2\2\2\u00d7\u00cb\3"+ - "\2\2\2\u00d7\u00d1\3\2\2\2\u00d8\u00db\3\2\2\2\u00d9\u00d7\3\2\2\2\u00d9"+ - "\u00da\3\2\2\2\u00da!\3\2\2\2\u00db\u00d9\3\2\2\2\u00dc\u00dd\7\"\2\2"+ - "\u00dd\u00de\5 \21\2\u00de\u00df\7#\2\2\u00df\u00e3\3\2\2\2\u00e0\u00e1"+ - "\7\"\2\2\u00e1\u00e3\7#\2\2\u00e2\u00dc\3\2\2\2\u00e2\u00e0\3\2\2\2\u00e3"+ - "#\3\2\2\2\u00e4\u00e5\b\23\1\2\u00e5\u00e6\5&\24\2\u00e6\u00ef\3\2\2\2"+ - "\u00e7\u00e8\f\4\2\2\u00e8\u00e9\7\37\2\2\u00e9\u00ee\5&\24\2\u00ea\u00eb"+ - "\f\3\2\2\u00eb\u00ec\7\36\2\2\u00ec\u00ee\5&\24\2\u00ed\u00e7\3\2\2\2"+ - "\u00ed\u00ea\3\2\2\2\u00ee\u00f1\3\2\2\2\u00ef\u00ed\3\2\2\2\u00ef\u00f0"+ - "\3\2\2\2\u00f0%\3\2\2\2\u00f1\u00ef\3\2\2\2\u00f2\u00f3\b\24\1\2\u00f3"+ - "\u00f4\5*\26\2\u00f4\u00fd\3\2\2\2\u00f5\u00f6\f\4\2\2\u00f6\u00f7\7!"+ - "\2\2\u00f7\u00fc\5&\24\5\u00f8\u00f9\f\3\2\2\u00f9\u00fa\7 \2\2\u00fa"+ - "\u00fc\5&\24\4\u00fb\u00f5\3\2\2\2\u00fb\u00f8\3\2\2\2\u00fc\u00ff\3\2"+ - "\2\2\u00fd\u00fb\3\2\2\2\u00fd\u00fe\3\2\2\2\u00fe\'\3\2\2\2\u00ff\u00fd"+ - "\3\2\2\2\u0100\u0101\7/\2\2\u0101\u0102\5\32\16\2\u0102)\3\2\2\2\u0103"+ - "\u0113\5(\25\2\u0104\u0113\7,\2\2\u0105\u0113\7+\2\2\u0106\u0113\7.\2"+ - "\2\u0107\u0113\7-\2\2\u0108\u0113\7/\2\2\u0109\u0113\7\32\2\2\u010a\u010b"+ - "\7&\2\2\u010b\u010c\5$\23\2\u010c\u010d\7\'\2\2\u010d\u0113\3\2\2\2\u010e"+ - "\u010f\7&\2\2\u010f\u0110\5\f\7\2\u0110\u0111\7\'\2\2\u0111\u0113\3\2"+ - "\2\2\u0112\u0103\3\2\2\2\u0112\u0104\3\2\2\2\u0112\u0105\3\2\2\2\u0112"+ - "\u0106\3\2\2\2\u0112\u0107\3\2\2\2\u0112\u0108\3\2\2\2\u0112\u0109\3\2"+ - "\2\2\u0112\u010a\3\2\2\2\u0112\u010e\3\2\2\2\u0113+\3\2\2\2\u0114\u0126"+ - "\t\3\2\2\u0115\u0126\5\62\32\2\u0116\u0126\5\60\31\2\u0117\u0126\5$\23"+ - "\2\u0118\u0126\7\60\2\2\u0119\u0126\5\36\20\2\u011a\u0126\5\"\22\2\u011b"+ - "\u0126\7\31\2\2\u011c\u011d\7)\2\2\u011d\u011e\7&\2\2\u011e\u011f\7/\2"+ - "\2\u011f\u0126\7\'\2\2\u0120\u0121\7&\2\2\u0121\u0122\5\f\7\2\u0122\u0123"+ - "\7\'\2\2\u0123\u0126\3\2\2\2\u0124\u0126\5(\25\2\u0125\u0114\3\2\2\2\u0125"+ - "\u0115\3\2\2\2\u0125\u0116\3\2\2\2\u0125\u0117\3\2\2\2\u0125\u0118\3\2"+ - "\2\2\u0125\u0119\3\2\2\2\u0125\u011a\3\2\2\2\u0125\u011b\3\2\2\2\u0125"+ - "\u011c\3\2\2\2\u0125\u0120\3\2\2\2\u0125\u0124\3\2\2\2\u0126-\3\2\2\2"+ - "\u0127\u0128\7\34\2\2\u0128/\3\2\2\2\u0129\u012a\7&\2\2\u012a\u012b\7"+ - "\'\2\2\u012b\u012c\7\4\2\2\u012c\u012d\5\4\3\2\u012d\61\3\2\2\2\u012e"+ - "\u012f\7&\2\2\u012f\u0130\5\64\33\2\u0130\u0131\7\'\2\2\u0131\u0132\7"+ - "\4\2\2\u0132\u0133\5\4\3\2\u0133\u0139\3\2\2\2\u0134\u0135\5\66\34\2\u0135"+ - "\u0136\7\4\2\2\u0136\u0137\5\4\3\2\u0137\u0139\3\2\2\2\u0138\u012e\3\2"+ - "\2\2\u0138\u0134\3\2\2\2\u0139\63\3\2\2\2\u013a\u013f\58\35\2\u013b\u013c"+ - "\7\7\2\2\u013c\u013e\58\35\2\u013d\u013b\3\2\2\2\u013e\u0141\3\2\2\2\u013f"+ - "\u013d\3\2\2\2\u013f\u0140\3\2\2\2\u0140\65\3\2\2\2\u0141\u013f\3\2\2"+ - "\2\u0142\u0143\58\35\2\u0143\67\3\2\2\2\u0144\u0145\7/\2\2\u01459\3\2"+ - "\2\2\u0146\u0147\7\33\2\2\u0147\u0148\7\"\2\2\u0148\u0149\5<\37\2\u0149"+ - "\u014a\7\7\2\2\u014a\u014b\7\34\2\2\u014b\u014c\7\35\2\2\u014c\u014d\5"+ - "@!\2\u014d\u014e\7#\2\2\u014e;\3\2\2\2\u014f\u0154\5> \2\u0150\u0151\7"+ - "\7\2\2\u0151\u0153\5> \2\u0152\u0150\3\2\2\2\u0153\u0156\3\2\2\2\u0154"+ - "\u0152\3\2\2\2\u0154\u0155\3\2\2\2\u0155=\3\2\2\2\u0156\u0154\3\2\2\2"+ - "\u0157\u0158\5B\"\2\u0158\u0159\7\35\2\2\u0159\u015a\5@!\2\u015a?\3\2"+ - "\2\2\u015b\u015c\5\4\3\2\u015cA\3\2\2\2\u015d\u0160\5\16\b\2\u015e\u0160"+ - "\5\f\7\2\u015f\u015d\3\2\2\2\u015f\u015e\3\2\2\2\u0160C\3\2\2\2\34Rgr"+ - "v\u0080\u008d\u0095\u00a2\u00a8\u00b3\u00b5\u00be\u00c9\u00d7\u00d9\u00e2"+ - "\u00ed\u00ef\u00fb\u00fd\u0112\u0125\u0138\u013f\u0154\u015f"; + "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\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\3\3\3\3\5\3\\\n\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\5\4m\n\4\3\5\3\5\3\5\3\5\5\5s\n\5\3\6\3\6"+ + "\3\6\3\6\5\6y\n\6\3\7\3\7\3\b\3\b\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n"+ + "\3\n\3\n\3\n\3\n\3\n\3\n\5\n\u008e\n\n\3\13\3\13\3\13\3\13\3\13\3\13\3"+ + "\13\3\13\3\13\5\13\u0099\n\13\3\f\3\f\5\f\u009d\n\f\3\r\3\r\3\r\3\r\3"+ + "\r\3\r\3\r\3\r\5\r\u00a7\n\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3"+ + "\16\3\16\3\16\5\16\u00b4\n\16\3\16\3\16\3\16\3\16\7\16\u00ba\n\16\f\16"+ + "\16\16\u00bd\13\16\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\5"+ + "\21\u00c9\n\21\3\22\3\22\3\22\3\22\5\22\u00cf\n\22\3\22\3\22\3\22\3\22"+ + "\3\22\3\22\3\22\3\22\3\22\7\22\u00da\n\22\f\22\16\22\u00dd\13\22\3\23"+ + "\3\23\3\23\3\23\3\23\3\23\5\23\u00e5\n\23\3\24\3\24\3\24\3\24\3\24\3\24"+ + "\3\24\3\24\3\24\5\24\u00f0\n\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24"+ + "\3\24\3\24\3\24\3\24\7\24\u00fe\n\24\f\24\16\24\u0101\13\24\3\25\3\25"+ + "\3\25\3\25\3\25\3\25\5\25\u0109\n\25\3\26\3\26\3\26\3\26\3\26\3\26\3\26"+ + "\3\26\3\26\7\26\u0114\n\26\f\26\16\26\u0117\13\26\3\27\3\27\3\27\3\27"+ + "\3\27\3\27\3\27\3\27\3\27\7\27\u0122\n\27\f\27\16\27\u0125\13\27\3\30"+ + "\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31"+ + "\3\31\3\31\3\31\5\31\u0139\n\31\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32"+ + "\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\5\32\u014c\n\32\3\33\3\33"+ + "\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35"+ + "\3\35\5\35\u015f\n\35\3\36\3\36\3\36\7\36\u0164\n\36\f\36\16\36\u0167"+ + "\13\36\3\37\3\37\3 \3 \3!\3!\3!\3!\3!\3!\3!\3!\3!\3\"\3\"\3\"\7\"\u0179"+ + "\n\"\f\"\16\"\u017c\13\"\3#\3#\3#\3#\3$\3$\3%\3%\5%\u0186\n%\3%\2\7\32"+ + "\"&*,&\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<"+ + ">@BDFH\2\4\3\2\23\30\3\2\f\r\u01a0\2J\3\2\2\2\4[\3\2\2\2\6l\3\2\2\2\b"+ + "r\3\2\2\2\nx\3\2\2\2\fz\3\2\2\2\16|\3\2\2\2\20~\3\2\2\2\22\u008d\3\2\2"+ + "\2\24\u0098\3\2\2\2\26\u009c\3\2\2\2\30\u00a6\3\2\2\2\32\u00b3\3\2\2\2"+ + "\34\u00be\3\2\2\2\36\u00c0\3\2\2\2 \u00c8\3\2\2\2\"\u00ce\3\2\2\2$\u00e4"+ + "\3\2\2\2&\u00ef\3\2\2\2(\u0108\3\2\2\2*\u010a\3\2\2\2,\u0118\3\2\2\2."+ + "\u0126\3\2\2\2\60\u0138\3\2\2\2\62\u014b\3\2\2\2\64\u014d\3\2\2\2\66\u014f"+ + "\3\2\2\28\u015e\3\2\2\2:\u0160\3\2\2\2<\u0168\3\2\2\2>\u016a\3\2\2\2@"+ + "\u016c\3\2\2\2B\u0175\3\2\2\2D\u017d\3\2\2\2F\u0181\3\2\2\2H\u0185\3\2"+ + "\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2M\\\5\22\n\2NO\7-\2\2OP\5\4\3\2PQ\7"+ + ".\2\2Q\\\3\2\2\2R\\\5*\26\2S\\\5\34\17\2T\\\5\32\16\2U\\\5\24\13\2V\\"+ + "\5\30\r\2W\\\5@!\2X\\\5\6\4\2Y\\\5\b\5\2Z\\\5\n\6\2[M\3\2\2\2[N\3\2\2"+ + "\2[R\3\2\2\2[S\3\2\2\2[T\3\2\2\2[U\3\2\2\2[V\3\2\2\2[W\3\2\2\2[X\3\2\2"+ + "\2[Y\3\2\2\2[Z\3\2\2\2\\\5\3\2\2\2]^\7\66\2\2^_\7\16\2\2_m\5\4\3\2`a\7"+ + "\66\2\2ab\7\17\2\2bm\5\4\3\2cd\7\66\2\2de\7\20\2\2em\5\4\3\2fg\7\66\2"+ + "\2gh\7\21\2\2hm\5\4\3\2ij\7\66\2\2jk\7\22\2\2km\5\4\3\2l]\3\2\2\2l`\3"+ + "\2\2\2lc\3\2\2\2lf\3\2\2\2li\3\2\2\2m\7\3\2\2\2no\7&\2\2os\7\66\2\2pq"+ + "\7$\2\2qs\7\66\2\2rn\3\2\2\2rp\3\2\2\2s\t\3\2\2\2tu\7\66\2\2uy\7&\2\2"+ + "vw\7\66\2\2wy\7$\2\2xt\3\2\2\2xv\3\2\2\2y\13\3\2\2\2z{\5\24\13\2{\r\3"+ + "\2\2\2|}\5\4\3\2}\17\3\2\2\2~\177\5\4\3\2\177\21\3\2\2\2\u0080\u0081\5"+ + "\f\7\2\u0081\u0082\7\31\2\2\u0082\u0083\5\16\b\2\u0083\u0084\7\32\2\2"+ + "\u0084\u0085\5\20\t\2\u0085\u008e\3\2\2\2\u0086\u0087\7\33\2\2\u0087\u0088"+ + "\5\f\7\2\u0088\u0089\7\34\2\2\u0089\u008a\5\16\b\2\u008a\u008b\7\35\2"+ + "\2\u008b\u008c\5\20\t\2\u008c\u008e\3\2\2\2\u008d\u0080\3\2\2\2\u008d"+ + "\u0086\3\2\2\2\u008e\23\3\2\2\2\u008f\u0090\5\26\f\2\u0090\u0091\7\t\2"+ + "\2\u0091\u0092\5\24\13\2\u0092\u0099\3\2\2\2\u0093\u0094\5\26\f\2\u0094"+ + "\u0095\7\n\2\2\u0095\u0096\5\24\13\2\u0096\u0099\3\2\2\2\u0097\u0099\5"+ + "\26\f\2\u0098\u008f\3\2\2\2\u0098\u0093\3\2\2\2\u0098\u0097\3\2\2\2\u0099"+ + "\25\3\2\2\2\u009a\u009d\5\32\16\2\u009b\u009d\5\30\r\2\u009c\u009a\3\2"+ + "\2\2\u009c\u009b\3\2\2\2\u009d\27\3\2\2\2\u009e\u009f\5\62\32\2\u009f"+ + "\u00a0\7\3\2\2\u00a0\u00a1\5\26\f\2\u00a1\u00a7\3\2\2\2\u00a2\u00a3\5"+ + "\62\32\2\u00a3\u00a4\7/\2\2\u00a4\u00a5\5\26\f\2\u00a5\u00a7\3\2\2\2\u00a6"+ + "\u009e\3\2\2\2\u00a6\u00a2\3\2\2\2\u00a7\31\3\2\2\2\u00a8\u00a9\b\16\1"+ + "\2\u00a9\u00aa\7\13\2\2\u00aa\u00ab\7-\2\2\u00ab\u00ac\5\24\13\2\u00ac"+ + "\u00ad\7.\2\2\u00ad\u00b4\3\2\2\2\u00ae\u00af\7-\2\2\u00af\u00b0\5\24"+ + "\13\2\u00b0\u00b1\7.\2\2\u00b1\u00b4\3\2\2\2\u00b2\u00b4\5\62\32\2\u00b3"+ + "\u00a8\3\2\2\2\u00b3\u00ae\3\2\2\2\u00b3\u00b2\3\2\2\2\u00b4\u00bb\3\2"+ + "\2\2\u00b5\u00b6\f\6\2\2\u00b6\u00b7\5\36\20\2\u00b7\u00b8\5\32\16\7\u00b8"+ + "\u00ba\3\2\2\2\u00b9\u00b5\3\2\2\2\u00ba\u00bd\3\2\2\2\u00bb\u00b9\3\2"+ + "\2\2\u00bb\u00bc\3\2\2\2\u00bc\33\3\2\2\2\u00bd\u00bb\3\2\2\2\u00be\u00bf"+ + "\5\62\32\2\u00bf\35\3\2\2\2\u00c0\u00c1\t\2\2\2\u00c1\37\3\2\2\2\u00c2"+ + "\u00c3\7-\2\2\u00c3\u00c4\5\"\22\2\u00c4\u00c5\7.\2\2\u00c5\u00c9\3\2"+ + "\2\2\u00c6\u00c7\7-\2\2\u00c7\u00c9\7.\2\2\u00c8\u00c2\3\2\2\2\u00c8\u00c6"+ + "\3\2\2\2\u00c9!\3\2\2\2\u00ca\u00cb\b\22\1\2\u00cb\u00cf\5\62\32\2\u00cc"+ + "\u00cf\5\22\n\2\u00cd\u00cf\5\32\16\2\u00ce\u00ca\3\2\2\2\u00ce\u00cc"+ + "\3\2\2\2\u00ce\u00cd\3\2\2\2\u00cf\u00db\3\2\2\2\u00d0\u00d1\f\7\2\2\u00d1"+ + "\u00d2\7\7\2\2\u00d2\u00da\5\62\32\2\u00d3\u00d4\f\5\2\2\u00d4\u00d5\7"+ + "\7\2\2\u00d5\u00da\5\22\n\2\u00d6\u00d7\f\3\2\2\u00d7\u00d8\7\7\2\2\u00d8"+ + "\u00da\5\32\16\2\u00d9\u00d0\3\2\2\2\u00d9\u00d3\3\2\2\2\u00d9\u00d6\3"+ + "\2\2\2\u00da\u00dd\3\2\2\2\u00db\u00d9\3\2\2\2\u00db\u00dc\3\2\2\2\u00dc"+ + "#\3\2\2\2\u00dd\u00db\3\2\2\2\u00de\u00df\7+\2\2\u00df\u00e5\7,\2\2\u00e0"+ + "\u00e1\7+\2\2\u00e1\u00e2\5\"\22\2\u00e2\u00e3\7,\2\2\u00e3\u00e5\3\2"+ + "\2\2\u00e4\u00de\3\2\2\2\u00e4\u00e0\3\2\2\2\u00e5%\3\2\2\2\u00e6\u00e7"+ + "\b\24\1\2\u00e7\u00e8\5\62\32\2\u00e8\u00e9\7\32\2\2\u00e9\u00ea\5\4\3"+ + "\2\u00ea\u00f0\3\2\2\2\u00eb\u00ec\5\32\16\2\u00ec\u00ed\7\32\2\2\u00ed"+ + "\u00ee\5\4\3\2\u00ee\u00f0\3\2\2\2\u00ef\u00e6\3\2\2\2\u00ef\u00eb\3\2"+ + "\2\2\u00f0\u00ff\3\2\2\2\u00f1\u00f2\f\4\2\2\u00f2\u00f3\7\7\2\2\u00f3"+ + "\u00f4\5\62\32\2\u00f4\u00f5\7\32\2\2\u00f5\u00f6\5\4\3\2\u00f6\u00fe"+ + "\3\2\2\2\u00f7\u00f8\f\3\2\2\u00f8\u00f9\7\7\2\2\u00f9\u00fa\5\32\16\2"+ + "\u00fa\u00fb\7\32\2\2\u00fb\u00fc\5\4\3\2\u00fc\u00fe\3\2\2\2\u00fd\u00f1"+ + "\3\2\2\2\u00fd\u00f7\3\2\2\2\u00fe\u0101\3\2\2\2\u00ff\u00fd\3\2\2\2\u00ff"+ + "\u0100\3\2\2\2\u0100\'\3\2\2\2\u0101\u00ff\3\2\2\2\u0102\u0103\7)\2\2"+ + "\u0103\u0104\5&\24\2\u0104\u0105\7*\2\2\u0105\u0109\3\2\2\2\u0106\u0107"+ + "\7)\2\2\u0107\u0109\7*\2\2\u0108\u0102\3\2\2\2\u0108\u0106\3\2\2\2\u0109"+ + ")\3\2\2\2\u010a\u010b\b\26\1\2\u010b\u010c\5,\27\2\u010c\u0115\3\2\2\2"+ + "\u010d\u010e\f\4\2\2\u010e\u010f\7%\2\2\u010f\u0114\5,\27\2\u0110\u0111"+ + "\f\3\2\2\u0111\u0112\7#\2\2\u0112\u0114\5,\27\2\u0113\u010d\3\2\2\2\u0113"+ + "\u0110\3\2\2\2\u0114\u0117\3\2\2\2\u0115\u0113\3\2\2\2\u0115\u0116\3\2"+ + "\2\2\u0116+\3\2\2\2\u0117\u0115\3\2\2\2\u0118\u0119\b\27\1\2\u0119\u011a"+ + "\5\60\31\2\u011a\u0123\3\2\2\2\u011b\u011c\f\4\2\2\u011c\u011d\7(\2\2"+ + "\u011d\u0122\5,\27\5\u011e\u011f\f\3\2\2\u011f\u0120\7\'\2\2\u0120\u0122"+ + "\5,\27\4\u0121\u011b\3\2\2\2\u0121\u011e\3\2\2\2\u0122\u0125\3\2\2\2\u0123"+ + "\u0121\3\2\2\2\u0123\u0124\3\2\2\2\u0124-\3\2\2\2\u0125\u0123\3\2\2\2"+ + "\u0126\u0127\7\66\2\2\u0127\u0128\5 \21\2\u0128/\3\2\2\2\u0129\u0139\5"+ + ".\30\2\u012a\u0139\7\63\2\2\u012b\u0139\7\62\2\2\u012c\u0139\7\65\2\2"+ + "\u012d\u0139\7\64\2\2\u012e\u0139\7\66\2\2\u012f\u0139\7\37\2\2\u0130"+ + "\u0131\7-\2\2\u0131\u0132\5*\26\2\u0132\u0133\7.\2\2\u0133\u0139\3\2\2"+ + "\2\u0134\u0135\7-\2\2\u0135\u0136\5\22\n\2\u0136\u0137\7.\2\2\u0137\u0139"+ + "\3\2\2\2\u0138\u0129\3\2\2\2\u0138\u012a\3\2\2\2\u0138\u012b\3\2\2\2\u0138"+ + "\u012c\3\2\2\2\u0138\u012d\3\2\2\2\u0138\u012e\3\2\2\2\u0138\u012f\3\2"+ + "\2\2\u0138\u0130\3\2\2\2\u0138\u0134\3\2\2\2\u0139\61\3\2\2\2\u013a\u014c"+ + "\t\3\2\2\u013b\u014c\58\35\2\u013c\u014c\5\66\34\2\u013d\u014c\5*\26\2"+ + "\u013e\u014c\7\67\2\2\u013f\u014c\5$\23\2\u0140\u014c\5(\25\2\u0141\u014c"+ + "\7\36\2\2\u0142\u0143\7\60\2\2\u0143\u0144\7-\2\2\u0144\u0145\7\66\2\2"+ + "\u0145\u014c\7.\2\2\u0146\u0147\7-\2\2\u0147\u0148\5\22\n\2\u0148\u0149"+ + "\7.\2\2\u0149\u014c\3\2\2\2\u014a\u014c\5.\30\2\u014b\u013a\3\2\2\2\u014b"+ + "\u013b\3\2\2\2\u014b\u013c\3\2\2\2\u014b\u013d\3\2\2\2\u014b\u013e\3\2"+ + "\2\2\u014b\u013f\3\2\2\2\u014b\u0140\3\2\2\2\u014b\u0141\3\2\2\2\u014b"+ + "\u0142\3\2\2\2\u014b\u0146\3\2\2\2\u014b\u014a\3\2\2\2\u014c\63\3\2\2"+ + "\2\u014d\u014e\7!\2\2\u014e\65\3\2\2\2\u014f\u0150\7-\2\2\u0150\u0151"+ + "\7.\2\2\u0151\u0152\7\4\2\2\u0152\u0153\5\4\3\2\u0153\67\3\2\2\2\u0154"+ + "\u0155\7-\2\2\u0155\u0156\5:\36\2\u0156\u0157\7.\2\2\u0157\u0158\7\4\2"+ + "\2\u0158\u0159\5\4\3\2\u0159\u015f\3\2\2\2\u015a\u015b\5<\37\2\u015b\u015c"+ + "\7\4\2\2\u015c\u015d\5\4\3\2\u015d\u015f\3\2\2\2\u015e\u0154\3\2\2\2\u015e"+ + "\u015a\3\2\2\2\u015f9\3\2\2\2\u0160\u0165\5> \2\u0161\u0162\7\7\2\2\u0162"+ + "\u0164\5> \2\u0163\u0161\3\2\2\2\u0164\u0167\3\2\2\2\u0165\u0163\3\2\2"+ + "\2\u0165\u0166\3\2\2\2\u0166;\3\2\2\2\u0167\u0165\3\2\2\2\u0168\u0169"+ + "\5> \2\u0169=\3\2\2\2\u016a\u016b\7\66\2\2\u016b?\3\2\2\2\u016c\u016d"+ + "\7 \2\2\u016d\u016e\7)\2\2\u016e\u016f\5B\"\2\u016f\u0170\7\7\2\2\u0170"+ + "\u0171\7!\2\2\u0171\u0172\7\"\2\2\u0172\u0173\5F$\2\u0173\u0174\7*\2\2"+ + "\u0174A\3\2\2\2\u0175\u017a\5D#\2\u0176\u0177\7\7\2\2\u0177\u0179\5D#"+ + "\2\u0178\u0176\3\2\2\2\u0179\u017c\3\2\2\2\u017a\u0178\3\2\2\2\u017a\u017b"+ + "\3\2\2\2\u017bC\3\2\2\2\u017c\u017a\3\2\2\2\u017d\u017e\5H%\2\u017e\u017f"+ + "\7\"\2\2\u017f\u0180\5F$\2\u0180E\3\2\2\2\u0181\u0182\5\4\3\2\u0182G\3"+ + "\2\2\2\u0183\u0186\5\24\13\2\u0184\u0186\5\22\n\2\u0185\u0183\3\2\2\2"+ + "\u0185\u0184\3\2\2\2\u0186I\3\2\2\2\37[lrx\u008d\u0098\u009c\u00a6\u00b3"+ + "\u00bb\u00c8\u00ce\u00d9\u00db\u00e4\u00ef\u00fd\u00ff\u0108\u0113\u0115"+ + "\u0121\u0123\u0138\u014b\u015e\u0165\u017a\u0185"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/StellarProcessorUtils.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/StellarProcessorUtils.java index cc2f6ba315..bc704a1ae0 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/StellarProcessorUtils.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/utils/StellarProcessorUtils.java @@ -89,7 +89,7 @@ private static Object execute(String expression, Map variables, StellarProcessor processor = new StellarProcessor(); Object result = processor.parse( expression, - new DefaultVariableResolver(x -> variables.get(x), x -> variables.containsKey(x)),(x,y)-> variables.put(x,y), + new DefaultVariableResolver(x -> variables.get(x), x -> variables.containsKey(x),(x,y)-> variables.put(x,y)), StellarFunctions.FUNCTION_RESOLVER(), context); From dd51ec8aca975f7ac2dce34a62b08d2a5c1a752f Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Wed, 24 Oct 2018 11:39:07 -0400 Subject: [PATCH 10/11] add support for := assignment --- metron-stellar/stellar-common/README.md | 5 +- .../stellar/common/generated/Stellar.g4 | 2 + .../src/main/java/Stellar.tokens | 140 ++-- .../src/main/java/StellarLexer.tokens | 140 ++-- .../stellar/common/StellarCompiler.java | 13 +- .../common/generated/StellarBaseListener.java | 12 + .../common/generated/StellarLexer.java | 436 +++++----- .../common/generated/StellarListener.java | 12 + .../common/generated/StellarParser.java | 761 +++++++++--------- .../dsl/functions/BasicStellarTest.java | 71 ++ 10 files changed, 867 insertions(+), 725 deletions(-) diff --git a/metron-stellar/stellar-common/README.md b/metron-stellar/stellar-common/README.md index 9e6ea0855b..7649ffd899 100644 --- a/metron-stellar/stellar-common/README.md +++ b/metron-stellar/stellar-common/README.md @@ -43,7 +43,8 @@ The Stellar language supports the following: * The literal `'\'foo\''` would represent `'foo'` * The literal `"\"foo\""` would represent `"foo"` * The literal `'foo \\ bar'` would represent `foo \ bar` -* Assignment operations for variables: `=`, `+=`, `-=`, `*=`, `/=` +* Assignment operations for variables: `=` or `:=`, `+=`, `-=`, `*=`, `/=` + * Note that `=` and `:=` can be used for assignment * Pre and Post increment and decrement operations for variables: `++`, `--` * Simple boolean operations: `and`, `not`, `or` * Simple arithmetic operations: `*`, `/`, `+`, `-` on real numbers or integers @@ -86,7 +87,7 @@ The following keywords need to be single quote escaped in order to be used in St | default | == | != | \<= | \> | | \>= | \+ | \- | \< | ? | | \* | / | , | \{ | \} | -| \=> | | | | | +| \=> | := | | | | Using parens such as: "foo" : "\" requires escaping; "foo": "\'\\'" diff --git a/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 b/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 index 669f7256db..6419fc7dca 100644 --- a/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 +++ b/metron-stellar/stellar-common/src/main/antlr4/org/apache/metron/stellar/common/generated/Stellar.g4 @@ -54,6 +54,7 @@ TRUE : 'true' | 'TRUE'; FALSE : 'false' | 'FALSE'; ASSIGN : '=' ; +COLON_ASSIGN : ':='; PLUSASSIGN : '+=' ; MINUSASSIGN : '-=' ; DIVIDEASSIGN : '/='; @@ -157,6 +158,7 @@ transformation_expr: assign_expr : IDENTIFIER ASSIGN transformation_expr #AssignExpression + |IDENTIFIER COLON_ASSIGN transformation_expr #ColonAssignExpression |IDENTIFIER PLUSASSIGN transformation_expr #PlusAssignExpression |IDENTIFIER MINUSASSIGN transformation_expr #MinusAssignExpression |IDENTIFIER DIVIDEASSIGN transformation_expr #DivideAssignExpression diff --git a/metron-stellar/stellar-common/src/main/java/Stellar.tokens b/metron-stellar/stellar-common/src/main/java/Stellar.tokens index 7fa7c0d78b..3e1c4852b9 100644 --- a/metron-stellar/stellar-common/src/main/java/Stellar.tokens +++ b/metron-stellar/stellar-common/src/main/java/Stellar.tokens @@ -10,78 +10,80 @@ NOT=9 TRUE=10 FALSE=11 ASSIGN=12 -PLUSASSIGN=13 -MINUSASSIGN=14 -DIVIDEASSIGN=15 -MULTASSIGN=16 -EQ=17 -NEQ=18 -LT=19 -LTE=20 -GT=21 -GTE=22 -QUESTION=23 -COLON=24 -IF=25 -THEN=26 -ELSE=27 -NULL=28 -NAN=29 -MATCH=30 -DEFAULT=31 -MATCH_ACTION=32 -MINUS=33 -MINUSMINUS=34 -PLUS=35 -PLUSPLUS=36 -DIV=37 -MUL=38 -LBRACE=39 -RBRACE=40 -LBRACKET=41 -RBRACKET=42 -LPAREN=43 -RPAREN=44 -NIN=45 -EXISTS=46 -EXPONENT=47 -INT_LITERAL=48 -DOUBLE_LITERAL=49 -FLOAT_LITERAL=50 -LONG_LITERAL=51 -IDENTIFIER=52 -STRING_LITERAL=53 -COMMENT=54 -WS=55 +COLON_ASSIGN=13 +PLUSASSIGN=14 +MINUSASSIGN=15 +DIVIDEASSIGN=16 +MULTASSIGN=17 +EQ=18 +NEQ=19 +LT=20 +LTE=21 +GT=22 +GTE=23 +QUESTION=24 +COLON=25 +IF=26 +THEN=27 +ELSE=28 +NULL=29 +NAN=30 +MATCH=31 +DEFAULT=32 +MATCH_ACTION=33 +MINUS=34 +MINUSMINUS=35 +PLUS=36 +PLUSPLUS=37 +DIV=38 +MUL=39 +LBRACE=40 +RBRACE=41 +LBRACKET=42 +RBRACKET=43 +LPAREN=44 +RPAREN=45 +NIN=46 +EXISTS=47 +EXPONENT=48 +INT_LITERAL=49 +DOUBLE_LITERAL=50 +FLOAT_LITERAL=51 +LONG_LITERAL=52 +IDENTIFIER=53 +STRING_LITERAL=54 +COMMENT=55 +WS=56 '->'=2 '"'=3 '\''=4 ','=5 '.'=6 '='=12 -'+='=13 -'-='=14 -'/='=15 -'*='=16 -'=='=17 -'!='=18 -'<'=19 -'<='=20 -'>'=21 -'>='=22 -'?'=23 -':'=24 -'NaN'=29 -'=>'=32 -'-'=33 -'--'=34 -'+'=35 -'++'=36 -'/'=37 -'*'=38 -'{'=39 -'}'=40 -'['=41 -']'=42 -'('=43 -')'=44 +':='=13 +'+='=14 +'-='=15 +'/='=16 +'*='=17 +'=='=18 +'!='=19 +'<'=20 +'<='=21 +'>'=22 +'>='=23 +'?'=24 +':'=25 +'NaN'=30 +'=>'=33 +'-'=34 +'--'=35 +'+'=36 +'++'=37 +'/'=38 +'*'=39 +'{'=40 +'}'=41 +'['=42 +']'=43 +'('=44 +')'=45 diff --git a/metron-stellar/stellar-common/src/main/java/StellarLexer.tokens b/metron-stellar/stellar-common/src/main/java/StellarLexer.tokens index 7fa7c0d78b..3e1c4852b9 100644 --- a/metron-stellar/stellar-common/src/main/java/StellarLexer.tokens +++ b/metron-stellar/stellar-common/src/main/java/StellarLexer.tokens @@ -10,78 +10,80 @@ NOT=9 TRUE=10 FALSE=11 ASSIGN=12 -PLUSASSIGN=13 -MINUSASSIGN=14 -DIVIDEASSIGN=15 -MULTASSIGN=16 -EQ=17 -NEQ=18 -LT=19 -LTE=20 -GT=21 -GTE=22 -QUESTION=23 -COLON=24 -IF=25 -THEN=26 -ELSE=27 -NULL=28 -NAN=29 -MATCH=30 -DEFAULT=31 -MATCH_ACTION=32 -MINUS=33 -MINUSMINUS=34 -PLUS=35 -PLUSPLUS=36 -DIV=37 -MUL=38 -LBRACE=39 -RBRACE=40 -LBRACKET=41 -RBRACKET=42 -LPAREN=43 -RPAREN=44 -NIN=45 -EXISTS=46 -EXPONENT=47 -INT_LITERAL=48 -DOUBLE_LITERAL=49 -FLOAT_LITERAL=50 -LONG_LITERAL=51 -IDENTIFIER=52 -STRING_LITERAL=53 -COMMENT=54 -WS=55 +COLON_ASSIGN=13 +PLUSASSIGN=14 +MINUSASSIGN=15 +DIVIDEASSIGN=16 +MULTASSIGN=17 +EQ=18 +NEQ=19 +LT=20 +LTE=21 +GT=22 +GTE=23 +QUESTION=24 +COLON=25 +IF=26 +THEN=27 +ELSE=28 +NULL=29 +NAN=30 +MATCH=31 +DEFAULT=32 +MATCH_ACTION=33 +MINUS=34 +MINUSMINUS=35 +PLUS=36 +PLUSPLUS=37 +DIV=38 +MUL=39 +LBRACE=40 +RBRACE=41 +LBRACKET=42 +RBRACKET=43 +LPAREN=44 +RPAREN=45 +NIN=46 +EXISTS=47 +EXPONENT=48 +INT_LITERAL=49 +DOUBLE_LITERAL=50 +FLOAT_LITERAL=51 +LONG_LITERAL=52 +IDENTIFIER=53 +STRING_LITERAL=54 +COMMENT=55 +WS=56 '->'=2 '"'=3 '\''=4 ','=5 '.'=6 '='=12 -'+='=13 -'-='=14 -'/='=15 -'*='=16 -'=='=17 -'!='=18 -'<'=19 -'<='=20 -'>'=21 -'>='=22 -'?'=23 -':'=24 -'NaN'=29 -'=>'=32 -'-'=33 -'--'=34 -'+'=35 -'++'=36 -'/'=37 -'*'=38 -'{'=39 -'}'=40 -'['=41 -']'=42 -'('=43 -')'=44 +':='=13 +'+='=14 +'-='=15 +'/='=16 +'*='=17 +'=='=18 +'!='=19 +'<'=20 +'<='=21 +'>'=22 +'>='=23 +'?'=24 +':'=25 +'NaN'=30 +'=>'=33 +'-'=34 +'--'=35 +'+'=36 +'++'=37 +'/'=38 +'*'=39 +'{'=40 +'}'=41 +'['=42 +']'=43 +'('=44 +')'=45 diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java index 909c5ea9cb..6c2fa79a32 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java @@ -356,13 +356,22 @@ public void exitNaNArith(StellarParser.NaNArithContext ctx) { @Override public void exitAssignExpression(StellarParser.AssignExpressionContext ctx) { + exitCommonAssign(ctx.getStart().getText()); + } + + @Override + public void exitColonAssignExpression(StellarParser.ColonAssignExpressionContext ctx) { + exitCommonAssign(ctx.getStart().getText()); + } + + private void exitCommonAssign(String varText) { final FrameContext.Context context = getArgContext(); expression.tokenDeque.push(new Token<>((tokenDeque, state) -> { // do not check for the existence of the variable, if the // resolver supports updates and creation, it will create it - String varName = ctx.getStart().getText(); + String varName = varText; Token token = popDeque(tokenDeque); Object value = token.getValue(); state.variableResolver.update(varName, value); @@ -371,7 +380,7 @@ public void exitAssignExpression(StellarParser.AssignExpressionContext ctx) { // do tokenDeque.push(new Token<>(value, Object.class, context)); }, DeferredFunction.class, context)); - expression.variablesUsed.add(ctx.getStart().getText()); + expression.variablesUsed.add(varText); } @SuppressWarnings("unchecked") diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarBaseListener.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarBaseListener.java index b4a8e71025..7019267b19 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarBaseListener.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarBaseListener.java @@ -188,6 +188,18 @@ public class StellarBaseListener implements StellarListener { *

The default implementation does nothing.

*/ @Override public void exitAssignExpression(StellarParser.AssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterColonAssignExpression(StellarParser.ColonAssignExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitColonAssignExpression(StellarParser.ColonAssignExpressionContext ctx) { } /** * {@inheritDoc} * diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarLexer.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarLexer.java index b52846a6c5..24eace415a 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarLexer.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarLexer.java @@ -38,46 +38,47 @@ public class StellarLexer extends Lexer { new PredictionContextCache(); public static final int IN=1, LAMBDA_OP=2, DOUBLE_QUOTE=3, SINGLE_QUOTE=4, COMMA=5, PERIOD=6, - AND=7, OR=8, NOT=9, TRUE=10, FALSE=11, ASSIGN=12, PLUSASSIGN=13, MINUSASSIGN=14, - DIVIDEASSIGN=15, MULTASSIGN=16, EQ=17, NEQ=18, LT=19, LTE=20, GT=21, GTE=22, - QUESTION=23, COLON=24, IF=25, THEN=26, ELSE=27, NULL=28, NAN=29, MATCH=30, - DEFAULT=31, MATCH_ACTION=32, MINUS=33, MINUSMINUS=34, PLUS=35, PLUSPLUS=36, - DIV=37, MUL=38, LBRACE=39, RBRACE=40, LBRACKET=41, RBRACKET=42, LPAREN=43, - RPAREN=44, NIN=45, EXISTS=46, EXPONENT=47, INT_LITERAL=48, DOUBLE_LITERAL=49, - FLOAT_LITERAL=50, LONG_LITERAL=51, IDENTIFIER=52, STRING_LITERAL=53, COMMENT=54, - WS=55; + AND=7, OR=8, NOT=9, TRUE=10, FALSE=11, ASSIGN=12, COLON_ASSIGN=13, PLUSASSIGN=14, + MINUSASSIGN=15, DIVIDEASSIGN=16, MULTASSIGN=17, EQ=18, NEQ=19, LT=20, + LTE=21, GT=22, GTE=23, QUESTION=24, COLON=25, IF=26, THEN=27, ELSE=28, + NULL=29, NAN=30, MATCH=31, DEFAULT=32, MATCH_ACTION=33, MINUS=34, MINUSMINUS=35, + PLUS=36, PLUSPLUS=37, DIV=38, MUL=39, LBRACE=40, RBRACE=41, LBRACKET=42, + RBRACKET=43, LPAREN=44, RPAREN=45, NIN=46, EXISTS=47, EXPONENT=48, INT_LITERAL=49, + DOUBLE_LITERAL=50, FLOAT_LITERAL=51, LONG_LITERAL=52, IDENTIFIER=53, STRING_LITERAL=54, + COMMENT=55, WS=56; public static String[] modeNames = { "DEFAULT_MODE" }; public static final String[] ruleNames = { "IN", "LAMBDA_OP", "DOUBLE_QUOTE", "SINGLE_QUOTE", "COMMA", "PERIOD", - "AND", "OR", "NOT", "TRUE", "FALSE", "ASSIGN", "PLUSASSIGN", "MINUSASSIGN", - "DIVIDEASSIGN", "MULTASSIGN", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "QUESTION", - "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", "MATCH", "DEFAULT", "MATCH_ACTION", - "MINUS", "MINUSMINUS", "PLUS", "PLUSPLUS", "DIV", "MUL", "LBRACE", "RBRACE", - "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", "NIN", "EXISTS", "EXPONENT", - "INT_LITERAL", "DOUBLE_LITERAL", "FLOAT_LITERAL", "LONG_LITERAL", "IDENTIFIER", - "STRING_LITERAL", "COMMENT", "WS", "ZERO", "FIRST_DIGIT", "DIGIT", "D", - "E", "F", "L", "EOL", "IDENTIFIER_START", "IDENTIFIER_MIDDLE", "IDENTIFIER_END" + "AND", "OR", "NOT", "TRUE", "FALSE", "ASSIGN", "COLON_ASSIGN", "PLUSASSIGN", + "MINUSASSIGN", "DIVIDEASSIGN", "MULTASSIGN", "EQ", "NEQ", "LT", "LTE", + "GT", "GTE", "QUESTION", "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", + "MATCH", "DEFAULT", "MATCH_ACTION", "MINUS", "MINUSMINUS", "PLUS", "PLUSPLUS", + "DIV", "MUL", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", + "NIN", "EXISTS", "EXPONENT", "INT_LITERAL", "DOUBLE_LITERAL", "FLOAT_LITERAL", + "LONG_LITERAL", "IDENTIFIER", "STRING_LITERAL", "COMMENT", "WS", "ZERO", + "FIRST_DIGIT", "DIGIT", "D", "E", "F", "L", "EOL", "IDENTIFIER_START", + "IDENTIFIER_MIDDLE", "IDENTIFIER_END" }; private static final String[] _LITERAL_NAMES = { null, null, "'->'", "'\"'", "'''", "','", "'.'", null, null, null, null, - null, "'='", "'+='", "'-='", "'/='", "'*='", "'=='", "'!='", "'<'", "'<='", - "'>'", "'>='", "'?'", "':'", null, null, null, null, "'NaN'", null, null, - "'=>'", "'-'", "'--'", "'+'", "'++'", "'/'", "'*'", "'{'", "'}'", "'['", - "']'", "'('", "')'" + null, "'='", "':='", "'+='", "'-='", "'/='", "'*='", "'=='", "'!='", "'<'", + "'<='", "'>'", "'>='", "'?'", "':'", null, null, null, null, "'NaN'", + null, null, "'=>'", "'-'", "'--'", "'+'", "'++'", "'/'", "'*'", "'{'", + "'}'", "'['", "']'", "'('", "')'" }; private static final String[] _SYMBOLIC_NAMES = { null, "IN", "LAMBDA_OP", "DOUBLE_QUOTE", "SINGLE_QUOTE", "COMMA", "PERIOD", - "AND", "OR", "NOT", "TRUE", "FALSE", "ASSIGN", "PLUSASSIGN", "MINUSASSIGN", - "DIVIDEASSIGN", "MULTASSIGN", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "QUESTION", - "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", "MATCH", "DEFAULT", "MATCH_ACTION", - "MINUS", "MINUSMINUS", "PLUS", "PLUSPLUS", "DIV", "MUL", "LBRACE", "RBRACE", - "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", "NIN", "EXISTS", "EXPONENT", - "INT_LITERAL", "DOUBLE_LITERAL", "FLOAT_LITERAL", "LONG_LITERAL", "IDENTIFIER", - "STRING_LITERAL", "COMMENT", "WS" + "AND", "OR", "NOT", "TRUE", "FALSE", "ASSIGN", "COLON_ASSIGN", "PLUSASSIGN", + "MINUSASSIGN", "DIVIDEASSIGN", "MULTASSIGN", "EQ", "NEQ", "LT", "LTE", + "GT", "GTE", "QUESTION", "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", + "MATCH", "DEFAULT", "MATCH_ACTION", "MINUS", "MINUSMINUS", "PLUS", "PLUSPLUS", + "DIV", "MUL", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", + "NIN", "EXISTS", "EXPONENT", "INT_LITERAL", "DOUBLE_LITERAL", "FLOAT_LITERAL", + "LONG_LITERAL", "IDENTIFIER", "STRING_LITERAL", "COMMENT", "WS" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -134,7 +135,7 @@ public StellarLexer(CharStream input) { public ATN getATN() { return _ATN; } public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\29\u021d\b\1\4\2\t"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2:\u0222\b\1\4\2\t"+ "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ @@ -142,195 +143,196 @@ public StellarLexer(CharStream input) { "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ - "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\3\2\3\2\3\2\3\2\5\2\u008c\n\2\3\3"+ - "\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3"+ - "\b\5\b\u00a1\n\b\3\t\3\t\3\t\3\t\3\t\3\t\5\t\u00a9\n\t\3\n\3\n\3\n\3\n"+ - "\3\n\3\n\5\n\u00b1\n\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\5\13\u00bb"+ - "\n\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f\u00c7\n\f\3\r\3\r\3"+ - "\16\3\16\3\16\3\17\3\17\3\17\3\20\3\20\3\20\3\21\3\21\3\21\3\22\3\22\3"+ - "\22\3\23\3\23\3\23\3\24\3\24\3\25\3\25\3\25\3\26\3\26\3\27\3\27\3\27\3"+ - "\30\3\30\3\31\3\31\3\32\3\32\3\32\3\32\5\32\u00ef\n\32\3\33\3\33\3\33"+ - "\3\33\3\33\3\33\3\33\3\33\5\33\u00f9\n\33\3\34\3\34\3\34\3\34\3\34\3\34"+ - "\3\34\3\34\5\34\u0103\n\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\5\35"+ - "\u010d\n\35\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3\37\3\37"+ - "\3\37\3\37\5\37\u011d\n\37\3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \3 \5"+ - " \u012d\n \3!\3!\3!\3\"\3\"\3#\3#\3#\3$\3$\3%\3%\3%\3&\3&\3\'\3\'\3(\3"+ - "(\3)\3)\3*\3*\3+\3+\3,\3,\3-\3-\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\3.\5"+ - ".\u0158\n.\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\5/\u0166\n/\3\60\3\60\3"+ - "\60\5\60\u016b\n\60\3\60\6\60\u016e\n\60\r\60\16\60\u016f\3\61\5\61\u0173"+ - "\n\61\3\61\3\61\5\61\u0177\n\61\3\61\3\61\7\61\u017b\n\61\f\61\16\61\u017e"+ - "\13\61\5\61\u0180\n\61\3\62\3\62\3\62\7\62\u0185\n\62\f\62\16\62\u0188"+ - "\13\62\3\62\5\62\u018b\n\62\3\62\5\62\u018e\n\62\3\62\3\62\6\62\u0192"+ - "\n\62\r\62\16\62\u0193\3\62\5\62\u0197\n\62\3\62\5\62\u019a\n\62\3\62"+ - "\3\62\3\62\5\62\u019f\n\62\3\62\3\62\5\62\u01a3\n\62\3\62\3\62\5\62\u01a7"+ - "\n\62\3\63\3\63\3\63\7\63\u01ac\n\63\f\63\16\63\u01af\13\63\3\63\5\63"+ - "\u01b2\n\63\3\63\3\63\3\63\5\63\u01b7\n\63\3\63\3\63\6\63\u01bb\n\63\r"+ - "\63\16\63\u01bc\3\63\5\63\u01c0\n\63\3\63\3\63\3\63\3\63\5\63\u01c6\n"+ - "\63\3\63\3\63\5\63\u01ca\n\63\3\64\3\64\3\64\3\65\3\65\3\65\7\65\u01d2"+ - "\n\65\f\65\16\65\u01d5\13\65\3\65\3\65\5\65\u01d9\n\65\3\66\3\66\3\66"+ - "\3\66\7\66\u01df\n\66\f\66\16\66\u01e2\13\66\3\66\3\66\3\66\3\66\3\66"+ - "\3\66\7\66\u01ea\n\66\f\66\16\66\u01ed\13\66\3\66\3\66\5\66\u01f1\n\66"+ - "\3\67\3\67\3\67\3\67\6\67\u01f7\n\67\r\67\16\67\u01f8\3\67\3\67\5\67\u01fd"+ - "\n\67\3\67\3\67\38\68\u0202\n8\r8\168\u0203\38\38\39\39\3:\3:\3;\3;\3"+ - "<\3<\3=\3=\3>\3>\3?\3?\3@\3@\3A\3A\3B\3B\3C\3C\3\u01f8\2D\3\3\5\4\7\5"+ - "\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23"+ - "%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G"+ - "%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\66k\67m8o9q\2s\2u\2w\2"+ - "y\2{\2}\2\177\2\u0081\2\u0083\2\u0085\2\3\2\16\4\2))^^\7\2))^^ppttvv\4"+ - "\2$$^^\7\2$$^^ppttvv\5\2\13\f\16\17\"\"\4\2FFff\4\2GGgg\4\2HHhh\4\2NN"+ - "nn\6\2&&C\\aac|\b\2\60\60\62\2\2\u00dd(\3\2\2\2\u00de\u00df\7>\2\2\u00df\u00e0\7?\2\2\u00e0*\3\2"+ - "\2\2\u00e1\u00e2\7@\2\2\u00e2,\3\2\2\2\u00e3\u00e4\7@\2\2\u00e4\u00e5"+ - "\7?\2\2\u00e5.\3\2\2\2\u00e6\u00e7\7A\2\2\u00e7\60\3\2\2\2\u00e8\u00e9"+ - "\7<\2\2\u00e9\62\3\2\2\2\u00ea\u00eb\7K\2\2\u00eb\u00ef\7H\2\2\u00ec\u00ed"+ - "\7k\2\2\u00ed\u00ef\7h\2\2\u00ee\u00ea\3\2\2\2\u00ee\u00ec\3\2\2\2\u00ef"+ - "\64\3\2\2\2\u00f0\u00f1\7V\2\2\u00f1\u00f2\7J\2\2\u00f2\u00f3\7G\2\2\u00f3"+ - "\u00f9\7P\2\2\u00f4\u00f5\7v\2\2\u00f5\u00f6\7j\2\2\u00f6\u00f7\7g\2\2"+ - "\u00f7\u00f9\7p\2\2\u00f8\u00f0\3\2\2\2\u00f8\u00f4\3\2\2\2\u00f9\66\3"+ - "\2\2\2\u00fa\u00fb\7G\2\2\u00fb\u00fc\7N\2\2\u00fc\u00fd\7U\2\2\u00fd"+ - "\u0103\7G\2\2\u00fe\u00ff\7g\2\2\u00ff\u0100\7n\2\2\u0100\u0101\7u\2\2"+ - "\u0101\u0103\7g\2\2\u0102\u00fa\3\2\2\2\u0102\u00fe\3\2\2\2\u01038\3\2"+ - "\2\2\u0104\u0105\7p\2\2\u0105\u0106\7w\2\2\u0106\u0107\7n\2\2\u0107\u010d"+ - "\7n\2\2\u0108\u0109\7P\2\2\u0109\u010a\7W\2\2\u010a\u010b\7N\2\2\u010b"+ - "\u010d\7N\2\2\u010c\u0104\3\2\2\2\u010c\u0108\3\2\2\2\u010d:\3\2\2\2\u010e"+ - "\u010f\7P\2\2\u010f\u0110\7c\2\2\u0110\u0111\7P\2\2\u0111<\3\2\2\2\u0112"+ - "\u0113\7o\2\2\u0113\u0114\7c\2\2\u0114\u0115\7v\2\2\u0115\u0116\7e\2\2"+ - "\u0116\u011d\7j\2\2\u0117\u0118\7O\2\2\u0118\u0119\7C\2\2\u0119\u011a"+ - "\7V\2\2\u011a\u011b\7E\2\2\u011b\u011d\7J\2\2\u011c\u0112\3\2\2\2\u011c"+ - "\u0117\3\2\2\2\u011d>\3\2\2\2\u011e\u011f\7f\2\2\u011f\u0120\7g\2\2\u0120"+ - "\u0121\7h\2\2\u0121\u0122\7c\2\2\u0122\u0123\7w\2\2\u0123\u0124\7n\2\2"+ - "\u0124\u012d\7v\2\2\u0125\u0126\7F\2\2\u0126\u0127\7G\2\2\u0127\u0128"+ - "\7H\2\2\u0128\u0129\7C\2\2\u0129\u012a\7W\2\2\u012a\u012b\7N\2\2\u012b"+ - "\u012d\7V\2\2\u012c\u011e\3\2\2\2\u012c\u0125\3\2\2\2\u012d@\3\2\2\2\u012e"+ - "\u012f\7?\2\2\u012f\u0130\7@\2\2\u0130B\3\2\2\2\u0131\u0132\7/\2\2\u0132"+ - "D\3\2\2\2\u0133\u0134\7/\2\2\u0134\u0135\7/\2\2\u0135F\3\2\2\2\u0136\u0137"+ - "\7-\2\2\u0137H\3\2\2\2\u0138\u0139\7-\2\2\u0139\u013a\7-\2\2\u013aJ\3"+ - "\2\2\2\u013b\u013c\7\61\2\2\u013cL\3\2\2\2\u013d\u013e\7,\2\2\u013eN\3"+ - "\2\2\2\u013f\u0140\7}\2\2\u0140P\3\2\2\2\u0141\u0142\7\177\2\2\u0142R"+ - "\3\2\2\2\u0143\u0144\7]\2\2\u0144T\3\2\2\2\u0145\u0146\7_\2\2\u0146V\3"+ - "\2\2\2\u0147\u0148\7*\2\2\u0148X\3\2\2\2\u0149\u014a\7+\2\2\u014aZ\3\2"+ - "\2\2\u014b\u014c\7p\2\2\u014c\u014d\7q\2\2\u014d\u014e\7v\2\2\u014e\u014f"+ - "\7\"\2\2\u014f\u0150\7k\2\2\u0150\u0158\7p\2\2\u0151\u0152\7P\2\2\u0152"+ - "\u0153\7Q\2\2\u0153\u0154\7V\2\2\u0154\u0155\7\"\2\2\u0155\u0156\7K\2"+ - "\2\u0156\u0158\7P\2\2\u0157\u014b\3\2\2\2\u0157\u0151\3\2\2\2\u0158\\"+ - "\3\2\2\2\u0159\u015a\7g\2\2\u015a\u015b\7z\2\2\u015b\u015c\7k\2\2\u015c"+ - "\u015d\7u\2\2\u015d\u015e\7v\2\2\u015e\u0166\7u\2\2\u015f\u0160\7G\2\2"+ - "\u0160\u0161\7Z\2\2\u0161\u0162\7K\2\2\u0162\u0163\7U\2\2\u0163\u0164"+ - "\7V\2\2\u0164\u0166\7U\2\2\u0165\u0159\3\2\2\2\u0165\u015f\3\2\2\2\u0166"+ - "^\3\2\2\2\u0167\u016a\5y=\2\u0168\u016b\5G$\2\u0169\u016b\5C\"\2\u016a"+ - "\u0168\3\2\2\2\u016a\u0169\3\2\2\2\u016a\u016b\3\2\2\2\u016b\u016d\3\2"+ - "\2\2\u016c\u016e\5u;\2\u016d\u016c\3\2\2\2\u016e\u016f\3\2\2\2\u016f\u016d"+ - "\3\2\2\2\u016f\u0170\3\2\2\2\u0170`\3\2\2\2\u0171\u0173\5C\"\2\u0172\u0171"+ - "\3\2\2\2\u0172\u0173\3\2\2\2\u0173\u0174\3\2\2\2\u0174\u0180\5q9\2\u0175"+ - "\u0177\5C\"\2\u0176\u0175\3\2\2\2\u0176\u0177\3\2\2\2\u0177\u0178\3\2"+ - "\2\2\u0178\u017c\5s:\2\u0179\u017b\5u;\2\u017a\u0179\3\2\2\2\u017b\u017e"+ - "\3\2\2\2\u017c\u017a\3\2\2\2\u017c\u017d\3\2\2\2\u017d\u0180\3\2\2\2\u017e"+ - "\u017c\3\2\2\2\u017f\u0172\3\2\2\2\u017f\u0176\3\2\2\2\u0180b\3\2\2\2"+ - "\u0181\u0182\5a\61\2\u0182\u0186\5\r\7\2\u0183\u0185\5u;\2\u0184\u0183"+ - "\3\2\2\2\u0185\u0188\3\2\2\2\u0186\u0184\3\2\2\2\u0186\u0187\3\2\2\2\u0187"+ - "\u018a\3\2\2\2\u0188\u0186\3\2\2\2\u0189\u018b\5_\60\2\u018a\u0189\3\2"+ - "\2\2\u018a\u018b\3\2\2\2\u018b\u018d\3\2\2\2\u018c\u018e\5w<\2\u018d\u018c"+ - "\3\2\2\2\u018d\u018e\3\2\2\2\u018e\u01a7\3\2\2\2\u018f\u0191\5\r\7\2\u0190"+ - "\u0192\5u;\2\u0191\u0190\3\2\2\2\u0192\u0193\3\2\2\2\u0193\u0191\3\2\2"+ - "\2\u0193\u0194\3\2\2\2\u0194\u0196\3\2\2\2\u0195\u0197\5_\60\2\u0196\u0195"+ - "\3\2\2\2\u0196\u0197\3\2\2\2\u0197\u0199\3\2\2\2\u0198\u019a\5w<\2\u0199"+ - "\u0198\3\2\2\2\u0199\u019a\3\2\2\2\u019a\u01a7\3\2\2\2\u019b\u019c\5a"+ - "\61\2\u019c\u019e\5_\60\2\u019d\u019f\5w<\2\u019e\u019d\3\2\2\2\u019e"+ - "\u019f\3\2\2\2\u019f\u01a7\3\2\2\2\u01a0\u01a2\5a\61\2\u01a1\u01a3\5_"+ - "\60\2\u01a2\u01a1\3\2\2\2\u01a2\u01a3\3\2\2\2\u01a3\u01a4\3\2\2\2\u01a4"+ - "\u01a5\5w<\2\u01a5\u01a7\3\2\2\2\u01a6\u0181\3\2\2\2\u01a6\u018f\3\2\2"+ - "\2\u01a6\u019b\3\2\2\2\u01a6\u01a0\3\2\2\2\u01a7d\3\2\2\2\u01a8\u01a9"+ - "\5a\61\2\u01a9\u01ad\5\r\7\2\u01aa\u01ac\5u;\2\u01ab\u01aa\3\2\2\2\u01ac"+ - "\u01af\3\2\2\2\u01ad\u01ab\3\2\2\2\u01ad\u01ae\3\2\2\2\u01ae\u01b1\3\2"+ - "\2\2\u01af\u01ad\3\2\2\2\u01b0\u01b2\5_\60\2\u01b1\u01b0\3\2\2\2\u01b1"+ - "\u01b2\3\2\2\2\u01b2\u01b3\3\2\2\2\u01b3\u01b4\5{>\2\u01b4\u01ca\3\2\2"+ - "\2\u01b5\u01b7\5C\"\2\u01b6\u01b5\3\2\2\2\u01b6\u01b7\3\2\2\2\u01b7\u01b8"+ - "\3\2\2\2\u01b8\u01ba\5\r\7\2\u01b9\u01bb\5u;\2\u01ba\u01b9\3\2\2\2\u01bb"+ - "\u01bc\3\2\2\2\u01bc\u01ba\3\2\2\2\u01bc\u01bd\3\2\2\2\u01bd\u01bf\3\2"+ - "\2\2\u01be\u01c0\5_\60\2\u01bf\u01be\3\2\2\2\u01bf\u01c0\3\2\2\2\u01c0"+ - "\u01c1\3\2\2\2\u01c1\u01c2\5{>\2\u01c2\u01ca\3\2\2\2\u01c3\u01c5\5a\61"+ - "\2\u01c4\u01c6\5_\60\2\u01c5\u01c4\3\2\2\2\u01c5\u01c6\3\2\2\2\u01c6\u01c7"+ - "\3\2\2\2\u01c7\u01c8\5{>\2\u01c8\u01ca\3\2\2\2\u01c9\u01a8\3\2\2\2\u01c9"+ - "\u01b6\3\2\2\2\u01c9\u01c3\3\2\2\2\u01caf\3\2\2\2\u01cb\u01cc\5a\61\2"+ - "\u01cc\u01cd\5}?\2\u01cdh\3\2\2\2\u01ce\u01d9\5\u0081A\2\u01cf\u01d3\5"+ - "\u0081A\2\u01d0\u01d2\5\u0083B\2\u01d1\u01d0\3\2\2\2\u01d2\u01d5\3\2\2"+ - "\2\u01d3\u01d1\3\2\2\2\u01d3\u01d4\3\2\2\2\u01d4\u01d6\3\2\2\2\u01d5\u01d3"+ - "\3\2\2\2\u01d6\u01d7\5\u0085C\2\u01d7\u01d9\3\2\2\2\u01d8\u01ce\3\2\2"+ - "\2\u01d8\u01cf\3\2\2\2\u01d9j\3\2\2\2\u01da\u01e0\5\t\5\2\u01db\u01df"+ - "\n\2\2\2\u01dc\u01dd\7^\2\2\u01dd\u01df\t\3\2\2\u01de\u01db\3\2\2\2\u01de"+ - "\u01dc\3\2\2\2\u01df\u01e2\3\2\2\2\u01e0\u01de\3\2\2\2\u01e0\u01e1\3\2"+ - "\2\2\u01e1\u01e3\3\2\2\2\u01e2\u01e0\3\2\2\2\u01e3\u01e4\5\t\5\2\u01e4"+ - "\u01f1\3\2\2\2\u01e5\u01eb\5\7\4\2\u01e6\u01ea\n\4\2\2\u01e7\u01e8\7^"+ - "\2\2\u01e8\u01ea\t\5\2\2\u01e9\u01e6\3\2\2\2\u01e9\u01e7\3\2\2\2\u01ea"+ - "\u01ed\3\2\2\2\u01eb\u01e9\3\2\2\2\u01eb\u01ec\3\2\2\2\u01ec\u01ee\3\2"+ - "\2\2\u01ed\u01eb\3\2\2\2\u01ee\u01ef\5\7\4\2\u01ef\u01f1\3\2\2\2\u01f0"+ - "\u01da\3\2\2\2\u01f0\u01e5\3\2\2\2\u01f1l\3\2\2\2\u01f2\u01f3\7\61\2\2"+ - "\u01f3\u01f4\7\61\2\2\u01f4\u01f6\3\2\2\2\u01f5\u01f7\13\2\2\2\u01f6\u01f5"+ - "\3\2\2\2\u01f7\u01f8\3\2\2\2\u01f8\u01f9\3\2\2\2\u01f8\u01f6\3\2\2\2\u01f9"+ - "\u01fc\3\2\2\2\u01fa\u01fd\5\177@\2\u01fb\u01fd\7\2\2\3\u01fc\u01fa\3"+ - "\2\2\2\u01fc\u01fb\3\2\2\2\u01fd\u01fe\3\2\2\2\u01fe\u01ff\b\67\2\2\u01ff"+ - "n\3\2\2\2\u0200\u0202\t\6\2\2\u0201\u0200\3\2\2\2\u0202\u0203\3\2\2\2"+ - "\u0203\u0201\3\2\2\2\u0203\u0204\3\2\2\2\u0204\u0205\3\2\2\2\u0205\u0206"+ - "\b8\2\2\u0206p\3\2\2\2\u0207\u0208\7\62\2\2\u0208r\3\2\2\2\u0209\u020a"+ - "\4\63;\2\u020at\3\2\2\2\u020b\u020c\4\62;\2\u020cv\3\2\2\2\u020d\u020e"+ - "\t\7\2\2\u020ex\3\2\2\2\u020f\u0210\t\b\2\2\u0210z\3\2\2\2\u0211\u0212"+ - "\t\t\2\2\u0212|\3\2\2\2\u0213\u0214\t\n\2\2\u0214~\3\2\2\2\u0215\u0216"+ - "\7\f\2\2\u0216\u0080\3\2\2\2\u0217\u0218\t\13\2\2\u0218\u0082\3\2\2\2"+ - "\u0219\u021a\t\f\2\2\u021a\u0084\3\2\2\2\u021b\u021c\t\r\2\2\u021c\u0086"+ - "\3\2\2\2\61\2\u008b\u00a0\u00a8\u00b0\u00ba\u00c6\u00ee\u00f8\u0102\u010c"+ - "\u011c\u012c\u0157\u0165\u016a\u016f\u0172\u0176\u017c\u017f\u0186\u018a"+ - "\u018d\u0193\u0196\u0199\u019e\u01a2\u01a6\u01ad\u01b1\u01b6\u01bc\u01bf"+ - "\u01c5\u01c9\u01d3\u01d8\u01de\u01e0\u01e9\u01eb\u01f0\u01f8\u01fc\u0203"+ - "\3\b\2\2"; + "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\3\2\3\2\3\2\3\2\5\2\u008e\n"+ + "\2\3\3\3\3\3\3\3\4\3\4\3\5\3\5\3\6\3\6\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b"+ + "\3\b\3\b\5\b\u00a3\n\b\3\t\3\t\3\t\3\t\3\t\3\t\5\t\u00ab\n\t\3\n\3\n\3"+ + "\n\3\n\3\n\3\n\5\n\u00b3\n\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\5"+ + "\13\u00bd\n\13\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\3\f\5\f\u00c9\n\f\3"+ + "\r\3\r\3\16\3\16\3\16\3\17\3\17\3\17\3\20\3\20\3\20\3\21\3\21\3\21\3\22"+ + "\3\22\3\22\3\23\3\23\3\23\3\24\3\24\3\24\3\25\3\25\3\26\3\26\3\26\3\27"+ + "\3\27\3\30\3\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33\3\33\3\33\5\33\u00f4"+ + "\n\33\3\34\3\34\3\34\3\34\3\34\3\34\3\34\3\34\5\34\u00fe\n\34\3\35\3\35"+ + "\3\35\3\35\3\35\3\35\3\35\3\35\5\35\u0108\n\35\3\36\3\36\3\36\3\36\3\36"+ + "\3\36\3\36\3\36\5\36\u0112\n\36\3\37\3\37\3\37\3\37\3 \3 \3 \3 \3 \3 "+ + "\3 \3 \3 \3 \5 \u0122\n \3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\3!\5!"+ + "\u0132\n!\3\"\3\"\3\"\3#\3#\3$\3$\3$\3%\3%\3&\3&\3&\3\'\3\'\3(\3(\3)\3"+ + ")\3*\3*\3+\3+\3,\3,\3-\3-\3.\3.\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\3/\5"+ + "/\u015d\n/\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60"+ + "\5\60\u016b\n\60\3\61\3\61\3\61\5\61\u0170\n\61\3\61\6\61\u0173\n\61\r"+ + "\61\16\61\u0174\3\62\5\62\u0178\n\62\3\62\3\62\5\62\u017c\n\62\3\62\3"+ + "\62\7\62\u0180\n\62\f\62\16\62\u0183\13\62\5\62\u0185\n\62\3\63\3\63\3"+ + "\63\7\63\u018a\n\63\f\63\16\63\u018d\13\63\3\63\5\63\u0190\n\63\3\63\5"+ + "\63\u0193\n\63\3\63\3\63\6\63\u0197\n\63\r\63\16\63\u0198\3\63\5\63\u019c"+ + "\n\63\3\63\5\63\u019f\n\63\3\63\3\63\3\63\5\63\u01a4\n\63\3\63\3\63\5"+ + "\63\u01a8\n\63\3\63\3\63\5\63\u01ac\n\63\3\64\3\64\3\64\7\64\u01b1\n\64"+ + "\f\64\16\64\u01b4\13\64\3\64\5\64\u01b7\n\64\3\64\3\64\3\64\5\64\u01bc"+ + "\n\64\3\64\3\64\6\64\u01c0\n\64\r\64\16\64\u01c1\3\64\5\64\u01c5\n\64"+ + "\3\64\3\64\3\64\3\64\5\64\u01cb\n\64\3\64\3\64\5\64\u01cf\n\64\3\65\3"+ + "\65\3\65\3\66\3\66\3\66\7\66\u01d7\n\66\f\66\16\66\u01da\13\66\3\66\3"+ + "\66\5\66\u01de\n\66\3\67\3\67\3\67\3\67\7\67\u01e4\n\67\f\67\16\67\u01e7"+ + "\13\67\3\67\3\67\3\67\3\67\3\67\3\67\7\67\u01ef\n\67\f\67\16\67\u01f2"+ + "\13\67\3\67\3\67\5\67\u01f6\n\67\38\38\38\38\68\u01fc\n8\r8\168\u01fd"+ + "\38\38\58\u0202\n8\38\38\39\69\u0207\n9\r9\169\u0208\39\39\3:\3:\3;\3"+ + ";\3<\3<\3=\3=\3>\3>\3?\3?\3@\3@\3A\3A\3B\3B\3C\3C\3D\3D\3\u01fd\2E\3\3"+ + "\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21"+ + "!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!"+ + "A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\66k\67m8o9q:s"+ + "\2u\2w\2y\2{\2}\2\177\2\u0081\2\u0083\2\u0085\2\u0087\2\3\2\16\4\2))^"+ + "^\7\2))^^ppttvv\4\2$$^^\7\2$$^^ppttvv\5\2\13\f\16\17\"\"\4\2FFff\4\2G"+ + "Ggg\4\2HHhh\4\2NNnn\6\2&&C\\aac|\b\2\60\60\62\2\2\u00e2*\3\2\2\2\u00e3\u00e4\7>\2\2\u00e4\u00e5\7?\2\2\u00e5,\3"+ + "\2\2\2\u00e6\u00e7\7@\2\2\u00e7.\3\2\2\2\u00e8\u00e9\7@\2\2\u00e9\u00ea"+ + "\7?\2\2\u00ea\60\3\2\2\2\u00eb\u00ec\7A\2\2\u00ec\62\3\2\2\2\u00ed\u00ee"+ + "\7<\2\2\u00ee\64\3\2\2\2\u00ef\u00f0\7K\2\2\u00f0\u00f4\7H\2\2\u00f1\u00f2"+ + "\7k\2\2\u00f2\u00f4\7h\2\2\u00f3\u00ef\3\2\2\2\u00f3\u00f1\3\2\2\2\u00f4"+ + "\66\3\2\2\2\u00f5\u00f6\7V\2\2\u00f6\u00f7\7J\2\2\u00f7\u00f8\7G\2\2\u00f8"+ + "\u00fe\7P\2\2\u00f9\u00fa\7v\2\2\u00fa\u00fb\7j\2\2\u00fb\u00fc\7g\2\2"+ + "\u00fc\u00fe\7p\2\2\u00fd\u00f5\3\2\2\2\u00fd\u00f9\3\2\2\2\u00fe8\3\2"+ + "\2\2\u00ff\u0100\7G\2\2\u0100\u0101\7N\2\2\u0101\u0102\7U\2\2\u0102\u0108"+ + "\7G\2\2\u0103\u0104\7g\2\2\u0104\u0105\7n\2\2\u0105\u0106\7u\2\2\u0106"+ + "\u0108\7g\2\2\u0107\u00ff\3\2\2\2\u0107\u0103\3\2\2\2\u0108:\3\2\2\2\u0109"+ + "\u010a\7p\2\2\u010a\u010b\7w\2\2\u010b\u010c\7n\2\2\u010c\u0112\7n\2\2"+ + "\u010d\u010e\7P\2\2\u010e\u010f\7W\2\2\u010f\u0110\7N\2\2\u0110\u0112"+ + "\7N\2\2\u0111\u0109\3\2\2\2\u0111\u010d\3\2\2\2\u0112<\3\2\2\2\u0113\u0114"+ + "\7P\2\2\u0114\u0115\7c\2\2\u0115\u0116\7P\2\2\u0116>\3\2\2\2\u0117\u0118"+ + "\7o\2\2\u0118\u0119\7c\2\2\u0119\u011a\7v\2\2\u011a\u011b\7e\2\2\u011b"+ + "\u0122\7j\2\2\u011c\u011d\7O\2\2\u011d\u011e\7C\2\2\u011e\u011f\7V\2\2"+ + "\u011f\u0120\7E\2\2\u0120\u0122\7J\2\2\u0121\u0117\3\2\2\2\u0121\u011c"+ + "\3\2\2\2\u0122@\3\2\2\2\u0123\u0124\7f\2\2\u0124\u0125\7g\2\2\u0125\u0126"+ + "\7h\2\2\u0126\u0127\7c\2\2\u0127\u0128\7w\2\2\u0128\u0129\7n\2\2\u0129"+ + "\u0132\7v\2\2\u012a\u012b\7F\2\2\u012b\u012c\7G\2\2\u012c\u012d\7H\2\2"+ + "\u012d\u012e\7C\2\2\u012e\u012f\7W\2\2\u012f\u0130\7N\2\2\u0130\u0132"+ + "\7V\2\2\u0131\u0123\3\2\2\2\u0131\u012a\3\2\2\2\u0132B\3\2\2\2\u0133\u0134"+ + "\7?\2\2\u0134\u0135\7@\2\2\u0135D\3\2\2\2\u0136\u0137\7/\2\2\u0137F\3"+ + "\2\2\2\u0138\u0139\7/\2\2\u0139\u013a\7/\2\2\u013aH\3\2\2\2\u013b\u013c"+ + "\7-\2\2\u013cJ\3\2\2\2\u013d\u013e\7-\2\2\u013e\u013f\7-\2\2\u013fL\3"+ + "\2\2\2\u0140\u0141\7\61\2\2\u0141N\3\2\2\2\u0142\u0143\7,\2\2\u0143P\3"+ + "\2\2\2\u0144\u0145\7}\2\2\u0145R\3\2\2\2\u0146\u0147\7\177\2\2\u0147T"+ + "\3\2\2\2\u0148\u0149\7]\2\2\u0149V\3\2\2\2\u014a\u014b\7_\2\2\u014bX\3"+ + "\2\2\2\u014c\u014d\7*\2\2\u014dZ\3\2\2\2\u014e\u014f\7+\2\2\u014f\\\3"+ + "\2\2\2\u0150\u0151\7p\2\2\u0151\u0152\7q\2\2\u0152\u0153\7v\2\2\u0153"+ + "\u0154\7\"\2\2\u0154\u0155\7k\2\2\u0155\u015d\7p\2\2\u0156\u0157\7P\2"+ + "\2\u0157\u0158\7Q\2\2\u0158\u0159\7V\2\2\u0159\u015a\7\"\2\2\u015a\u015b"+ + "\7K\2\2\u015b\u015d\7P\2\2\u015c\u0150\3\2\2\2\u015c\u0156\3\2\2\2\u015d"+ + "^\3\2\2\2\u015e\u015f\7g\2\2\u015f\u0160\7z\2\2\u0160\u0161\7k\2\2\u0161"+ + "\u0162\7u\2\2\u0162\u0163\7v\2\2\u0163\u016b\7u\2\2\u0164\u0165\7G\2\2"+ + "\u0165\u0166\7Z\2\2\u0166\u0167\7K\2\2\u0167\u0168\7U\2\2\u0168\u0169"+ + "\7V\2\2\u0169\u016b\7U\2\2\u016a\u015e\3\2\2\2\u016a\u0164\3\2\2\2\u016b"+ + "`\3\2\2\2\u016c\u016f\5{>\2\u016d\u0170\5I%\2\u016e\u0170\5E#\2\u016f"+ + "\u016d\3\2\2\2\u016f\u016e\3\2\2\2\u016f\u0170\3\2\2\2\u0170\u0172\3\2"+ + "\2\2\u0171\u0173\5w<\2\u0172\u0171\3\2\2\2\u0173\u0174\3\2\2\2\u0174\u0172"+ + "\3\2\2\2\u0174\u0175\3\2\2\2\u0175b\3\2\2\2\u0176\u0178\5E#\2\u0177\u0176"+ + "\3\2\2\2\u0177\u0178\3\2\2\2\u0178\u0179\3\2\2\2\u0179\u0185\5s:\2\u017a"+ + "\u017c\5E#\2\u017b\u017a\3\2\2\2\u017b\u017c\3\2\2\2\u017c\u017d\3\2\2"+ + "\2\u017d\u0181\5u;\2\u017e\u0180\5w<\2\u017f\u017e\3\2\2\2\u0180\u0183"+ + "\3\2\2\2\u0181\u017f\3\2\2\2\u0181\u0182\3\2\2\2\u0182\u0185\3\2\2\2\u0183"+ + "\u0181\3\2\2\2\u0184\u0177\3\2\2\2\u0184\u017b\3\2\2\2\u0185d\3\2\2\2"+ + "\u0186\u0187\5c\62\2\u0187\u018b\5\r\7\2\u0188\u018a\5w<\2\u0189\u0188"+ + "\3\2\2\2\u018a\u018d\3\2\2\2\u018b\u0189\3\2\2\2\u018b\u018c\3\2\2\2\u018c"+ + "\u018f\3\2\2\2\u018d\u018b\3\2\2\2\u018e\u0190\5a\61\2\u018f\u018e\3\2"+ + "\2\2\u018f\u0190\3\2\2\2\u0190\u0192\3\2\2\2\u0191\u0193\5y=\2\u0192\u0191"+ + "\3\2\2\2\u0192\u0193\3\2\2\2\u0193\u01ac\3\2\2\2\u0194\u0196\5\r\7\2\u0195"+ + "\u0197\5w<\2\u0196\u0195\3\2\2\2\u0197\u0198\3\2\2\2\u0198\u0196\3\2\2"+ + "\2\u0198\u0199\3\2\2\2\u0199\u019b\3\2\2\2\u019a\u019c\5a\61\2\u019b\u019a"+ + "\3\2\2\2\u019b\u019c\3\2\2\2\u019c\u019e\3\2\2\2\u019d\u019f\5y=\2\u019e"+ + "\u019d\3\2\2\2\u019e\u019f\3\2\2\2\u019f\u01ac\3\2\2\2\u01a0\u01a1\5c"+ + "\62\2\u01a1\u01a3\5a\61\2\u01a2\u01a4\5y=\2\u01a3\u01a2\3\2\2\2\u01a3"+ + "\u01a4\3\2\2\2\u01a4\u01ac\3\2\2\2\u01a5\u01a7\5c\62\2\u01a6\u01a8\5a"+ + "\61\2\u01a7\u01a6\3\2\2\2\u01a7\u01a8\3\2\2\2\u01a8\u01a9\3\2\2\2\u01a9"+ + "\u01aa\5y=\2\u01aa\u01ac\3\2\2\2\u01ab\u0186\3\2\2\2\u01ab\u0194\3\2\2"+ + "\2\u01ab\u01a0\3\2\2\2\u01ab\u01a5\3\2\2\2\u01acf\3\2\2\2\u01ad\u01ae"+ + "\5c\62\2\u01ae\u01b2\5\r\7\2\u01af\u01b1\5w<\2\u01b0\u01af\3\2\2\2\u01b1"+ + "\u01b4\3\2\2\2\u01b2\u01b0\3\2\2\2\u01b2\u01b3\3\2\2\2\u01b3\u01b6\3\2"+ + "\2\2\u01b4\u01b2\3\2\2\2\u01b5\u01b7\5a\61\2\u01b6\u01b5\3\2\2\2\u01b6"+ + "\u01b7\3\2\2\2\u01b7\u01b8\3\2\2\2\u01b8\u01b9\5}?\2\u01b9\u01cf\3\2\2"+ + "\2\u01ba\u01bc\5E#\2\u01bb\u01ba\3\2\2\2\u01bb\u01bc\3\2\2\2\u01bc\u01bd"+ + "\3\2\2\2\u01bd\u01bf\5\r\7\2\u01be\u01c0\5w<\2\u01bf\u01be\3\2\2\2\u01c0"+ + "\u01c1\3\2\2\2\u01c1\u01bf\3\2\2\2\u01c1\u01c2\3\2\2\2\u01c2\u01c4\3\2"+ + "\2\2\u01c3\u01c5\5a\61\2\u01c4\u01c3\3\2\2\2\u01c4\u01c5\3\2\2\2\u01c5"+ + "\u01c6\3\2\2\2\u01c6\u01c7\5}?\2\u01c7\u01cf\3\2\2\2\u01c8\u01ca\5c\62"+ + "\2\u01c9\u01cb\5a\61\2\u01ca\u01c9\3\2\2\2\u01ca\u01cb\3\2\2\2\u01cb\u01cc"+ + "\3\2\2\2\u01cc\u01cd\5}?\2\u01cd\u01cf\3\2\2\2\u01ce\u01ad\3\2\2\2\u01ce"+ + "\u01bb\3\2\2\2\u01ce\u01c8\3\2\2\2\u01cfh\3\2\2\2\u01d0\u01d1\5c\62\2"+ + "\u01d1\u01d2\5\177@\2\u01d2j\3\2\2\2\u01d3\u01de\5\u0083B\2\u01d4\u01d8"+ + "\5\u0083B\2\u01d5\u01d7\5\u0085C\2\u01d6\u01d5\3\2\2\2\u01d7\u01da\3\2"+ + "\2\2\u01d8\u01d6\3\2\2\2\u01d8\u01d9\3\2\2\2\u01d9\u01db\3\2\2\2\u01da"+ + "\u01d8\3\2\2\2\u01db\u01dc\5\u0087D\2\u01dc\u01de\3\2\2\2\u01dd\u01d3"+ + "\3\2\2\2\u01dd\u01d4\3\2\2\2\u01del\3\2\2\2\u01df\u01e5\5\t\5\2\u01e0"+ + "\u01e4\n\2\2\2\u01e1\u01e2\7^\2\2\u01e2\u01e4\t\3\2\2\u01e3\u01e0\3\2"+ + "\2\2\u01e3\u01e1\3\2\2\2\u01e4\u01e7\3\2\2\2\u01e5\u01e3\3\2\2\2\u01e5"+ + "\u01e6\3\2\2\2\u01e6\u01e8\3\2\2\2\u01e7\u01e5\3\2\2\2\u01e8\u01e9\5\t"+ + "\5\2\u01e9\u01f6\3\2\2\2\u01ea\u01f0\5\7\4\2\u01eb\u01ef\n\4\2\2\u01ec"+ + "\u01ed\7^\2\2\u01ed\u01ef\t\5\2\2\u01ee\u01eb\3\2\2\2\u01ee\u01ec\3\2"+ + "\2\2\u01ef\u01f2\3\2\2\2\u01f0\u01ee\3\2\2\2\u01f0\u01f1\3\2\2\2\u01f1"+ + "\u01f3\3\2\2\2\u01f2\u01f0\3\2\2\2\u01f3\u01f4\5\7\4\2\u01f4\u01f6\3\2"+ + "\2\2\u01f5\u01df\3\2\2\2\u01f5\u01ea\3\2\2\2\u01f6n\3\2\2\2\u01f7\u01f8"+ + "\7\61\2\2\u01f8\u01f9\7\61\2\2\u01f9\u01fb\3\2\2\2\u01fa\u01fc\13\2\2"+ + "\2\u01fb\u01fa\3\2\2\2\u01fc\u01fd\3\2\2\2\u01fd\u01fe\3\2\2\2\u01fd\u01fb"+ + "\3\2\2\2\u01fe\u0201\3\2\2\2\u01ff\u0202\5\u0081A\2\u0200\u0202\7\2\2"+ + "\3\u0201\u01ff\3\2\2\2\u0201\u0200\3\2\2\2\u0202\u0203\3\2\2\2\u0203\u0204"+ + "\b8\2\2\u0204p\3\2\2\2\u0205\u0207\t\6\2\2\u0206\u0205\3\2\2\2\u0207\u0208"+ + "\3\2\2\2\u0208\u0206\3\2\2\2\u0208\u0209\3\2\2\2\u0209\u020a\3\2\2\2\u020a"+ + "\u020b\b9\2\2\u020br\3\2\2\2\u020c\u020d\7\62\2\2\u020dt\3\2\2\2\u020e"+ + "\u020f\4\63;\2\u020fv\3\2\2\2\u0210\u0211\4\62;\2\u0211x\3\2\2\2\u0212"+ + "\u0213\t\7\2\2\u0213z\3\2\2\2\u0214\u0215\t\b\2\2\u0215|\3\2\2\2\u0216"+ + "\u0217\t\t\2\2\u0217~\3\2\2\2\u0218\u0219\t\n\2\2\u0219\u0080\3\2\2\2"+ + "\u021a\u021b\7\f\2\2\u021b\u0082\3\2\2\2\u021c\u021d\t\13\2\2\u021d\u0084"+ + "\3\2\2\2\u021e\u021f\t\f\2\2\u021f\u0086\3\2\2\2\u0220\u0221\t\r\2\2\u0221"+ + "\u0088\3\2\2\2\61\2\u008d\u00a2\u00aa\u00b2\u00bc\u00c8\u00f3\u00fd\u0107"+ + "\u0111\u0121\u0131\u015c\u016a\u016f\u0174\u0177\u017b\u0181\u0184\u018b"+ + "\u018f\u0192\u0198\u019b\u019e\u01a3\u01a7\u01ab\u01b2\u01b6\u01bb\u01c1"+ + "\u01c4\u01ca\u01ce\u01d8\u01dd\u01e3\u01e5\u01ee\u01f0\u01f5\u01fd\u0201"+ + "\u0208\3\b\2\2"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarListener.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarListener.java index 9fa65cae89..c4165e599c 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarListener.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarListener.java @@ -184,6 +184,18 @@ public interface StellarListener extends ParseTreeListener { * @param ctx the parse tree */ void exitAssignExpression(StellarParser.AssignExpressionContext ctx); + /** + * Enter a parse tree produced by the {@code ColonAssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void enterColonAssignExpression(StellarParser.ColonAssignExpressionContext ctx); + /** + * Exit a parse tree produced by the {@code ColonAssignExpression} + * labeled alternative in {@link StellarParser#assign_expr}. + * @param ctx the parse tree + */ + void exitColonAssignExpression(StellarParser.ColonAssignExpressionContext ctx); /** * Enter a parse tree produced by the {@code PlusAssignExpression} * labeled alternative in {@link StellarParser#assign_expr}. diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarParser.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarParser.java index bb59072837..3fda80bfd7 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarParser.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/generated/StellarParser.java @@ -38,14 +38,14 @@ public class StellarParser extends Parser { new PredictionContextCache(); public static final int IN=1, LAMBDA_OP=2, DOUBLE_QUOTE=3, SINGLE_QUOTE=4, COMMA=5, PERIOD=6, - AND=7, OR=8, NOT=9, TRUE=10, FALSE=11, ASSIGN=12, PLUSASSIGN=13, MINUSASSIGN=14, - DIVIDEASSIGN=15, MULTASSIGN=16, EQ=17, NEQ=18, LT=19, LTE=20, GT=21, GTE=22, - QUESTION=23, COLON=24, IF=25, THEN=26, ELSE=27, NULL=28, NAN=29, MATCH=30, - DEFAULT=31, MATCH_ACTION=32, MINUS=33, MINUSMINUS=34, PLUS=35, PLUSPLUS=36, - DIV=37, MUL=38, LBRACE=39, RBRACE=40, LBRACKET=41, RBRACKET=42, LPAREN=43, - RPAREN=44, NIN=45, EXISTS=46, EXPONENT=47, INT_LITERAL=48, DOUBLE_LITERAL=49, - FLOAT_LITERAL=50, LONG_LITERAL=51, IDENTIFIER=52, STRING_LITERAL=53, COMMENT=54, - WS=55; + AND=7, OR=8, NOT=9, TRUE=10, FALSE=11, ASSIGN=12, COLON_ASSIGN=13, PLUSASSIGN=14, + MINUSASSIGN=15, DIVIDEASSIGN=16, MULTASSIGN=17, EQ=18, NEQ=19, LT=20, + LTE=21, GT=22, GTE=23, QUESTION=24, COLON=25, IF=26, THEN=27, ELSE=28, + NULL=29, NAN=30, MATCH=31, DEFAULT=32, MATCH_ACTION=33, MINUS=34, MINUSMINUS=35, + PLUS=36, PLUSPLUS=37, DIV=38, MUL=39, LBRACE=40, RBRACE=41, LBRACKET=42, + RBRACKET=43, LPAREN=44, RPAREN=45, NIN=46, EXISTS=47, EXPONENT=48, INT_LITERAL=49, + DOUBLE_LITERAL=50, FLOAT_LITERAL=51, LONG_LITERAL=52, IDENTIFIER=53, STRING_LITERAL=54, + COMMENT=55, WS=56; public static final int RULE_transformation = 0, RULE_transformation_expr = 1, RULE_assign_expr = 2, RULE_pre_expr = 3, RULE_post_expr = 4, RULE_if_expr = 5, RULE_then_expr = 6, @@ -71,20 +71,20 @@ public class StellarParser extends Parser { private static final String[] _LITERAL_NAMES = { null, null, "'->'", "'\"'", "'''", "','", "'.'", null, null, null, null, - null, "'='", "'+='", "'-='", "'/='", "'*='", "'=='", "'!='", "'<'", "'<='", - "'>'", "'>='", "'?'", "':'", null, null, null, null, "'NaN'", null, null, - "'=>'", "'-'", "'--'", "'+'", "'++'", "'/'", "'*'", "'{'", "'}'", "'['", - "']'", "'('", "')'" + null, "'='", "':='", "'+='", "'-='", "'/='", "'*='", "'=='", "'!='", "'<'", + "'<='", "'>'", "'>='", "'?'", "':'", null, null, null, null, "'NaN'", + null, null, "'=>'", "'-'", "'--'", "'+'", "'++'", "'/'", "'*'", "'{'", + "'}'", "'['", "']'", "'('", "')'" }; private static final String[] _SYMBOLIC_NAMES = { null, "IN", "LAMBDA_OP", "DOUBLE_QUOTE", "SINGLE_QUOTE", "COMMA", "PERIOD", - "AND", "OR", "NOT", "TRUE", "FALSE", "ASSIGN", "PLUSASSIGN", "MINUSASSIGN", - "DIVIDEASSIGN", "MULTASSIGN", "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "QUESTION", - "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", "MATCH", "DEFAULT", "MATCH_ACTION", - "MINUS", "MINUSMINUS", "PLUS", "PLUSPLUS", "DIV", "MUL", "LBRACE", "RBRACE", - "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", "NIN", "EXISTS", "EXPONENT", - "INT_LITERAL", "DOUBLE_LITERAL", "FLOAT_LITERAL", "LONG_LITERAL", "IDENTIFIER", - "STRING_LITERAL", "COMMENT", "WS" + "AND", "OR", "NOT", "TRUE", "FALSE", "ASSIGN", "COLON_ASSIGN", "PLUSASSIGN", + "MINUSASSIGN", "DIVIDEASSIGN", "MULTASSIGN", "EQ", "NEQ", "LT", "LTE", + "GT", "GTE", "QUESTION", "COLON", "IF", "THEN", "ELSE", "NULL", "NAN", + "MATCH", "DEFAULT", "MATCH_ACTION", "MINUS", "MINUSMINUS", "PLUS", "PLUSPLUS", + "DIV", "MUL", "LBRACE", "RBRACE", "LBRACKET", "RBRACKET", "LPAREN", "RPAREN", + "NIN", "EXISTS", "EXPONENT", "INT_LITERAL", "DOUBLE_LITERAL", "FLOAT_LITERAL", + "LONG_LITERAL", "IDENTIFIER", "STRING_LITERAL", "COMMENT", "WS" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -531,6 +531,22 @@ public void exitRule(ParseTreeListener listener) { if ( listener instanceof StellarListener ) ((StellarListener)listener).exitMultiAssignExpression(this); } } + public static class ColonAssignExpressionContext extends Assign_exprContext { + public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } + public TerminalNode COLON_ASSIGN() { return getToken(StellarParser.COLON_ASSIGN, 0); } + public Transformation_exprContext transformation_expr() { + return getRuleContext(Transformation_exprContext.class,0); + } + public ColonAssignExpressionContext(Assign_exprContext ctx) { copyFrom(ctx); } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).enterColonAssignExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof StellarListener ) ((StellarListener)listener).exitColonAssignExpression(this); + } + } public static class MinusAssignExpressionContext extends Assign_exprContext { public TerminalNode IDENTIFIER() { return getToken(StellarParser.IDENTIFIER, 0); } public TerminalNode MINUSASSIGN() { return getToken(StellarParser.MINUSASSIGN, 0); } @@ -552,7 +568,7 @@ public final Assign_exprContext assign_expr() throws RecognitionException { Assign_exprContext _localctx = new Assign_exprContext(_ctx, getState()); enterRule(_localctx, 4, RULE_assign_expr); try { - setState(106); + setState(109); switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) { case 1: _localctx = new AssignExpressionContext(_localctx); @@ -567,53 +583,65 @@ public final Assign_exprContext assign_expr() throws RecognitionException { } break; case 2: - _localctx = new PlusAssignExpressionContext(_localctx); + _localctx = new ColonAssignExpressionContext(_localctx); enterOuterAlt(_localctx, 2); { setState(94); match(IDENTIFIER); setState(95); - match(PLUSASSIGN); + match(COLON_ASSIGN); setState(96); transformation_expr(); } break; case 3: - _localctx = new MinusAssignExpressionContext(_localctx); + _localctx = new PlusAssignExpressionContext(_localctx); enterOuterAlt(_localctx, 3); { setState(97); match(IDENTIFIER); setState(98); - match(MINUSASSIGN); + match(PLUSASSIGN); setState(99); transformation_expr(); } break; case 4: - _localctx = new DivideAssignExpressionContext(_localctx); + _localctx = new MinusAssignExpressionContext(_localctx); enterOuterAlt(_localctx, 4); { setState(100); match(IDENTIFIER); setState(101); - match(DIVIDEASSIGN); + match(MINUSASSIGN); setState(102); transformation_expr(); } break; case 5: - _localctx = new MultiAssignExpressionContext(_localctx); + _localctx = new DivideAssignExpressionContext(_localctx); enterOuterAlt(_localctx, 5); { setState(103); match(IDENTIFIER); setState(104); - match(MULTASSIGN); + match(DIVIDEASSIGN); setState(105); transformation_expr(); } break; + case 6: + _localctx = new MultiAssignExpressionContext(_localctx); + enterOuterAlt(_localctx, 6); + { + setState(106); + match(IDENTIFIER); + setState(107); + match(MULTASSIGN); + setState(108); + transformation_expr(); + } + break; } } catch (RecognitionException re) { @@ -669,15 +697,15 @@ public final Pre_exprContext pre_expr() throws RecognitionException { Pre_exprContext _localctx = new Pre_exprContext(_ctx, getState()); enterRule(_localctx, 6, RULE_pre_expr); try { - setState(112); + setState(115); switch (_input.LA(1)) { case PLUSPLUS: _localctx = new PreIncrementExpressionContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(108); + setState(111); match(PLUSPLUS); - setState(109); + setState(112); match(IDENTIFIER); } break; @@ -685,9 +713,9 @@ public final Pre_exprContext pre_expr() throws RecognitionException { _localctx = new PreDecrementExpressionContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(110); + setState(113); match(MINUSMINUS); - setState(111); + setState(114); match(IDENTIFIER); } break; @@ -748,15 +776,15 @@ public final Post_exprContext post_expr() throws RecognitionException { Post_exprContext _localctx = new Post_exprContext(_ctx, getState()); enterRule(_localctx, 8, RULE_post_expr); try { - setState(118); + setState(121); switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { case 1: _localctx = new PostIncrementExpressionContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(114); + setState(117); match(IDENTIFIER); - setState(115); + setState(118); match(PLUSPLUS); } break; @@ -764,9 +792,9 @@ public final Post_exprContext post_expr() throws RecognitionException { _localctx = new PostDecrementExpressionContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(116); + setState(119); match(IDENTIFIER); - setState(117); + setState(120); match(MINUSMINUS); } break; @@ -807,7 +835,7 @@ public final If_exprContext if_expr() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(120); + setState(123); logical_expr(); } } @@ -846,7 +874,7 @@ public final Then_exprContext then_expr() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(122); + setState(125); transformation_expr(); } } @@ -885,7 +913,7 @@ public final Else_exprContext else_expr() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(124); + setState(127); transformation_expr(); } } @@ -961,7 +989,7 @@ public final Conditional_exprContext conditional_expr() throws RecognitionExcept Conditional_exprContext _localctx = new Conditional_exprContext(_ctx, getState()); enterRule(_localctx, 16, RULE_conditional_expr); try { - setState(139); + setState(142); switch (_input.LA(1)) { case NOT: case TRUE: @@ -981,15 +1009,15 @@ public final Conditional_exprContext conditional_expr() throws RecognitionExcept _localctx = new TernaryFuncWithoutIfContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(126); + setState(129); if_expr(); - setState(127); + setState(130); match(QUESTION); - setState(128); + setState(131); then_expr(); - setState(129); + setState(132); match(COLON); - setState(130); + setState(133); else_expr(); } break; @@ -997,17 +1025,17 @@ public final Conditional_exprContext conditional_expr() throws RecognitionExcept _localctx = new TernaryFuncWithIfContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(132); + setState(135); match(IF); - setState(133); + setState(136); if_expr(); - setState(134); + setState(137); match(THEN); - setState(135); + setState(138); then_expr(); - setState(136); + setState(139); match(ELSE); - setState(137); + setState(140); else_expr(); } break; @@ -1092,17 +1120,17 @@ public final Logical_exprContext logical_expr() throws RecognitionException { Logical_exprContext _localctx = new Logical_exprContext(_ctx, getState()); enterRule(_localctx, 18, RULE_logical_expr); try { - setState(150); + setState(153); switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) { case 1: _localctx = new LogicalExpressionAndContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(141); + setState(144); b_expr(); - setState(142); + setState(145); match(AND); - setState(143); + setState(146); logical_expr(); } break; @@ -1110,11 +1138,11 @@ public final Logical_exprContext logical_expr() throws RecognitionException { _localctx = new LogicalExpressionOrContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(145); + setState(148); b_expr(); - setState(146); + setState(149); match(OR); - setState(147); + setState(150); logical_expr(); } break; @@ -1122,7 +1150,7 @@ public final Logical_exprContext logical_expr() throws RecognitionException { _localctx = new BoleanExpressionContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(149); + setState(152); b_expr(); } break; @@ -1164,19 +1192,19 @@ public final B_exprContext b_expr() throws RecognitionException { B_exprContext _localctx = new B_exprContext(_ctx, getState()); enterRule(_localctx, 20, RULE_b_expr); try { - setState(154); + setState(157); switch ( getInterpreter().adaptivePredict(_input,6,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(152); + setState(155); comparison_expr(0); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(153); + setState(156); in_expr(); } break; @@ -1245,17 +1273,17 @@ public final In_exprContext in_expr() throws RecognitionException { In_exprContext _localctx = new In_exprContext(_ctx, getState()); enterRule(_localctx, 22, RULE_in_expr); try { - setState(164); + setState(167); switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) { case 1: _localctx = new InExpressionStatementContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(156); + setState(159); identifier_operand(); - setState(157); + setState(160); match(IN); - setState(158); + setState(161); b_expr(); } break; @@ -1263,11 +1291,11 @@ public final In_exprContext in_expr() throws RecognitionException { _localctx = new NInExpressionStatementContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(160); + setState(163); identifier_operand(); - setState(161); + setState(164); match(NIN); - setState(162); + setState(165); b_expr(); } break; @@ -1378,7 +1406,7 @@ private Comparison_exprContext comparison_expr(int _p) throws RecognitionExcepti int _alt; enterOuterAlt(_localctx, 1); { - setState(177); + setState(180); switch ( getInterpreter().adaptivePredict(_input,8,_ctx) ) { case 1: { @@ -1386,13 +1414,13 @@ private Comparison_exprContext comparison_expr(int _p) throws RecognitionExcepti _ctx = _localctx; _prevctx = _localctx; - setState(167); + setState(170); match(NOT); - setState(168); + setState(171); match(LPAREN); - setState(169); + setState(172); logical_expr(); - setState(170); + setState(173); match(RPAREN); } break; @@ -1401,11 +1429,11 @@ private Comparison_exprContext comparison_expr(int _p) throws RecognitionExcepti _localctx = new ComparisonExpressionParensContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(172); + setState(175); match(LPAREN); - setState(173); + setState(176); logical_expr(); - setState(174); + setState(177); match(RPAREN); } break; @@ -1414,13 +1442,13 @@ private Comparison_exprContext comparison_expr(int _p) throws RecognitionExcepti _localctx = new OperandContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(176); + setState(179); identifier_operand(); } break; } _ctx.stop = _input.LT(-1); - setState(185); + setState(188); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,9,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -1431,16 +1459,16 @@ private Comparison_exprContext comparison_expr(int _p) throws RecognitionExcepti { _localctx = new ComparisonExpressionWithOperatorContext(new Comparison_exprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_comparison_expr); - setState(179); + setState(182); if (!(precpred(_ctx, 4))) throw new FailedPredicateException(this, "precpred(_ctx, 4)"); - setState(180); + setState(183); comp_operator(); - setState(181); + setState(184); comparison_expr(5); } } } - setState(187); + setState(190); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,9,_ctx); } @@ -1481,7 +1509,7 @@ public final Transformation_entityContext transformation_entity() throws Recogni try { enterOuterAlt(_localctx, 1); { - setState(188); + setState(191); identifier_operand(); } } @@ -1533,7 +1561,7 @@ public final Comp_operatorContext comp_operator() throws RecognitionException { _localctx = new ComparisonOpContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(190); + setState(193); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << EQ) | (1L << NEQ) | (1L << LT) | (1L << LTE) | (1L << GT) | (1L << GTE))) != 0)) ) { _errHandler.recoverInline(this); @@ -1577,25 +1605,25 @@ public final Func_argsContext func_args() throws RecognitionException { Func_argsContext _localctx = new Func_argsContext(_ctx, getState()); enterRule(_localctx, 30, RULE_func_args); try { - setState(198); + setState(201); switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(192); + setState(195); match(LPAREN); - setState(193); + setState(196); op_list(0); - setState(194); + setState(197); match(RPAREN); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(196); + setState(199); match(LPAREN); - setState(197); + setState(200); match(RPAREN); } break; @@ -1655,29 +1683,29 @@ private Op_listContext op_list(int _p) throws RecognitionException { int _alt; enterOuterAlt(_localctx, 1); { - setState(204); + setState(207); switch ( getInterpreter().adaptivePredict(_input,11,_ctx) ) { case 1: { - setState(201); + setState(204); identifier_operand(); } break; case 2: { - setState(202); + setState(205); conditional_expr(); } break; case 3: { - setState(203); + setState(206); comparison_expr(0); } break; } _ctx.stop = _input.LT(-1); - setState(217); + setState(220); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -1685,17 +1713,17 @@ private Op_listContext op_list(int _p) throws RecognitionException { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(215); + setState(218); switch ( getInterpreter().adaptivePredict(_input,12,_ctx) ) { case 1: { _localctx = new Op_listContext(_parentctx, _parentState); pushNewRecursionContext(_localctx, _startState, RULE_op_list); - setState(206); + setState(209); if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)"); - setState(207); + setState(210); match(COMMA); - setState(208); + setState(211); identifier_operand(); } break; @@ -1703,11 +1731,11 @@ private Op_listContext op_list(int _p) throws RecognitionException { { _localctx = new Op_listContext(_parentctx, _parentState); pushNewRecursionContext(_localctx, _startState, RULE_op_list); - setState(209); + setState(212); if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); - setState(210); + setState(213); match(COMMA); - setState(211); + setState(214); conditional_expr(); } break; @@ -1715,18 +1743,18 @@ private Op_listContext op_list(int _p) throws RecognitionException { { _localctx = new Op_listContext(_parentctx, _parentState); pushNewRecursionContext(_localctx, _startState, RULE_op_list); - setState(212); + setState(215); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(213); + setState(216); match(COMMA); - setState(214); + setState(217); comparison_expr(0); } break; } } } - setState(219); + setState(222); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); } @@ -1767,25 +1795,25 @@ public final List_entityContext list_entity() throws RecognitionException { List_entityContext _localctx = new List_entityContext(_ctx, getState()); enterRule(_localctx, 34, RULE_list_entity); try { - setState(226); + setState(229); switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(220); + setState(223); match(LBRACKET); - setState(221); + setState(224); match(RBRACKET); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(222); + setState(225); match(LBRACKET); - setState(223); + setState(226); op_list(0); - setState(224); + setState(227); match(RBRACKET); } break; @@ -1846,31 +1874,31 @@ private Kv_listContext kv_list(int _p) throws RecognitionException { int _alt; enterOuterAlt(_localctx, 1); { - setState(237); + setState(240); switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) { case 1: { - setState(229); + setState(232); identifier_operand(); - setState(230); + setState(233); match(COLON); - setState(231); + setState(234); transformation_expr(); } break; case 2: { - setState(233); + setState(236); comparison_expr(0); - setState(234); + setState(237); match(COLON); - setState(235); + setState(238); transformation_expr(); } break; } _ctx.stop = _input.LT(-1); - setState(253); + setState(256); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,17,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -1878,21 +1906,21 @@ private Kv_listContext kv_list(int _p) throws RecognitionException { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(251); + setState(254); switch ( getInterpreter().adaptivePredict(_input,16,_ctx) ) { case 1: { _localctx = new Kv_listContext(_parentctx, _parentState); pushNewRecursionContext(_localctx, _startState, RULE_kv_list); - setState(239); + setState(242); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(240); + setState(243); match(COMMA); - setState(241); + setState(244); identifier_operand(); - setState(242); + setState(245); match(COLON); - setState(243); + setState(246); transformation_expr(); } break; @@ -1900,22 +1928,22 @@ private Kv_listContext kv_list(int _p) throws RecognitionException { { _localctx = new Kv_listContext(_parentctx, _parentState); pushNewRecursionContext(_localctx, _startState, RULE_kv_list); - setState(245); + setState(248); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(246); + setState(249); match(COMMA); - setState(247); + setState(250); comparison_expr(0); - setState(248); + setState(251); match(COLON); - setState(249); + setState(252); transformation_expr(); } break; } } } - setState(255); + setState(258); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,17,_ctx); } @@ -1956,25 +1984,25 @@ public final Map_entityContext map_entity() throws RecognitionException { Map_entityContext _localctx = new Map_entityContext(_ctx, getState()); enterRule(_localctx, 38, RULE_map_entity); try { - setState(262); + setState(265); switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(256); + setState(259); match(LBRACE); - setState(257); + setState(260); kv_list(0); - setState(258); + setState(261); match(RBRACE); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(260); + setState(263); match(LBRACE); - setState(261); + setState(264); match(RBRACE); } break; @@ -2073,11 +2101,11 @@ private Arithmetic_exprContext arithmetic_expr(int _p) throws RecognitionExcepti _ctx = _localctx; _prevctx = _localctx; - setState(265); + setState(268); arithmetic_expr_mul(0); } _ctx.stop = _input.LT(-1); - setState(275); + setState(278); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,20,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -2085,17 +2113,17 @@ private Arithmetic_exprContext arithmetic_expr(int _p) throws RecognitionExcepti if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(273); + setState(276); switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) { case 1: { _localctx = new ArithExpr_plusContext(new Arithmetic_exprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_arithmetic_expr); - setState(267); + setState(270); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(268); + setState(271); match(PLUS); - setState(269); + setState(272); arithmetic_expr_mul(0); } break; @@ -2103,18 +2131,18 @@ private Arithmetic_exprContext arithmetic_expr(int _p) throws RecognitionExcepti { _localctx = new ArithExpr_minusContext(new Arithmetic_exprContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_arithmetic_expr); - setState(270); + setState(273); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(271); + setState(274); match(MINUS); - setState(272); + setState(275); arithmetic_expr_mul(0); } break; } } } - setState(277); + setState(280); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,20,_ctx); } @@ -2213,11 +2241,11 @@ private Arithmetic_expr_mulContext arithmetic_expr_mul(int _p) throws Recognitio _ctx = _localctx; _prevctx = _localctx; - setState(279); + setState(282); arithmetic_operands(); } _ctx.stop = _input.LT(-1); - setState(289); + setState(292); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,22,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -2225,17 +2253,17 @@ private Arithmetic_expr_mulContext arithmetic_expr_mul(int _p) throws Recognitio if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(287); + setState(290); switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) { case 1: { _localctx = new ArithExpr_mulContext(new Arithmetic_expr_mulContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_arithmetic_expr_mul); - setState(281); + setState(284); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(282); + setState(285); match(MUL); - setState(283); + setState(286); arithmetic_expr_mul(3); } break; @@ -2243,18 +2271,18 @@ private Arithmetic_expr_mulContext arithmetic_expr_mul(int _p) throws Recognitio { _localctx = new ArithExpr_divContext(new Arithmetic_expr_mulContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_arithmetic_expr_mul); - setState(284); + setState(287); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(285); + setState(288); match(DIV); - setState(286); + setState(289); arithmetic_expr_mul(2); } break; } } } - setState(291); + setState(294); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,22,_ctx); } @@ -2305,9 +2333,9 @@ public final FunctionsContext functions() throws RecognitionException { _localctx = new TransformationFuncContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(292); + setState(295); match(IDENTIFIER); - setState(293); + setState(296); func_args(); } } @@ -2456,13 +2484,13 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition Arithmetic_operandsContext _localctx = new Arithmetic_operandsContext(_ctx, getState()); enterRule(_localctx, 46, RULE_arithmetic_operands); try { - setState(310); + setState(313); switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { case 1: _localctx = new NumericFunctionsContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(295); + setState(298); functions(); } break; @@ -2470,7 +2498,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new DoubleLiteralContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(296); + setState(299); match(DOUBLE_LITERAL); } break; @@ -2478,7 +2506,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new IntLiteralContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(297); + setState(300); match(INT_LITERAL); } break; @@ -2486,7 +2514,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new LongLiteralContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(298); + setState(301); match(LONG_LITERAL); } break; @@ -2494,7 +2522,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new FloatLiteralContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(299); + setState(302); match(FLOAT_LITERAL); } break; @@ -2502,7 +2530,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new VariableContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(300); + setState(303); match(IDENTIFIER); } break; @@ -2510,7 +2538,7 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new NaNArithContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(301); + setState(304); match(NAN); } break; @@ -2518,11 +2546,11 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new ParenArithContext(_localctx); enterOuterAlt(_localctx, 8); { - setState(302); + setState(305); match(LPAREN); - setState(303); + setState(306); arithmetic_expr(0); - setState(304); + setState(307); match(RPAREN); } break; @@ -2530,11 +2558,11 @@ public final Arithmetic_operandsContext arithmetic_operands() throws Recognition _localctx = new CondExprContext(_localctx); enterOuterAlt(_localctx, 9); { - setState(306); + setState(309); match(LPAREN); - setState(307); + setState(310); conditional_expr(); - setState(308); + setState(311); match(RPAREN); } break; @@ -2720,13 +2748,13 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx enterRule(_localctx, 48, RULE_identifier_operand); int _la; try { - setState(329); + setState(332); switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) { case 1: _localctx = new LogicalConstContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(312); + setState(315); _la = _input.LA(1); if ( !(_la==TRUE || _la==FALSE) ) { _errHandler.recoverInline(this); @@ -2739,7 +2767,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new LambdaWithArgsExprContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(313); + setState(316); lambda_with_args(); } break; @@ -2747,7 +2775,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new LambdaWithoutArgsExprContext(_localctx); enterOuterAlt(_localctx, 3); { - setState(314); + setState(317); lambda_without_args(); } break; @@ -2755,7 +2783,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new ArithmeticOperandsContext(_localctx); enterOuterAlt(_localctx, 4); { - setState(315); + setState(318); arithmetic_expr(0); } break; @@ -2763,7 +2791,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new StringLiteralContext(_localctx); enterOuterAlt(_localctx, 5); { - setState(316); + setState(319); match(STRING_LITERAL); } break; @@ -2771,7 +2799,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new ListContext(_localctx); enterOuterAlt(_localctx, 6); { - setState(317); + setState(320); list_entity(); } break; @@ -2779,7 +2807,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new MapConstContext(_localctx); enterOuterAlt(_localctx, 7); { - setState(318); + setState(321); map_entity(); } break; @@ -2787,7 +2815,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new NullConstContext(_localctx); enterOuterAlt(_localctx, 8); { - setState(319); + setState(322); match(NULL); } break; @@ -2795,13 +2823,13 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new ExistsFuncContext(_localctx); enterOuterAlt(_localctx, 9); { - setState(320); + setState(323); match(EXISTS); - setState(321); + setState(324); match(LPAREN); - setState(322); + setState(325); match(IDENTIFIER); - setState(323); + setState(326); match(RPAREN); } break; @@ -2809,11 +2837,11 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new CondExpr_parenContext(_localctx); enterOuterAlt(_localctx, 10); { - setState(324); + setState(327); match(LPAREN); - setState(325); + setState(328); conditional_expr(); - setState(326); + setState(329); match(RPAREN); } break; @@ -2821,7 +2849,7 @@ public final Identifier_operandContext identifier_operand() throws RecognitionEx _localctx = new FuncContext(_localctx); enterOuterAlt(_localctx, 11); { - setState(328); + setState(331); functions(); } break; @@ -2869,7 +2897,7 @@ public final Default_operandContext default_operand() throws RecognitionExceptio _localctx = new DefaultContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(331); + setState(334); match(DEFAULT); } } @@ -2911,13 +2939,13 @@ public final Lambda_without_argsContext lambda_without_args() throws Recognition try { enterOuterAlt(_localctx, 1); { - setState(333); + setState(336); match(LPAREN); - setState(334); + setState(337); match(RPAREN); - setState(335); + setState(338); match(LAMBDA_OP); - setState(336); + setState(339); transformation_expr(); } } @@ -2963,31 +2991,31 @@ public final Lambda_with_argsContext lambda_with_args() throws RecognitionExcept Lambda_with_argsContext _localctx = new Lambda_with_argsContext(_ctx, getState()); enterRule(_localctx, 54, RULE_lambda_with_args); try { - setState(348); + setState(351); switch (_input.LA(1)) { case LPAREN: enterOuterAlt(_localctx, 1); { - setState(338); + setState(341); match(LPAREN); - setState(339); + setState(342); lambda_variables(); - setState(340); + setState(343); match(RPAREN); - setState(341); + setState(344); match(LAMBDA_OP); - setState(342); + setState(345); transformation_expr(); } break; case IDENTIFIER: enterOuterAlt(_localctx, 2); { - setState(344); + setState(347); single_lambda_variable(); - setState(345); + setState(348); match(LAMBDA_OP); - setState(346); + setState(349); transformation_expr(); } break; @@ -3038,21 +3066,21 @@ public final Lambda_variablesContext lambda_variables() throws RecognitionExcept try { enterOuterAlt(_localctx, 1); { - setState(350); + setState(353); lambda_variable(); - setState(355); + setState(358); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(351); + setState(354); match(COMMA); - setState(352); + setState(355); lambda_variable(); } } - setState(357); + setState(360); _errHandler.sync(this); _la = _input.LA(1); } @@ -3093,7 +3121,7 @@ public final Single_lambda_variableContext single_lambda_variable() throws Recog try { enterOuterAlt(_localctx, 1); { - setState(358); + setState(361); lambda_variable(); } } @@ -3130,7 +3158,7 @@ public final Lambda_variableContext lambda_variable() throws RecognitionExceptio try { enterOuterAlt(_localctx, 1); { - setState(360); + setState(363); match(IDENTIFIER); } } @@ -3187,21 +3215,21 @@ public final Match_exprContext match_expr() throws RecognitionException { _localctx = new MatchClausesContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(362); + setState(365); match(MATCH); - setState(363); + setState(366); match(LBRACE); - setState(364); + setState(367); match_clauses(); - setState(365); + setState(368); match(COMMA); - setState(366); + setState(369); match(DEFAULT); - setState(367); + setState(370); match(MATCH_ACTION); - setState(368); + setState(371); match_clause_action(); - setState(369); + setState(372); match(RBRACE); } } @@ -3248,23 +3276,23 @@ public final Match_clausesContext match_clauses() throws RecognitionException { int _alt; enterOuterAlt(_localctx, 1); { - setState(371); + setState(374); match_clause(); - setState(376); + setState(379); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,27,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(372); + setState(375); match(COMMA); - setState(373); + setState(376); match_clause(); } } } - setState(378); + setState(381); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,27,_ctx); } @@ -3309,11 +3337,11 @@ public final Match_clauseContext match_clause() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(379); + setState(382); match_clause_check(); - setState(380); + setState(383); match(MATCH_ACTION); - setState(381); + setState(384); match_clause_action(); } } @@ -3361,7 +3389,7 @@ public final Match_clause_actionContext match_clause_action() throws Recognition _localctx = new MatchClauseActionContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(383); + setState(386); transformation_expr(); } } @@ -3409,13 +3437,13 @@ public final Match_clause_checkContext match_clause_check() throws RecognitionEx Match_clause_checkContext _localctx = new Match_clause_checkContext(_ctx, getState()); enterRule(_localctx, 70, RULE_match_clause_check); try { - setState(387); + setState(390); switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { case 1: _localctx = new MatchClauseCheckExprContext(_localctx); enterOuterAlt(_localctx, 1); { - setState(385); + setState(388); logical_expr(); } break; @@ -3423,7 +3451,7 @@ public final Match_clause_checkContext match_clause_check() throws RecognitionEx _localctx = new MatchClauseCheckExprContext(_localctx); enterOuterAlt(_localctx, 2); { - setState(386); + setState(389); conditional_expr(); } break; @@ -3502,143 +3530,144 @@ private boolean arithmetic_expr_mul_sempred(Arithmetic_expr_mulContext _localctx } public static final String _serializedATN = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\39\u0188\4\2\t\2\4"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3:\u018b\4\2\t\2\4"+ "\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+ "\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\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\3\3\3\3\5\3\\\n\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\5\4m\n\4\3\5\3\5\3\5\3\5\5\5s\n\5\3\6\3\6"+ - "\3\6\3\6\5\6y\n\6\3\7\3\7\3\b\3\b\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\n"+ - "\3\n\3\n\3\n\3\n\3\n\3\n\5\n\u008e\n\n\3\13\3\13\3\13\3\13\3\13\3\13\3"+ - "\13\3\13\3\13\5\13\u0099\n\13\3\f\3\f\5\f\u009d\n\f\3\r\3\r\3\r\3\r\3"+ - "\r\3\r\3\r\3\r\5\r\u00a7\n\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3"+ - "\16\3\16\3\16\5\16\u00b4\n\16\3\16\3\16\3\16\3\16\7\16\u00ba\n\16\f\16"+ - "\16\16\u00bd\13\16\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\21\5"+ - "\21\u00c9\n\21\3\22\3\22\3\22\3\22\5\22\u00cf\n\22\3\22\3\22\3\22\3\22"+ - "\3\22\3\22\3\22\3\22\3\22\7\22\u00da\n\22\f\22\16\22\u00dd\13\22\3\23"+ - "\3\23\3\23\3\23\3\23\3\23\5\23\u00e5\n\23\3\24\3\24\3\24\3\24\3\24\3\24"+ - "\3\24\3\24\3\24\5\24\u00f0\n\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24"+ - "\3\24\3\24\3\24\3\24\7\24\u00fe\n\24\f\24\16\24\u0101\13\24\3\25\3\25"+ - "\3\25\3\25\3\25\3\25\5\25\u0109\n\25\3\26\3\26\3\26\3\26\3\26\3\26\3\26"+ - "\3\26\3\26\7\26\u0114\n\26\f\26\16\26\u0117\13\26\3\27\3\27\3\27\3\27"+ - "\3\27\3\27\3\27\3\27\3\27\7\27\u0122\n\27\f\27\16\27\u0125\13\27\3\30"+ - "\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31"+ - "\3\31\3\31\3\31\5\31\u0139\n\31\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32"+ - "\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\5\32\u014c\n\32\3\33\3\33"+ - "\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35"+ - "\3\35\5\35\u015f\n\35\3\36\3\36\3\36\7\36\u0164\n\36\f\36\16\36\u0167"+ - "\13\36\3\37\3\37\3 \3 \3!\3!\3!\3!\3!\3!\3!\3!\3!\3\"\3\"\3\"\7\"\u0179"+ - "\n\"\f\"\16\"\u017c\13\"\3#\3#\3#\3#\3$\3$\3%\3%\5%\u0186\n%\3%\2\7\32"+ - "\"&*,&\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<"+ - ">@BDFH\2\4\3\2\23\30\3\2\f\r\u01a0\2J\3\2\2\2\4[\3\2\2\2\6l\3\2\2\2\b"+ - "r\3\2\2\2\nx\3\2\2\2\fz\3\2\2\2\16|\3\2\2\2\20~\3\2\2\2\22\u008d\3\2\2"+ - "\2\24\u0098\3\2\2\2\26\u009c\3\2\2\2\30\u00a6\3\2\2\2\32\u00b3\3\2\2\2"+ - "\34\u00be\3\2\2\2\36\u00c0\3\2\2\2 \u00c8\3\2\2\2\"\u00ce\3\2\2\2$\u00e4"+ - "\3\2\2\2&\u00ef\3\2\2\2(\u0108\3\2\2\2*\u010a\3\2\2\2,\u0118\3\2\2\2."+ - "\u0126\3\2\2\2\60\u0138\3\2\2\2\62\u014b\3\2\2\2\64\u014d\3\2\2\2\66\u014f"+ - "\3\2\2\28\u015e\3\2\2\2:\u0160\3\2\2\2<\u0168\3\2\2\2>\u016a\3\2\2\2@"+ - "\u016c\3\2\2\2B\u0175\3\2\2\2D\u017d\3\2\2\2F\u0181\3\2\2\2H\u0185\3\2"+ - "\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2M\\\5\22\n\2NO\7-\2\2OP\5\4\3\2PQ\7"+ - ".\2\2Q\\\3\2\2\2R\\\5*\26\2S\\\5\34\17\2T\\\5\32\16\2U\\\5\24\13\2V\\"+ - "\5\30\r\2W\\\5@!\2X\\\5\6\4\2Y\\\5\b\5\2Z\\\5\n\6\2[M\3\2\2\2[N\3\2\2"+ - "\2[R\3\2\2\2[S\3\2\2\2[T\3\2\2\2[U\3\2\2\2[V\3\2\2\2[W\3\2\2\2[X\3\2\2"+ - "\2[Y\3\2\2\2[Z\3\2\2\2\\\5\3\2\2\2]^\7\66\2\2^_\7\16\2\2_m\5\4\3\2`a\7"+ - "\66\2\2ab\7\17\2\2bm\5\4\3\2cd\7\66\2\2de\7\20\2\2em\5\4\3\2fg\7\66\2"+ - "\2gh\7\21\2\2hm\5\4\3\2ij\7\66\2\2jk\7\22\2\2km\5\4\3\2l]\3\2\2\2l`\3"+ - "\2\2\2lc\3\2\2\2lf\3\2\2\2li\3\2\2\2m\7\3\2\2\2no\7&\2\2os\7\66\2\2pq"+ - "\7$\2\2qs\7\66\2\2rn\3\2\2\2rp\3\2\2\2s\t\3\2\2\2tu\7\66\2\2uy\7&\2\2"+ - "vw\7\66\2\2wy\7$\2\2xt\3\2\2\2xv\3\2\2\2y\13\3\2\2\2z{\5\24\13\2{\r\3"+ - "\2\2\2|}\5\4\3\2}\17\3\2\2\2~\177\5\4\3\2\177\21\3\2\2\2\u0080\u0081\5"+ - "\f\7\2\u0081\u0082\7\31\2\2\u0082\u0083\5\16\b\2\u0083\u0084\7\32\2\2"+ - "\u0084\u0085\5\20\t\2\u0085\u008e\3\2\2\2\u0086\u0087\7\33\2\2\u0087\u0088"+ - "\5\f\7\2\u0088\u0089\7\34\2\2\u0089\u008a\5\16\b\2\u008a\u008b\7\35\2"+ - "\2\u008b\u008c\5\20\t\2\u008c\u008e\3\2\2\2\u008d\u0080\3\2\2\2\u008d"+ - "\u0086\3\2\2\2\u008e\23\3\2\2\2\u008f\u0090\5\26\f\2\u0090\u0091\7\t\2"+ - "\2\u0091\u0092\5\24\13\2\u0092\u0099\3\2\2\2\u0093\u0094\5\26\f\2\u0094"+ - "\u0095\7\n\2\2\u0095\u0096\5\24\13\2\u0096\u0099\3\2\2\2\u0097\u0099\5"+ - "\26\f\2\u0098\u008f\3\2\2\2\u0098\u0093\3\2\2\2\u0098\u0097\3\2\2\2\u0099"+ - "\25\3\2\2\2\u009a\u009d\5\32\16\2\u009b\u009d\5\30\r\2\u009c\u009a\3\2"+ - "\2\2\u009c\u009b\3\2\2\2\u009d\27\3\2\2\2\u009e\u009f\5\62\32\2\u009f"+ - "\u00a0\7\3\2\2\u00a0\u00a1\5\26\f\2\u00a1\u00a7\3\2\2\2\u00a2\u00a3\5"+ - "\62\32\2\u00a3\u00a4\7/\2\2\u00a4\u00a5\5\26\f\2\u00a5\u00a7\3\2\2\2\u00a6"+ - "\u009e\3\2\2\2\u00a6\u00a2\3\2\2\2\u00a7\31\3\2\2\2\u00a8\u00a9\b\16\1"+ - "\2\u00a9\u00aa\7\13\2\2\u00aa\u00ab\7-\2\2\u00ab\u00ac\5\24\13\2\u00ac"+ - "\u00ad\7.\2\2\u00ad\u00b4\3\2\2\2\u00ae\u00af\7-\2\2\u00af\u00b0\5\24"+ - "\13\2\u00b0\u00b1\7.\2\2\u00b1\u00b4\3\2\2\2\u00b2\u00b4\5\62\32\2\u00b3"+ - "\u00a8\3\2\2\2\u00b3\u00ae\3\2\2\2\u00b3\u00b2\3\2\2\2\u00b4\u00bb\3\2"+ - "\2\2\u00b5\u00b6\f\6\2\2\u00b6\u00b7\5\36\20\2\u00b7\u00b8\5\32\16\7\u00b8"+ - "\u00ba\3\2\2\2\u00b9\u00b5\3\2\2\2\u00ba\u00bd\3\2\2\2\u00bb\u00b9\3\2"+ - "\2\2\u00bb\u00bc\3\2\2\2\u00bc\33\3\2\2\2\u00bd\u00bb\3\2\2\2\u00be\u00bf"+ - "\5\62\32\2\u00bf\35\3\2\2\2\u00c0\u00c1\t\2\2\2\u00c1\37\3\2\2\2\u00c2"+ - "\u00c3\7-\2\2\u00c3\u00c4\5\"\22\2\u00c4\u00c5\7.\2\2\u00c5\u00c9\3\2"+ - "\2\2\u00c6\u00c7\7-\2\2\u00c7\u00c9\7.\2\2\u00c8\u00c2\3\2\2\2\u00c8\u00c6"+ - "\3\2\2\2\u00c9!\3\2\2\2\u00ca\u00cb\b\22\1\2\u00cb\u00cf\5\62\32\2\u00cc"+ - "\u00cf\5\22\n\2\u00cd\u00cf\5\32\16\2\u00ce\u00ca\3\2\2\2\u00ce\u00cc"+ - "\3\2\2\2\u00ce\u00cd\3\2\2\2\u00cf\u00db\3\2\2\2\u00d0\u00d1\f\7\2\2\u00d1"+ - "\u00d2\7\7\2\2\u00d2\u00da\5\62\32\2\u00d3\u00d4\f\5\2\2\u00d4\u00d5\7"+ - "\7\2\2\u00d5\u00da\5\22\n\2\u00d6\u00d7\f\3\2\2\u00d7\u00d8\7\7\2\2\u00d8"+ - "\u00da\5\32\16\2\u00d9\u00d0\3\2\2\2\u00d9\u00d3\3\2\2\2\u00d9\u00d6\3"+ - "\2\2\2\u00da\u00dd\3\2\2\2\u00db\u00d9\3\2\2\2\u00db\u00dc\3\2\2\2\u00dc"+ - "#\3\2\2\2\u00dd\u00db\3\2\2\2\u00de\u00df\7+\2\2\u00df\u00e5\7,\2\2\u00e0"+ - "\u00e1\7+\2\2\u00e1\u00e2\5\"\22\2\u00e2\u00e3\7,\2\2\u00e3\u00e5\3\2"+ - "\2\2\u00e4\u00de\3\2\2\2\u00e4\u00e0\3\2\2\2\u00e5%\3\2\2\2\u00e6\u00e7"+ - "\b\24\1\2\u00e7\u00e8\5\62\32\2\u00e8\u00e9\7\32\2\2\u00e9\u00ea\5\4\3"+ - "\2\u00ea\u00f0\3\2\2\2\u00eb\u00ec\5\32\16\2\u00ec\u00ed\7\32\2\2\u00ed"+ - "\u00ee\5\4\3\2\u00ee\u00f0\3\2\2\2\u00ef\u00e6\3\2\2\2\u00ef\u00eb\3\2"+ - "\2\2\u00f0\u00ff\3\2\2\2\u00f1\u00f2\f\4\2\2\u00f2\u00f3\7\7\2\2\u00f3"+ - "\u00f4\5\62\32\2\u00f4\u00f5\7\32\2\2\u00f5\u00f6\5\4\3\2\u00f6\u00fe"+ - "\3\2\2\2\u00f7\u00f8\f\3\2\2\u00f8\u00f9\7\7\2\2\u00f9\u00fa\5\32\16\2"+ - "\u00fa\u00fb\7\32\2\2\u00fb\u00fc\5\4\3\2\u00fc\u00fe\3\2\2\2\u00fd\u00f1"+ - "\3\2\2\2\u00fd\u00f7\3\2\2\2\u00fe\u0101\3\2\2\2\u00ff\u00fd\3\2\2\2\u00ff"+ - "\u0100\3\2\2\2\u0100\'\3\2\2\2\u0101\u00ff\3\2\2\2\u0102\u0103\7)\2\2"+ - "\u0103\u0104\5&\24\2\u0104\u0105\7*\2\2\u0105\u0109\3\2\2\2\u0106\u0107"+ - "\7)\2\2\u0107\u0109\7*\2\2\u0108\u0102\3\2\2\2\u0108\u0106\3\2\2\2\u0109"+ - ")\3\2\2\2\u010a\u010b\b\26\1\2\u010b\u010c\5,\27\2\u010c\u0115\3\2\2\2"+ - "\u010d\u010e\f\4\2\2\u010e\u010f\7%\2\2\u010f\u0114\5,\27\2\u0110\u0111"+ - "\f\3\2\2\u0111\u0112\7#\2\2\u0112\u0114\5,\27\2\u0113\u010d\3\2\2\2\u0113"+ - "\u0110\3\2\2\2\u0114\u0117\3\2\2\2\u0115\u0113\3\2\2\2\u0115\u0116\3\2"+ - "\2\2\u0116+\3\2\2\2\u0117\u0115\3\2\2\2\u0118\u0119\b\27\1\2\u0119\u011a"+ - "\5\60\31\2\u011a\u0123\3\2\2\2\u011b\u011c\f\4\2\2\u011c\u011d\7(\2\2"+ - "\u011d\u0122\5,\27\5\u011e\u011f\f\3\2\2\u011f\u0120\7\'\2\2\u0120\u0122"+ - "\5,\27\4\u0121\u011b\3\2\2\2\u0121\u011e\3\2\2\2\u0122\u0125\3\2\2\2\u0123"+ - "\u0121\3\2\2\2\u0123\u0124\3\2\2\2\u0124-\3\2\2\2\u0125\u0123\3\2\2\2"+ - "\u0126\u0127\7\66\2\2\u0127\u0128\5 \21\2\u0128/\3\2\2\2\u0129\u0139\5"+ - ".\30\2\u012a\u0139\7\63\2\2\u012b\u0139\7\62\2\2\u012c\u0139\7\65\2\2"+ - "\u012d\u0139\7\64\2\2\u012e\u0139\7\66\2\2\u012f\u0139\7\37\2\2\u0130"+ - "\u0131\7-\2\2\u0131\u0132\5*\26\2\u0132\u0133\7.\2\2\u0133\u0139\3\2\2"+ - "\2\u0134\u0135\7-\2\2\u0135\u0136\5\22\n\2\u0136\u0137\7.\2\2\u0137\u0139"+ - "\3\2\2\2\u0138\u0129\3\2\2\2\u0138\u012a\3\2\2\2\u0138\u012b\3\2\2\2\u0138"+ - "\u012c\3\2\2\2\u0138\u012d\3\2\2\2\u0138\u012e\3\2\2\2\u0138\u012f\3\2"+ - "\2\2\u0138\u0130\3\2\2\2\u0138\u0134\3\2\2\2\u0139\61\3\2\2\2\u013a\u014c"+ - "\t\3\2\2\u013b\u014c\58\35\2\u013c\u014c\5\66\34\2\u013d\u014c\5*\26\2"+ - "\u013e\u014c\7\67\2\2\u013f\u014c\5$\23\2\u0140\u014c\5(\25\2\u0141\u014c"+ - "\7\36\2\2\u0142\u0143\7\60\2\2\u0143\u0144\7-\2\2\u0144\u0145\7\66\2\2"+ - "\u0145\u014c\7.\2\2\u0146\u0147\7-\2\2\u0147\u0148\5\22\n\2\u0148\u0149"+ - "\7.\2\2\u0149\u014c\3\2\2\2\u014a\u014c\5.\30\2\u014b\u013a\3\2\2\2\u014b"+ - "\u013b\3\2\2\2\u014b\u013c\3\2\2\2\u014b\u013d\3\2\2\2\u014b\u013e\3\2"+ - "\2\2\u014b\u013f\3\2\2\2\u014b\u0140\3\2\2\2\u014b\u0141\3\2\2\2\u014b"+ - "\u0142\3\2\2\2\u014b\u0146\3\2\2\2\u014b\u014a\3\2\2\2\u014c\63\3\2\2"+ - "\2\u014d\u014e\7!\2\2\u014e\65\3\2\2\2\u014f\u0150\7-\2\2\u0150\u0151"+ - "\7.\2\2\u0151\u0152\7\4\2\2\u0152\u0153\5\4\3\2\u0153\67\3\2\2\2\u0154"+ - "\u0155\7-\2\2\u0155\u0156\5:\36\2\u0156\u0157\7.\2\2\u0157\u0158\7\4\2"+ - "\2\u0158\u0159\5\4\3\2\u0159\u015f\3\2\2\2\u015a\u015b\5<\37\2\u015b\u015c"+ - "\7\4\2\2\u015c\u015d\5\4\3\2\u015d\u015f\3\2\2\2\u015e\u0154\3\2\2\2\u015e"+ - "\u015a\3\2\2\2\u015f9\3\2\2\2\u0160\u0165\5> \2\u0161\u0162\7\7\2\2\u0162"+ - "\u0164\5> \2\u0163\u0161\3\2\2\2\u0164\u0167\3\2\2\2\u0165\u0163\3\2\2"+ - "\2\u0165\u0166\3\2\2\2\u0166;\3\2\2\2\u0167\u0165\3\2\2\2\u0168\u0169"+ - "\5> \2\u0169=\3\2\2\2\u016a\u016b\7\66\2\2\u016b?\3\2\2\2\u016c\u016d"+ - "\7 \2\2\u016d\u016e\7)\2\2\u016e\u016f\5B\"\2\u016f\u0170\7\7\2\2\u0170"+ - "\u0171\7!\2\2\u0171\u0172\7\"\2\2\u0172\u0173\5F$\2\u0173\u0174\7*\2\2"+ - "\u0174A\3\2\2\2\u0175\u017a\5D#\2\u0176\u0177\7\7\2\2\u0177\u0179\5D#"+ - "\2\u0178\u0176\3\2\2\2\u0179\u017c\3\2\2\2\u017a\u0178\3\2\2\2\u017a\u017b"+ - "\3\2\2\2\u017bC\3\2\2\2\u017c\u017a\3\2\2\2\u017d\u017e\5H%\2\u017e\u017f"+ - "\7\"\2\2\u017f\u0180\5F$\2\u0180E\3\2\2\2\u0181\u0182\5\4\3\2\u0182G\3"+ - "\2\2\2\u0183\u0186\5\24\13\2\u0184\u0186\5\22\n\2\u0185\u0183\3\2\2\2"+ - "\u0185\u0184\3\2\2\2\u0186I\3\2\2\2\37[lrx\u008d\u0098\u009c\u00a6\u00b3"+ - "\u00bb\u00c8\u00ce\u00d9\u00db\u00e4\u00ef\u00fd\u00ff\u0108\u0113\u0115"+ - "\u0121\u0123\u0138\u014b\u015e\u0165\u017a\u0185"; + "\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\5\4p\n\4\3\5\3\5\3\5\3\5\5\5"+ + "v\n\5\3\6\3\6\3\6\3\6\5\6|\n\6\3\7\3\7\3\b\3\b\3\t\3\t\3\n\3\n\3\n\3\n"+ + "\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\5\n\u0091\n\n\3\13\3\13\3\13\3\13"+ + "\3\13\3\13\3\13\3\13\3\13\5\13\u009c\n\13\3\f\3\f\5\f\u00a0\n\f\3\r\3"+ + "\r\3\r\3\r\3\r\3\r\3\r\3\r\5\r\u00aa\n\r\3\16\3\16\3\16\3\16\3\16\3\16"+ + "\3\16\3\16\3\16\3\16\3\16\5\16\u00b7\n\16\3\16\3\16\3\16\3\16\7\16\u00bd"+ + "\n\16\f\16\16\16\u00c0\13\16\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21\3"+ + "\21\3\21\5\21\u00cc\n\21\3\22\3\22\3\22\3\22\5\22\u00d2\n\22\3\22\3\22"+ + "\3\22\3\22\3\22\3\22\3\22\3\22\3\22\7\22\u00dd\n\22\f\22\16\22\u00e0\13"+ + "\22\3\23\3\23\3\23\3\23\3\23\3\23\5\23\u00e8\n\23\3\24\3\24\3\24\3\24"+ + "\3\24\3\24\3\24\3\24\3\24\5\24\u00f3\n\24\3\24\3\24\3\24\3\24\3\24\3\24"+ + "\3\24\3\24\3\24\3\24\3\24\3\24\7\24\u0101\n\24\f\24\16\24\u0104\13\24"+ + "\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u010c\n\25\3\26\3\26\3\26\3\26\3\26"+ + "\3\26\3\26\3\26\3\26\7\26\u0117\n\26\f\26\16\26\u011a\13\26\3\27\3\27"+ + "\3\27\3\27\3\27\3\27\3\27\3\27\3\27\7\27\u0125\n\27\f\27\16\27\u0128\13"+ + "\27\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3"+ + "\31\3\31\3\31\3\31\3\31\5\31\u013c\n\31\3\32\3\32\3\32\3\32\3\32\3\32"+ + "\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\5\32\u014f\n\32"+ + "\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\3\35\3\35\3\35"+ + "\3\35\3\35\3\35\5\35\u0162\n\35\3\36\3\36\3\36\7\36\u0167\n\36\f\36\16"+ + "\36\u016a\13\36\3\37\3\37\3 \3 \3!\3!\3!\3!\3!\3!\3!\3!\3!\3\"\3\"\3\""+ + "\7\"\u017c\n\"\f\"\16\"\u017f\13\"\3#\3#\3#\3#\3$\3$\3%\3%\5%\u0189\n"+ + "%\3%\2\7\32\"&*,&\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62"+ + "\64\668:<>@BDFH\2\4\3\2\24\31\3\2\f\r\u01a4\2J\3\2\2\2\4[\3\2\2\2\6o\3"+ + "\2\2\2\bu\3\2\2\2\n{\3\2\2\2\f}\3\2\2\2\16\177\3\2\2\2\20\u0081\3\2\2"+ + "\2\22\u0090\3\2\2\2\24\u009b\3\2\2\2\26\u009f\3\2\2\2\30\u00a9\3\2\2\2"+ + "\32\u00b6\3\2\2\2\34\u00c1\3\2\2\2\36\u00c3\3\2\2\2 \u00cb\3\2\2\2\"\u00d1"+ + "\3\2\2\2$\u00e7\3\2\2\2&\u00f2\3\2\2\2(\u010b\3\2\2\2*\u010d\3\2\2\2,"+ + "\u011b\3\2\2\2.\u0129\3\2\2\2\60\u013b\3\2\2\2\62\u014e\3\2\2\2\64\u0150"+ + "\3\2\2\2\66\u0152\3\2\2\28\u0161\3\2\2\2:\u0163\3\2\2\2<\u016b\3\2\2\2"+ + ">\u016d\3\2\2\2@\u016f\3\2\2\2B\u0178\3\2\2\2D\u0180\3\2\2\2F\u0184\3"+ + "\2\2\2H\u0188\3\2\2\2JK\5\4\3\2KL\7\2\2\3L\3\3\2\2\2M\\\5\22\n\2NO\7."+ + "\2\2OP\5\4\3\2PQ\7/\2\2Q\\\3\2\2\2R\\\5*\26\2S\\\5\34\17\2T\\\5\32\16"+ + "\2U\\\5\24\13\2V\\\5\30\r\2W\\\5@!\2X\\\5\6\4\2Y\\\5\b\5\2Z\\\5\n\6\2"+ + "[M\3\2\2\2[N\3\2\2\2[R\3\2\2\2[S\3\2\2\2[T\3\2\2\2[U\3\2\2\2[V\3\2\2\2"+ + "[W\3\2\2\2[X\3\2\2\2[Y\3\2\2\2[Z\3\2\2\2\\\5\3\2\2\2]^\7\67\2\2^_\7\16"+ + "\2\2_p\5\4\3\2`a\7\67\2\2ab\7\17\2\2bp\5\4\3\2cd\7\67\2\2de\7\20\2\2e"+ + "p\5\4\3\2fg\7\67\2\2gh\7\21\2\2hp\5\4\3\2ij\7\67\2\2jk\7\22\2\2kp\5\4"+ + "\3\2lm\7\67\2\2mn\7\23\2\2np\5\4\3\2o]\3\2\2\2o`\3\2\2\2oc\3\2\2\2of\3"+ + "\2\2\2oi\3\2\2\2ol\3\2\2\2p\7\3\2\2\2qr\7\'\2\2rv\7\67\2\2st\7%\2\2tv"+ + "\7\67\2\2uq\3\2\2\2us\3\2\2\2v\t\3\2\2\2wx\7\67\2\2x|\7\'\2\2yz\7\67\2"+ + "\2z|\7%\2\2{w\3\2\2\2{y\3\2\2\2|\13\3\2\2\2}~\5\24\13\2~\r\3\2\2\2\177"+ + "\u0080\5\4\3\2\u0080\17\3\2\2\2\u0081\u0082\5\4\3\2\u0082\21\3\2\2\2\u0083"+ + "\u0084\5\f\7\2\u0084\u0085\7\32\2\2\u0085\u0086\5\16\b\2\u0086\u0087\7"+ + "\33\2\2\u0087\u0088\5\20\t\2\u0088\u0091\3\2\2\2\u0089\u008a\7\34\2\2"+ + "\u008a\u008b\5\f\7\2\u008b\u008c\7\35\2\2\u008c\u008d\5\16\b\2\u008d\u008e"+ + "\7\36\2\2\u008e\u008f\5\20\t\2\u008f\u0091\3\2\2\2\u0090\u0083\3\2\2\2"+ + "\u0090\u0089\3\2\2\2\u0091\23\3\2\2\2\u0092\u0093\5\26\f\2\u0093\u0094"+ + "\7\t\2\2\u0094\u0095\5\24\13\2\u0095\u009c\3\2\2\2\u0096\u0097\5\26\f"+ + "\2\u0097\u0098\7\n\2\2\u0098\u0099\5\24\13\2\u0099\u009c\3\2\2\2\u009a"+ + "\u009c\5\26\f\2\u009b\u0092\3\2\2\2\u009b\u0096\3\2\2\2\u009b\u009a\3"+ + "\2\2\2\u009c\25\3\2\2\2\u009d\u00a0\5\32\16\2\u009e\u00a0\5\30\r\2\u009f"+ + "\u009d\3\2\2\2\u009f\u009e\3\2\2\2\u00a0\27\3\2\2\2\u00a1\u00a2\5\62\32"+ + "\2\u00a2\u00a3\7\3\2\2\u00a3\u00a4\5\26\f\2\u00a4\u00aa\3\2\2\2\u00a5"+ + "\u00a6\5\62\32\2\u00a6\u00a7\7\60\2\2\u00a7\u00a8\5\26\f\2\u00a8\u00aa"+ + "\3\2\2\2\u00a9\u00a1\3\2\2\2\u00a9\u00a5\3\2\2\2\u00aa\31\3\2\2\2\u00ab"+ + "\u00ac\b\16\1\2\u00ac\u00ad\7\13\2\2\u00ad\u00ae\7.\2\2\u00ae\u00af\5"+ + "\24\13\2\u00af\u00b0\7/\2\2\u00b0\u00b7\3\2\2\2\u00b1\u00b2\7.\2\2\u00b2"+ + "\u00b3\5\24\13\2\u00b3\u00b4\7/\2\2\u00b4\u00b7\3\2\2\2\u00b5\u00b7\5"+ + "\62\32\2\u00b6\u00ab\3\2\2\2\u00b6\u00b1\3\2\2\2\u00b6\u00b5\3\2\2\2\u00b7"+ + "\u00be\3\2\2\2\u00b8\u00b9\f\6\2\2\u00b9\u00ba\5\36\20\2\u00ba\u00bb\5"+ + "\32\16\7\u00bb\u00bd\3\2\2\2\u00bc\u00b8\3\2\2\2\u00bd\u00c0\3\2\2\2\u00be"+ + "\u00bc\3\2\2\2\u00be\u00bf\3\2\2\2\u00bf\33\3\2\2\2\u00c0\u00be\3\2\2"+ + "\2\u00c1\u00c2\5\62\32\2\u00c2\35\3\2\2\2\u00c3\u00c4\t\2\2\2\u00c4\37"+ + "\3\2\2\2\u00c5\u00c6\7.\2\2\u00c6\u00c7\5\"\22\2\u00c7\u00c8\7/\2\2\u00c8"+ + "\u00cc\3\2\2\2\u00c9\u00ca\7.\2\2\u00ca\u00cc\7/\2\2\u00cb\u00c5\3\2\2"+ + "\2\u00cb\u00c9\3\2\2\2\u00cc!\3\2\2\2\u00cd\u00ce\b\22\1\2\u00ce\u00d2"+ + "\5\62\32\2\u00cf\u00d2\5\22\n\2\u00d0\u00d2\5\32\16\2\u00d1\u00cd\3\2"+ + "\2\2\u00d1\u00cf\3\2\2\2\u00d1\u00d0\3\2\2\2\u00d2\u00de\3\2\2\2\u00d3"+ + "\u00d4\f\7\2\2\u00d4\u00d5\7\7\2\2\u00d5\u00dd\5\62\32\2\u00d6\u00d7\f"+ + "\5\2\2\u00d7\u00d8\7\7\2\2\u00d8\u00dd\5\22\n\2\u00d9\u00da\f\3\2\2\u00da"+ + "\u00db\7\7\2\2\u00db\u00dd\5\32\16\2\u00dc\u00d3\3\2\2\2\u00dc\u00d6\3"+ + "\2\2\2\u00dc\u00d9\3\2\2\2\u00dd\u00e0\3\2\2\2\u00de\u00dc\3\2\2\2\u00de"+ + "\u00df\3\2\2\2\u00df#\3\2\2\2\u00e0\u00de\3\2\2\2\u00e1\u00e2\7,\2\2\u00e2"+ + "\u00e8\7-\2\2\u00e3\u00e4\7,\2\2\u00e4\u00e5\5\"\22\2\u00e5\u00e6\7-\2"+ + "\2\u00e6\u00e8\3\2\2\2\u00e7\u00e1\3\2\2\2\u00e7\u00e3\3\2\2\2\u00e8%"+ + "\3\2\2\2\u00e9\u00ea\b\24\1\2\u00ea\u00eb\5\62\32\2\u00eb\u00ec\7\33\2"+ + "\2\u00ec\u00ed\5\4\3\2\u00ed\u00f3\3\2\2\2\u00ee\u00ef\5\32\16\2\u00ef"+ + "\u00f0\7\33\2\2\u00f0\u00f1\5\4\3\2\u00f1\u00f3\3\2\2\2\u00f2\u00e9\3"+ + "\2\2\2\u00f2\u00ee\3\2\2\2\u00f3\u0102\3\2\2\2\u00f4\u00f5\f\4\2\2\u00f5"+ + "\u00f6\7\7\2\2\u00f6\u00f7\5\62\32\2\u00f7\u00f8\7\33\2\2\u00f8\u00f9"+ + "\5\4\3\2\u00f9\u0101\3\2\2\2\u00fa\u00fb\f\3\2\2\u00fb\u00fc\7\7\2\2\u00fc"+ + "\u00fd\5\32\16\2\u00fd\u00fe\7\33\2\2\u00fe\u00ff\5\4\3\2\u00ff\u0101"+ + "\3\2\2\2\u0100\u00f4\3\2\2\2\u0100\u00fa\3\2\2\2\u0101\u0104\3\2\2\2\u0102"+ + "\u0100\3\2\2\2\u0102\u0103\3\2\2\2\u0103\'\3\2\2\2\u0104\u0102\3\2\2\2"+ + "\u0105\u0106\7*\2\2\u0106\u0107\5&\24\2\u0107\u0108\7+\2\2\u0108\u010c"+ + "\3\2\2\2\u0109\u010a\7*\2\2\u010a\u010c\7+\2\2\u010b\u0105\3\2\2\2\u010b"+ + "\u0109\3\2\2\2\u010c)\3\2\2\2\u010d\u010e\b\26\1\2\u010e\u010f\5,\27\2"+ + "\u010f\u0118\3\2\2\2\u0110\u0111\f\4\2\2\u0111\u0112\7&\2\2\u0112\u0117"+ + "\5,\27\2\u0113\u0114\f\3\2\2\u0114\u0115\7$\2\2\u0115\u0117\5,\27\2\u0116"+ + "\u0110\3\2\2\2\u0116\u0113\3\2\2\2\u0117\u011a\3\2\2\2\u0118\u0116\3\2"+ + "\2\2\u0118\u0119\3\2\2\2\u0119+\3\2\2\2\u011a\u0118\3\2\2\2\u011b\u011c"+ + "\b\27\1\2\u011c\u011d\5\60\31\2\u011d\u0126\3\2\2\2\u011e\u011f\f\4\2"+ + "\2\u011f\u0120\7)\2\2\u0120\u0125\5,\27\5\u0121\u0122\f\3\2\2\u0122\u0123"+ + "\7(\2\2\u0123\u0125\5,\27\4\u0124\u011e\3\2\2\2\u0124\u0121\3\2\2\2\u0125"+ + "\u0128\3\2\2\2\u0126\u0124\3\2\2\2\u0126\u0127\3\2\2\2\u0127-\3\2\2\2"+ + "\u0128\u0126\3\2\2\2\u0129\u012a\7\67\2\2\u012a\u012b\5 \21\2\u012b/\3"+ + "\2\2\2\u012c\u013c\5.\30\2\u012d\u013c\7\64\2\2\u012e\u013c\7\63\2\2\u012f"+ + "\u013c\7\66\2\2\u0130\u013c\7\65\2\2\u0131\u013c\7\67\2\2\u0132\u013c"+ + "\7 \2\2\u0133\u0134\7.\2\2\u0134\u0135\5*\26\2\u0135\u0136\7/\2\2\u0136"+ + "\u013c\3\2\2\2\u0137\u0138\7.\2\2\u0138\u0139\5\22\n\2\u0139\u013a\7/"+ + "\2\2\u013a\u013c\3\2\2\2\u013b\u012c\3\2\2\2\u013b\u012d\3\2\2\2\u013b"+ + "\u012e\3\2\2\2\u013b\u012f\3\2\2\2\u013b\u0130\3\2\2\2\u013b\u0131\3\2"+ + "\2\2\u013b\u0132\3\2\2\2\u013b\u0133\3\2\2\2\u013b\u0137\3\2\2\2\u013c"+ + "\61\3\2\2\2\u013d\u014f\t\3\2\2\u013e\u014f\58\35\2\u013f\u014f\5\66\34"+ + "\2\u0140\u014f\5*\26\2\u0141\u014f\78\2\2\u0142\u014f\5$\23\2\u0143\u014f"+ + "\5(\25\2\u0144\u014f\7\37\2\2\u0145\u0146\7\61\2\2\u0146\u0147\7.\2\2"+ + "\u0147\u0148\7\67\2\2\u0148\u014f\7/\2\2\u0149\u014a\7.\2\2\u014a\u014b"+ + "\5\22\n\2\u014b\u014c\7/\2\2\u014c\u014f\3\2\2\2\u014d\u014f\5.\30\2\u014e"+ + "\u013d\3\2\2\2\u014e\u013e\3\2\2\2\u014e\u013f\3\2\2\2\u014e\u0140\3\2"+ + "\2\2\u014e\u0141\3\2\2\2\u014e\u0142\3\2\2\2\u014e\u0143\3\2\2\2\u014e"+ + "\u0144\3\2\2\2\u014e\u0145\3\2\2\2\u014e\u0149\3\2\2\2\u014e\u014d\3\2"+ + "\2\2\u014f\63\3\2\2\2\u0150\u0151\7\"\2\2\u0151\65\3\2\2\2\u0152\u0153"+ + "\7.\2\2\u0153\u0154\7/\2\2\u0154\u0155\7\4\2\2\u0155\u0156\5\4\3\2\u0156"+ + "\67\3\2\2\2\u0157\u0158\7.\2\2\u0158\u0159\5:\36\2\u0159\u015a\7/\2\2"+ + "\u015a\u015b\7\4\2\2\u015b\u015c\5\4\3\2\u015c\u0162\3\2\2\2\u015d\u015e"+ + "\5<\37\2\u015e\u015f\7\4\2\2\u015f\u0160\5\4\3\2\u0160\u0162\3\2\2\2\u0161"+ + "\u0157\3\2\2\2\u0161\u015d\3\2\2\2\u01629\3\2\2\2\u0163\u0168\5> \2\u0164"+ + "\u0165\7\7\2\2\u0165\u0167\5> \2\u0166\u0164\3\2\2\2\u0167\u016a\3\2\2"+ + "\2\u0168\u0166\3\2\2\2\u0168\u0169\3\2\2\2\u0169;\3\2\2\2\u016a\u0168"+ + "\3\2\2\2\u016b\u016c\5> \2\u016c=\3\2\2\2\u016d\u016e\7\67\2\2\u016e?"+ + "\3\2\2\2\u016f\u0170\7!\2\2\u0170\u0171\7*\2\2\u0171\u0172\5B\"\2\u0172"+ + "\u0173\7\7\2\2\u0173\u0174\7\"\2\2\u0174\u0175\7#\2\2\u0175\u0176\5F$"+ + "\2\u0176\u0177\7+\2\2\u0177A\3\2\2\2\u0178\u017d\5D#\2\u0179\u017a\7\7"+ + "\2\2\u017a\u017c\5D#\2\u017b\u0179\3\2\2\2\u017c\u017f\3\2\2\2\u017d\u017b"+ + "\3\2\2\2\u017d\u017e\3\2\2\2\u017eC\3\2\2\2\u017f\u017d\3\2\2\2\u0180"+ + "\u0181\5H%\2\u0181\u0182\7#\2\2\u0182\u0183\5F$\2\u0183E\3\2\2\2\u0184"+ + "\u0185\5\4\3\2\u0185G\3\2\2\2\u0186\u0189\5\24\13\2\u0187\u0189\5\22\n"+ + "\2\u0188\u0186\3\2\2\2\u0188\u0187\3\2\2\2\u0189I\3\2\2\2\37[ou{\u0090"+ + "\u009b\u009f\u00a9\u00b6\u00be\u00cb\u00d1\u00dc\u00de\u00e7\u00f2\u0100"+ + "\u0102\u010b\u0116\u0118\u0124\u0126\u013b\u014e\u0161\u0168\u017d\u0188"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java index 04286b84d7..28f1ae4eee 100644 --- a/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java +++ b/metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/BasicStellarTest.java @@ -172,6 +172,77 @@ public void testAssign(){ } + @Test + public void testColonAssign(){ + String query = "foo := 1"; + Map variables = new HashMap(){{ + put("foo",null); + }}; + + // basics, return the assign, set the var with default resolver + Assert.assertEquals(1, run(query,variables)); + Assert.assertEquals(1, variables.get("foo")); + + // test more complex, until we get += + // the else is required.... + query = "if foo == 1 then foo := foo + 1 else foo := foo - 1"; + Assert.assertEquals(2, run(query,variables)); + Assert.assertEquals(2, variables.get("foo")); + + // does it work in a lambda if we explicitly use var name? + { + String expr = "MAP([ foo, bar, baz ], (item) -> count := count + 1 )"; + Map map = new HashMap(){{ + put("foo",1); + put("bar",1); + put("baz",1); + put("count", 0); + }}; + for(int i = 0 ; i < 5; i++){ + run(expr, map); + } + Assert.assertEquals(new Integer(15), (Integer)map.get("count")); + } + + // can we assign one variable to another? + { + String expr = "foo := bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar",999); + }}; + Assert.assertEquals(999,run(expr,map)); + Assert.assertEquals(999,map.get("foo")); + } + + // can we assign one variable to another as a string? + { + String expr = "foo := bar"; + Map map = new HashMap(){{ + put("foo",null); + put("bar","message"); + }}; + Assert.assertEquals("message",run(expr,map)); + Assert.assertEquals("message",map.get("foo")); + } + + } + + @Test + public void testMixedAssign(){ + Map variables = new HashMap(){{ + put("foo",1); + }}; + + // test more complex, until we get += + // the else is required.... + String query = "if foo == 1 then foo := foo + 1 else foo = foo - 1"; + Assert.assertEquals(2, run(query,variables)); + Assert.assertEquals(2, variables.get("foo")); + + } + + @Test public void testPlusAssign(){ String query = "foo += 1"; From be5a84415226ef88795c631d5165614cb6b71b64 Mon Sep 17 00:00:00 2001 From: Otto Fowler Date: Wed, 24 Oct 2018 11:50:27 -0400 Subject: [PATCH 11/11] fix variable name --- .../org/apache/metron/stellar/common/StellarCompiler.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java index 6c2fa79a32..6c6a2cb3f1 100644 --- a/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java +++ b/metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/StellarCompiler.java @@ -364,14 +364,13 @@ public void exitColonAssignExpression(StellarParser.ColonAssignExpressionContext exitCommonAssign(ctx.getStart().getText()); } - private void exitCommonAssign(String varText) { + private void exitCommonAssign(String varName) { final FrameContext.Context context = getArgContext(); expression.tokenDeque.push(new Token<>((tokenDeque, state) -> { // do not check for the existence of the variable, if the // resolver supports updates and creation, it will create it - String varName = varText; Token token = popDeque(tokenDeque); Object value = token.getValue(); state.variableResolver.update(varName, value); @@ -380,7 +379,7 @@ private void exitCommonAssign(String varText) { // do tokenDeque.push(new Token<>(value, Object.class, context)); }, DeferredFunction.class, context)); - expression.variablesUsed.add(varText); + expression.variablesUsed.add(varName); } @SuppressWarnings("unchecked")