From ccc864d40cbee6cbf0665524d1788cf934e7c361 Mon Sep 17 00:00:00 2001
From: Ross Wolf <31489089+rw-access@users.noreply.github.com>
Date: Mon, 25 Nov 2019 12:18:20 -0700
Subject: [PATCH 1/8] Additional tests and grammar updates
---
x-pack/plugin/eql/src/main/antlr/EqlBase.g4 | 134 +-
.../plugin/eql/src/main/antlr/EqlBase.tokens | 87 -
.../eql/src/main/antlr/EqlBaseLexer.tokens | 86 -
.../eql/parser/CaseInsensitiveStream.java | 45 -
.../xpack/eql/parser/EqlBaseBaseListener.java | 100 +-
.../xpack/eql/parser/EqlBaseBaseVisitor.java | 57 +-
.../xpack/eql/parser/EqlBaseLexer.java | 304 ++--
.../xpack/eql/parser/EqlBaseListener.java | 110 +-
.../xpack/eql/parser/EqlBaseParser.java | 1433 +++++++++--------
.../xpack/eql/parser/EqlBaseVisitor.java | 62 +-
.../xpack/eql/parser/EqlParser.java | 34 +-
.../xpack/eql/parser/GrammarTests.java | 2 +
.../src/test/resources/grammar-queries.eql | 878 +++++++++-
13 files changed, 2005 insertions(+), 1327 deletions(-)
delete mode 100644 x-pack/plugin/eql/src/main/antlr/EqlBase.tokens
delete mode 100644 x-pack/plugin/eql/src/main/antlr/EqlBaseLexer.tokens
delete mode 100644 x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/CaseInsensitiveStream.java
diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
index 717f549614397..3478f46e81fd9 100644
--- a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
+++ b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
@@ -6,9 +6,6 @@
grammar EqlBase;
-tokens {
- DELIMITER
-}
singleStatement
: statement EOF
@@ -21,43 +18,52 @@ singleExpression
statement
: query (PIPE pipe)*
;
-
+
query
: sequence
| join
- | condition
+ | eventQuery
+ ;
+withParams
+ : WITH namedParam (COMMA namedParam)*
;
-
sequence
- : SEQUENCE (by=joinKeys)? (span)?
- match+
- (UNTIL match)?
+ : SEQUENCE (by=joinKeys withParams? | withParams by=joinKeys?)?
+ sequenceTerm sequenceTerm+
+ (UNTIL sequenceTerm)?
;
join
: JOIN (by=joinKeys)?
- match+
- (UNTIL match)?
+ joinTerm joinTerm+
+ (UNTIL joinTerm)?
;
pipe
: kind=IDENTIFIER (booleanExpression (COMMA booleanExpression)*)?
;
+
+namedParam: key=IDENTIFIER EQ (expression | timeUnit);
+
joinKeys
- : BY qualifiedNames
- ;
-
-span
- : WITH MAXSPAN EQ DIGIT_IDENTIFIER
+ : BY expression (COMMA expression)*
;
-match
- : LB condition RB (by=joinKeys)?
+joinTerm
+ : subquery (by=joinKeys)?
+ ;
+
+sequenceTerm
+ : subquery namedParam* (by=joinKeys)?
+ ;
+
+subquery
+ : LB eventQuery RB
;
-condition
- : event=qualifiedName WHERE expression
+eventQuery
+ : event=identifier WHERE expression
;
expression
@@ -66,6 +72,7 @@ expression
booleanExpression
: NOT booleanExpression #logicalNot
+ | relationship=identifier OF subquery #processCheck
| predicated #booleanDefault
| left=booleanExpression operator=AND right=booleanExpression #logicalBinary
| left=booleanExpression operator=OR right=booleanExpression #logicalBinary
@@ -81,9 +88,7 @@ predicated
// dedicated calls for each branch are not used to reuse the NOT handling across them
// instead the property kind is used for differentiation
predicate
- : NOT? kind=BETWEEN lower=valueExpression AND upper=valueExpression
- | NOT? kind=IN LP valueExpression (COMMA valueExpression)* RP
- | NOT? kind=IN LP query RP
+ : NOT? kind=IN LP valueExpression (COMMA valueExpression)* RP
;
valueExpression
@@ -109,7 +114,7 @@ constant
: NULL #nullLiteral
| number #numericLiteral
| booleanValue #booleanLiteral
- | STRING+ #stringLiteral
+ | string #stringLiteral
;
comparisonOperator
@@ -120,26 +125,16 @@ booleanValue
: TRUE | FALSE
;
-qualifiedNames
- : qualifiedName (COMMA qualifiedName)*
- ;
-
qualifiedName
- : (identifier DOT)* identifier
+ : identifier (DOT identifier | LB INTEGER_VALUE+ RB)*
;
identifier
- : quoteIdentifier
- | unquoteIdentifier
+ : IDENTIFIER
;
-quoteIdentifier
- : QUOTED_IDENTIFIER #quotedIdentifier
- ;
-
-unquoteIdentifier
- : IDENTIFIER #unquotedIdentifier
- | DIGIT_IDENTIFIER #digitIdentifier
+timeUnit
+ : number unit=IDENTIFIER
;
number
@@ -151,31 +146,24 @@ string
: STRING
;
-AND: 'AND';
-ANY: 'ANY';
-ASC: 'ASC';
-BETWEEN: 'BETWEEN';
-BY: 'BY';
-CHILD: 'CHILD';
-DESCENDANT: 'DESCENDANT';
-EVENT: 'EVENT';
-FALSE: 'FALSE';
-IN: 'IN';
-JOIN: 'JOIN';
-MAXSPAN: 'MAXSPAN';
-NOT: 'NOT';
-NULL: 'NULL';
-OF: 'OF';
-OR: 'OR';
-SEQUENCE: 'SEQUENCE';
-TRUE: 'TRUE';
-UNTIL: 'UNTIL';
-WHERE: 'WHERE';
-WITH: 'WITH';
+AND: 'and';
+BY: 'by';
+FALSE: 'false';
+IN: 'in';
+JOIN: 'join';
+NOT: 'not';
+NULL: 'null';
+OF: 'of';
+OR: 'or';
+SEQUENCE: 'sequence';
+TRUE: 'true';
+UNTIL: 'until';
+WHERE: 'where';
+WITH: 'with';
// Operators
EQ : '=' | '==';
-NEQ : '<>' | '!=';
+NEQ : '!=';
LT : '<';
LTE : '<=';
GT : '>';
@@ -195,8 +183,10 @@ RP: ')';
PIPE: '|';
STRING
- : '\'' ( ~'\'')* '\''
- | '"' ( ~'"' )* '"'
+ : '\'' ('\\' [btnfr"'\\] | ~[\r\n'\\])* '\''
+ | '"' ('\\' [btnfr"'\\] | ~[\r\n"\\])* '"'
+ | '?"' ('\\"' |~["\r\n])* '"'
+ | '?\'' ('\\\'' |~['\r\n])* '\''
;
INTEGER_VALUE
@@ -211,19 +201,11 @@ DECIMAL_VALUE
;
IDENTIFIER
- : (LETTER | '_') (LETTER | DIGIT | '_' | '@' )*
- ;
-
-DIGIT_IDENTIFIER
- : DIGIT (LETTER | DIGIT | '_' | '@')+
+ : (LETTER | '_') (LETTER | DIGIT | '_')*
;
-QUOTED_IDENTIFIER
- : '"' ( ~'"' | '""' )* '"'
- ;
-
fragment EXPONENT
- : 'E' [+-]? DIGIT+
+ : [Ee] [+-]? DIGIT+
;
fragment DIGIT
@@ -231,10 +213,10 @@ fragment DIGIT
;
fragment LETTER
- : [A-Z]
+ : [A-Za-z]
;
-SIMPLE_COMMENT
+LINE_COMMENT
: '//' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN)
;
@@ -246,9 +228,11 @@ WS
: [ \r\n\t]+ -> channel(HIDDEN)
;
+
// Catch-all for anything we can't recognize.
// We use this to be able to ignore and recover all the text
// when splitting statements with DelimiterLexer
UNRECOGNIZED
: .
- ;
\ No newline at end of file
+ ;
+
diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBase.tokens b/x-pack/plugin/eql/src/main/antlr/EqlBase.tokens
deleted file mode 100644
index e27c72ef28209..0000000000000
--- a/x-pack/plugin/eql/src/main/antlr/EqlBase.tokens
+++ /dev/null
@@ -1,87 +0,0 @@
-AND=1
-ANY=2
-ASC=3
-BETWEEN=4
-BY=5
-CHILD=6
-DESCENDANT=7
-EVENT=8
-FALSE=9
-IN=10
-JOIN=11
-MAXSPAN=12
-NOT=13
-NULL=14
-OF=15
-OR=16
-SEQUENCE=17
-TRUE=18
-UNTIL=19
-WHERE=20
-WITH=21
-EQ=22
-NEQ=23
-LT=24
-LTE=25
-GT=26
-GTE=27
-PLUS=28
-MINUS=29
-ASTERISK=30
-SLASH=31
-PERCENT=32
-DOT=33
-COMMA=34
-LB=35
-RB=36
-LP=37
-RP=38
-PIPE=39
-STRING=40
-INTEGER_VALUE=41
-DECIMAL_VALUE=42
-IDENTIFIER=43
-DIGIT_IDENTIFIER=44
-QUOTED_IDENTIFIER=45
-SIMPLE_COMMENT=46
-BRACKETED_COMMENT=47
-WS=48
-UNRECOGNIZED=49
-DELIMITER=50
-'AND'=1
-'ANY'=2
-'ASC'=3
-'BETWEEN'=4
-'BY'=5
-'CHILD'=6
-'DESCENDANT'=7
-'EVENT'=8
-'FALSE'=9
-'IN'=10
-'JOIN'=11
-'MAXSPAN'=12
-'NOT'=13
-'NULL'=14
-'OF'=15
-'OR'=16
-'SEQUENCE'=17
-'TRUE'=18
-'UNTIL'=19
-'WHERE'=20
-'WITH'=21
-'<'=24
-'<='=25
-'>'=26
-'>='=27
-'+'=28
-'-'=29
-'*'=30
-'/'=31
-'%'=32
-'.'=33
-','=34
-'['=35
-']'=36
-'('=37
-')'=38
-'|'=39
diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBaseLexer.tokens b/x-pack/plugin/eql/src/main/antlr/EqlBaseLexer.tokens
deleted file mode 100644
index e72abca518c43..0000000000000
--- a/x-pack/plugin/eql/src/main/antlr/EqlBaseLexer.tokens
+++ /dev/null
@@ -1,86 +0,0 @@
-AND=1
-ANY=2
-ASC=3
-BETWEEN=4
-BY=5
-CHILD=6
-DESCENDANT=7
-EVENT=8
-FALSE=9
-IN=10
-JOIN=11
-MAXSPAN=12
-NOT=13
-NULL=14
-OF=15
-OR=16
-SEQUENCE=17
-TRUE=18
-UNTIL=19
-WHERE=20
-WITH=21
-EQ=22
-NEQ=23
-LT=24
-LTE=25
-GT=26
-GTE=27
-PLUS=28
-MINUS=29
-ASTERISK=30
-SLASH=31
-PERCENT=32
-DOT=33
-COMMA=34
-LB=35
-RB=36
-LP=37
-RP=38
-PIPE=39
-STRING=40
-INTEGER_VALUE=41
-DECIMAL_VALUE=42
-IDENTIFIER=43
-DIGIT_IDENTIFIER=44
-QUOTED_IDENTIFIER=45
-SIMPLE_COMMENT=46
-BRACKETED_COMMENT=47
-WS=48
-UNRECOGNIZED=49
-'AND'=1
-'ANY'=2
-'ASC'=3
-'BETWEEN'=4
-'BY'=5
-'CHILD'=6
-'DESCENDANT'=7
-'EVENT'=8
-'FALSE'=9
-'IN'=10
-'JOIN'=11
-'MAXSPAN'=12
-'NOT'=13
-'NULL'=14
-'OF'=15
-'OR'=16
-'SEQUENCE'=17
-'TRUE'=18
-'UNTIL'=19
-'WHERE'=20
-'WITH'=21
-'<'=24
-'<='=25
-'>'=26
-'>='=27
-'+'=28
-'-'=29
-'*'=30
-'/'=31
-'%'=32
-'.'=33
-','=34
-'['=35
-']'=36
-'('=37
-')'=38
-'|'=39
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/CaseInsensitiveStream.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/CaseInsensitiveStream.java
deleted file mode 100644
index 1cfb5198a0c26..0000000000000
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/CaseInsensitiveStream.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License;
- * you may not use this file except in compliance with the Elastic License.
- */
-package org.elasticsearch.xpack.eql.parser;
-
-import org.antlr.v4.runtime.ANTLRInputStream;
-import org.antlr.v4.runtime.IntStream;
-
-import java.util.Locale;
-
-// extension of ANTLR that does the upper-casing once for the whole stream
-// the ugly part is that it has to duplicate LA method
-
-// This approach is the official solution from the ANTLR authors
-// in that it's both faster and easier than having a dedicated lexer
-// see https://github.com/antlr/antlr4/issues/1002
-class CaseInsensitiveStream extends ANTLRInputStream {
- protected char[] uppedChars;
-
- CaseInsensitiveStream(String input) {
- super(input);
- this.uppedChars = input.toUpperCase(Locale.ROOT).toCharArray();
- }
-
- // this part is copied from ANTLRInputStream
- @Override
- public int LA(int i) {
- if (i == 0) {
- return 0; // undefined
- }
- if (i < 0) {
- i++;
- if ((p + i - 1) < 0) {
- return IntStream.EOF;
- }
- }
-
- if ((p + i - 1) >= n) {
- return IntStream.EOF;
- }
- return uppedChars[p + i - 1];
- }
-}
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
index 6dcdd9e6141c4..b1af9de5d832e 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
@@ -59,6 +59,18 @@ class EqlBaseBaseListener implements EqlBaseListener {
*
The default implementation does nothing.
*/
@Override public void exitQuery(EqlBaseParser.QueryContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterWithParams(EqlBaseParser.WithParamsContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitWithParams(EqlBaseParser.WithParamsContext ctx) { }
/**
* {@inheritDoc}
*
@@ -95,6 +107,18 @@ class EqlBaseBaseListener implements EqlBaseListener {
* The default implementation does nothing.
*/
@Override public void exitPipe(EqlBaseParser.PipeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterNamedParam(EqlBaseParser.NamedParamContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitNamedParam(EqlBaseParser.NamedParamContext ctx) { }
/**
* {@inheritDoc}
*
@@ -112,37 +136,49 @@ class EqlBaseBaseListener implements EqlBaseListener {
*
* The default implementation does nothing.
*/
- @Override public void enterSpan(EqlBaseParser.SpanContext ctx) { }
+ @Override public void enterJoinTerm(EqlBaseParser.JoinTermContext ctx) { }
/**
* {@inheritDoc}
*
* The default implementation does nothing.
*/
- @Override public void exitSpan(EqlBaseParser.SpanContext ctx) { }
+ @Override public void exitJoinTerm(EqlBaseParser.JoinTermContext ctx) { }
/**
* {@inheritDoc}
*
* The default implementation does nothing.
*/
- @Override public void enterMatch(EqlBaseParser.MatchContext ctx) { }
+ @Override public void enterSequenceTerm(EqlBaseParser.SequenceTermContext ctx) { }
/**
* {@inheritDoc}
*
* The default implementation does nothing.
*/
- @Override public void exitMatch(EqlBaseParser.MatchContext ctx) { }
+ @Override public void exitSequenceTerm(EqlBaseParser.SequenceTermContext ctx) { }
/**
* {@inheritDoc}
*
* The default implementation does nothing.
*/
- @Override public void enterCondition(EqlBaseParser.ConditionContext ctx) { }
+ @Override public void enterSubquery(EqlBaseParser.SubqueryContext ctx) { }
/**
* {@inheritDoc}
*
* The default implementation does nothing.
*/
- @Override public void exitCondition(EqlBaseParser.ConditionContext ctx) { }
+ @Override public void exitSubquery(EqlBaseParser.SubqueryContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterEventQuery(EqlBaseParser.EventQueryContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitEventQuery(EqlBaseParser.EventQueryContext ctx) { }
/**
* {@inheritDoc}
*
@@ -179,6 +215,18 @@ class EqlBaseBaseListener implements EqlBaseListener {
* The default implementation does nothing.
*/
@Override public void exitBooleanDefault(EqlBaseParser.BooleanDefaultContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterProcessCheck(EqlBaseParser.ProcessCheckContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitProcessCheck(EqlBaseParser.ProcessCheckContext ctx) { }
/**
* {@inheritDoc}
*
@@ -395,18 +443,6 @@ class EqlBaseBaseListener implements EqlBaseListener {
* The default implementation does nothing.
*/
@Override public void exitBooleanValue(EqlBaseParser.BooleanValueContext ctx) { }
- /**
- * {@inheritDoc}
- *
- * The default implementation does nothing.
- */
- @Override public void enterQualifiedNames(EqlBaseParser.QualifiedNamesContext ctx) { }
- /**
- * {@inheritDoc}
- *
- * The default implementation does nothing.
- */
- @Override public void exitQualifiedNames(EqlBaseParser.QualifiedNamesContext ctx) { }
/**
* {@inheritDoc}
*
@@ -436,37 +472,13 @@ class EqlBaseBaseListener implements EqlBaseListener {
*
* The default implementation does nothing.
*/
- @Override public void enterQuotedIdentifier(EqlBaseParser.QuotedIdentifierContext ctx) { }
- /**
- * {@inheritDoc}
- *
- * The default implementation does nothing.
- */
- @Override public void exitQuotedIdentifier(EqlBaseParser.QuotedIdentifierContext ctx) { }
- /**
- * {@inheritDoc}
- *
- * The default implementation does nothing.
- */
- @Override public void enterUnquotedIdentifier(EqlBaseParser.UnquotedIdentifierContext ctx) { }
- /**
- * {@inheritDoc}
- *
- * The default implementation does nothing.
- */
- @Override public void exitUnquotedIdentifier(EqlBaseParser.UnquotedIdentifierContext ctx) { }
- /**
- * {@inheritDoc}
- *
- * The default implementation does nothing.
- */
- @Override public void enterDigitIdentifier(EqlBaseParser.DigitIdentifierContext ctx) { }
+ @Override public void enterTimeUnit(EqlBaseParser.TimeUnitContext ctx) { }
/**
* {@inheritDoc}
*
* The default implementation does nothing.
*/
- @Override public void exitDigitIdentifier(EqlBaseParser.DigitIdentifierContext ctx) { }
+ @Override public void exitTimeUnit(EqlBaseParser.TimeUnitContext ctx) { }
/**
* {@inheritDoc}
*
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
index 9f1cb859225b6..741fee7dd60f3 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
@@ -39,6 +39,13 @@ class EqlBaseBaseVisitor extends AbstractParseTreeVisitor implements EqlBa
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitQuery(EqlBaseParser.QueryContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitWithParams(EqlBaseParser.WithParamsContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
@@ -60,6 +67,13 @@ class EqlBaseBaseVisitor extends AbstractParseTreeVisitor implements EqlBa
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitPipe(EqlBaseParser.PipeContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitNamedParam(EqlBaseParser.NamedParamContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
@@ -73,21 +87,28 @@ class EqlBaseBaseVisitor extends AbstractParseTreeVisitor implements EqlBa
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
- @Override public T visitSpan(EqlBaseParser.SpanContext ctx) { return visitChildren(ctx); }
+ @Override public T visitJoinTerm(EqlBaseParser.JoinTermContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitSequenceTerm(EqlBaseParser.SequenceTermContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
- @Override public T visitMatch(EqlBaseParser.MatchContext ctx) { return visitChildren(ctx); }
+ @Override public T visitSubquery(EqlBaseParser.SubqueryContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
- @Override public T visitCondition(EqlBaseParser.ConditionContext ctx) { return visitChildren(ctx); }
+ @Override public T visitEventQuery(EqlBaseParser.EventQueryContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
@@ -109,6 +130,13 @@ class EqlBaseBaseVisitor extends AbstractParseTreeVisitor implements EqlBa
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitBooleanDefault(EqlBaseParser.BooleanDefaultContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitProcessCheck(EqlBaseParser.ProcessCheckContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
@@ -235,13 +263,6 @@ class EqlBaseBaseVisitor extends AbstractParseTreeVisitor implements EqlBa
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitBooleanValue(EqlBaseParser.BooleanValueContext ctx) { return visitChildren(ctx); }
- /**
- * {@inheritDoc}
- *
- * The default implementation returns the result of calling
- * {@link #visitChildren} on {@code ctx}.
- */
- @Override public T visitQualifiedNames(EqlBaseParser.QualifiedNamesContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
@@ -262,21 +283,7 @@ class EqlBaseBaseVisitor extends AbstractParseTreeVisitor implements EqlBa
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
- @Override public T visitQuotedIdentifier(EqlBaseParser.QuotedIdentifierContext ctx) { return visitChildren(ctx); }
- /**
- * {@inheritDoc}
- *
- * The default implementation returns the result of calling
- * {@link #visitChildren} on {@code ctx}.
- */
- @Override public T visitUnquotedIdentifier(EqlBaseParser.UnquotedIdentifierContext ctx) { return visitChildren(ctx); }
- /**
- * {@inheritDoc}
- *
- * The default implementation returns the result of calling
- * {@link #visitChildren} on {@code ctx}.
- */
- @Override public T visitDigitIdentifier(EqlBaseParser.DigitIdentifierContext ctx) { return visitChildren(ctx); }
+ @Override public T visitTimeUnit(EqlBaseParser.TimeUnitContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java
index 398f1798f75a7..6c94fdfd945b8 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java
@@ -17,42 +17,37 @@ class EqlBaseLexer extends Lexer {
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
- AND=1, ANY=2, ASC=3, BETWEEN=4, BY=5, CHILD=6, DESCENDANT=7, EVENT=8,
- FALSE=9, IN=10, JOIN=11, MAXSPAN=12, NOT=13, NULL=14, OF=15, OR=16, SEQUENCE=17,
- TRUE=18, UNTIL=19, WHERE=20, WITH=21, EQ=22, NEQ=23, LT=24, LTE=25, GT=26,
- GTE=27, PLUS=28, MINUS=29, ASTERISK=30, SLASH=31, PERCENT=32, DOT=33,
- COMMA=34, LB=35, RB=36, LP=37, RP=38, PIPE=39, STRING=40, INTEGER_VALUE=41,
- DECIMAL_VALUE=42, IDENTIFIER=43, DIGIT_IDENTIFIER=44, QUOTED_IDENTIFIER=45,
- SIMPLE_COMMENT=46, BRACKETED_COMMENT=47, WS=48, UNRECOGNIZED=49;
+ AND=1, BY=2, FALSE=3, IN=4, JOIN=5, NOT=6, NULL=7, OF=8, OR=9, SEQUENCE=10,
+ TRUE=11, UNTIL=12, WHERE=13, WITH=14, EQ=15, NEQ=16, LT=17, LTE=18, GT=19,
+ GTE=20, PLUS=21, MINUS=22, ASTERISK=23, SLASH=24, PERCENT=25, DOT=26,
+ COMMA=27, LB=28, RB=29, LP=30, RP=31, PIPE=32, STRING=33, INTEGER_VALUE=34,
+ DECIMAL_VALUE=35, IDENTIFIER=36, LINE_COMMENT=37, BRACKETED_COMMENT=38,
+ WS=39, UNRECOGNIZED=40;
public static String[] modeNames = {
"DEFAULT_MODE"
};
public static final String[] ruleNames = {
- "AND", "ANY", "ASC", "BETWEEN", "BY", "CHILD", "DESCENDANT", "EVENT",
- "FALSE", "IN", "JOIN", "MAXSPAN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
+ "AND", "BY", "FALSE", "IN", "JOIN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
"TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ", "LT", "LTE", "GT", "GTE",
"PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "DOT", "COMMA", "LB",
"RB", "LP", "RP", "PIPE", "STRING", "INTEGER_VALUE", "DECIMAL_VALUE",
- "IDENTIFIER", "DIGIT_IDENTIFIER", "QUOTED_IDENTIFIER", "EXPONENT", "DIGIT",
- "LETTER", "SIMPLE_COMMENT", "BRACKETED_COMMENT", "WS", "UNRECOGNIZED"
+ "IDENTIFIER", "EXPONENT", "DIGIT", "LETTER", "LINE_COMMENT", "BRACKETED_COMMENT",
+ "WS", "UNRECOGNIZED"
};
private static final String[] _LITERAL_NAMES = {
- null, "'AND'", "'ANY'", "'ASC'", "'BETWEEN'", "'BY'", "'CHILD'", "'DESCENDANT'",
- "'EVENT'", "'FALSE'", "'IN'", "'JOIN'", "'MAXSPAN'", "'NOT'", "'NULL'",
- "'OF'", "'OR'", "'SEQUENCE'", "'TRUE'", "'UNTIL'", "'WHERE'", "'WITH'",
- null, null, "'<'", "'<='", "'>'", "'>='", "'+'", "'-'", "'*'", "'/'",
+ null, "'and'", "'by'", "'false'", "'in'", "'join'", "'not'", "'null'",
+ "'of'", "'or'", "'sequence'", "'true'", "'until'", "'where'", "'with'",
+ null, "'!='", "'<'", "'<='", "'>'", "'>='", "'+'", "'-'", "'*'", "'/'",
"'%'", "'.'", "','", "'['", "']'", "'('", "')'", "'|'"
};
private static final String[] _SYMBOLIC_NAMES = {
- null, "AND", "ANY", "ASC", "BETWEEN", "BY", "CHILD", "DESCENDANT", "EVENT",
- "FALSE", "IN", "JOIN", "MAXSPAN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
+ null, "AND", "BY", "FALSE", "IN", "JOIN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
"TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ", "LT", "LTE", "GT", "GTE",
"PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "DOT", "COMMA", "LB",
"RB", "LP", "RP", "PIPE", "STRING", "INTEGER_VALUE", "DECIMAL_VALUE",
- "IDENTIFIER", "DIGIT_IDENTIFIER", "QUOTED_IDENTIFIER", "SIMPLE_COMMENT",
- "BRACKETED_COMMENT", "WS", "UNRECOGNIZED"
+ "IDENTIFIER", "LINE_COMMENT", "BRACKETED_COMMENT", "WS", "UNRECOGNIZED"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
@@ -109,151 +104,132 @@ public EqlBaseLexer(CharStream input) {
public ATN getATN() { return _ATN; }
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\63\u01a2\b\1\4\2"+
- "\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4"+
- "\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+
- "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+
- "\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t"+
- " \4!\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t"+
- "+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64"+
- "\t\64\4\65\t\65\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\5\3"+
- "\5\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b"+
- "\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3"+
- "\n\3\n\3\n\3\n\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r"+
- "\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\17\3\17\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\22\3\22\3\22\3\22\3\22\3\22\3\23\3"+
- "\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3"+
- "\25\3\25\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\27\5\27\u00e1\n\27\3\30"+
- "\3\30\3\30\3\30\5\30\u00e7\n\30\3\31\3\31\3\32\3\32\3\32\3\33\3\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)\7)\u010d\n)\f)\16)\u0110\13)\3)\3"+
- ")\3)\7)\u0115\n)\f)\16)\u0118\13)\3)\5)\u011b\n)\3*\6*\u011e\n*\r*\16"+
- "*\u011f\3+\6+\u0123\n+\r+\16+\u0124\3+\3+\7+\u0129\n+\f+\16+\u012c\13"+
- "+\3+\3+\6+\u0130\n+\r+\16+\u0131\3+\6+\u0135\n+\r+\16+\u0136\3+\3+\7+"+
- "\u013b\n+\f+\16+\u013e\13+\5+\u0140\n+\3+\3+\3+\3+\6+\u0146\n+\r+\16+"+
- "\u0147\3+\3+\5+\u014c\n+\3,\3,\5,\u0150\n,\3,\3,\3,\7,\u0155\n,\f,\16"+
- ",\u0158\13,\3-\3-\3-\3-\6-\u015e\n-\r-\16-\u015f\3.\3.\3.\3.\7.\u0166"+
- "\n.\f.\16.\u0169\13.\3.\3.\3/\3/\5/\u016f\n/\3/\6/\u0172\n/\r/\16/\u0173"+
- "\3\60\3\60\3\61\3\61\3\62\3\62\3\62\3\62\7\62\u017e\n\62\f\62\16\62\u0181"+
- "\13\62\3\62\5\62\u0184\n\62\3\62\5\62\u0187\n\62\3\62\3\62\3\63\3\63\3"+
- "\63\3\63\3\63\7\63\u0190\n\63\f\63\16\63\u0193\13\63\3\63\3\63\3\63\3"+
- "\63\3\63\3\64\6\64\u019b\n\64\r\64\16\64\u019c\3\64\3\64\3\65\3\65\3\u0191"+
- "\2\66\3\3\5\4\7\5\t\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35"+
- "\20\37\21!\22#\23%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36"+
- ";\37= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]\2_\2a\2c\60e\61g\62i\63\3\2\n"+
- "\3\2))\3\2$$\4\2BBaa\4\2--//\3\2\62;\3\2C\\\4\2\f\f\17\17\5\2\13\f\17"+
- "\17\"\"\u01bf\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2"+
- "\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2"+
- "\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2"+
- "\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2"+
- "\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3"+
- "\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2"+
- "\2\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2"+
- "S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2c\3\2\2\2\2e\3"+
- "\2\2\2\2g\3\2\2\2\2i\3\2\2\2\3k\3\2\2\2\5o\3\2\2\2\7s\3\2\2\2\tw\3\2\2"+
- "\2\13\177\3\2\2\2\r\u0082\3\2\2\2\17\u0088\3\2\2\2\21\u0093\3\2\2\2\23"+
- "\u0099\3\2\2\2\25\u009f\3\2\2\2\27\u00a2\3\2\2\2\31\u00a7\3\2\2\2\33\u00af"+
- "\3\2\2\2\35\u00b3\3\2\2\2\37\u00b8\3\2\2\2!\u00bb\3\2\2\2#\u00be\3\2\2"+
- "\2%\u00c7\3\2\2\2\'\u00cc\3\2\2\2)\u00d2\3\2\2\2+\u00d8\3\2\2\2-\u00e0"+
- "\3\2\2\2/\u00e6\3\2\2\2\61\u00e8\3\2\2\2\63\u00ea\3\2\2\2\65\u00ed\3\2"+
- "\2\2\67\u00ef\3\2\2\29\u00f2\3\2\2\2;\u00f4\3\2\2\2=\u00f6\3\2\2\2?\u00f8"+
- "\3\2\2\2A\u00fa\3\2\2\2C\u00fc\3\2\2\2E\u00fe\3\2\2\2G\u0100\3\2\2\2I"+
- "\u0102\3\2\2\2K\u0104\3\2\2\2M\u0106\3\2\2\2O\u0108\3\2\2\2Q\u011a\3\2"+
- "\2\2S\u011d\3\2\2\2U\u014b\3\2\2\2W\u014f\3\2\2\2Y\u0159\3\2\2\2[\u0161"+
- "\3\2\2\2]\u016c\3\2\2\2_\u0175\3\2\2\2a\u0177\3\2\2\2c\u0179\3\2\2\2e"+
- "\u018a\3\2\2\2g\u019a\3\2\2\2i\u01a0\3\2\2\2kl\7C\2\2lm\7P\2\2mn\7F\2"+
- "\2n\4\3\2\2\2op\7C\2\2pq\7P\2\2qr\7[\2\2r\6\3\2\2\2st\7C\2\2tu\7U\2\2"+
- "uv\7E\2\2v\b\3\2\2\2wx\7D\2\2xy\7G\2\2yz\7V\2\2z{\7Y\2\2{|\7G\2\2|}\7"+
- "G\2\2}~\7P\2\2~\n\3\2\2\2\177\u0080\7D\2\2\u0080\u0081\7[\2\2\u0081\f"+
- "\3\2\2\2\u0082\u0083\7E\2\2\u0083\u0084\7J\2\2\u0084\u0085\7K\2\2\u0085"+
- "\u0086\7N\2\2\u0086\u0087\7F\2\2\u0087\16\3\2\2\2\u0088\u0089\7F\2\2\u0089"+
- "\u008a\7G\2\2\u008a\u008b\7U\2\2\u008b\u008c\7E\2\2\u008c\u008d\7G\2\2"+
- "\u008d\u008e\7P\2\2\u008e\u008f\7F\2\2\u008f\u0090\7C\2\2\u0090\u0091"+
- "\7P\2\2\u0091\u0092\7V\2\2\u0092\20\3\2\2\2\u0093\u0094\7G\2\2\u0094\u0095"+
- "\7X\2\2\u0095\u0096\7G\2\2\u0096\u0097\7P\2\2\u0097\u0098\7V\2\2\u0098"+
- "\22\3\2\2\2\u0099\u009a\7H\2\2\u009a\u009b\7C\2\2\u009b\u009c\7N\2\2\u009c"+
- "\u009d\7U\2\2\u009d\u009e\7G\2\2\u009e\24\3\2\2\2\u009f\u00a0\7K\2\2\u00a0"+
- "\u00a1\7P\2\2\u00a1\26\3\2\2\2\u00a2\u00a3\7L\2\2\u00a3\u00a4\7Q\2\2\u00a4"+
- "\u00a5\7K\2\2\u00a5\u00a6\7P\2\2\u00a6\30\3\2\2\2\u00a7\u00a8\7O\2\2\u00a8"+
- "\u00a9\7C\2\2\u00a9\u00aa\7Z\2\2\u00aa\u00ab\7U\2\2\u00ab\u00ac\7R\2\2"+
- "\u00ac\u00ad\7C\2\2\u00ad\u00ae\7P\2\2\u00ae\32\3\2\2\2\u00af\u00b0\7"+
- "P\2\2\u00b0\u00b1\7Q\2\2\u00b1\u00b2\7V\2\2\u00b2\34\3\2\2\2\u00b3\u00b4"+
- "\7P\2\2\u00b4\u00b5\7W\2\2\u00b5\u00b6\7N\2\2\u00b6\u00b7\7N\2\2\u00b7"+
- "\36\3\2\2\2\u00b8\u00b9\7Q\2\2\u00b9\u00ba\7H\2\2\u00ba \3\2\2\2\u00bb"+
- "\u00bc\7Q\2\2\u00bc\u00bd\7T\2\2\u00bd\"\3\2\2\2\u00be\u00bf\7U\2\2\u00bf"+
- "\u00c0\7G\2\2\u00c0\u00c1\7S\2\2\u00c1\u00c2\7W\2\2\u00c2\u00c3\7G\2\2"+
- "\u00c3\u00c4\7P\2\2\u00c4\u00c5\7E\2\2\u00c5\u00c6\7G\2\2\u00c6$\3\2\2"+
- "\2\u00c7\u00c8\7V\2\2\u00c8\u00c9\7T\2\2\u00c9\u00ca\7W\2\2\u00ca\u00cb"+
- "\7G\2\2\u00cb&\3\2\2\2\u00cc\u00cd\7W\2\2\u00cd\u00ce\7P\2\2\u00ce\u00cf"+
- "\7V\2\2\u00cf\u00d0\7K\2\2\u00d0\u00d1\7N\2\2\u00d1(\3\2\2\2\u00d2\u00d3"+
- "\7Y\2\2\u00d3\u00d4\7J\2\2\u00d4\u00d5\7G\2\2\u00d5\u00d6\7T\2\2\u00d6"+
- "\u00d7\7G\2\2\u00d7*\3\2\2\2\u00d8\u00d9\7Y\2\2\u00d9\u00da\7K\2\2\u00da"+
- "\u00db\7V\2\2\u00db\u00dc\7J\2\2\u00dc,\3\2\2\2\u00dd\u00e1\7?\2\2\u00de"+
- "\u00df\7?\2\2\u00df\u00e1\7?\2\2\u00e0\u00dd\3\2\2\2\u00e0\u00de\3\2\2"+
- "\2\u00e1.\3\2\2\2\u00e2\u00e3\7>\2\2\u00e3\u00e7\7@\2\2\u00e4\u00e5\7"+
- "#\2\2\u00e5\u00e7\7?\2\2\u00e6\u00e2\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e7"+
- "\60\3\2\2\2\u00e8\u00e9\7>\2\2\u00e9\62\3\2\2\2\u00ea\u00eb\7>\2\2\u00eb"+
- "\u00ec\7?\2\2\u00ec\64\3\2\2\2\u00ed\u00ee\7@\2\2\u00ee\66\3\2\2\2\u00ef"+
- "\u00f0\7@\2\2\u00f0\u00f1\7?\2\2\u00f18\3\2\2\2\u00f2\u00f3\7-\2\2\u00f3"+
- ":\3\2\2\2\u00f4\u00f5\7/\2\2\u00f5<\3\2\2\2\u00f6\u00f7\7,\2\2\u00f7>"+
- "\3\2\2\2\u00f8\u00f9\7\61\2\2\u00f9@\3\2\2\2\u00fa\u00fb\7\'\2\2\u00fb"+
- "B\3\2\2\2\u00fc\u00fd\7\60\2\2\u00fdD\3\2\2\2\u00fe\u00ff\7.\2\2\u00ff"+
- "F\3\2\2\2\u0100\u0101\7]\2\2\u0101H\3\2\2\2\u0102\u0103\7_\2\2\u0103J"+
- "\3\2\2\2\u0104\u0105\7*\2\2\u0105L\3\2\2\2\u0106\u0107\7+\2\2\u0107N\3"+
- "\2\2\2\u0108\u0109\7~\2\2\u0109P\3\2\2\2\u010a\u010e\7)\2\2\u010b\u010d"+
- "\n\2\2\2\u010c\u010b\3\2\2\2\u010d\u0110\3\2\2\2\u010e\u010c\3\2\2\2\u010e"+
- "\u010f\3\2\2\2\u010f\u0111\3\2\2\2\u0110\u010e\3\2\2\2\u0111\u011b\7)"+
- "\2\2\u0112\u0116\7$\2\2\u0113\u0115\n\3\2\2\u0114\u0113\3\2\2\2\u0115"+
- "\u0118\3\2\2\2\u0116\u0114\3\2\2\2\u0116\u0117\3\2\2\2\u0117\u0119\3\2"+
- "\2\2\u0118\u0116\3\2\2\2\u0119\u011b\7$\2\2\u011a\u010a\3\2\2\2\u011a"+
- "\u0112\3\2\2\2\u011bR\3\2\2\2\u011c\u011e\5_\60\2\u011d\u011c\3\2\2\2"+
- "\u011e\u011f\3\2\2\2\u011f\u011d\3\2\2\2\u011f\u0120\3\2\2\2\u0120T\3"+
- "\2\2\2\u0121\u0123\5_\60\2\u0122\u0121\3\2\2\2\u0123\u0124\3\2\2\2\u0124"+
- "\u0122\3\2\2\2\u0124\u0125\3\2\2\2\u0125\u0126\3\2\2\2\u0126\u012a\5C"+
- "\"\2\u0127\u0129\5_\60\2\u0128\u0127\3\2\2\2\u0129\u012c\3\2\2\2\u012a"+
- "\u0128\3\2\2\2\u012a\u012b\3\2\2\2\u012b\u014c\3\2\2\2\u012c\u012a\3\2"+
- "\2\2\u012d\u012f\5C\"\2\u012e\u0130\5_\60\2\u012f\u012e\3\2\2\2\u0130"+
- "\u0131\3\2\2\2\u0131\u012f\3\2\2\2\u0131\u0132\3\2\2\2\u0132\u014c\3\2"+
- "\2\2\u0133\u0135\5_\60\2\u0134\u0133\3\2\2\2\u0135\u0136\3\2\2\2\u0136"+
- "\u0134\3\2\2\2\u0136\u0137\3\2\2\2\u0137\u013f\3\2\2\2\u0138\u013c\5C"+
- "\"\2\u0139\u013b\5_\60\2\u013a\u0139\3\2\2\2\u013b\u013e\3\2\2\2\u013c"+
- "\u013a\3\2\2\2\u013c\u013d\3\2\2\2\u013d\u0140\3\2\2\2\u013e\u013c\3\2"+
- "\2\2\u013f\u0138\3\2\2\2\u013f\u0140\3\2\2\2\u0140\u0141\3\2\2\2\u0141"+
- "\u0142\5]/\2\u0142\u014c\3\2\2\2\u0143\u0145\5C\"\2\u0144\u0146\5_\60"+
- "\2\u0145\u0144\3\2\2\2\u0146\u0147\3\2\2\2\u0147\u0145\3\2\2\2\u0147\u0148"+
- "\3\2\2\2\u0148\u0149\3\2\2\2\u0149\u014a\5]/\2\u014a\u014c\3\2\2\2\u014b"+
- "\u0122\3\2\2\2\u014b\u012d\3\2\2\2\u014b\u0134\3\2\2\2\u014b\u0143\3\2"+
- "\2\2\u014cV\3\2\2\2\u014d\u0150\5a\61\2\u014e\u0150\7a\2\2\u014f\u014d"+
- "\3\2\2\2\u014f\u014e\3\2\2\2\u0150\u0156\3\2\2\2\u0151\u0155\5a\61\2\u0152"+
- "\u0155\5_\60\2\u0153\u0155\t\4\2\2\u0154\u0151\3\2\2\2\u0154\u0152\3\2"+
- "\2\2\u0154\u0153\3\2\2\2\u0155\u0158\3\2\2\2\u0156\u0154\3\2\2\2\u0156"+
- "\u0157\3\2\2\2\u0157X\3\2\2\2\u0158\u0156\3\2\2\2\u0159\u015d\5_\60\2"+
- "\u015a\u015e\5a\61\2\u015b\u015e\5_\60\2\u015c\u015e\t\4\2\2\u015d\u015a"+
- "\3\2\2\2\u015d\u015b\3\2\2\2\u015d\u015c\3\2\2\2\u015e\u015f\3\2\2\2\u015f"+
- "\u015d\3\2\2\2\u015f\u0160\3\2\2\2\u0160Z\3\2\2\2\u0161\u0167\7$\2\2\u0162"+
- "\u0166\n\3\2\2\u0163\u0164\7$\2\2\u0164\u0166\7$\2\2\u0165\u0162\3\2\2"+
- "\2\u0165\u0163\3\2\2\2\u0166\u0169\3\2\2\2\u0167\u0165\3\2\2\2\u0167\u0168"+
- "\3\2\2\2\u0168\u016a\3\2\2\2\u0169\u0167\3\2\2\2\u016a\u016b\7$\2\2\u016b"+
- "\\\3\2\2\2\u016c\u016e\7G\2\2\u016d\u016f\t\5\2\2\u016e\u016d\3\2\2\2"+
- "\u016e\u016f\3\2\2\2\u016f\u0171\3\2\2\2\u0170\u0172\5_\60\2\u0171\u0170"+
- "\3\2\2\2\u0172\u0173\3\2\2\2\u0173\u0171\3\2\2\2\u0173\u0174\3\2\2\2\u0174"+
- "^\3\2\2\2\u0175\u0176\t\6\2\2\u0176`\3\2\2\2\u0177\u0178\t\7\2\2\u0178"+
- "b\3\2\2\2\u0179\u017a\7\61\2\2\u017a\u017b\7\61\2\2\u017b\u017f\3\2\2"+
- "\2\u017c\u017e\n\b\2\2\u017d\u017c\3\2\2\2\u017e\u0181\3\2\2\2\u017f\u017d"+
- "\3\2\2\2\u017f\u0180\3\2\2\2\u0180\u0183\3\2\2\2\u0181\u017f\3\2\2\2\u0182"+
- "\u0184\7\17\2\2\u0183\u0182\3\2\2\2\u0183\u0184\3\2\2\2\u0184\u0186\3"+
- "\2\2\2\u0185\u0187\7\f\2\2\u0186\u0185\3\2\2\2\u0186\u0187\3\2\2\2\u0187"+
- "\u0188\3\2\2\2\u0188\u0189\b\62\2\2\u0189d\3\2\2\2\u018a\u018b\7\61\2"+
- "\2\u018b\u018c\7,\2\2\u018c\u0191\3\2\2\2\u018d\u0190\5e\63\2\u018e\u0190"+
- "\13\2\2\2\u018f\u018d\3\2\2\2\u018f\u018e\3\2\2\2\u0190\u0193\3\2\2\2"+
- "\u0191\u0192\3\2\2\2\u0191\u018f\3\2\2\2\u0192\u0194\3\2\2\2\u0193\u0191"+
- "\3\2\2\2\u0194\u0195\7,\2\2\u0195\u0196\7\61\2\2\u0196\u0197\3\2\2\2\u0197"+
- "\u0198\b\63\2\2\u0198f\3\2\2\2\u0199\u019b\t\t\2\2\u019a\u0199\3\2\2\2"+
- "\u019b\u019c\3\2\2\2\u019c\u019a\3\2\2\2\u019c\u019d\3\2\2\2\u019d\u019e"+
- "\3\2\2\2\u019e\u019f\b\64\2\2\u019fh\3\2\2\2\u01a0\u01a1\13\2\2\2\u01a1"+
- "j\3\2\2\2 \2\u00e0\u00e6\u010e\u0116\u011a\u011f\u0124\u012a\u0131\u0136"+
- "\u013c\u013f\u0147\u014b\u014f\u0154\u0156\u015d\u015f\u0165\u0167\u016e"+
- "\u0173\u017f\u0183\u0186\u018f\u0191\u019c\3\2\3\2";
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2*\u0167\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,\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3"+
+ "\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\n"+
+ "\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f"+
+ "\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3"+
+ "\17\3\17\3\17\3\20\3\20\3\20\5\20\u00a0\n\20\3\21\3\21\3\21\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\30\3\30"+
+ "\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37"+
+ "\3 \3 \3!\3!\3\"\3\"\3\"\3\"\7\"\u00cb\n\"\f\"\16\"\u00ce\13\"\3\"\3\""+
+ "\3\"\3\"\3\"\7\"\u00d5\n\"\f\"\16\"\u00d8\13\"\3\"\3\"\3\"\3\"\3\"\3\""+
+ "\3\"\7\"\u00e1\n\"\f\"\16\"\u00e4\13\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\7\""+
+ "\u00ed\n\"\f\"\16\"\u00f0\13\"\3\"\5\"\u00f3\n\"\3#\6#\u00f6\n#\r#\16"+
+ "#\u00f7\3$\6$\u00fb\n$\r$\16$\u00fc\3$\3$\7$\u0101\n$\f$\16$\u0104\13"+
+ "$\3$\3$\6$\u0108\n$\r$\16$\u0109\3$\6$\u010d\n$\r$\16$\u010e\3$\3$\7$"+
+ "\u0113\n$\f$\16$\u0116\13$\5$\u0118\n$\3$\3$\3$\3$\6$\u011e\n$\r$\16$"+
+ "\u011f\3$\3$\5$\u0124\n$\3%\3%\5%\u0128\n%\3%\3%\3%\7%\u012d\n%\f%\16"+
+ "%\u0130\13%\3&\3&\5&\u0134\n&\3&\6&\u0137\n&\r&\16&\u0138\3\'\3\'\3(\3"+
+ "(\3)\3)\3)\3)\7)\u0143\n)\f)\16)\u0146\13)\3)\5)\u0149\n)\3)\5)\u014c"+
+ "\n)\3)\3)\3*\3*\3*\3*\3*\7*\u0155\n*\f*\16*\u0158\13*\3*\3*\3*\3*\3*\3"+
+ "+\6+\u0160\n+\r+\16+\u0161\3+\3+\3,\3,\3\u0156\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\2M\2"+
+ "O\2Q\'S(U)W*\3\2\r\n\2$$))^^ddhhppttvv\6\2\f\f\17\17))^^\6\2\f\f\17\17"+
+ "$$^^\5\2\f\f\17\17$$\5\2\f\f\17\17))\4\2GGgg\4\2--//\3\2\62;\4\2C\\c|"+
+ "\4\2\f\f\17\17\5\2\13\f\17\17\"\"\u0186\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3"+
+ "\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2"+
+ "\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35"+
+ "\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)"+
+ "\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2"+
+ "\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2"+
+ "A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2Q\3\2\2\2\2S\3"+
+ "\2\2\2\2U\3\2\2\2\2W\3\2\2\2\3Y\3\2\2\2\5]\3\2\2\2\7`\3\2\2\2\tf\3\2\2"+
+ "\2\13i\3\2\2\2\rn\3\2\2\2\17r\3\2\2\2\21w\3\2\2\2\23z\3\2\2\2\25}\3\2"+
+ "\2\2\27\u0086\3\2\2\2\31\u008b\3\2\2\2\33\u0091\3\2\2\2\35\u0097\3\2\2"+
+ "\2\37\u009f\3\2\2\2!\u00a1\3\2\2\2#\u00a4\3\2\2\2%\u00a6\3\2\2\2\'\u00a9"+
+ "\3\2\2\2)\u00ab\3\2\2\2+\u00ae\3\2\2\2-\u00b0\3\2\2\2/\u00b2\3\2\2\2\61"+
+ "\u00b4\3\2\2\2\63\u00b6\3\2\2\2\65\u00b8\3\2\2\2\67\u00ba\3\2\2\29\u00bc"+
+ "\3\2\2\2;\u00be\3\2\2\2=\u00c0\3\2\2\2?\u00c2\3\2\2\2A\u00c4\3\2\2\2C"+
+ "\u00f2\3\2\2\2E\u00f5\3\2\2\2G\u0123\3\2\2\2I\u0127\3\2\2\2K\u0131\3\2"+
+ "\2\2M\u013a\3\2\2\2O\u013c\3\2\2\2Q\u013e\3\2\2\2S\u014f\3\2\2\2U\u015f"+
+ "\3\2\2\2W\u0165\3\2\2\2YZ\7c\2\2Z[\7p\2\2[\\\7f\2\2\\\4\3\2\2\2]^\7d\2"+
+ "\2^_\7{\2\2_\6\3\2\2\2`a\7h\2\2ab\7c\2\2bc\7n\2\2cd\7u\2\2de\7g\2\2e\b"+
+ "\3\2\2\2fg\7k\2\2gh\7p\2\2h\n\3\2\2\2ij\7l\2\2jk\7q\2\2kl\7k\2\2lm\7p"+
+ "\2\2m\f\3\2\2\2no\7p\2\2op\7q\2\2pq\7v\2\2q\16\3\2\2\2rs\7p\2\2st\7w\2"+
+ "\2tu\7n\2\2uv\7n\2\2v\20\3\2\2\2wx\7q\2\2xy\7h\2\2y\22\3\2\2\2z{\7q\2"+
+ "\2{|\7t\2\2|\24\3\2\2\2}~\7u\2\2~\177\7g\2\2\177\u0080\7s\2\2\u0080\u0081"+
+ "\7w\2\2\u0081\u0082\7g\2\2\u0082\u0083\7p\2\2\u0083\u0084\7e\2\2\u0084"+
+ "\u0085\7g\2\2\u0085\26\3\2\2\2\u0086\u0087\7v\2\2\u0087\u0088\7t\2\2\u0088"+
+ "\u0089\7w\2\2\u0089\u008a\7g\2\2\u008a\30\3\2\2\2\u008b\u008c\7w\2\2\u008c"+
+ "\u008d\7p\2\2\u008d\u008e\7v\2\2\u008e\u008f\7k\2\2\u008f\u0090\7n\2\2"+
+ "\u0090\32\3\2\2\2\u0091\u0092\7y\2\2\u0092\u0093\7j\2\2\u0093\u0094\7"+
+ "g\2\2\u0094\u0095\7t\2\2\u0095\u0096\7g\2\2\u0096\34\3\2\2\2\u0097\u0098"+
+ "\7y\2\2\u0098\u0099\7k\2\2\u0099\u009a\7v\2\2\u009a\u009b\7j\2\2\u009b"+
+ "\36\3\2\2\2\u009c\u00a0\7?\2\2\u009d\u009e\7?\2\2\u009e\u00a0\7?\2\2\u009f"+
+ "\u009c\3\2\2\2\u009f\u009d\3\2\2\2\u00a0 \3\2\2\2\u00a1\u00a2\7#\2\2\u00a2"+
+ "\u00a3\7?\2\2\u00a3\"\3\2\2\2\u00a4\u00a5\7>\2\2\u00a5$\3\2\2\2\u00a6"+
+ "\u00a7\7>\2\2\u00a7\u00a8\7?\2\2\u00a8&\3\2\2\2\u00a9\u00aa\7@\2\2\u00aa"+
+ "(\3\2\2\2\u00ab\u00ac\7@\2\2\u00ac\u00ad\7?\2\2\u00ad*\3\2\2\2\u00ae\u00af"+
+ "\7-\2\2\u00af,\3\2\2\2\u00b0\u00b1\7/\2\2\u00b1.\3\2\2\2\u00b2\u00b3\7"+
+ ",\2\2\u00b3\60\3\2\2\2\u00b4\u00b5\7\61\2\2\u00b5\62\3\2\2\2\u00b6\u00b7"+
+ "\7\'\2\2\u00b7\64\3\2\2\2\u00b8\u00b9\7\60\2\2\u00b9\66\3\2\2\2\u00ba"+
+ "\u00bb\7.\2\2\u00bb8\3\2\2\2\u00bc\u00bd\7]\2\2\u00bd:\3\2\2\2\u00be\u00bf"+
+ "\7_\2\2\u00bf<\3\2\2\2\u00c0\u00c1\7*\2\2\u00c1>\3\2\2\2\u00c2\u00c3\7"+
+ "+\2\2\u00c3@\3\2\2\2\u00c4\u00c5\7~\2\2\u00c5B\3\2\2\2\u00c6\u00cc\7)"+
+ "\2\2\u00c7\u00c8\7^\2\2\u00c8\u00cb\t\2\2\2\u00c9\u00cb\n\3\2\2\u00ca"+
+ "\u00c7\3\2\2\2\u00ca\u00c9\3\2\2\2\u00cb\u00ce\3\2\2\2\u00cc\u00ca\3\2"+
+ "\2\2\u00cc\u00cd\3\2\2\2\u00cd\u00cf\3\2\2\2\u00ce\u00cc\3\2\2\2\u00cf"+
+ "\u00f3\7)\2\2\u00d0\u00d6\7$\2\2\u00d1\u00d2\7^\2\2\u00d2\u00d5\t\2\2"+
+ "\2\u00d3\u00d5\n\4\2\2\u00d4\u00d1\3\2\2\2\u00d4\u00d3\3\2\2\2\u00d5\u00d8"+
+ "\3\2\2\2\u00d6\u00d4\3\2\2\2\u00d6\u00d7\3\2\2\2\u00d7\u00d9\3\2\2\2\u00d8"+
+ "\u00d6\3\2\2\2\u00d9\u00f3\7$\2\2\u00da\u00db\7A\2\2\u00db\u00dc\7$\2"+
+ "\2\u00dc\u00e2\3\2\2\2\u00dd\u00de\7^\2\2\u00de\u00e1\7$\2\2\u00df\u00e1"+
+ "\n\5\2\2\u00e0\u00dd\3\2\2\2\u00e0\u00df\3\2\2\2\u00e1\u00e4\3\2\2\2\u00e2"+
+ "\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3\u00e5\3\2\2\2\u00e4\u00e2\3\2"+
+ "\2\2\u00e5\u00f3\7$\2\2\u00e6\u00e7\7A\2\2\u00e7\u00e8\7)\2\2\u00e8\u00ee"+
+ "\3\2\2\2\u00e9\u00ea\7^\2\2\u00ea\u00ed\7)\2\2\u00eb\u00ed\n\6\2\2\u00ec"+
+ "\u00e9\3\2\2\2\u00ec\u00eb\3\2\2\2\u00ed\u00f0\3\2\2\2\u00ee\u00ec\3\2"+
+ "\2\2\u00ee\u00ef\3\2\2\2\u00ef\u00f1\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f1"+
+ "\u00f3\7)\2\2\u00f2\u00c6\3\2\2\2\u00f2\u00d0\3\2\2\2\u00f2\u00da\3\2"+
+ "\2\2\u00f2\u00e6\3\2\2\2\u00f3D\3\2\2\2\u00f4\u00f6\5M\'\2\u00f5\u00f4"+
+ "\3\2\2\2\u00f6\u00f7\3\2\2\2\u00f7\u00f5\3\2\2\2\u00f7\u00f8\3\2\2\2\u00f8"+
+ "F\3\2\2\2\u00f9\u00fb\5M\'\2\u00fa\u00f9\3\2\2\2\u00fb\u00fc\3\2\2\2\u00fc"+
+ "\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u00fe\3\2\2\2\u00fe\u0102\5\65"+
+ "\33\2\u00ff\u0101\5M\'\2\u0100\u00ff\3\2\2\2\u0101\u0104\3\2\2\2\u0102"+
+ "\u0100\3\2\2\2\u0102\u0103\3\2\2\2\u0103\u0124\3\2\2\2\u0104\u0102\3\2"+
+ "\2\2\u0105\u0107\5\65\33\2\u0106\u0108\5M\'\2\u0107\u0106\3\2\2\2\u0108"+
+ "\u0109\3\2\2\2\u0109\u0107\3\2\2\2\u0109\u010a\3\2\2\2\u010a\u0124\3\2"+
+ "\2\2\u010b\u010d\5M\'\2\u010c\u010b\3\2\2\2\u010d\u010e\3\2\2\2\u010e"+
+ "\u010c\3\2\2\2\u010e\u010f\3\2\2\2\u010f\u0117\3\2\2\2\u0110\u0114\5\65"+
+ "\33\2\u0111\u0113\5M\'\2\u0112\u0111\3\2\2\2\u0113\u0116\3\2\2\2\u0114"+
+ "\u0112\3\2\2\2\u0114\u0115\3\2\2\2\u0115\u0118\3\2\2\2\u0116\u0114\3\2"+
+ "\2\2\u0117\u0110\3\2\2\2\u0117\u0118\3\2\2\2\u0118\u0119\3\2\2\2\u0119"+
+ "\u011a\5K&\2\u011a\u0124\3\2\2\2\u011b\u011d\5\65\33\2\u011c\u011e\5M"+
+ "\'\2\u011d\u011c\3\2\2\2\u011e\u011f\3\2\2\2\u011f\u011d\3\2\2\2\u011f"+
+ "\u0120\3\2\2\2\u0120\u0121\3\2\2\2\u0121\u0122\5K&\2\u0122\u0124\3\2\2"+
+ "\2\u0123\u00fa\3\2\2\2\u0123\u0105\3\2\2\2\u0123\u010c\3\2\2\2\u0123\u011b"+
+ "\3\2\2\2\u0124H\3\2\2\2\u0125\u0128\5O(\2\u0126\u0128\7a\2\2\u0127\u0125"+
+ "\3\2\2\2\u0127\u0126\3\2\2\2\u0128\u012e\3\2\2\2\u0129\u012d\5O(\2\u012a"+
+ "\u012d\5M\'\2\u012b\u012d\7a\2\2\u012c\u0129\3\2\2\2\u012c\u012a\3\2\2"+
+ "\2\u012c\u012b\3\2\2\2\u012d\u0130\3\2\2\2\u012e\u012c\3\2\2\2\u012e\u012f"+
+ "\3\2\2\2\u012fJ\3\2\2\2\u0130\u012e\3\2\2\2\u0131\u0133\t\7\2\2\u0132"+
+ "\u0134\t\b\2\2\u0133\u0132\3\2\2\2\u0133\u0134\3\2\2\2\u0134\u0136\3\2"+
+ "\2\2\u0135\u0137\5M\'\2\u0136\u0135\3\2\2\2\u0137\u0138\3\2\2\2\u0138"+
+ "\u0136\3\2\2\2\u0138\u0139\3\2\2\2\u0139L\3\2\2\2\u013a\u013b\t\t\2\2"+
+ "\u013bN\3\2\2\2\u013c\u013d\t\n\2\2\u013dP\3\2\2\2\u013e\u013f\7\61\2"+
+ "\2\u013f\u0140\7\61\2\2\u0140\u0144\3\2\2\2\u0141\u0143\n\13\2\2\u0142"+
+ "\u0141\3\2\2\2\u0143\u0146\3\2\2\2\u0144\u0142\3\2\2\2\u0144\u0145\3\2"+
+ "\2\2\u0145\u0148\3\2\2\2\u0146\u0144\3\2\2\2\u0147\u0149\7\17\2\2\u0148"+
+ "\u0147\3\2\2\2\u0148\u0149\3\2\2\2\u0149\u014b\3\2\2\2\u014a\u014c\7\f"+
+ "\2\2\u014b\u014a\3\2\2\2\u014b\u014c\3\2\2\2\u014c\u014d\3\2\2\2\u014d"+
+ "\u014e\b)\2\2\u014eR\3\2\2\2\u014f\u0150\7\61\2\2\u0150\u0151\7,\2\2\u0151"+
+ "\u0156\3\2\2\2\u0152\u0155\5S*\2\u0153\u0155\13\2\2\2\u0154\u0152\3\2"+
+ "\2\2\u0154\u0153\3\2\2\2\u0155\u0158\3\2\2\2\u0156\u0157\3\2\2\2\u0156"+
+ "\u0154\3\2\2\2\u0157\u0159\3\2\2\2\u0158\u0156\3\2\2\2\u0159\u015a\7,"+
+ "\2\2\u015a\u015b\7\61\2\2\u015b\u015c\3\2\2\2\u015c\u015d\b*\2\2\u015d"+
+ "T\3\2\2\2\u015e\u0160\t\f\2\2\u015f\u015e\3\2\2\2\u0160\u0161\3\2\2\2"+
+ "\u0161\u015f\3\2\2\2\u0161\u0162\3\2\2\2\u0162\u0163\3\2\2\2\u0163\u0164"+
+ "\b+\2\2\u0164V\3\2\2\2\u0165\u0166\13\2\2\2\u0166X\3\2\2\2!\2\u009f\u00ca"+
+ "\u00cc\u00d4\u00d6\u00e0\u00e2\u00ec\u00ee\u00f2\u00f7\u00fc\u0102\u0109"+
+ "\u010e\u0114\u0117\u011f\u0123\u0127\u012c\u012e\u0133\u0138\u0144\u0148"+
+ "\u014b\u0154\u0156\u0161\3\2\3\2";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
index 1a6d2e5742d5d..1b85b38d1be30 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
@@ -47,6 +47,16 @@ interface EqlBaseListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitQuery(EqlBaseParser.QueryContext ctx);
+ /**
+ * Enter a parse tree produced by {@link EqlBaseParser#withParams}.
+ * @param ctx the parse tree
+ */
+ void enterWithParams(EqlBaseParser.WithParamsContext ctx);
+ /**
+ * Exit a parse tree produced by {@link EqlBaseParser#withParams}.
+ * @param ctx the parse tree
+ */
+ void exitWithParams(EqlBaseParser.WithParamsContext ctx);
/**
* Enter a parse tree produced by {@link EqlBaseParser#sequence}.
* @param ctx the parse tree
@@ -77,6 +87,16 @@ interface EqlBaseListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitPipe(EqlBaseParser.PipeContext ctx);
+ /**
+ * Enter a parse tree produced by {@link EqlBaseParser#namedParam}.
+ * @param ctx the parse tree
+ */
+ void enterNamedParam(EqlBaseParser.NamedParamContext ctx);
+ /**
+ * Exit a parse tree produced by {@link EqlBaseParser#namedParam}.
+ * @param ctx the parse tree
+ */
+ void exitNamedParam(EqlBaseParser.NamedParamContext ctx);
/**
* Enter a parse tree produced by {@link EqlBaseParser#joinKeys}.
* @param ctx the parse tree
@@ -88,35 +108,45 @@ interface EqlBaseListener extends ParseTreeListener {
*/
void exitJoinKeys(EqlBaseParser.JoinKeysContext ctx);
/**
- * Enter a parse tree produced by {@link EqlBaseParser#span}.
+ * Enter a parse tree produced by {@link EqlBaseParser#joinTerm}.
+ * @param ctx the parse tree
+ */
+ void enterJoinTerm(EqlBaseParser.JoinTermContext ctx);
+ /**
+ * Exit a parse tree produced by {@link EqlBaseParser#joinTerm}.
* @param ctx the parse tree
*/
- void enterSpan(EqlBaseParser.SpanContext ctx);
+ void exitJoinTerm(EqlBaseParser.JoinTermContext ctx);
/**
- * Exit a parse tree produced by {@link EqlBaseParser#span}.
+ * Enter a parse tree produced by {@link EqlBaseParser#sequenceTerm}.
* @param ctx the parse tree
*/
- void exitSpan(EqlBaseParser.SpanContext ctx);
+ void enterSequenceTerm(EqlBaseParser.SequenceTermContext ctx);
/**
- * Enter a parse tree produced by {@link EqlBaseParser#match}.
+ * Exit a parse tree produced by {@link EqlBaseParser#sequenceTerm}.
* @param ctx the parse tree
*/
- void enterMatch(EqlBaseParser.MatchContext ctx);
+ void exitSequenceTerm(EqlBaseParser.SequenceTermContext ctx);
/**
- * Exit a parse tree produced by {@link EqlBaseParser#match}.
+ * Enter a parse tree produced by {@link EqlBaseParser#subquery}.
* @param ctx the parse tree
*/
- void exitMatch(EqlBaseParser.MatchContext ctx);
+ void enterSubquery(EqlBaseParser.SubqueryContext ctx);
/**
- * Enter a parse tree produced by {@link EqlBaseParser#condition}.
+ * Exit a parse tree produced by {@link EqlBaseParser#subquery}.
* @param ctx the parse tree
*/
- void enterCondition(EqlBaseParser.ConditionContext ctx);
+ void exitSubquery(EqlBaseParser.SubqueryContext ctx);
/**
- * Exit a parse tree produced by {@link EqlBaseParser#condition}.
+ * Enter a parse tree produced by {@link EqlBaseParser#eventQuery}.
* @param ctx the parse tree
*/
- void exitCondition(EqlBaseParser.ConditionContext ctx);
+ void enterEventQuery(EqlBaseParser.EventQueryContext ctx);
+ /**
+ * Exit a parse tree produced by {@link EqlBaseParser#eventQuery}.
+ * @param ctx the parse tree
+ */
+ void exitEventQuery(EqlBaseParser.EventQueryContext ctx);
/**
* Enter a parse tree produced by {@link EqlBaseParser#expression}.
* @param ctx the parse tree
@@ -151,6 +181,18 @@ interface EqlBaseListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitBooleanDefault(EqlBaseParser.BooleanDefaultContext ctx);
+ /**
+ * Enter a parse tree produced by the {@code processCheck}
+ * labeled alternative in {@link EqlBaseParser#booleanExpression}.
+ * @param ctx the parse tree
+ */
+ void enterProcessCheck(EqlBaseParser.ProcessCheckContext ctx);
+ /**
+ * Exit a parse tree produced by the {@code processCheck}
+ * labeled alternative in {@link EqlBaseParser#booleanExpression}.
+ * @param ctx the parse tree
+ */
+ void exitProcessCheck(EqlBaseParser.ProcessCheckContext ctx);
/**
* Enter a parse tree produced by the {@code logicalBinary}
* labeled alternative in {@link EqlBaseParser#booleanExpression}.
@@ -357,16 +399,6 @@ interface EqlBaseListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitBooleanValue(EqlBaseParser.BooleanValueContext ctx);
- /**
- * Enter a parse tree produced by {@link EqlBaseParser#qualifiedNames}.
- * @param ctx the parse tree
- */
- void enterQualifiedNames(EqlBaseParser.QualifiedNamesContext ctx);
- /**
- * Exit a parse tree produced by {@link EqlBaseParser#qualifiedNames}.
- * @param ctx the parse tree
- */
- void exitQualifiedNames(EqlBaseParser.QualifiedNamesContext ctx);
/**
* Enter a parse tree produced by {@link EqlBaseParser#qualifiedName}.
* @param ctx the parse tree
@@ -388,41 +420,15 @@ interface EqlBaseListener extends ParseTreeListener {
*/
void exitIdentifier(EqlBaseParser.IdentifierContext ctx);
/**
- * Enter a parse tree produced by the {@code quotedIdentifier}
- * labeled alternative in {@link EqlBaseParser#quoteIdentifier}.
- * @param ctx the parse tree
- */
- void enterQuotedIdentifier(EqlBaseParser.QuotedIdentifierContext ctx);
- /**
- * Exit a parse tree produced by the {@code quotedIdentifier}
- * labeled alternative in {@link EqlBaseParser#quoteIdentifier}.
- * @param ctx the parse tree
- */
- void exitQuotedIdentifier(EqlBaseParser.QuotedIdentifierContext ctx);
- /**
- * Enter a parse tree produced by the {@code unquotedIdentifier}
- * labeled alternative in {@link EqlBaseParser#unquoteIdentifier}.
- * @param ctx the parse tree
- */
- void enterUnquotedIdentifier(EqlBaseParser.UnquotedIdentifierContext ctx);
- /**
- * Exit a parse tree produced by the {@code unquotedIdentifier}
- * labeled alternative in {@link EqlBaseParser#unquoteIdentifier}.
- * @param ctx the parse tree
- */
- void exitUnquotedIdentifier(EqlBaseParser.UnquotedIdentifierContext ctx);
- /**
- * Enter a parse tree produced by the {@code digitIdentifier}
- * labeled alternative in {@link EqlBaseParser#unquoteIdentifier}.
+ * Enter a parse tree produced by {@link EqlBaseParser#timeUnit}.
* @param ctx the parse tree
*/
- void enterDigitIdentifier(EqlBaseParser.DigitIdentifierContext ctx);
+ void enterTimeUnit(EqlBaseParser.TimeUnitContext ctx);
/**
- * Exit a parse tree produced by the {@code digitIdentifier}
- * labeled alternative in {@link EqlBaseParser#unquoteIdentifier}.
+ * Exit a parse tree produced by {@link EqlBaseParser#timeUnit}.
* @param ctx the parse tree
*/
- void exitDigitIdentifier(EqlBaseParser.DigitIdentifierContext ctx);
+ void exitTimeUnit(EqlBaseParser.TimeUnitContext ctx);
/**
* Enter a parse tree produced by the {@code decimalLiteral}
* labeled alternative in {@link EqlBaseParser#number}.
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
index 8003fc65c9784..8197cd53fe672 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
@@ -17,47 +17,43 @@ class EqlBaseParser extends Parser {
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
- AND=1, ANY=2, ASC=3, BETWEEN=4, BY=5, CHILD=6, DESCENDANT=7, EVENT=8,
- FALSE=9, IN=10, JOIN=11, MAXSPAN=12, NOT=13, NULL=14, OF=15, OR=16, SEQUENCE=17,
- TRUE=18, UNTIL=19, WHERE=20, WITH=21, EQ=22, NEQ=23, LT=24, LTE=25, GT=26,
- GTE=27, PLUS=28, MINUS=29, ASTERISK=30, SLASH=31, PERCENT=32, DOT=33,
- COMMA=34, LB=35, RB=36, LP=37, RP=38, PIPE=39, STRING=40, INTEGER_VALUE=41,
- DECIMAL_VALUE=42, IDENTIFIER=43, DIGIT_IDENTIFIER=44, QUOTED_IDENTIFIER=45,
- SIMPLE_COMMENT=46, BRACKETED_COMMENT=47, WS=48, UNRECOGNIZED=49, DELIMITER=50;
+ AND=1, BY=2, FALSE=3, IN=4, JOIN=5, NOT=6, NULL=7, OF=8, OR=9, SEQUENCE=10,
+ TRUE=11, UNTIL=12, WHERE=13, WITH=14, EQ=15, NEQ=16, LT=17, LTE=18, GT=19,
+ GTE=20, PLUS=21, MINUS=22, ASTERISK=23, SLASH=24, PERCENT=25, DOT=26,
+ COMMA=27, LB=28, RB=29, LP=30, RP=31, PIPE=32, STRING=33, INTEGER_VALUE=34,
+ DECIMAL_VALUE=35, IDENTIFIER=36, LINE_COMMENT=37, BRACKETED_COMMENT=38,
+ WS=39, UNRECOGNIZED=40;
public static final int
RULE_singleStatement = 0, RULE_singleExpression = 1, RULE_statement = 2,
- RULE_query = 3, RULE_sequence = 4, RULE_join = 5, RULE_pipe = 6, RULE_joinKeys = 7,
- RULE_span = 8, RULE_match = 9, RULE_condition = 10, RULE_expression = 11,
- RULE_booleanExpression = 12, RULE_predicated = 13, RULE_predicate = 14,
- RULE_valueExpression = 15, RULE_primaryExpression = 16, RULE_functionExpression = 17,
- RULE_constant = 18, RULE_comparisonOperator = 19, RULE_booleanValue = 20,
- RULE_qualifiedNames = 21, RULE_qualifiedName = 22, RULE_identifier = 23,
- RULE_quoteIdentifier = 24, RULE_unquoteIdentifier = 25, RULE_number = 26,
- RULE_string = 27;
+ RULE_query = 3, RULE_withParams = 4, RULE_sequence = 5, RULE_join = 6,
+ RULE_pipe = 7, RULE_namedParam = 8, RULE_joinKeys = 9, RULE_joinTerm = 10,
+ RULE_sequenceTerm = 11, RULE_subquery = 12, RULE_eventQuery = 13, RULE_expression = 14,
+ RULE_booleanExpression = 15, RULE_predicated = 16, RULE_predicate = 17,
+ RULE_valueExpression = 18, RULE_primaryExpression = 19, RULE_functionExpression = 20,
+ RULE_constant = 21, RULE_comparisonOperator = 22, RULE_booleanValue = 23,
+ RULE_qualifiedName = 24, RULE_identifier = 25, RULE_timeUnit = 26, RULE_number = 27,
+ RULE_string = 28;
public static final String[] ruleNames = {
- "singleStatement", "singleExpression", "statement", "query", "sequence",
- "join", "pipe", "joinKeys", "span", "match", "condition", "expression",
- "booleanExpression", "predicated", "predicate", "valueExpression", "primaryExpression",
- "functionExpression", "constant", "comparisonOperator", "booleanValue",
- "qualifiedNames", "qualifiedName", "identifier", "quoteIdentifier", "unquoteIdentifier",
- "number", "string"
+ "singleStatement", "singleExpression", "statement", "query", "withParams",
+ "sequence", "join", "pipe", "namedParam", "joinKeys", "joinTerm", "sequenceTerm",
+ "subquery", "eventQuery", "expression", "booleanExpression", "predicated",
+ "predicate", "valueExpression", "primaryExpression", "functionExpression",
+ "constant", "comparisonOperator", "booleanValue", "qualifiedName", "identifier",
+ "timeUnit", "number", "string"
};
private static final String[] _LITERAL_NAMES = {
- null, "'AND'", "'ANY'", "'ASC'", "'BETWEEN'", "'BY'", "'CHILD'", "'DESCENDANT'",
- "'EVENT'", "'FALSE'", "'IN'", "'JOIN'", "'MAXSPAN'", "'NOT'", "'NULL'",
- "'OF'", "'OR'", "'SEQUENCE'", "'TRUE'", "'UNTIL'", "'WHERE'", "'WITH'",
- null, null, "'<'", "'<='", "'>'", "'>='", "'+'", "'-'", "'*'", "'/'",
+ null, "'and'", "'by'", "'false'", "'in'", "'join'", "'not'", "'null'",
+ "'of'", "'or'", "'sequence'", "'true'", "'until'", "'where'", "'with'",
+ null, "'!='", "'<'", "'<='", "'>'", "'>='", "'+'", "'-'", "'*'", "'/'",
"'%'", "'.'", "','", "'['", "']'", "'('", "')'", "'|'"
};
private static final String[] _SYMBOLIC_NAMES = {
- null, "AND", "ANY", "ASC", "BETWEEN", "BY", "CHILD", "DESCENDANT", "EVENT",
- "FALSE", "IN", "JOIN", "MAXSPAN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
+ null, "AND", "BY", "FALSE", "IN", "JOIN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
"TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ", "LT", "LTE", "GT", "GTE",
"PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "DOT", "COMMA", "LB",
"RB", "LP", "RP", "PIPE", "STRING", "INTEGER_VALUE", "DECIMAL_VALUE",
- "IDENTIFIER", "DIGIT_IDENTIFIER", "QUOTED_IDENTIFIER", "SIMPLE_COMMENT",
- "BRACKETED_COMMENT", "WS", "UNRECOGNIZED", "DELIMITER"
+ "IDENTIFIER", "LINE_COMMENT", "BRACKETED_COMMENT", "WS", "UNRECOGNIZED"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
@@ -138,9 +134,9 @@ public final SingleStatementContext singleStatement() throws RecognitionExceptio
try {
enterOuterAlt(_localctx, 1);
{
- setState(56);
+ setState(58);
statement();
- setState(57);
+ setState(59);
match(EOF);
}
}
@@ -185,9 +181,9 @@ public final SingleExpressionContext singleExpression() throws RecognitionExcept
try {
enterOuterAlt(_localctx, 1);
{
- setState(59);
+ setState(61);
expression();
- setState(60);
+ setState(62);
match(EOF);
}
}
@@ -242,21 +238,21 @@ public final StatementContext statement() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(62);
+ setState(64);
query();
- setState(67);
+ setState(69);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==PIPE) {
{
{
- setState(63);
+ setState(65);
match(PIPE);
- setState(64);
+ setState(66);
pipe();
}
}
- setState(69);
+ setState(71);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -280,8 +276,8 @@ public SequenceContext sequence() {
public JoinContext join() {
return getRuleContext(JoinContext.class,0);
}
- public ConditionContext condition() {
- return getRuleContext(ConditionContext.class,0);
+ public EventQueryContext eventQuery() {
+ return getRuleContext(EventQueryContext.class,0);
}
public QueryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
@@ -306,29 +302,27 @@ public final QueryContext query() throws RecognitionException {
QueryContext _localctx = new QueryContext(_ctx, getState());
enterRule(_localctx, 6, RULE_query);
try {
- setState(73);
+ setState(75);
switch (_input.LA(1)) {
case SEQUENCE:
enterOuterAlt(_localctx, 1);
{
- setState(70);
+ setState(72);
sequence();
}
break;
case JOIN:
enterOuterAlt(_localctx, 2);
{
- setState(71);
+ setState(73);
join();
}
break;
case IDENTIFIER:
- case DIGIT_IDENTIFIER:
- case QUOTED_IDENTIFIER:
enterOuterAlt(_localctx, 3);
{
- setState(72);
- condition();
+ setState(74);
+ eventQuery();
}
break;
default:
@@ -346,17 +340,88 @@ public final QueryContext query() throws RecognitionException {
return _localctx;
}
+ public static class WithParamsContext extends ParserRuleContext {
+ public TerminalNode WITH() { return getToken(EqlBaseParser.WITH, 0); }
+ public List namedParam() {
+ return getRuleContexts(NamedParamContext.class);
+ }
+ public NamedParamContext namedParam(int i) {
+ return getRuleContext(NamedParamContext.class,i);
+ }
+ public List COMMA() { return getTokens(EqlBaseParser.COMMA); }
+ public TerminalNode COMMA(int i) {
+ return getToken(EqlBaseParser.COMMA, i);
+ }
+ public WithParamsContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_withParams; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterWithParams(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitWithParams(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitWithParams(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final WithParamsContext withParams() throws RecognitionException {
+ WithParamsContext _localctx = new WithParamsContext(_ctx, getState());
+ enterRule(_localctx, 8, RULE_withParams);
+ int _la;
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(77);
+ match(WITH);
+ setState(78);
+ namedParam();
+ setState(83);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==COMMA) {
+ {
+ {
+ setState(79);
+ match(COMMA);
+ setState(80);
+ namedParam();
+ }
+ }
+ setState(85);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
public static class SequenceContext extends ParserRuleContext {
public JoinKeysContext by;
public TerminalNode SEQUENCE() { return getToken(EqlBaseParser.SEQUENCE, 0); }
- public SpanContext span() {
- return getRuleContext(SpanContext.class,0);
+ public List sequenceTerm() {
+ return getRuleContexts(SequenceTermContext.class);
}
- public List match() {
- return getRuleContexts(MatchContext.class);
+ public SequenceTermContext sequenceTerm(int i) {
+ return getRuleContext(SequenceTermContext.class,i);
}
- public MatchContext match(int i) {
- return getRuleContext(MatchContext.class,i);
+ public WithParamsContext withParams() {
+ return getRuleContext(WithParamsContext.class,0);
}
public TerminalNode UNTIL() { return getToken(EqlBaseParser.UNTIL, 0); }
public JoinKeysContext joinKeys() {
@@ -383,53 +448,74 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final SequenceContext sequence() throws RecognitionException {
SequenceContext _localctx = new SequenceContext(_ctx, getState());
- enterRule(_localctx, 8, RULE_sequence);
+ enterRule(_localctx, 10, RULE_sequence);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(75);
+ setState(86);
match(SEQUENCE);
- setState(77);
- _la = _input.LA(1);
- if (_la==BY) {
+ setState(95);
+ switch (_input.LA(1)) {
+ case BY:
{
- setState(76);
+ setState(87);
((SequenceContext)_localctx).by = joinKeys();
+ setState(89);
+ _la = _input.LA(1);
+ if (_la==WITH) {
+ {
+ setState(88);
+ withParams();
+ }
}
- }
- setState(80);
- _la = _input.LA(1);
- if (_la==WITH) {
+ }
+ break;
+ case WITH:
{
- setState(79);
- span();
+ setState(91);
+ withParams();
+ setState(93);
+ _la = _input.LA(1);
+ if (_la==BY) {
+ {
+ setState(92);
+ ((SequenceContext)_localctx).by = joinKeys();
+ }
}
- }
- setState(83);
+ }
+ break;
+ case LB:
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ setState(97);
+ sequenceTerm();
+ setState(99);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
- setState(82);
- match();
+ setState(98);
+ sequenceTerm();
}
}
- setState(85);
+ setState(101);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==LB );
- setState(89);
+ setState(105);
_la = _input.LA(1);
if (_la==UNTIL) {
{
- setState(87);
+ setState(103);
match(UNTIL);
- setState(88);
- match();
+ setState(104);
+ sequenceTerm();
}
}
@@ -449,11 +535,11 @@ public final SequenceContext sequence() throws RecognitionException {
public static class JoinContext extends ParserRuleContext {
public JoinKeysContext by;
public TerminalNode JOIN() { return getToken(EqlBaseParser.JOIN, 0); }
- public List match() {
- return getRuleContexts(MatchContext.class);
+ public List joinTerm() {
+ return getRuleContexts(JoinTermContext.class);
}
- public MatchContext match(int i) {
- return getRuleContext(MatchContext.class,i);
+ public JoinTermContext joinTerm(int i) {
+ return getRuleContext(JoinTermContext.class,i);
}
public TerminalNode UNTIL() { return getToken(EqlBaseParser.UNTIL, 0); }
public JoinKeysContext joinKeys() {
@@ -480,44 +566,46 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final JoinContext join() throws RecognitionException {
JoinContext _localctx = new JoinContext(_ctx, getState());
- enterRule(_localctx, 10, RULE_join);
+ enterRule(_localctx, 12, RULE_join);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(91);
+ setState(107);
match(JOIN);
- setState(93);
+ setState(109);
_la = _input.LA(1);
if (_la==BY) {
{
- setState(92);
+ setState(108);
((JoinContext)_localctx).by = joinKeys();
}
}
- setState(96);
+ setState(111);
+ joinTerm();
+ setState(113);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
- setState(95);
- match();
+ setState(112);
+ joinTerm();
}
}
- setState(98);
+ setState(115);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==LB );
- setState(102);
+ setState(119);
_la = _input.LA(1);
if (_la==UNTIL) {
{
- setState(100);
+ setState(117);
match(UNTIL);
- setState(101);
- match();
+ setState(118);
+ joinTerm();
}
}
@@ -568,32 +656,32 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final PipeContext pipe() throws RecognitionException {
PipeContext _localctx = new PipeContext(_ctx, getState());
- enterRule(_localctx, 12, RULE_pipe);
+ enterRule(_localctx, 14, RULE_pipe);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(104);
+ setState(121);
((PipeContext)_localctx).kind = match(IDENTIFIER);
- setState(113);
+ setState(130);
_la = _input.LA(1);
- if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER) | (1L << DIGIT_IDENTIFIER) | (1L << QUOTED_IDENTIFIER))) != 0)) {
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER))) != 0)) {
{
- setState(105);
+ setState(122);
booleanExpression(0);
- setState(110);
+ setState(127);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(106);
+ setState(123);
match(COMMA);
- setState(107);
+ setState(124);
booleanExpression(0);
}
}
- setState(112);
+ setState(129);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -613,10 +701,85 @@ public final PipeContext pipe() throws RecognitionException {
return _localctx;
}
+ public static class NamedParamContext extends ParserRuleContext {
+ public Token key;
+ public TerminalNode EQ() { return getToken(EqlBaseParser.EQ, 0); }
+ public TerminalNode IDENTIFIER() { return getToken(EqlBaseParser.IDENTIFIER, 0); }
+ public ExpressionContext expression() {
+ return getRuleContext(ExpressionContext.class,0);
+ }
+ public TimeUnitContext timeUnit() {
+ return getRuleContext(TimeUnitContext.class,0);
+ }
+ public NamedParamContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_namedParam; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterNamedParam(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitNamedParam(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitNamedParam(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final NamedParamContext namedParam() throws RecognitionException {
+ NamedParamContext _localctx = new NamedParamContext(_ctx, getState());
+ enterRule(_localctx, 16, RULE_namedParam);
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(132);
+ ((NamedParamContext)_localctx).key = match(IDENTIFIER);
+ setState(133);
+ match(EQ);
+ setState(136);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,13,_ctx) ) {
+ case 1:
+ {
+ setState(134);
+ expression();
+ }
+ break;
+ case 2:
+ {
+ setState(135);
+ timeUnit();
+ }
+ break;
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
public static class JoinKeysContext extends ParserRuleContext {
public TerminalNode BY() { return getToken(EqlBaseParser.BY, 0); }
- public QualifiedNamesContext qualifiedNames() {
- return getRuleContext(QualifiedNamesContext.class,0);
+ public List expression() {
+ return getRuleContexts(ExpressionContext.class);
+ }
+ public ExpressionContext expression(int i) {
+ return getRuleContext(ExpressionContext.class,i);
+ }
+ public List COMMA() { return getTokens(EqlBaseParser.COMMA); }
+ public TerminalNode COMMA(int i) {
+ return getToken(EqlBaseParser.COMMA, i);
}
public JoinKeysContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
@@ -639,14 +802,31 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final JoinKeysContext joinKeys() throws RecognitionException {
JoinKeysContext _localctx = new JoinKeysContext(_ctx, getState());
- enterRule(_localctx, 14, RULE_joinKeys);
+ enterRule(_localctx, 18, RULE_joinKeys);
+ int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(115);
+ setState(138);
match(BY);
- setState(116);
- qualifiedNames();
+ setState(139);
+ expression();
+ setState(144);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==COMMA) {
+ {
+ {
+ setState(140);
+ match(COMMA);
+ setState(141);
+ expression();
+ }
+ }
+ setState(146);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
}
}
catch (RecognitionException re) {
@@ -660,44 +840,51 @@ public final JoinKeysContext joinKeys() throws RecognitionException {
return _localctx;
}
- public static class SpanContext extends ParserRuleContext {
- public TerminalNode WITH() { return getToken(EqlBaseParser.WITH, 0); }
- public TerminalNode MAXSPAN() { return getToken(EqlBaseParser.MAXSPAN, 0); }
- public TerminalNode EQ() { return getToken(EqlBaseParser.EQ, 0); }
- public TerminalNode DIGIT_IDENTIFIER() { return getToken(EqlBaseParser.DIGIT_IDENTIFIER, 0); }
- public SpanContext(ParserRuleContext parent, int invokingState) {
+ public static class JoinTermContext extends ParserRuleContext {
+ public JoinKeysContext by;
+ public SubqueryContext subquery() {
+ return getRuleContext(SubqueryContext.class,0);
+ }
+ public JoinKeysContext joinKeys() {
+ return getRuleContext(JoinKeysContext.class,0);
+ }
+ public JoinTermContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
- @Override public int getRuleIndex() { return RULE_span; }
+ @Override public int getRuleIndex() { return RULE_joinTerm; }
@Override
public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterSpan(this);
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterJoinTerm(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitSpan(this);
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitJoinTerm(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
- if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitSpan(this);
+ if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitJoinTerm(this);
else return visitor.visitChildren(this);
}
}
- public final SpanContext span() throws RecognitionException {
- SpanContext _localctx = new SpanContext(_ctx, getState());
- enterRule(_localctx, 16, RULE_span);
+ public final JoinTermContext joinTerm() throws RecognitionException {
+ JoinTermContext _localctx = new JoinTermContext(_ctx, getState());
+ enterRule(_localctx, 20, RULE_joinTerm);
+ int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(118);
- match(WITH);
- setState(119);
- match(MAXSPAN);
- setState(120);
- match(EQ);
- setState(121);
- match(DIGIT_IDENTIFIER);
+ setState(147);
+ subquery();
+ setState(149);
+ _la = _input.LA(1);
+ if (_la==BY) {
+ {
+ setState(148);
+ ((JoinTermContext)_localctx).by = joinKeys();
+ }
+ }
+
}
}
catch (RecognitionException re) {
@@ -711,54 +898,68 @@ public final SpanContext span() throws RecognitionException {
return _localctx;
}
- public static class MatchContext extends ParserRuleContext {
+ public static class SequenceTermContext extends ParserRuleContext {
public JoinKeysContext by;
- public TerminalNode LB() { return getToken(EqlBaseParser.LB, 0); }
- public ConditionContext condition() {
- return getRuleContext(ConditionContext.class,0);
+ public SubqueryContext subquery() {
+ return getRuleContext(SubqueryContext.class,0);
+ }
+ public List namedParam() {
+ return getRuleContexts(NamedParamContext.class);
+ }
+ public NamedParamContext namedParam(int i) {
+ return getRuleContext(NamedParamContext.class,i);
}
- public TerminalNode RB() { return getToken(EqlBaseParser.RB, 0); }
public JoinKeysContext joinKeys() {
return getRuleContext(JoinKeysContext.class,0);
}
- public MatchContext(ParserRuleContext parent, int invokingState) {
+ public SequenceTermContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
- @Override public int getRuleIndex() { return RULE_match; }
+ @Override public int getRuleIndex() { return RULE_sequenceTerm; }
@Override
public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterMatch(this);
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterSequenceTerm(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitMatch(this);
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitSequenceTerm(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
- if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitMatch(this);
+ if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitSequenceTerm(this);
else return visitor.visitChildren(this);
}
}
- public final MatchContext match() throws RecognitionException {
- MatchContext _localctx = new MatchContext(_ctx, getState());
- enterRule(_localctx, 18, RULE_match);
+ public final SequenceTermContext sequenceTerm() throws RecognitionException {
+ SequenceTermContext _localctx = new SequenceTermContext(_ctx, getState());
+ enterRule(_localctx, 22, RULE_sequenceTerm);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(123);
- match(LB);
- setState(124);
- condition();
- setState(125);
- match(RB);
- setState(127);
+ setState(151);
+ subquery();
+ setState(155);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==IDENTIFIER) {
+ {
+ {
+ setState(152);
+ namedParam();
+ }
+ }
+ setState(157);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ }
+ setState(159);
_la = _input.LA(1);
if (_la==BY) {
{
- setState(126);
- ((MatchContext)_localctx).by = joinKeys();
+ setState(158);
+ ((SequenceTermContext)_localctx).by = joinKeys();
}
}
@@ -775,45 +976,95 @@ public final MatchContext match() throws RecognitionException {
return _localctx;
}
- public static class ConditionContext extends ParserRuleContext {
- public QualifiedNameContext event;
+ public static class SubqueryContext extends ParserRuleContext {
+ public TerminalNode LB() { return getToken(EqlBaseParser.LB, 0); }
+ public EventQueryContext eventQuery() {
+ return getRuleContext(EventQueryContext.class,0);
+ }
+ public TerminalNode RB() { return getToken(EqlBaseParser.RB, 0); }
+ public SubqueryContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_subquery; }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterSubquery(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitSubquery(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitSubquery(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final SubqueryContext subquery() throws RecognitionException {
+ SubqueryContext _localctx = new SubqueryContext(_ctx, getState());
+ enterRule(_localctx, 24, RULE_subquery);
+ try {
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(161);
+ match(LB);
+ setState(162);
+ eventQuery();
+ setState(163);
+ match(RB);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class EventQueryContext extends ParserRuleContext {
+ public IdentifierContext event;
public TerminalNode WHERE() { return getToken(EqlBaseParser.WHERE, 0); }
public ExpressionContext expression() {
return getRuleContext(ExpressionContext.class,0);
}
- public QualifiedNameContext qualifiedName() {
- return getRuleContext(QualifiedNameContext.class,0);
+ public IdentifierContext identifier() {
+ return getRuleContext(IdentifierContext.class,0);
}
- public ConditionContext(ParserRuleContext parent, int invokingState) {
+ public EventQueryContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
- @Override public int getRuleIndex() { return RULE_condition; }
+ @Override public int getRuleIndex() { return RULE_eventQuery; }
@Override
public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterCondition(this);
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterEventQuery(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitCondition(this);
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitEventQuery(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
- if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitCondition(this);
+ if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitEventQuery(this);
else return visitor.visitChildren(this);
}
}
- public final ConditionContext condition() throws RecognitionException {
- ConditionContext _localctx = new ConditionContext(_ctx, getState());
- enterRule(_localctx, 20, RULE_condition);
+ public final EventQueryContext eventQuery() throws RecognitionException {
+ EventQueryContext _localctx = new EventQueryContext(_ctx, getState());
+ enterRule(_localctx, 26, RULE_eventQuery);
try {
enterOuterAlt(_localctx, 1);
{
- setState(129);
- ((ConditionContext)_localctx).event = qualifiedName();
- setState(130);
+ setState(165);
+ ((EventQueryContext)_localctx).event = identifier();
+ setState(166);
match(WHERE);
- setState(131);
+ setState(167);
expression();
}
}
@@ -853,11 +1104,11 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final ExpressionContext expression() throws RecognitionException {
ExpressionContext _localctx = new ExpressionContext(_ctx, getState());
- enterRule(_localctx, 22, RULE_expression);
+ enterRule(_localctx, 28, RULE_expression);
try {
enterOuterAlt(_localctx, 1);
{
- setState(133);
+ setState(169);
booleanExpression(0);
}
}
@@ -922,6 +1173,30 @@ public T accept(ParseTreeVisitor extends T> visitor) {
else return visitor.visitChildren(this);
}
}
+ public static class ProcessCheckContext extends BooleanExpressionContext {
+ public IdentifierContext relationship;
+ public TerminalNode OF() { return getToken(EqlBaseParser.OF, 0); }
+ public SubqueryContext subquery() {
+ return getRuleContext(SubqueryContext.class,0);
+ }
+ public IdentifierContext identifier() {
+ return getRuleContext(IdentifierContext.class,0);
+ }
+ public ProcessCheckContext(BooleanExpressionContext ctx) { copyFrom(ctx); }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterProcessCheck(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitProcessCheck(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitProcessCheck(this);
+ else return visitor.visitChildren(this);
+ }
+ }
public static class LogicalBinaryContext extends BooleanExpressionContext {
public BooleanExpressionContext left;
public Token operator;
@@ -959,71 +1234,72 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
int _parentState = getState();
BooleanExpressionContext _localctx = new BooleanExpressionContext(_ctx, _parentState);
BooleanExpressionContext _prevctx = _localctx;
- int _startState = 24;
- enterRecursionRule(_localctx, 24, RULE_booleanExpression, _p);
+ int _startState = 30;
+ enterRecursionRule(_localctx, 30, RULE_booleanExpression, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(139);
- switch (_input.LA(1)) {
- case NOT:
+ setState(179);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) {
+ case 1:
{
_localctx = new LogicalNotContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(136);
+ setState(172);
match(NOT);
- setState(137);
- booleanExpression(4);
+ setState(173);
+ booleanExpression(5);
}
break;
- case FALSE:
- case NULL:
- case TRUE:
- case PLUS:
- case MINUS:
- case LP:
- case STRING:
- case INTEGER_VALUE:
- case DECIMAL_VALUE:
- case IDENTIFIER:
- case DIGIT_IDENTIFIER:
- case QUOTED_IDENTIFIER:
+ case 2:
+ {
+ _localctx = new ProcessCheckContext(_localctx);
+ _ctx = _localctx;
+ _prevctx = _localctx;
+ setState(174);
+ ((ProcessCheckContext)_localctx).relationship = identifier();
+ setState(175);
+ match(OF);
+ setState(176);
+ subquery();
+ }
+ break;
+ case 3:
{
_localctx = new BooleanDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(138);
+ setState(178);
predicated();
}
break;
- default:
- throw new NoViableAltException(this);
}
_ctx.stop = _input.LT(-1);
- setState(149);
+ setState(189);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,14,_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(147);
+ setState(187);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,13,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) {
case 1:
{
_localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState));
((LogicalBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
- setState(141);
+ setState(181);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
- setState(142);
+ setState(182);
((LogicalBinaryContext)_localctx).operator = match(AND);
- setState(143);
+ setState(183);
((LogicalBinaryContext)_localctx).right = booleanExpression(3);
}
break;
@@ -1032,20 +1308,20 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
_localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState));
((LogicalBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
- setState(144);
+ setState(184);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
- setState(145);
+ setState(185);
((LogicalBinaryContext)_localctx).operator = match(OR);
- setState(146);
+ setState(186);
((LogicalBinaryContext)_localctx).right = booleanExpression(2);
}
break;
}
}
}
- setState(151);
+ setState(191);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,14,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,20,_ctx);
}
}
}
@@ -1088,18 +1364,18 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final PredicatedContext predicated() throws RecognitionException {
PredicatedContext _localctx = new PredicatedContext(_ctx, getState());
- enterRule(_localctx, 26, RULE_predicated);
+ enterRule(_localctx, 32, RULE_predicated);
try {
enterOuterAlt(_localctx, 1);
{
- setState(152);
+ setState(192);
valueExpression(0);
- setState(154);
+ setState(194);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,15,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) {
case 1:
{
- setState(153);
+ setState(193);
predicate();
}
break;
@@ -1119,27 +1395,20 @@ public final PredicatedContext predicated() throws RecognitionException {
public static class PredicateContext extends ParserRuleContext {
public Token kind;
- public ValueExpressionContext lower;
- public ValueExpressionContext upper;
- public TerminalNode AND() { return getToken(EqlBaseParser.AND, 0); }
- public TerminalNode BETWEEN() { return getToken(EqlBaseParser.BETWEEN, 0); }
+ public TerminalNode LP() { return getToken(EqlBaseParser.LP, 0); }
public List valueExpression() {
return getRuleContexts(ValueExpressionContext.class);
}
public ValueExpressionContext valueExpression(int i) {
return getRuleContext(ValueExpressionContext.class,i);
}
- public TerminalNode NOT() { return getToken(EqlBaseParser.NOT, 0); }
- public TerminalNode LP() { return getToken(EqlBaseParser.LP, 0); }
public TerminalNode RP() { return getToken(EqlBaseParser.RP, 0); }
public TerminalNode IN() { return getToken(EqlBaseParser.IN, 0); }
+ public TerminalNode NOT() { return getToken(EqlBaseParser.NOT, 0); }
public List COMMA() { return getTokens(EqlBaseParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(EqlBaseParser.COMMA, i);
}
- public QueryContext query() {
- return getRuleContext(QueryContext.class,0);
- }
public PredicateContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@@ -1161,94 +1430,44 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final PredicateContext predicate() throws RecognitionException {
PredicateContext _localctx = new PredicateContext(_ctx, getState());
- enterRule(_localctx, 28, RULE_predicate);
+ enterRule(_localctx, 34, RULE_predicate);
int _la;
try {
- setState(187);
- _errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) {
- case 1:
- enterOuterAlt(_localctx, 1);
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(197);
+ _la = _input.LA(1);
+ if (_la==NOT) {
{
- setState(157);
- _la = _input.LA(1);
- if (_la==NOT) {
- {
- setState(156);
- match(NOT);
- }
+ setState(196);
+ match(NOT);
}
+ }
- setState(159);
- ((PredicateContext)_localctx).kind = match(BETWEEN);
- setState(160);
- ((PredicateContext)_localctx).lower = valueExpression(0);
- setState(161);
- match(AND);
- setState(162);
- ((PredicateContext)_localctx).upper = valueExpression(0);
- }
- break;
- case 2:
- enterOuterAlt(_localctx, 2);
+ setState(199);
+ ((PredicateContext)_localctx).kind = match(IN);
+ setState(200);
+ match(LP);
+ setState(201);
+ valueExpression(0);
+ setState(206);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ while (_la==COMMA) {
{
- setState(165);
- _la = _input.LA(1);
- if (_la==NOT) {
- {
- setState(164);
- match(NOT);
- }
- }
-
- setState(167);
- ((PredicateContext)_localctx).kind = match(IN);
- setState(168);
- match(LP);
- setState(169);
+ {
+ setState(202);
+ match(COMMA);
+ setState(203);
valueExpression(0);
- setState(174);
- _errHandler.sync(this);
- _la = _input.LA(1);
- while (_la==COMMA) {
- {
- {
- setState(170);
- match(COMMA);
- setState(171);
- valueExpression(0);
- }
- }
- setState(176);
- _errHandler.sync(this);
- _la = _input.LA(1);
}
- setState(177);
- match(RP);
}
- break;
- case 3:
- enterOuterAlt(_localctx, 3);
- {
- setState(180);
+ setState(208);
+ _errHandler.sync(this);
_la = _input.LA(1);
- if (_la==NOT) {
- {
- setState(179);
- match(NOT);
- }
- }
-
- setState(182);
- ((PredicateContext)_localctx).kind = match(IN);
- setState(183);
- match(LP);
- setState(184);
- query();
- setState(185);
- match(RP);
- }
- break;
+ }
+ setState(209);
+ match(RP);
}
}
catch (RecognitionException re) {
@@ -1381,14 +1600,14 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
int _parentState = getState();
ValueExpressionContext _localctx = new ValueExpressionContext(_ctx, _parentState);
ValueExpressionContext _prevctx = _localctx;
- int _startState = 30;
- enterRecursionRule(_localctx, 30, RULE_valueExpression, _p);
+ int _startState = 36;
+ enterRecursionRule(_localctx, 36, RULE_valueExpression, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(193);
+ setState(215);
switch (_input.LA(1)) {
case FALSE:
case NULL:
@@ -1398,14 +1617,12 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
case INTEGER_VALUE:
case DECIMAL_VALUE:
case IDENTIFIER:
- case DIGIT_IDENTIFIER:
- case QUOTED_IDENTIFIER:
{
_localctx = new ValueExpressionDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(190);
+ setState(212);
primaryExpression();
}
break;
@@ -1415,7 +1632,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_localctx = new ArithmeticUnaryContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(191);
+ setState(213);
((ArithmeticUnaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
@@ -1423,7 +1640,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
} else {
consume();
}
- setState(192);
+ setState(214);
valueExpression(4);
}
break;
@@ -1431,25 +1648,25 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
throw new NoViableAltException(this);
}
_ctx.stop = _input.LT(-1);
- setState(207);
+ setState(229);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,23,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,26,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
- setState(205);
+ setState(227);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) {
case 1:
{
_localctx = new ArithmeticBinaryContext(new ValueExpressionContext(_parentctx, _parentState));
((ArithmeticBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
- setState(195);
+ setState(217);
if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)");
- setState(196);
+ setState(218);
((ArithmeticBinaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ASTERISK) | (1L << SLASH) | (1L << PERCENT))) != 0)) ) {
@@ -1457,7 +1674,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
} else {
consume();
}
- setState(197);
+ setState(219);
((ArithmeticBinaryContext)_localctx).right = valueExpression(4);
}
break;
@@ -1466,9 +1683,9 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_localctx = new ArithmeticBinaryContext(new ValueExpressionContext(_parentctx, _parentState));
((ArithmeticBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
- setState(198);
+ setState(220);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
- setState(199);
+ setState(221);
((ArithmeticBinaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
@@ -1476,7 +1693,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
} else {
consume();
}
- setState(200);
+ setState(222);
((ArithmeticBinaryContext)_localctx).right = valueExpression(3);
}
break;
@@ -1485,20 +1702,20 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_localctx = new ComparisonContext(new ValueExpressionContext(_parentctx, _parentState));
((ComparisonContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
- setState(201);
+ setState(223);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
- setState(202);
+ setState(224);
comparisonOperator();
- setState(203);
+ setState(225);
((ComparisonContext)_localctx).right = valueExpression(2);
}
break;
}
}
}
- setState(209);
+ setState(231);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,23,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,26,_ctx);
}
}
}
@@ -1605,16 +1822,16 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final PrimaryExpressionContext primaryExpression() throws RecognitionException {
PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState());
- enterRule(_localctx, 32, RULE_primaryExpression);
+ enterRule(_localctx, 38, RULE_primaryExpression);
try {
- setState(217);
+ setState(239);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) {
case 1:
_localctx = new ConstantDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(210);
+ setState(232);
constant();
}
break;
@@ -1622,7 +1839,7 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
_localctx = new FunctionContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(211);
+ setState(233);
functionExpression();
}
break;
@@ -1630,7 +1847,7 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
_localctx = new DereferenceContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(212);
+ setState(234);
qualifiedName();
}
break;
@@ -1638,11 +1855,11 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
_localctx = new ParenthesizedExpressionContext(_localctx);
enterOuterAlt(_localctx, 4);
{
- setState(213);
+ setState(235);
match(LP);
- setState(214);
+ setState(236);
expression();
- setState(215);
+ setState(237);
match(RP);
}
break;
@@ -1696,41 +1913,41 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final FunctionExpressionContext functionExpression() throws RecognitionException {
FunctionExpressionContext _localctx = new FunctionExpressionContext(_ctx, getState());
- enterRule(_localctx, 34, RULE_functionExpression);
+ enterRule(_localctx, 40, RULE_functionExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(219);
+ setState(241);
identifier();
- setState(220);
+ setState(242);
match(LP);
- setState(229);
+ setState(251);
_la = _input.LA(1);
- if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER) | (1L << DIGIT_IDENTIFIER) | (1L << QUOTED_IDENTIFIER))) != 0)) {
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER))) != 0)) {
{
- setState(221);
+ setState(243);
expression();
- setState(226);
+ setState(248);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(222);
+ setState(244);
match(COMMA);
- setState(223);
+ setState(245);
expression();
}
}
- setState(228);
+ setState(250);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
- setState(231);
+ setState(253);
match(RP);
}
}
@@ -1774,9 +1991,8 @@ public T accept(ParseTreeVisitor extends T> visitor) {
}
}
public static class StringLiteralContext extends ConstantContext {
- public List STRING() { return getTokens(EqlBaseParser.STRING); }
- public TerminalNode STRING(int i) {
- return getToken(EqlBaseParser.STRING, i);
+ public StringContext string() {
+ return getRuleContext(StringContext.class,0);
}
public StringLiteralContext(ConstantContext ctx) { copyFrom(ctx); }
@Override
@@ -1834,16 +2050,15 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final ConstantContext constant() throws RecognitionException {
ConstantContext _localctx = new ConstantContext(_ctx, getState());
- enterRule(_localctx, 36, RULE_constant);
+ enterRule(_localctx, 42, RULE_constant);
try {
- int _alt;
- setState(241);
+ setState(259);
switch (_input.LA(1)) {
case NULL:
_localctx = new NullLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(233);
+ setState(255);
match(NULL);
}
break;
@@ -1852,7 +2067,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new NumericLiteralContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(234);
+ setState(256);
number();
}
break;
@@ -1861,7 +2076,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new BooleanLiteralContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(235);
+ setState(257);
booleanValue();
}
break;
@@ -1869,26 +2084,8 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new StringLiteralContext(_localctx);
enterOuterAlt(_localctx, 4);
{
- setState(237);
- _errHandler.sync(this);
- _alt = 1;
- do {
- switch (_alt) {
- case 1:
- {
- {
- setState(236);
- match(STRING);
- }
- }
- break;
- default:
- throw new NoViableAltException(this);
- }
- setState(239);
- _errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,27,_ctx);
- } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER );
+ setState(258);
+ string();
}
break;
default:
@@ -1934,12 +2131,12 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final ComparisonOperatorContext comparisonOperator() throws RecognitionException {
ComparisonOperatorContext _localctx = new ComparisonOperatorContext(_ctx, getState());
- enterRule(_localctx, 38, RULE_comparisonOperator);
+ enterRule(_localctx, 44, RULE_comparisonOperator);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(243);
+ setState(261);
_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);
@@ -1983,12 +2180,12 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final BooleanValueContext booleanValue() throws RecognitionException {
BooleanValueContext _localctx = new BooleanValueContext(_ctx, getState());
- enterRule(_localctx, 40, RULE_booleanValue);
+ enterRule(_localctx, 46, RULE_booleanValue);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(245);
+ setState(263);
_la = _input.LA(1);
if ( !(_la==FALSE || _la==TRUE) ) {
_errHandler.recoverInline(this);
@@ -2008,74 +2205,6 @@ public final BooleanValueContext booleanValue() throws RecognitionException {
return _localctx;
}
- public static class QualifiedNamesContext extends ParserRuleContext {
- public List qualifiedName() {
- return getRuleContexts(QualifiedNameContext.class);
- }
- public QualifiedNameContext qualifiedName(int i) {
- return getRuleContext(QualifiedNameContext.class,i);
- }
- public List COMMA() { return getTokens(EqlBaseParser.COMMA); }
- public TerminalNode COMMA(int i) {
- return getToken(EqlBaseParser.COMMA, i);
- }
- public QualifiedNamesContext(ParserRuleContext parent, int invokingState) {
- super(parent, invokingState);
- }
- @Override public int getRuleIndex() { return RULE_qualifiedNames; }
- @Override
- public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterQualifiedNames(this);
- }
- @Override
- public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitQualifiedNames(this);
- }
- @Override
- public T accept(ParseTreeVisitor extends T> visitor) {
- if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitQualifiedNames(this);
- else return visitor.visitChildren(this);
- }
- }
-
- public final QualifiedNamesContext qualifiedNames() throws RecognitionException {
- QualifiedNamesContext _localctx = new QualifiedNamesContext(_ctx, getState());
- enterRule(_localctx, 42, RULE_qualifiedNames);
- int _la;
- try {
- enterOuterAlt(_localctx, 1);
- {
- setState(247);
- qualifiedName();
- setState(252);
- _errHandler.sync(this);
- _la = _input.LA(1);
- while (_la==COMMA) {
- {
- {
- setState(248);
- match(COMMA);
- setState(249);
- qualifiedName();
- }
- }
- setState(254);
- _errHandler.sync(this);
- _la = _input.LA(1);
- }
- }
- }
- catch (RecognitionException re) {
- _localctx.exception = re;
- _errHandler.reportError(this, re);
- _errHandler.recover(this, re);
- }
- finally {
- exitRule();
- }
- return _localctx;
- }
-
public static class QualifiedNameContext extends ParserRuleContext {
public List identifier() {
return getRuleContexts(IdentifierContext.class);
@@ -2087,6 +2216,18 @@ public IdentifierContext identifier(int i) {
public TerminalNode DOT(int i) {
return getToken(EqlBaseParser.DOT, i);
}
+ public List LB() { return getTokens(EqlBaseParser.LB); }
+ public TerminalNode LB(int i) {
+ return getToken(EqlBaseParser.LB, i);
+ }
+ public List RB() { return getTokens(EqlBaseParser.RB); }
+ public TerminalNode RB(int i) {
+ return getToken(EqlBaseParser.RB, i);
+ }
+ public List INTEGER_VALUE() { return getTokens(EqlBaseParser.INTEGER_VALUE); }
+ public TerminalNode INTEGER_VALUE(int i) {
+ return getToken(EqlBaseParser.INTEGER_VALUE, i);
+ }
public QualifiedNameContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@@ -2108,31 +2249,61 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final QualifiedNameContext qualifiedName() throws RecognitionException {
QualifiedNameContext _localctx = new QualifiedNameContext(_ctx, getState());
- enterRule(_localctx, 44, RULE_qualifiedName);
+ enterRule(_localctx, 48, RULE_qualifiedName);
+ int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(260);
+ setState(265);
+ identifier();
+ setState(277);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,30,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,33,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
- {
- setState(255);
- identifier();
- setState(256);
- match(DOT);
+ setState(275);
+ switch (_input.LA(1)) {
+ case DOT:
+ {
+ setState(266);
+ match(DOT);
+ setState(267);
+ identifier();
+ }
+ break;
+ case LB:
+ {
+ setState(268);
+ match(LB);
+ setState(270);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ do {
+ {
+ {
+ setState(269);
+ match(INTEGER_VALUE);
+ }
+ }
+ setState(272);
+ _errHandler.sync(this);
+ _la = _input.LA(1);
+ } while ( _la==INTEGER_VALUE );
+ setState(274);
+ match(RB);
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
}
}
}
- setState(262);
+ setState(279);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,30,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,33,_ctx);
}
- setState(263);
- identifier();
}
}
catch (RecognitionException re) {
@@ -2147,12 +2318,7 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException {
}
public static class IdentifierContext extends ParserRuleContext {
- public QuoteIdentifierContext quoteIdentifier() {
- return getRuleContext(QuoteIdentifierContext.class,0);
- }
- public UnquoteIdentifierContext unquoteIdentifier() {
- return getRuleContext(UnquoteIdentifierContext.class,0);
- }
+ public TerminalNode IDENTIFIER() { return getToken(EqlBaseParser.IDENTIFIER, 0); }
public IdentifierContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@@ -2174,78 +2340,12 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final IdentifierContext identifier() throws RecognitionException {
IdentifierContext _localctx = new IdentifierContext(_ctx, getState());
- enterRule(_localctx, 46, RULE_identifier);
- try {
- setState(267);
- switch (_input.LA(1)) {
- case QUOTED_IDENTIFIER:
- enterOuterAlt(_localctx, 1);
- {
- setState(265);
- quoteIdentifier();
- }
- break;
- case IDENTIFIER:
- case DIGIT_IDENTIFIER:
- enterOuterAlt(_localctx, 2);
- {
- setState(266);
- unquoteIdentifier();
- }
- 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 QuoteIdentifierContext extends ParserRuleContext {
- public QuoteIdentifierContext(ParserRuleContext parent, int invokingState) {
- super(parent, invokingState);
- }
- @Override public int getRuleIndex() { return RULE_quoteIdentifier; }
-
- public QuoteIdentifierContext() { }
- public void copyFrom(QuoteIdentifierContext ctx) {
- super.copyFrom(ctx);
- }
- }
- public static class QuotedIdentifierContext extends QuoteIdentifierContext {
- public TerminalNode QUOTED_IDENTIFIER() { return getToken(EqlBaseParser.QUOTED_IDENTIFIER, 0); }
- public QuotedIdentifierContext(QuoteIdentifierContext ctx) { copyFrom(ctx); }
- @Override
- public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterQuotedIdentifier(this);
- }
- @Override
- public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitQuotedIdentifier(this);
- }
- @Override
- public T accept(ParseTreeVisitor extends T> visitor) {
- if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitQuotedIdentifier(this);
- else return visitor.visitChildren(this);
- }
- }
-
- public final QuoteIdentifierContext quoteIdentifier() throws RecognitionException {
- QuoteIdentifierContext _localctx = new QuoteIdentifierContext(_ctx, getState());
- enterRule(_localctx, 48, RULE_quoteIdentifier);
+ enterRule(_localctx, 50, RULE_identifier);
try {
- _localctx = new QuotedIdentifierContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(269);
- match(QUOTED_IDENTIFIER);
+ setState(280);
+ match(IDENTIFIER);
}
}
catch (RecognitionException re) {
@@ -2259,76 +2359,41 @@ public final QuoteIdentifierContext quoteIdentifier() throws RecognitionExceptio
return _localctx;
}
- public static class UnquoteIdentifierContext extends ParserRuleContext {
- public UnquoteIdentifierContext(ParserRuleContext parent, int invokingState) {
- super(parent, invokingState);
- }
- @Override public int getRuleIndex() { return RULE_unquoteIdentifier; }
-
- public UnquoteIdentifierContext() { }
- public void copyFrom(UnquoteIdentifierContext ctx) {
- super.copyFrom(ctx);
- }
- }
- public static class DigitIdentifierContext extends UnquoteIdentifierContext {
- public TerminalNode DIGIT_IDENTIFIER() { return getToken(EqlBaseParser.DIGIT_IDENTIFIER, 0); }
- public DigitIdentifierContext(UnquoteIdentifierContext ctx) { copyFrom(ctx); }
- @Override
- public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterDigitIdentifier(this);
- }
- @Override
- public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitDigitIdentifier(this);
- }
- @Override
- public T accept(ParseTreeVisitor extends T> visitor) {
- if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitDigitIdentifier(this);
- else return visitor.visitChildren(this);
+ public static class TimeUnitContext extends ParserRuleContext {
+ public Token unit;
+ public NumberContext number() {
+ return getRuleContext(NumberContext.class,0);
}
- }
- public static class UnquotedIdentifierContext extends UnquoteIdentifierContext {
public TerminalNode IDENTIFIER() { return getToken(EqlBaseParser.IDENTIFIER, 0); }
- public UnquotedIdentifierContext(UnquoteIdentifierContext ctx) { copyFrom(ctx); }
+ public TimeUnitContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_timeUnit; }
@Override
public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterUnquotedIdentifier(this);
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterTimeUnit(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitUnquotedIdentifier(this);
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitTimeUnit(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
- if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitUnquotedIdentifier(this);
+ if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitTimeUnit(this);
else return visitor.visitChildren(this);
}
}
- public final UnquoteIdentifierContext unquoteIdentifier() throws RecognitionException {
- UnquoteIdentifierContext _localctx = new UnquoteIdentifierContext(_ctx, getState());
- enterRule(_localctx, 50, RULE_unquoteIdentifier);
+ public final TimeUnitContext timeUnit() throws RecognitionException {
+ TimeUnitContext _localctx = new TimeUnitContext(_ctx, getState());
+ enterRule(_localctx, 52, RULE_timeUnit);
try {
- setState(273);
- switch (_input.LA(1)) {
- case IDENTIFIER:
- _localctx = new UnquotedIdentifierContext(_localctx);
- enterOuterAlt(_localctx, 1);
- {
- setState(271);
- match(IDENTIFIER);
- }
- break;
- case DIGIT_IDENTIFIER:
- _localctx = new DigitIdentifierContext(_localctx);
- enterOuterAlt(_localctx, 2);
- {
- setState(272);
- match(DIGIT_IDENTIFIER);
- }
- break;
- default:
- throw new NoViableAltException(this);
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(282);
+ number();
+ setState(283);
+ ((TimeUnitContext)_localctx).unit = match(IDENTIFIER);
}
}
catch (RecognitionException re) {
@@ -2390,15 +2455,15 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final NumberContext number() throws RecognitionException {
NumberContext _localctx = new NumberContext(_ctx, getState());
- enterRule(_localctx, 52, RULE_number);
+ enterRule(_localctx, 54, RULE_number);
try {
- setState(277);
+ setState(287);
switch (_input.LA(1)) {
case DECIMAL_VALUE:
_localctx = new DecimalLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(275);
+ setState(285);
match(DECIMAL_VALUE);
}
break;
@@ -2406,7 +2471,7 @@ public final NumberContext number() throws RecognitionException {
_localctx = new IntegerLiteralContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(276);
+ setState(286);
match(INTEGER_VALUE);
}
break;
@@ -2448,11 +2513,11 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final StringContext string() throws RecognitionException {
StringContext _localctx = new StringContext(_ctx, getState());
- enterRule(_localctx, 54, RULE_string);
+ enterRule(_localctx, 56, RULE_string);
try {
enterOuterAlt(_localctx, 1);
{
- setState(279);
+ setState(289);
match(STRING);
}
}
@@ -2469,9 +2534,9 @@ public final StringContext string() throws RecognitionException {
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
switch (ruleIndex) {
- case 12:
- return booleanExpression_sempred((BooleanExpressionContext)_localctx, predIndex);
case 15:
+ return booleanExpression_sempred((BooleanExpressionContext)_localctx, predIndex);
+ case 18:
return valueExpression_sempred((ValueExpressionContext)_localctx, predIndex);
}
return true;
@@ -2498,102 +2563,106 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
}
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\64\u011c\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\3*\u0126\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\3\2\3\2\3\2\3\3\3\3\3\3\3\4\3"+
- "\4\3\4\7\4D\n\4\f\4\16\4G\13\4\3\5\3\5\3\5\5\5L\n\5\3\6\3\6\5\6P\n\6\3"+
- "\6\5\6S\n\6\3\6\6\6V\n\6\r\6\16\6W\3\6\3\6\5\6\\\n\6\3\7\3\7\5\7`\n\7"+
- "\3\7\6\7c\n\7\r\7\16\7d\3\7\3\7\5\7i\n\7\3\b\3\b\3\b\3\b\7\bo\n\b\f\b"+
- "\16\br\13\b\5\bt\n\b\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3"+
- "\13\5\13\u0082\n\13\3\f\3\f\3\f\3\f\3\r\3\r\3\16\3\16\3\16\3\16\5\16\u008e"+
- "\n\16\3\16\3\16\3\16\3\16\3\16\3\16\7\16\u0096\n\16\f\16\16\16\u0099\13"+
- "\16\3\17\3\17\5\17\u009d\n\17\3\20\5\20\u00a0\n\20\3\20\3\20\3\20\3\20"+
- "\3\20\3\20\5\20\u00a8\n\20\3\20\3\20\3\20\3\20\3\20\7\20\u00af\n\20\f"+
- "\20\16\20\u00b2\13\20\3\20\3\20\3\20\5\20\u00b7\n\20\3\20\3\20\3\20\3"+
- "\20\3\20\5\20\u00be\n\20\3\21\3\21\3\21\3\21\5\21\u00c4\n\21\3\21\3\21"+
- "\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\7\21\u00d0\n\21\f\21\16\21\u00d3"+
- "\13\21\3\22\3\22\3\22\3\22\3\22\3\22\3\22\5\22\u00dc\n\22\3\23\3\23\3"+
- "\23\3\23\3\23\7\23\u00e3\n\23\f\23\16\23\u00e6\13\23\5\23\u00e8\n\23\3"+
- "\23\3\23\3\24\3\24\3\24\3\24\6\24\u00f0\n\24\r\24\16\24\u00f1\5\24\u00f4"+
- "\n\24\3\25\3\25\3\26\3\26\3\27\3\27\3\27\7\27\u00fd\n\27\f\27\16\27\u0100"+
- "\13\27\3\30\3\30\3\30\7\30\u0105\n\30\f\30\16\30\u0108\13\30\3\30\3\30"+
- "\3\31\3\31\5\31\u010e\n\31\3\32\3\32\3\33\3\33\5\33\u0114\n\33\3\34\3"+
- "\34\5\34\u0118\n\34\3\35\3\35\3\35\2\4\32 \36\2\4\6\b\n\f\16\20\22\24"+
- "\26\30\32\34\36 \"$&(*,.\60\62\64\668\2\6\3\2\36\37\3\2 \"\3\2\30\35\4"+
- "\2\13\13\24\24\u0128\2:\3\2\2\2\4=\3\2\2\2\6@\3\2\2\2\bK\3\2\2\2\nM\3"+
- "\2\2\2\f]\3\2\2\2\16j\3\2\2\2\20u\3\2\2\2\22x\3\2\2\2\24}\3\2\2\2\26\u0083"+
- "\3\2\2\2\30\u0087\3\2\2\2\32\u008d\3\2\2\2\34\u009a\3\2\2\2\36\u00bd\3"+
- "\2\2\2 \u00c3\3\2\2\2\"\u00db\3\2\2\2$\u00dd\3\2\2\2&\u00f3\3\2\2\2(\u00f5"+
- "\3\2\2\2*\u00f7\3\2\2\2,\u00f9\3\2\2\2.\u0106\3\2\2\2\60\u010d\3\2\2\2"+
- "\62\u010f\3\2\2\2\64\u0113\3\2\2\2\66\u0117\3\2\2\28\u0119\3\2\2\2:;\5"+
- "\6\4\2;<\7\2\2\3<\3\3\2\2\2=>\5\30\r\2>?\7\2\2\3?\5\3\2\2\2@E\5\b\5\2"+
- "AB\7)\2\2BD\5\16\b\2CA\3\2\2\2DG\3\2\2\2EC\3\2\2\2EF\3\2\2\2F\7\3\2\2"+
- "\2GE\3\2\2\2HL\5\n\6\2IL\5\f\7\2JL\5\26\f\2KH\3\2\2\2KI\3\2\2\2KJ\3\2"+
- "\2\2L\t\3\2\2\2MO\7\23\2\2NP\5\20\t\2ON\3\2\2\2OP\3\2\2\2PR\3\2\2\2QS"+
- "\5\22\n\2RQ\3\2\2\2RS\3\2\2\2SU\3\2\2\2TV\5\24\13\2UT\3\2\2\2VW\3\2\2"+
- "\2WU\3\2\2\2WX\3\2\2\2X[\3\2\2\2YZ\7\25\2\2Z\\\5\24\13\2[Y\3\2\2\2[\\"+
- "\3\2\2\2\\\13\3\2\2\2]_\7\r\2\2^`\5\20\t\2_^\3\2\2\2_`\3\2\2\2`b\3\2\2"+
- "\2ac\5\24\13\2ba\3\2\2\2cd\3\2\2\2db\3\2\2\2de\3\2\2\2eh\3\2\2\2fg\7\25"+
- "\2\2gi\5\24\13\2hf\3\2\2\2hi\3\2\2\2i\r\3\2\2\2js\7-\2\2kp\5\32\16\2l"+
- "m\7$\2\2mo\5\32\16\2nl\3\2\2\2or\3\2\2\2pn\3\2\2\2pq\3\2\2\2qt\3\2\2\2"+
- "rp\3\2\2\2sk\3\2\2\2st\3\2\2\2t\17\3\2\2\2uv\7\7\2\2vw\5,\27\2w\21\3\2"+
- "\2\2xy\7\27\2\2yz\7\16\2\2z{\7\30\2\2{|\7.\2\2|\23\3\2\2\2}~\7%\2\2~\177"+
- "\5\26\f\2\177\u0081\7&\2\2\u0080\u0082\5\20\t\2\u0081\u0080\3\2\2\2\u0081"+
- "\u0082\3\2\2\2\u0082\25\3\2\2\2\u0083\u0084\5.\30\2\u0084\u0085\7\26\2"+
- "\2\u0085\u0086\5\30\r\2\u0086\27\3\2\2\2\u0087\u0088\5\32\16\2\u0088\31"+
- "\3\2\2\2\u0089\u008a\b\16\1\2\u008a\u008b\7\17\2\2\u008b\u008e\5\32\16"+
- "\6\u008c\u008e\5\34\17\2\u008d\u0089\3\2\2\2\u008d\u008c\3\2\2\2\u008e"+
- "\u0097\3\2\2\2\u008f\u0090\f\4\2\2\u0090\u0091\7\3\2\2\u0091\u0096\5\32"+
- "\16\5\u0092\u0093\f\3\2\2\u0093\u0094\7\22\2\2\u0094\u0096\5\32\16\4\u0095"+
- "\u008f\3\2\2\2\u0095\u0092\3\2\2\2\u0096\u0099\3\2\2\2\u0097\u0095\3\2"+
- "\2\2\u0097\u0098\3\2\2\2\u0098\33\3\2\2\2\u0099\u0097\3\2\2\2\u009a\u009c"+
- "\5 \21\2\u009b\u009d\5\36\20\2\u009c\u009b\3\2\2\2\u009c\u009d\3\2\2\2"+
- "\u009d\35\3\2\2\2\u009e\u00a0\7\17\2\2\u009f\u009e\3\2\2\2\u009f\u00a0"+
- "\3\2\2\2\u00a0\u00a1\3\2\2\2\u00a1\u00a2\7\6\2\2\u00a2\u00a3\5 \21\2\u00a3"+
- "\u00a4\7\3\2\2\u00a4\u00a5\5 \21\2\u00a5\u00be\3\2\2\2\u00a6\u00a8\7\17"+
- "\2\2\u00a7\u00a6\3\2\2\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9\3\2\2\2\u00a9"+
- "\u00aa\7\f\2\2\u00aa\u00ab\7\'\2\2\u00ab\u00b0\5 \21\2\u00ac\u00ad\7$"+
- "\2\2\u00ad\u00af\5 \21\2\u00ae\u00ac\3\2\2\2\u00af\u00b2\3\2\2\2\u00b0"+
- "\u00ae\3\2\2\2\u00b0\u00b1\3\2\2\2\u00b1\u00b3\3\2\2\2\u00b2\u00b0\3\2"+
- "\2\2\u00b3\u00b4\7(\2\2\u00b4\u00be\3\2\2\2\u00b5\u00b7\7\17\2\2\u00b6"+
- "\u00b5\3\2\2\2\u00b6\u00b7\3\2\2\2\u00b7\u00b8\3\2\2\2\u00b8\u00b9\7\f"+
- "\2\2\u00b9\u00ba\7\'\2\2\u00ba\u00bb\5\b\5\2\u00bb\u00bc\7(\2\2\u00bc"+
- "\u00be\3\2\2\2\u00bd\u009f\3\2\2\2\u00bd\u00a7\3\2\2\2\u00bd\u00b6\3\2"+
- "\2\2\u00be\37\3\2\2\2\u00bf\u00c0\b\21\1\2\u00c0\u00c4\5\"\22\2\u00c1"+
- "\u00c2\t\2\2\2\u00c2\u00c4\5 \21\6\u00c3\u00bf\3\2\2\2\u00c3\u00c1\3\2"+
- "\2\2\u00c4\u00d1\3\2\2\2\u00c5\u00c6\f\5\2\2\u00c6\u00c7\t\3\2\2\u00c7"+
- "\u00d0\5 \21\6\u00c8\u00c9\f\4\2\2\u00c9\u00ca\t\2\2\2\u00ca\u00d0\5 "+
- "\21\5\u00cb\u00cc\f\3\2\2\u00cc\u00cd\5(\25\2\u00cd\u00ce\5 \21\4\u00ce"+
- "\u00d0\3\2\2\2\u00cf\u00c5\3\2\2\2\u00cf\u00c8\3\2\2\2\u00cf\u00cb\3\2"+
- "\2\2\u00d0\u00d3\3\2\2\2\u00d1\u00cf\3\2\2\2\u00d1\u00d2\3\2\2\2\u00d2"+
- "!\3\2\2\2\u00d3\u00d1\3\2\2\2\u00d4\u00dc\5&\24\2\u00d5\u00dc\5$\23\2"+
- "\u00d6\u00dc\5.\30\2\u00d7\u00d8\7\'\2\2\u00d8\u00d9\5\30\r\2\u00d9\u00da"+
- "\7(\2\2\u00da\u00dc\3\2\2\2\u00db\u00d4\3\2\2\2\u00db\u00d5\3\2\2\2\u00db"+
- "\u00d6\3\2\2\2\u00db\u00d7\3\2\2\2\u00dc#\3\2\2\2\u00dd\u00de\5\60\31"+
- "\2\u00de\u00e7\7\'\2\2\u00df\u00e4\5\30\r\2\u00e0\u00e1\7$\2\2\u00e1\u00e3"+
- "\5\30\r\2\u00e2\u00e0\3\2\2\2\u00e3\u00e6\3\2\2\2\u00e4\u00e2\3\2\2\2"+
- "\u00e4\u00e5\3\2\2\2\u00e5\u00e8\3\2\2\2\u00e6\u00e4\3\2\2\2\u00e7\u00df"+
- "\3\2\2\2\u00e7\u00e8\3\2\2\2\u00e8\u00e9\3\2\2\2\u00e9\u00ea\7(\2\2\u00ea"+
- "%\3\2\2\2\u00eb\u00f4\7\20\2\2\u00ec\u00f4\5\66\34\2\u00ed\u00f4\5*\26"+
- "\2\u00ee\u00f0\7*\2\2\u00ef\u00ee\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00ef"+
- "\3\2\2\2\u00f1\u00f2\3\2\2\2\u00f2\u00f4\3\2\2\2\u00f3\u00eb\3\2\2\2\u00f3"+
- "\u00ec\3\2\2\2\u00f3\u00ed\3\2\2\2\u00f3\u00ef\3\2\2\2\u00f4\'\3\2\2\2"+
- "\u00f5\u00f6\t\4\2\2\u00f6)\3\2\2\2\u00f7\u00f8\t\5\2\2\u00f8+\3\2\2\2"+
- "\u00f9\u00fe\5.\30\2\u00fa\u00fb\7$\2\2\u00fb\u00fd\5.\30\2\u00fc\u00fa"+
- "\3\2\2\2\u00fd\u0100\3\2\2\2\u00fe\u00fc\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff"+
- "-\3\2\2\2\u0100\u00fe\3\2\2\2\u0101\u0102\5\60\31\2\u0102\u0103\7#\2\2"+
- "\u0103\u0105\3\2\2\2\u0104\u0101\3\2\2\2\u0105\u0108\3\2\2\2\u0106\u0104"+
- "\3\2\2\2\u0106\u0107\3\2\2\2\u0107\u0109\3\2\2\2\u0108\u0106\3\2\2\2\u0109"+
- "\u010a\5\60\31\2\u010a/\3\2\2\2\u010b\u010e\5\62\32\2\u010c\u010e\5\64"+
- "\33\2\u010d\u010b\3\2\2\2\u010d\u010c\3\2\2\2\u010e\61\3\2\2\2\u010f\u0110"+
- "\7/\2\2\u0110\63\3\2\2\2\u0111\u0114\7-\2\2\u0112\u0114\7.\2\2\u0113\u0111"+
- "\3\2\2\2\u0113\u0112\3\2\2\2\u0114\65\3\2\2\2\u0115\u0118\7,\2\2\u0116"+
- "\u0118\7+\2\2\u0117\u0115\3\2\2\2\u0117\u0116\3\2\2\2\u0118\67\3\2\2\2"+
- "\u0119\u011a\7*\2\2\u011a9\3\2\2\2$EKORW[_dhps\u0081\u008d\u0095\u0097"+
- "\u009c\u009f\u00a7\u00b0\u00b6\u00bd\u00c3\u00cf\u00d1\u00db\u00e4\u00e7"+
- "\u00f1\u00f3\u00fe\u0106\u010d\u0113\u0117";
+ "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\3\2\3\2\3\2\3\3\3\3"+
+ "\3\3\3\4\3\4\3\4\7\4F\n\4\f\4\16\4I\13\4\3\5\3\5\3\5\5\5N\n\5\3\6\3\6"+
+ "\3\6\3\6\7\6T\n\6\f\6\16\6W\13\6\3\7\3\7\3\7\5\7\\\n\7\3\7\3\7\5\7`\n"+
+ "\7\5\7b\n\7\3\7\3\7\6\7f\n\7\r\7\16\7g\3\7\3\7\5\7l\n\7\3\b\3\b\5\bp\n"+
+ "\b\3\b\3\b\6\bt\n\b\r\b\16\bu\3\b\3\b\5\bz\n\b\3\t\3\t\3\t\3\t\7\t\u0080"+
+ "\n\t\f\t\16\t\u0083\13\t\5\t\u0085\n\t\3\n\3\n\3\n\3\n\5\n\u008b\n\n\3"+
+ "\13\3\13\3\13\3\13\7\13\u0091\n\13\f\13\16\13\u0094\13\13\3\f\3\f\5\f"+
+ "\u0098\n\f\3\r\3\r\7\r\u009c\n\r\f\r\16\r\u009f\13\r\3\r\5\r\u00a2\n\r"+
+ "\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21"+
+ "\3\21\3\21\3\21\3\21\5\21\u00b6\n\21\3\21\3\21\3\21\3\21\3\21\3\21\7\21"+
+ "\u00be\n\21\f\21\16\21\u00c1\13\21\3\22\3\22\5\22\u00c5\n\22\3\23\5\23"+
+ "\u00c8\n\23\3\23\3\23\3\23\3\23\3\23\7\23\u00cf\n\23\f\23\16\23\u00d2"+
+ "\13\23\3\23\3\23\3\24\3\24\3\24\3\24\5\24\u00da\n\24\3\24\3\24\3\24\3"+
+ "\24\3\24\3\24\3\24\3\24\3\24\3\24\7\24\u00e6\n\24\f\24\16\24\u00e9\13"+
+ "\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u00f2\n\25\3\26\3\26\3\26"+
+ "\3\26\3\26\7\26\u00f9\n\26\f\26\16\26\u00fc\13\26\5\26\u00fe\n\26\3\26"+
+ "\3\26\3\27\3\27\3\27\3\27\5\27\u0106\n\27\3\30\3\30\3\31\3\31\3\32\3\32"+
+ "\3\32\3\32\3\32\6\32\u0111\n\32\r\32\16\32\u0112\3\32\7\32\u0116\n\32"+
+ "\f\32\16\32\u0119\13\32\3\33\3\33\3\34\3\34\3\34\3\35\3\35\5\35\u0122"+
+ "\n\35\3\36\3\36\3\36\2\4 &\37\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 "+
+ "\"$&(*,.\60\62\64\668:\2\6\3\2\27\30\3\2\31\33\3\2\21\26\4\2\5\5\r\r\u0133"+
+ "\2<\3\2\2\2\4?\3\2\2\2\6B\3\2\2\2\bM\3\2\2\2\nO\3\2\2\2\fX\3\2\2\2\16"+
+ "m\3\2\2\2\20{\3\2\2\2\22\u0086\3\2\2\2\24\u008c\3\2\2\2\26\u0095\3\2\2"+
+ "\2\30\u0099\3\2\2\2\32\u00a3\3\2\2\2\34\u00a7\3\2\2\2\36\u00ab\3\2\2\2"+
+ " \u00b5\3\2\2\2\"\u00c2\3\2\2\2$\u00c7\3\2\2\2&\u00d9\3\2\2\2(\u00f1\3"+
+ "\2\2\2*\u00f3\3\2\2\2,\u0105\3\2\2\2.\u0107\3\2\2\2\60\u0109\3\2\2\2\62"+
+ "\u010b\3\2\2\2\64\u011a\3\2\2\2\66\u011c\3\2\2\28\u0121\3\2\2\2:\u0123"+
+ "\3\2\2\2<=\5\6\4\2=>\7\2\2\3>\3\3\2\2\2?@\5\36\20\2@A\7\2\2\3A\5\3\2\2"+
+ "\2BG\5\b\5\2CD\7\"\2\2DF\5\20\t\2EC\3\2\2\2FI\3\2\2\2GE\3\2\2\2GH\3\2"+
+ "\2\2H\7\3\2\2\2IG\3\2\2\2JN\5\f\7\2KN\5\16\b\2LN\5\34\17\2MJ\3\2\2\2M"+
+ "K\3\2\2\2ML\3\2\2\2N\t\3\2\2\2OP\7\20\2\2PU\5\22\n\2QR\7\35\2\2RT\5\22"+
+ "\n\2SQ\3\2\2\2TW\3\2\2\2US\3\2\2\2UV\3\2\2\2V\13\3\2\2\2WU\3\2\2\2Xa\7"+
+ "\f\2\2Y[\5\24\13\2Z\\\5\n\6\2[Z\3\2\2\2[\\\3\2\2\2\\b\3\2\2\2]_\5\n\6"+
+ "\2^`\5\24\13\2_^\3\2\2\2_`\3\2\2\2`b\3\2\2\2aY\3\2\2\2a]\3\2\2\2ab\3\2"+
+ "\2\2bc\3\2\2\2ce\5\30\r\2df\5\30\r\2ed\3\2\2\2fg\3\2\2\2ge\3\2\2\2gh\3"+
+ "\2\2\2hk\3\2\2\2ij\7\16\2\2jl\5\30\r\2ki\3\2\2\2kl\3\2\2\2l\r\3\2\2\2"+
+ "mo\7\7\2\2np\5\24\13\2on\3\2\2\2op\3\2\2\2pq\3\2\2\2qs\5\26\f\2rt\5\26"+
+ "\f\2sr\3\2\2\2tu\3\2\2\2us\3\2\2\2uv\3\2\2\2vy\3\2\2\2wx\7\16\2\2xz\5"+
+ "\26\f\2yw\3\2\2\2yz\3\2\2\2z\17\3\2\2\2{\u0084\7&\2\2|\u0081\5 \21\2}"+
+ "~\7\35\2\2~\u0080\5 \21\2\177}\3\2\2\2\u0080\u0083\3\2\2\2\u0081\177\3"+
+ "\2\2\2\u0081\u0082\3\2\2\2\u0082\u0085\3\2\2\2\u0083\u0081\3\2\2\2\u0084"+
+ "|\3\2\2\2\u0084\u0085\3\2\2\2\u0085\21\3\2\2\2\u0086\u0087\7&\2\2\u0087"+
+ "\u008a\7\21\2\2\u0088\u008b\5\36\20\2\u0089\u008b\5\66\34\2\u008a\u0088"+
+ "\3\2\2\2\u008a\u0089\3\2\2\2\u008b\23\3\2\2\2\u008c\u008d\7\4\2\2\u008d"+
+ "\u0092\5\36\20\2\u008e\u008f\7\35\2\2\u008f\u0091\5\36\20\2\u0090\u008e"+
+ "\3\2\2\2\u0091\u0094\3\2\2\2\u0092\u0090\3\2\2\2\u0092\u0093\3\2\2\2\u0093"+
+ "\25\3\2\2\2\u0094\u0092\3\2\2\2\u0095\u0097\5\32\16\2\u0096\u0098\5\24"+
+ "\13\2\u0097\u0096\3\2\2\2\u0097\u0098\3\2\2\2\u0098\27\3\2\2\2\u0099\u009d"+
+ "\5\32\16\2\u009a\u009c\5\22\n\2\u009b\u009a\3\2\2\2\u009c\u009f\3\2\2"+
+ "\2\u009d\u009b\3\2\2\2\u009d\u009e\3\2\2\2\u009e\u00a1\3\2\2\2\u009f\u009d"+
+ "\3\2\2\2\u00a0\u00a2\5\24\13\2\u00a1\u00a0\3\2\2\2\u00a1\u00a2\3\2\2\2"+
+ "\u00a2\31\3\2\2\2\u00a3\u00a4\7\36\2\2\u00a4\u00a5\5\34\17\2\u00a5\u00a6"+
+ "\7\37\2\2\u00a6\33\3\2\2\2\u00a7\u00a8\5\64\33\2\u00a8\u00a9\7\17\2\2"+
+ "\u00a9\u00aa\5\36\20\2\u00aa\35\3\2\2\2\u00ab\u00ac\5 \21\2\u00ac\37\3"+
+ "\2\2\2\u00ad\u00ae\b\21\1\2\u00ae\u00af\7\b\2\2\u00af\u00b6\5 \21\7\u00b0"+
+ "\u00b1\5\64\33\2\u00b1\u00b2\7\n\2\2\u00b2\u00b3\5\32\16\2\u00b3\u00b6"+
+ "\3\2\2\2\u00b4\u00b6\5\"\22\2\u00b5\u00ad\3\2\2\2\u00b5\u00b0\3\2\2\2"+
+ "\u00b5\u00b4\3\2\2\2\u00b6\u00bf\3\2\2\2\u00b7\u00b8\f\4\2\2\u00b8\u00b9"+
+ "\7\3\2\2\u00b9\u00be\5 \21\5\u00ba\u00bb\f\3\2\2\u00bb\u00bc\7\13\2\2"+
+ "\u00bc\u00be\5 \21\4\u00bd\u00b7\3\2\2\2\u00bd\u00ba\3\2\2\2\u00be\u00c1"+
+ "\3\2\2\2\u00bf\u00bd\3\2\2\2\u00bf\u00c0\3\2\2\2\u00c0!\3\2\2\2\u00c1"+
+ "\u00bf\3\2\2\2\u00c2\u00c4\5&\24\2\u00c3\u00c5\5$\23\2\u00c4\u00c3\3\2"+
+ "\2\2\u00c4\u00c5\3\2\2\2\u00c5#\3\2\2\2\u00c6\u00c8\7\b\2\2\u00c7\u00c6"+
+ "\3\2\2\2\u00c7\u00c8\3\2\2\2\u00c8\u00c9\3\2\2\2\u00c9\u00ca\7\6\2\2\u00ca"+
+ "\u00cb\7 \2\2\u00cb\u00d0\5&\24\2\u00cc\u00cd\7\35\2\2\u00cd\u00cf\5&"+
+ "\24\2\u00ce\u00cc\3\2\2\2\u00cf\u00d2\3\2\2\2\u00d0\u00ce\3\2\2\2\u00d0"+
+ "\u00d1\3\2\2\2\u00d1\u00d3\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d3\u00d4\7!"+
+ "\2\2\u00d4%\3\2\2\2\u00d5\u00d6\b\24\1\2\u00d6\u00da\5(\25\2\u00d7\u00d8"+
+ "\t\2\2\2\u00d8\u00da\5&\24\6\u00d9\u00d5\3\2\2\2\u00d9\u00d7\3\2\2\2\u00da"+
+ "\u00e7\3\2\2\2\u00db\u00dc\f\5\2\2\u00dc\u00dd\t\3\2\2\u00dd\u00e6\5&"+
+ "\24\6\u00de\u00df\f\4\2\2\u00df\u00e0\t\2\2\2\u00e0\u00e6\5&\24\5\u00e1"+
+ "\u00e2\f\3\2\2\u00e2\u00e3\5.\30\2\u00e3\u00e4\5&\24\4\u00e4\u00e6\3\2"+
+ "\2\2\u00e5\u00db\3\2\2\2\u00e5\u00de\3\2\2\2\u00e5\u00e1\3\2\2\2\u00e6"+
+ "\u00e9\3\2\2\2\u00e7\u00e5\3\2\2\2\u00e7\u00e8\3\2\2\2\u00e8\'\3\2\2\2"+
+ "\u00e9\u00e7\3\2\2\2\u00ea\u00f2\5,\27\2\u00eb\u00f2\5*\26\2\u00ec\u00f2"+
+ "\5\62\32\2\u00ed\u00ee\7 \2\2\u00ee\u00ef\5\36\20\2\u00ef\u00f0\7!\2\2"+
+ "\u00f0\u00f2\3\2\2\2\u00f1\u00ea\3\2\2\2\u00f1\u00eb\3\2\2\2\u00f1\u00ec"+
+ "\3\2\2\2\u00f1\u00ed\3\2\2\2\u00f2)\3\2\2\2\u00f3\u00f4\5\64\33\2\u00f4"+
+ "\u00fd\7 \2\2\u00f5\u00fa\5\36\20\2\u00f6\u00f7\7\35\2\2\u00f7\u00f9\5"+
+ "\36\20\2\u00f8\u00f6\3\2\2\2\u00f9\u00fc\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fa"+
+ "\u00fb\3\2\2\2\u00fb\u00fe\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fd\u00f5\3\2"+
+ "\2\2\u00fd\u00fe\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff\u0100\7!\2\2\u0100"+
+ "+\3\2\2\2\u0101\u0106\7\t\2\2\u0102\u0106\58\35\2\u0103\u0106\5\60\31"+
+ "\2\u0104\u0106\5:\36\2\u0105\u0101\3\2\2\2\u0105\u0102\3\2\2\2\u0105\u0103"+
+ "\3\2\2\2\u0105\u0104\3\2\2\2\u0106-\3\2\2\2\u0107\u0108\t\4\2\2\u0108"+
+ "/\3\2\2\2\u0109\u010a\t\5\2\2\u010a\61\3\2\2\2\u010b\u0117\5\64\33\2\u010c"+
+ "\u010d\7\34\2\2\u010d\u0116\5\64\33\2\u010e\u0110\7\36\2\2\u010f\u0111"+
+ "\7$\2\2\u0110\u010f\3\2\2\2\u0111\u0112\3\2\2\2\u0112\u0110\3\2\2\2\u0112"+
+ "\u0113\3\2\2\2\u0113\u0114\3\2\2\2\u0114\u0116\7\37\2\2\u0115\u010c\3"+
+ "\2\2\2\u0115\u010e\3\2\2\2\u0116\u0119\3\2\2\2\u0117\u0115\3\2\2\2\u0117"+
+ "\u0118\3\2\2\2\u0118\63\3\2\2\2\u0119\u0117\3\2\2\2\u011a\u011b\7&\2\2"+
+ "\u011b\65\3\2\2\2\u011c\u011d\58\35\2\u011d\u011e\7&\2\2\u011e\67\3\2"+
+ "\2\2\u011f\u0122\7%\2\2\u0120\u0122\7$\2\2\u0121\u011f\3\2\2\2\u0121\u0120"+
+ "\3\2\2\2\u01229\3\2\2\2\u0123\u0124\7#\2\2\u0124;\3\2\2\2%GMU[_agkouy"+
+ "\u0081\u0084\u008a\u0092\u0097\u009d\u00a1\u00b5\u00bd\u00bf\u00c4\u00c7"+
+ "\u00d0\u00d9\u00e5\u00e7\u00f1\u00fa\u00fd\u0105\u0112\u0115\u0117\u0121";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
index 22425b849dc31..280edd132b19d 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
@@ -34,6 +34,12 @@ interface EqlBaseVisitor extends ParseTreeVisitor {
* @return the visitor result
*/
T visitQuery(EqlBaseParser.QueryContext ctx);
+ /**
+ * Visit a parse tree produced by {@link EqlBaseParser#withParams}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitWithParams(EqlBaseParser.WithParamsContext ctx);
/**
* Visit a parse tree produced by {@link EqlBaseParser#sequence}.
* @param ctx the parse tree
@@ -52,6 +58,12 @@ interface EqlBaseVisitor extends ParseTreeVisitor {
* @return the visitor result
*/
T visitPipe(EqlBaseParser.PipeContext ctx);
+ /**
+ * Visit a parse tree produced by {@link EqlBaseParser#namedParam}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitNamedParam(EqlBaseParser.NamedParamContext ctx);
/**
* Visit a parse tree produced by {@link EqlBaseParser#joinKeys}.
* @param ctx the parse tree
@@ -59,23 +71,29 @@ interface EqlBaseVisitor extends ParseTreeVisitor {
*/
T visitJoinKeys(EqlBaseParser.JoinKeysContext ctx);
/**
- * Visit a parse tree produced by {@link EqlBaseParser#span}.
+ * Visit a parse tree produced by {@link EqlBaseParser#joinTerm}.
* @param ctx the parse tree
* @return the visitor result
*/
- T visitSpan(EqlBaseParser.SpanContext ctx);
+ T visitJoinTerm(EqlBaseParser.JoinTermContext ctx);
/**
- * Visit a parse tree produced by {@link EqlBaseParser#match}.
+ * Visit a parse tree produced by {@link EqlBaseParser#sequenceTerm}.
* @param ctx the parse tree
* @return the visitor result
*/
- T visitMatch(EqlBaseParser.MatchContext ctx);
+ T visitSequenceTerm(EqlBaseParser.SequenceTermContext ctx);
/**
- * Visit a parse tree produced by {@link EqlBaseParser#condition}.
+ * Visit a parse tree produced by {@link EqlBaseParser#subquery}.
* @param ctx the parse tree
* @return the visitor result
*/
- T visitCondition(EqlBaseParser.ConditionContext ctx);
+ T visitSubquery(EqlBaseParser.SubqueryContext ctx);
+ /**
+ * Visit a parse tree produced by {@link EqlBaseParser#eventQuery}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitEventQuery(EqlBaseParser.EventQueryContext ctx);
/**
* Visit a parse tree produced by {@link EqlBaseParser#expression}.
* @param ctx the parse tree
@@ -96,6 +114,13 @@ interface EqlBaseVisitor extends ParseTreeVisitor {
* @return the visitor result
*/
T visitBooleanDefault(EqlBaseParser.BooleanDefaultContext ctx);
+ /**
+ * Visit a parse tree produced by the {@code processCheck}
+ * labeled alternative in {@link EqlBaseParser#booleanExpression}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitProcessCheck(EqlBaseParser.ProcessCheckContext ctx);
/**
* Visit a parse tree produced by the {@code logicalBinary}
* labeled alternative in {@link EqlBaseParser#booleanExpression}.
@@ -217,12 +242,6 @@ interface EqlBaseVisitor extends ParseTreeVisitor {
* @return the visitor result
*/
T visitBooleanValue(EqlBaseParser.BooleanValueContext ctx);
- /**
- * Visit a parse tree produced by {@link EqlBaseParser#qualifiedNames}.
- * @param ctx the parse tree
- * @return the visitor result
- */
- T visitQualifiedNames(EqlBaseParser.QualifiedNamesContext ctx);
/**
* Visit a parse tree produced by {@link EqlBaseParser#qualifiedName}.
* @param ctx the parse tree
@@ -236,26 +255,11 @@ interface EqlBaseVisitor extends ParseTreeVisitor {
*/
T visitIdentifier(EqlBaseParser.IdentifierContext ctx);
/**
- * Visit a parse tree produced by the {@code quotedIdentifier}
- * labeled alternative in {@link EqlBaseParser#quoteIdentifier}.
- * @param ctx the parse tree
- * @return the visitor result
- */
- T visitQuotedIdentifier(EqlBaseParser.QuotedIdentifierContext ctx);
- /**
- * Visit a parse tree produced by the {@code unquotedIdentifier}
- * labeled alternative in {@link EqlBaseParser#unquoteIdentifier}.
- * @param ctx the parse tree
- * @return the visitor result
- */
- T visitUnquotedIdentifier(EqlBaseParser.UnquotedIdentifierContext ctx);
- /**
- * Visit a parse tree produced by the {@code digitIdentifier}
- * labeled alternative in {@link EqlBaseParser#unquoteIdentifier}.
+ * Visit a parse tree produced by {@link EqlBaseParser#timeUnit}.
* @param ctx the parse tree
* @return the visitor result
*/
- T visitDigitIdentifier(EqlBaseParser.DigitIdentifierContext ctx);
+ T visitTimeUnit(EqlBaseParser.TimeUnitContext ctx);
/**
* Visit a parse tree produced by the {@code decimalLiteral}
* labeled alternative in {@link EqlBaseParser#number}.
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java
index d153e9ed2f38e..8697bf202192d 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java
@@ -21,6 +21,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.xpack.eql.expression.Expression;
+import org.antlr.v4.runtime.ANTLRInputStream;
import java.util.Arrays;
import java.util.BitSet;
@@ -56,11 +57,11 @@ public Expression createExpression(String expression) {
return invokeParser(expression, EqlBaseParser::singleExpression, AstBuilder::expression);
}
- private T invokeParser(String sql,
+ private T invokeParser(String eql,
Function parseFunction,
BiFunction visitor) {
try {
- EqlBaseLexer lexer = new EqlBaseLexer(new CaseInsensitiveStream(sql));
+ EqlBaseLexer lexer = new EqlBaseLexer(new ANTLRInputStream(eql));
lexer.removeErrorListeners();
lexer.addErrorListener(ERROR_LISTENER);
@@ -96,8 +97,8 @@ private T invokeParser(String sql,
return visitor.apply(new AstBuilder(), tree);
} catch (StackOverflowError e) {
- throw new ParsingException("SQL statement is too large, " +
- "causing stack overflow when generating the parsing tree: [{}]", sql);
+ throw new ParsingException("EQL statement is too large, " +
+ "causing stack overflow when generating the parsing tree: [{}]", eql);
}
}
@@ -126,29 +127,6 @@ private class PostProcessor extends EqlBaseBaseListener {
this.ruleNames = ruleNames;
}
- @Override
- public void exitDigitIdentifier(EqlBaseParser.DigitIdentifierContext context) {
- Token token = context.DIGIT_IDENTIFIER().getSymbol();
- throw new ParsingException(
- "identifiers must not start with a digit; please use double quotes",
- null,
- token.getLine(),
- token.getCharPositionInLine());
- }
-
- @Override
- public void exitQuotedIdentifier(EqlBaseParser.QuotedIdentifierContext context) {
- // Remove quotes
- context.getParent().removeLastChild();
-
- Token token = (Token) context.getChild(0).getPayload();
- context.getParent().addChild(new CommonToken(
- new Pair<>(token.getTokenSource(), token.getInputStream()),
- EqlBaseLexer.IDENTIFIER,
- token.getChannel(),
- token.getStartIndex() + 1,
- token.getStopIndex() - 1));
- }
}
private static final BaseErrorListener ERROR_LISTENER = new BaseErrorListener() {
@@ -158,4 +136,4 @@ public void syntaxError(Recognizer, ?> recognizer, Object offendingSymbol, int
throw new ParsingException(message, e, line, charPositionInLine);
}
};
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
index 42ce57628de4f..8fbfd72a5ee97 100644
--- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
+++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
@@ -67,6 +67,8 @@ private static List> readQueries(String source) throws Ex
query.setLength(query.length() - 1);
queries.add(new Tuple<>(query.toString(), lineNumber));
query.setLength(0);
+ } else {
+ query.append("\n");
}
}
lineNumber++;
diff --git a/x-pack/plugin/eql/src/test/resources/grammar-queries.eql b/x-pack/plugin/eql/src/test/resources/grammar-queries.eql
index 2df66243e12c0..2b71ed8339623 100644
--- a/x-pack/plugin/eql/src/test/resources/grammar-queries.eql
+++ b/x-pack/plugin/eql/src/test/resources/grammar-queries.eql
@@ -47,7 +47,7 @@ network where total_out_bytes > 100000000
//
// Sequences
-//
+//
sequence by user_name
[process where process_name == "whoami"]
@@ -59,26 +59,26 @@ sequence with maxspan=30s
[network where destination_port==3389 and event_subtype_full="*_accept_event*"]
[security where event_id in (4624, 4625) and logon_type == 10]
;
-
+
sequence with maxspan=30s
[network where destination_port==3389 and event_subtype_full="*_accept_event"] by source_address
[security where event_id in (4624, 4625) and logon_type == 10] by ip_address
;
-
+
sequence with maxspan=5m
- [ file where file_name == "*.exe"] by user_name, file_path
- [ process where true] by user_name, process_path
+ [file where file_name == "*.exe"] by user_name, file_path
+ [process where true] by user_name, process_path
;
-
+
sequence by user_name with maxspan=5m
- [ file where file_name == "*.exe"] by file_path
- [ process where true] by process_path
+ [file where file_name == "*.exe"] by file_path
+ [process where true] by process_path
;
//
// Joins
//
-
+
join by source_ip, destination_ip
[network where destination_port == 3389] // RDP
[network where destination_port == 135] // RPC
@@ -92,4 +92,862 @@ join by pid
[file where true]
until [process where event_subtype_full == "termination_event"]
-;
\ No newline at end of file
+;
+
+
+
+/* UNIT TESTS FROM
+ * https://github.com/endgameinc/eql/blob/master/tests/test_parser.py
+ */
+
+file where true;
+
+file where true and true;
+
+file where false or true;
+
+registry where not pid;
+
+process where process_name == "net.exe" and command_line == "* user*.exe";
+
+process where command_line == "~!@#$%^&*();'[]{}\\|<>?,./:\"-= ' ";
+
+process where
+
+ pid == 4;
+
+process where process_name in ("net.exe", "cmd.exe", "at.exe");
+
+process where command_line == "*.exe *admin*" or command_line == "* a b*";
+
+process where pid in (1,2,3,4,5,6,7,8) and abc == 100 and def == 200 and ghi == 300 and jkl == x;
+
+process where ppid != pid;
+
+image_load where not x != y;
+
+image_load where not x == y;
+
+image_load where not not not not x < y;
+
+image_load where not x <= y;
+
+image_load where not x >= y;
+
+image_load where not x > y;
+
+process where _leadingUnderscore == 100;
+
+network where 1 * 2 + 3 * 4 + 10 / 2 == 2 + 12 + 5;
+
+file where 1 - -2;
+
+file where 1 + (-2);
+
+file where 1 * (-2);
+
+file where 3 * -length(file_path);
+
+network where a * b + c * d + e / f == g + h + i;
+
+network where a * (b + c * d) + e / f == g + h + i;
+
+process where pid == 4 or pid == 5 or pid == 6 or pid == 7 or pid == 8;
+
+network where pid == 0 or pid == 4 or (ppid == 0 or ppid = 4) or (abc == defgh) and process_name == "*" ;
+
+network where pid = 4;
+
+process where descendant of [process where process_name == "lsass.exe"] and process_name == "cmd.exe";
+
+ join [process where process_name == "*"] [file where file_path == "*"
+ ];
+
+ join by pid [process where name == "*"] [file where path == "*"] until [process where opcode == 2];
+
+sequence [process where name == "*"] [file where path == "*"] until [process where opcode == 2];
+
+sequence by pid [process where name == "*"] [file where path == "*"] until [process where opcode == 2];
+
+ join [process where process_name == "*"] by process_path [file where file_path == "*"] by image_path;
+
+sequence [process where process_name == "*"] by process_path [file where file_path == "*"] by image_path;
+
+sequence by pid [process where process_name == "*"] [file where file_path == "*"];
+
+sequence by pid with maxspan=200 [process where process_name == "*" ] [file where file_path == "*"];
+
+sequence by pid with maxspan=2s [process where process_name == "*" ] [file where file_path == "*"];
+
+sequence by pid with maxspan=2sec [process where process_name == "*" ] [file where file_path == "*"];
+
+sequence by pid with maxspan=2seconds [process where process_name == "*" ] [file where file_path == "*"];
+
+sequence with maxspan=2.5m [process where x == x] by pid [file where file_path == "*"] by ppid;
+
+sequence by pid with maxspan=2.0h [process where process_name == "*"] [file where file_path == "*"];
+
+sequence by pid with maxspan=2.0h [process where process_name == "*"] [file where file_path == "*"];
+
+sequence by pid with maxspan=1.0075d [process where process_name == "*"] [file where file_path == "*"];
+
+dns where pid == 100 | head 100 | tail 50 | unique pid;
+
+network where pid == 100 | unique command_line | count;
+
+security where user_domain == "endgame" | count user_name, a, b | tail 5;
+
+process where 1==1 | count user_name, unique_pid, concat(field2,a,bc);
+
+process where 1==1 | unique user_name, concat(field2,a,bc), field2;
+
+registry where a.b;
+
+registry where a[0];
+
+registry where a.b.c.d.e;
+
+registry where a.b.c[0];
+
+registry where a[0].b;
+
+registry where a[0][1].b;
+
+registry where a[0].b[1];
+
+registry where topField.subField[100].subsubField == 0;
+
+process where true | filter true;
+
+process where 1==1 | filter abc == def;
+
+process where 1==1 | filter abc == def and 1 != 2;
+
+process where 1==1 | count process_name | filter percent > 0.5;
+
+process where a > 100000000000000000000000000000000;
+
+any where true | unique a, b, c | sort a, b, c | count;
+
+any where true | unique a, b, c | sort a, b, c | count;
+
+any where true | unique a, b, c | sort a,b,c | count;
+
+file where child of [registry where true];
+
+file where event of [registry where true];
+
+file where event of [registry where true];
+
+file where descendant of [registry where true];
+
+sequence by field1 [file where true] by f1 [process where true] by f1;
+
+sequence by a,b,c,d [file where true] by f1,f2 [process where true] by f1,f2;
+
+sequence [file where 1] by f1,f2 [process where 1] by f1,f2 until [process where 1] by f1,f2;
+
+sequence by f [file where true] by a,b [process where true] by c,d until [process where 1] by e,f;
+
+//sequence by unique_pid [process where true] [file where true] fork;
+
+sequence by unique_pid [process where true] [file where true] fork=true;
+
+sequence by unique_pid [process where true] [file where true] fork=1;
+
+sequence by unique_pid [process where true] [file where true] fork=false;
+
+sequence by unique_pid [process where true] [file where true] fork=0 [network where true];
+
+sequence by unique_pid [process where true] [file where true] fork=0;
+
+
+/* TESTS FROM
+ * https://raw.githubusercontent.com/endgameinc/eql/master/eql/etc/test_queries.toml
+ */
+process where serial_event_id = 1;
+
+process where serial_event_id < 4;
+
+process where true | head 6;
+
+process where false;
+
+process where missing_field != null;
+
+process where bad_field == null | head 5;
+
+process where process_name == "impossible name" or (serial_event_id < 4.5 and serial_event_id >= 3.1)
+;
+
+process where serial_event_id <= 8 and serial_event_id > 7
+| filter serial_event_id == 8;
+
+process where true
+| filter serial_event_id <= 10
+| filter serial_event_id > 6;
+
+process where true
+| filter serial_event_id <= 10
+| filter serial_event_id > 6
+| head 2;
+
+process where true
+| head 1000
+| filter serial_event_id <= 10
+| filter serial_event_id > 6
+| tail 2
+;
+
+process where serial_event_id<=8 and serial_event_id > 7
+;
+
+process where exit_code >= 0;
+
+process where 0 <= exit_code;
+
+process where exit_code <= 0;
+
+process where exit_code < 1;
+
+process where exit_code > -1;
+
+process where -1 < exit_code;
+
+process where not (exit_code > -1)
+ and serial_event_id in (58, 64, 69, 74, 80, 85, 90, 93, 94)
+| head 10
+;
+
+process where not (exit_code > -1) | head 7;
+
+process where not (-1 < exit_code) | head 7;
+
+process where exit_code > 0;
+
+process where exit_code < 0;
+
+process where 0 < exit_code;
+
+process where 0 > exit_code;
+
+process where (serial_event_id<=8 and serial_event_id > 7) and (opcode=3 and opcode>2);
+
+process where (serial_event_id<9 and serial_event_id >= 7) or (opcode == pid);
+
+process where process_name == "VMACTHLP.exe" and unique_pid == 12 | filter true;
+
+process where process_name in ("python.exe", "SMSS.exe", "explorer.exe")
+| unique process_name;
+
+process where process_name in ("python.exe", "smss.exe", "Explorer.exe")
+| unique length(process_name);
+
+process where process_name in ("python.exe", "smss.exe", "explorer.exe")
+| unique length(process_name) == length("python.exe");
+
+process where process_name in ("Python.exe", "smss.exe", "explorer.exe")
+| unique process_name != "python.exe";
+
+process where process_name in ("python.exe", "smss.exe", "explorer.exe")
+| unique process_name
+| head 2
+| tail 1;
+
+process where process_name in ("python.exe", "smss.exe", "explorer.exe")
+| unique process_name
+| tail 2
+| head 1;
+
+process where process_name in ("python.exe", "smss.exe")
+| unique process_name, parent_process_name;
+
+process where process_name in ("python.exe", "smss.exe")
+| unique process_name, parent_process_name;
+
+process where process_name in ("python.exe", "smss.exe")
+| head 5
+| unique process_name, parent_process_name;
+
+registry where length(bytes_written_string_list) == 2 and bytes_written_string_list[1] == "EN";
+
+registry where key_path == "*\\MACHINE\\SAM\\SAM\\*\\Account\\Us*ers\\00*03E9\\F";
+
+process where process_path == "*\\red_ttp\\wininit.*" and opcode in (0,1,2,3,4);
+
+file where file_name == "csrss.exe" and opcode=0
+ and descendant of [process where opcode in (1,3) and process_name="cmd.exe"]
+;
+
+process where opcode=1 and process_name == "csrss.exe"
+ and descendant of [file where file_name == "csrss.exe" and opcode=0]
+;
+
+process where opcode=1 and process_name == "smss.exe"
+ and descendant of [
+ file where file_name == "csrss.exe" and opcode=0
+ and descendant of [
+ process where opcode in(1,3) and process_name="cmd.exe"
+ ]
+ ]
+;
+
+file where file_path="*\\red_ttp\\winin*.*"
+ and opcode in (0,1,2) and user_name="vagrant"
+;
+
+file where file_path="*\\red_ttp\\winin*.*"
+ and opcode not in (0,1,2) and user_name="vagrant"
+;
+
+file where file_path="*\\red_ttp\\winin*.*"
+ and opcode not in (3, 4, 5, 6 ,7) and user_name="vagrant"
+;
+
+file where file_name in ("wininit.exe", "lsass.exe") and opcode == 2
+;
+
+file where true
+| tail 3;
+
+process where opcode in (1,3) and process_name in (parent_process_name, "SYSTEM")
+;
+
+file where true
+| tail 4
+| sort file_path;
+
+process where true
+| head 5
+| sort md5, event_subtype_full, process_name;
+
+process where true
+| head 5
+| sort md5, event_subtype_full, null_field, process_name;
+
+process where true
+| head 5
+| sort md5, event_subtype_full, null_field, process_name;
+
+process where true
+| head 5
+| sort md5, event_subtype_full, null_field, process_name
+| head 2;
+
+process where true
+| head 5
+| sort md5, event_subtype_full, null_field, process_name
+| sort serial_event_id;
+
+sequence
+ [process where serial_event_id = 1]
+ [process where serial_event_id = 2]
+;
+
+sequence
+ [process where serial_event_id < 5]
+ [process where serial_event_id = 5]
+;
+
+sequence
+ [process where serial_event_id=1] by unique_pid
+ [process where true] by unique_ppid;
+
+sequence
+ [process where serial_event_id<3] by unique_pid
+ [process where true] by unique_ppid
+;
+
+sequence
+ [process where serial_event_id<3] by unique_pid * 2
+ [process where true] by unique_ppid * 2
+;
+
+sequence
+ [process where serial_event_id<3] by unique_pid * 2, length(unique_pid), string(unique_pid)
+ [process where true] by unique_ppid * 2, length(unique_ppid), string(unique_ppid)
+;
+
+sequence
+ [file where event_subtype_full == "file_create_event"] by file_path
+ [process where opcode == 1] by process_path
+ [process where opcode == 2] by process_path
+ [file where event_subtype_full == "file_delete_event"] by file_path
+| head 4
+| tail 2;
+
+sequence with maxspan=1d
+ [file where event_subtype_full == "file_create_event"] by file_path
+ [process where opcode == 1] by process_path
+ [process where opcode == 2] by process_path
+ [file where event_subtype_full == "file_delete_event"] by file_path
+| head 4
+| tail 2;
+
+sequence with maxspan=1h
+ [file where event_subtype_full == "file_create_event"] by file_path
+ [process where opcode == 1] by process_path
+ [process where opcode == 2] by process_path
+ [file where event_subtype_full == "file_delete_event"] by file_path
+| head 4
+| tail 2;
+
+sequence with maxspan=1m
+ [file where event_subtype_full == "file_create_event"] by file_path
+ [process where opcode == 1] by process_path
+ [process where opcode == 2] by process_path
+ [file where event_subtype_full == "file_delete_event"] by file_path
+| head 4
+| tail 2;
+
+sequence with maxspan=10s
+ [file where event_subtype_full == "file_create_event"] by file_path
+ [process where opcode == 1] by process_path
+ [process where opcode == 2] by process_path
+ [file where event_subtype_full == "file_delete_event"] by file_path
+| head 4
+| tail 2;
+
+sequence with maxspan=0.5s
+ [file where event_subtype_full == "file_create_event"] by file_path
+ [process where opcode == 1] by process_path
+ [process where opcode == 2] by process_path
+ [file where event_subtype_full == "file_delete_event"] by file_path
+| head 4
+| tail 2;
+
+sequence
+ [process where serial_event_id < 5]
+ [process where serial_event_id < 5]
+;
+
+sequence
+ [file where opcode=0 and file_name="svchost.exe"] by unique_pid
+ [process where opcode == 1] by unique_ppid
+;
+
+sequence
+ [file where opcode=0] by unique_pid
+ [file where opcode=0] by unique_pid
+| head 1;
+
+sequence
+ [file where opcode=0] by unique_pid
+ [file where opcode=0] by unique_pid
+| filter events[1].serial_event_id == 92;
+
+sequence
+ [file where opcode=0 and file_name="*.exe"] by unique_pid
+ [file where opcode=0 and file_name="*.exe"] by unique_pid
+until [process where opcode=5000] by unique_ppid
+| head 1;
+
+sequence
+ [file where opcode=0 and file_name="*.exe"] by unique_pid
+ [file where opcode=0 and file_name="*.exe"] by unique_pid
+until [process where opcode=1] by unique_ppid
+| head 1;
+
+join
+ [file where opcode=0 and file_name="*.exe"] by unique_pid
+ [file where opcode=2 and file_name="*.exe"] by unique_pid
+until [process where opcode=1] by unique_ppid
+| head 1;
+
+join by user_name
+ [process where opcode in (1,3) and process_name="smss.exe"]
+ [process where opcode in (1,3) and process_name == "python.exe"]
+;
+
+join by unique_pid
+ [process where opcode=1]
+ [file where opcode=0 and file_name="svchost.exe"]
+ [file where opcode == 0 and file_name == "lsass.exe"];
+
+join by string(unique_pid)
+ [process where opcode=1]
+ [file where opcode=0 and file_name="svchost.exe"]
+ [file where opcode == 0 and file_name == "lsass.exe"];
+
+join by unique_pid
+ [process where opcode=1]
+ [file where opcode=0 and file_name="svchost.exe"]
+ [file where opcode == 0 and file_name == "lsass.exe"]
+until [file where opcode == 2];
+
+join by string(unique_pid), unique_pid, unique_pid * 2
+ [process where opcode=1]
+ [file where opcode=0 and file_name="svchost.exe"]
+ [file where opcode == 0 and file_name == "lsass.exe"]
+until [file where opcode == 2];
+
+join
+ [file where opcode=0 and file_name="svchost.exe"] by unique_pid
+ [process where opcode == 1] by unique_ppid
+;
+
+join by unique_pid
+ [process where opcode in (1,3) and process_name="python.exe"]
+ [file where file_name == "*.exe"];
+
+join by user_name
+ [process where opcode in (1,3) and process_name="python.exe"]
+ [process where opcode in (1,3) and process_name == "smss.exe"]
+;
+
+join
+ [process where opcode in (1,3) and process_name="python.exe"]
+ [process where opcode in (1,3) and process_name == "smss.exe"]
+;
+
+process where fake_field == "*";
+
+process where fake_field != "*"
+| head 4;
+
+process where not (fake_field == "*")
+| head 4;
+
+registry where invalid_field_name != null;
+
+registry where length(bad_field) > 0
+;
+
+process where opcode == 1
+ and process_name in ("net.exe", "net1.exe")
+ and not (parent_process_name == "net.exe"
+ and process_name == "net1.exe")
+ and command_line == "*group *admin*" and command_line != "* /add*";
+
+any where true
+| unique event_type_full;
+
+process where opcode=1 and process_name in ("services.exe", "smss.exe", "lsass.exe")
+ and descendant of [process where process_name == "cmd.exe" ];
+
+process where process_name in ("services.exe", "smss.exe", "lsass.exe")
+ and descendant of [process where process_name == "cmd.exe" ];
+
+process where opcode=2 and process_name in ("services.exe", "smss.exe", "lsass.exe")
+ and descendant of [process where process_name == "cmd.exe" ];
+
+process where process_name="svchost.exe"
+ and child of [file where file_name="svchost.exe" and opcode=0];
+
+process where process_name="svchost.exe"
+ and not child of [file where file_name="svchost.exe" and opcode=0]
+| head 3;
+
+process where process_name="lsass.exe"
+ and child of [
+ process where process_name="python.exe"
+ and child of [process where process_name="cmd.exe"]
+ ]
+;
+
+file where child of [
+process where child of [
+ process where child of [process where process_name="*wsmprovhost.exe"]
+ ]
+]
+| tail 1;
+
+file where process_name = "python.exe"
+| unique unique_pid;
+
+file where event of [process where process_name = "python.exe" ]
+| unique unique_pid;
+
+process where process_name = "python.exe";
+
+process where event of [process where process_name = "python.exe" ];
+
+sequence
+ [file where file_name="lsass.exe"] by file_path,process_path
+ [process where true] by process_path,parent_process_path
+;
+
+sequence by user_name
+ [file where file_name="lsass.exe"] by file_path, process_path
+ [process where true] by process_path, parent_process_path
+;
+
+sequence by pid
+ [file where file_name="lsass.exe"] by file_path,process_path
+ [process where true] by process_path,parent_process_path
+;
+
+sequence by user_name
+ [file where opcode=0] by file_path
+ [process where opcode=1] by process_path
+ [process where opcode=2] by process_path
+ [file where opcode=2] by file_path
+| tail 1;
+
+sequence by user_name
+ [file where opcode=0] by pid,file_path
+ [file where opcode=2] by pid,file_path
+until [process where opcode=2] by ppid,process_path
+;
+
+sequence by user_name
+ [file where opcode=0] by pid,file_path
+ [file where opcode=2] by pid,file_path
+until [process where opcode=5] by ppid,process_path
+| head 2;
+
+sequence by pid
+ [file where opcode=0] by file_path
+ [process where opcode=1] by process_path
+ [process where opcode=2] by process_path
+ [file where opcode=2] by file_path
+| tail 1;
+
+join by user_name
+ [file where true] by pid,file_path
+ [process where true] by ppid,process_path
+| head 2;
+
+sequence
+ [process where true] by unique_pid
+ [file where true] fork=true by unique_pid
+ [process where true] by unique_ppid
+| head 4;
+
+process where command_line == "*%*" ;
+
+process where command_line == "*%*%*" ;
+
+process where command_line == "%*%*" ;
+
+any where process_name == "svchost.exe"
+| unique_count event_type_full, process_name;
+
+any where process_name == "svchost.exe"
+| sort event_type_full, serial_event_id
+| unique_count event_type_full, process_name;
+
+any where process_name == "svchost.exe"
+| unique_count event_type_full, opcode
+| filter count == 7;
+
+any where process_name == "svchost.exe"
+| unique_count event_type_full, opcode
+| filter percent >= .5
+;
+
+registry where arrayContains(bytes_written_string_list, 'En-uS');
+
+registry where arrayContains(bytes_written_string_list, 'En');
+
+registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] == 'EN-us'
+;
+
+registry where bytes_written_string_list[0] == 'EN-us'
+;
+
+registry where bytes_written_string_list[1] == 'EN'
+;
+
+process where matchLite(?'.*?net1\s+localgroup\s+.*?', command_line)
+;
+
+process where matchLite(?'.*?net1\s+\w+\s+.*?', command_line)
+;
+
+process where matchLite(?'.*?net1\s+\w{4,15}\s+.*?', command_line)
+;
+
+process where match(?'.*?net1\s+\w{4,15}\s+.*?', command_line)
+;
+
+process where matchLite(?'.*?net1\s+[localgrup]{4,15}\s+.*?', command_line)
+;
+
+process where 'net.EXE' == original_file_name
+| filter process_name="net*.exe"
+;
+
+process where process_name == original_file_name
+| filter process_name='net*.exe'
+;
+
+process where original_file_name == process_name
+| filter length(original_file_name) > 0
+;
+
+file where opcode=0 and startsWith(file_name, 'exploRER.')
+;
+
+file where opcode=0 and startsWith(file_name, 'expLORER.exe')
+;
+
+file where opcode=0 and endsWith(file_name, 'loREr.exe');
+
+file where opcode=0 and startsWith(file_name, 'explORER.EXE');
+
+file where opcode=0 and startsWith('explorer.exeaaaaaaaa', file_name);
+
+file where opcode=0 and serial_event_id = 88 and startsWith('explorer.exeaAAAA', 'EXPLORER.exe');
+
+file where opcode=0 and stringContains('ABCDEFGHIexplorer.exeJKLMNOP', file_name)
+;
+
+file where opcode=0 and indexOf(file_name, 'plore') == 2 and not indexOf(file_name, '.pf')
+;
+
+file where opcode=0 and indexOf(file_name, 'explorer.') and indexOf(file_name, 'plore', 100)
+;
+
+file where opcode=0 and indexOf(file_name, 'plorer.', 0) == 2;
+
+file where opcode=0 and indexOf(file_name, 'plorer.', 2);
+
+file where opcode=0 and indexOf(file_name, 'plorer.', 4);
+
+file where opcode=0 and indexOf(file_name, 'thing that never happened');
+
+file where opcode=0 and indexOf(file_name, 'plorer.', 2) == 2;
+
+file where opcode=0 and indexOf(file_name, 'explorer.', 0) == 0;
+
+file where serial_event_id=88 and substring(file_name, 0, 4) == 'expl'
+;
+
+file where serial_event_id=88 and substring(file_name, 1, 3) == 'xp'
+;
+
+file where serial_event_id=88 and substring(file_name, -4) == '.exe'
+;
+
+file where serial_event_id=88 and substring(file_name, -4, -1) == '.ex'
+;
+
+process where add(serial_event_id, 0) == 1 and add(0, 1) == serial_event_id;
+
+process where subtract(serial_event_id, -5) == 6;
+
+process where multiply(6, serial_event_id) == 30 and divide(30, 4.0) == 7.5;
+
+process where modulo(11, add(serial_event_id, 1)) == serial_event_id;
+
+process where serial_event_id == number('5');
+
+process where serial_event_id == number('0x32', 16);
+
+process where serial_event_id == number('32', 16);
+
+process where number(serial_event_id) == number(5);
+
+process where concat(serial_event_id, ':', process_name, opcode) == '5:winINIT.exe3'
+;
+
+process where process_name != original_file_name
+| filter length(original_file_name) > 0;
+
+sequence by unique_pid [process where opcode=1 and process_name == 'msbuild.exe'] [network where true];
+
+registry where arraySearch(bytes_written_string_list, a, a == 'en-us');
+
+registry where arraySearch(bytes_written_string_list, a, endsWith(a, '-us'));
+
+network where mysterious_field
+ and arraySearch(mysterious_field.subarray, s, true)
+;
+
+network where mysterious_field and arraySearch(mysterious_field.subarray, s, false)
+;
+
+network where mysterious_field and arraySearch(mysterious_field.subarray, s, s.a == 's0-*')
+;
+
+network where mysterious_field and arraySearch(mysterious_field.subarray, s, s.a != 's0-*')
+;
+
+network where mysterious_field
+ and arraySearch(mysterious_field.subarray, sub1,
+ arraySearch(sub1.c, nested, nested.x.y == '*'))
+;
+
+network where mysterious_field
+ and arraySearch(mysterious_field.subarray, sub1,
+ sub1.a == 's0-a' and arraySearch(sub1.c, nested, nested.z == 's0-c1-x-z'))
+;
+
+network where mysterious_field
+ and arraySearch(mysterious_field.subarray, sub1,
+ sub1.a == 's0-a' and arraySearch(sub1.c, nested, nested.z == sub1.cross_match))
+;
+
+network where mysterious_field
+ and arraySearch(mysterious_field.subarray, sub1,
+ arraySearch(sub1.c, nested, nested.x.y == mysterious_field.outer_cross_match))
+;
+
+network where safe(divide(process_name, process_name))
+;
+
+file where serial_event_id == 82 and (true == (process_name in ('svchost.EXE', 'bad.exe', 'bad2.exe')))
+;
+
+registry where arrayCount(bytes_written_string_list, s, s == '*-us') == 1
+;
+
+registry where arrayCount(bytes_written_string_list, s, s == '*en*') == 2
+;
+
+registry where arrayContains(bytes_written_string_list, "missing", "en-US")
+;
+
+file where serial_event_id - 1 == 81;
+
+file where serial_event_id + 1 == 83;
+
+file where serial_event_id * 2 == 164;
+
+file where serial_event_id / 2 == 41;
+
+file where serial_event_id % 40 == 2;
+
+process where between(process_name, "s", "e") == "yst"
+;
+
+process where between(process_name, "s", "e", false) == "yst"
+;
+
+process where between(process_name, "s", "e", false, true) == "yst"
+;
+
+process where between(process_name, "s", "e", false, true) == "t"
+;
+
+process where between(process_name, "S", "e", false, true) == "yst"
+;
+
+process where between(process_name, "s", "e", true) == "ystem Idle Proc"
+;
+
+file where between(file_path, "dev", ".json", false) == "\\testlogs\\something"
+;
+
+file where between(file_path, "dev", ".json", true) == "\\testlogs\\something"
+;
+
+network where cidrMatch(source_address, "10.6.48.157/8")
+;
+
+network where cidrMatch(source_address, "192.168.0.0/16")
+;
+
+network where cidrMatch(source_address, "192.168.0.0/16", "10.6.48.157/8")
+
+;
+
+network where cidrMatch(source_address, "0.0.0.0/0")
+;
+
+process where length(between(process_name, 'g', 'e')) > 0
+;
+
+process where length(between(process_name, 'g', 'z')) > 0
+;
From 796033abb7cad8261b32e6be119ca501a6b34332 Mon Sep 17 00:00:00 2001
From: Ross Wolf <31489089+rw-access@users.noreply.github.com>
Date: Thu, 16 Jan 2020 18:19:00 -0700
Subject: [PATCH 2/8] Add backtick escaped identifiers
---
x-pack/plugin/eql/src/main/antlr/EqlBase.g4 | 12 +-
.../xpack/eql/parser/EqlBaseBaseListener.java | 12 +
.../xpack/eql/parser/EqlBaseBaseVisitor.java | 7 +
.../xpack/eql/parser/EqlBaseLexer.java | 246 +++++++++---------
.../xpack/eql/parser/EqlBaseListener.java | 12 +
.../xpack/eql/parser/EqlBaseParser.java | 189 ++++++++------
.../xpack/eql/parser/EqlBaseVisitor.java | 7 +
.../src/test/resources/grammar-queries.eql | 10 +
8 files changed, 290 insertions(+), 205 deletions(-)
diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
index 3478f46e81fd9..80f4dfc30b525 100644
--- a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
+++ b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
@@ -103,6 +103,7 @@ primaryExpression
: constant #constantDefault
| functionExpression #function
| qualifiedName #dereference
+ | ESCAPED_IDENTIFIER #identifierEscape
| LP expression RP #parenthesizedExpression
;
@@ -182,6 +183,11 @@ LP: '(';
RP: ')';
PIPE: '|';
+
+ESCAPED_IDENTIFIER
+ : '`' (~'`')* '`'
+ ;
+
STRING
: '\'' ('\\' [btnfr"'\\] | ~[\r\n'\\])* '\''
| '"' ('\\' [btnfr"'\\] | ~[\r\n"\\])* '"'
@@ -200,8 +206,9 @@ DECIMAL_VALUE
| DOT DIGIT+ EXPONENT
;
+// make @timestamp not require escaping, since @ has no other meaning
IDENTIFIER
- : (LETTER | '_') (LETTER | DIGIT | '_')*
+ : (LETTER | '_' | '@') (LETTER | DIGIT | '_')*
;
fragment EXPONENT
@@ -232,7 +239,8 @@ WS
// Catch-all for anything we can't recognize.
// We use this to be able to ignore and recover all the text
// when splitting statements with DelimiterLexer
+/*
UNRECOGNIZED
: .
;
-
+*/
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
index b1af9de5d832e..f546518ba1a1c 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
@@ -347,6 +347,18 @@ class EqlBaseBaseListener implements EqlBaseListener {
* The default implementation does nothing.
*/
@Override public void exitDereference(EqlBaseParser.DereferenceContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void enterIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx) { }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation does nothing.
+ */
+ @Override public void exitIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx) { }
/**
* {@inheritDoc}
*
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
index 741fee7dd60f3..f6a85e1805ec8 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
@@ -207,6 +207,13 @@ class EqlBaseBaseVisitor extends AbstractParseTreeVisitor implements EqlBa
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitDereference(EqlBaseParser.DereferenceContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java
index 6c94fdfd945b8..66e5db285125c 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java
@@ -20,9 +20,9 @@ class EqlBaseLexer extends Lexer {
AND=1, BY=2, FALSE=3, IN=4, JOIN=5, NOT=6, NULL=7, OF=8, OR=9, SEQUENCE=10,
TRUE=11, UNTIL=12, WHERE=13, WITH=14, EQ=15, NEQ=16, LT=17, LTE=18, GT=19,
GTE=20, PLUS=21, MINUS=22, ASTERISK=23, SLASH=24, PERCENT=25, DOT=26,
- COMMA=27, LB=28, RB=29, LP=30, RP=31, PIPE=32, STRING=33, INTEGER_VALUE=34,
- DECIMAL_VALUE=35, IDENTIFIER=36, LINE_COMMENT=37, BRACKETED_COMMENT=38,
- WS=39, UNRECOGNIZED=40;
+ COMMA=27, LB=28, RB=29, LP=30, RP=31, PIPE=32, ESCAPED_IDENTIFIER=33,
+ STRING=34, INTEGER_VALUE=35, DECIMAL_VALUE=36, IDENTIFIER=37, LINE_COMMENT=38,
+ BRACKETED_COMMENT=39, WS=40;
public static String[] modeNames = {
"DEFAULT_MODE"
};
@@ -31,9 +31,9 @@ class EqlBaseLexer extends Lexer {
"AND", "BY", "FALSE", "IN", "JOIN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
"TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ", "LT", "LTE", "GT", "GTE",
"PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "DOT", "COMMA", "LB",
- "RB", "LP", "RP", "PIPE", "STRING", "INTEGER_VALUE", "DECIMAL_VALUE",
- "IDENTIFIER", "EXPONENT", "DIGIT", "LETTER", "LINE_COMMENT", "BRACKETED_COMMENT",
- "WS", "UNRECOGNIZED"
+ "RB", "LP", "RP", "PIPE", "ESCAPED_IDENTIFIER", "STRING", "INTEGER_VALUE",
+ "DECIMAL_VALUE", "IDENTIFIER", "EXPONENT", "DIGIT", "LETTER", "LINE_COMMENT",
+ "BRACKETED_COMMENT", "WS"
};
private static final String[] _LITERAL_NAMES = {
@@ -46,8 +46,8 @@ class EqlBaseLexer extends Lexer {
null, "AND", "BY", "FALSE", "IN", "JOIN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
"TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ", "LT", "LTE", "GT", "GTE",
"PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "DOT", "COMMA", "LB",
- "RB", "LP", "RP", "PIPE", "STRING", "INTEGER_VALUE", "DECIMAL_VALUE",
- "IDENTIFIER", "LINE_COMMENT", "BRACKETED_COMMENT", "WS", "UNRECOGNIZED"
+ "RB", "LP", "RP", "PIPE", "ESCAPED_IDENTIFIER", "STRING", "INTEGER_VALUE",
+ "DECIMAL_VALUE", "IDENTIFIER", "LINE_COMMENT", "BRACKETED_COMMENT", "WS"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
@@ -104,7 +104,7 @@ public EqlBaseLexer(CharStream input) {
public ATN getATN() { return _ATN; }
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2*\u0167\b\1\4\2\t"+
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2*\u016e\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"+
@@ -117,119 +117,121 @@ public EqlBaseLexer(CharStream input) {
"\17\3\17\3\17\3\20\3\20\3\20\5\20\u00a0\n\20\3\21\3\21\3\21\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\30\3\30"+
"\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37"+
- "\3 \3 \3!\3!\3\"\3\"\3\"\3\"\7\"\u00cb\n\"\f\"\16\"\u00ce\13\"\3\"\3\""+
- "\3\"\3\"\3\"\7\"\u00d5\n\"\f\"\16\"\u00d8\13\"\3\"\3\"\3\"\3\"\3\"\3\""+
- "\3\"\7\"\u00e1\n\"\f\"\16\"\u00e4\13\"\3\"\3\"\3\"\3\"\3\"\3\"\3\"\7\""+
- "\u00ed\n\"\f\"\16\"\u00f0\13\"\3\"\5\"\u00f3\n\"\3#\6#\u00f6\n#\r#\16"+
- "#\u00f7\3$\6$\u00fb\n$\r$\16$\u00fc\3$\3$\7$\u0101\n$\f$\16$\u0104\13"+
- "$\3$\3$\6$\u0108\n$\r$\16$\u0109\3$\6$\u010d\n$\r$\16$\u010e\3$\3$\7$"+
- "\u0113\n$\f$\16$\u0116\13$\5$\u0118\n$\3$\3$\3$\3$\6$\u011e\n$\r$\16$"+
- "\u011f\3$\3$\5$\u0124\n$\3%\3%\5%\u0128\n%\3%\3%\3%\7%\u012d\n%\f%\16"+
- "%\u0130\13%\3&\3&\5&\u0134\n&\3&\6&\u0137\n&\r&\16&\u0138\3\'\3\'\3(\3"+
- "(\3)\3)\3)\3)\7)\u0143\n)\f)\16)\u0146\13)\3)\5)\u0149\n)\3)\5)\u014c"+
- "\n)\3)\3)\3*\3*\3*\3*\3*\7*\u0155\n*\f*\16*\u0158\13*\3*\3*\3*\3*\3*\3"+
- "+\6+\u0160\n+\r+\16+\u0161\3+\3+\3,\3,\3\u0156\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\2M\2"+
- "O\2Q\'S(U)W*\3\2\r\n\2$$))^^ddhhppttvv\6\2\f\f\17\17))^^\6\2\f\f\17\17"+
- "$$^^\5\2\f\f\17\17$$\5\2\f\f\17\17))\4\2GGgg\4\2--//\3\2\62;\4\2C\\c|"+
- "\4\2\f\f\17\17\5\2\13\f\17\17\"\"\u0186\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3"+
- "\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2"+
- "\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35"+
- "\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)"+
- "\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2"+
- "\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2"+
- "A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2Q\3\2\2\2\2S\3"+
- "\2\2\2\2U\3\2\2\2\2W\3\2\2\2\3Y\3\2\2\2\5]\3\2\2\2\7`\3\2\2\2\tf\3\2\2"+
- "\2\13i\3\2\2\2\rn\3\2\2\2\17r\3\2\2\2\21w\3\2\2\2\23z\3\2\2\2\25}\3\2"+
- "\2\2\27\u0086\3\2\2\2\31\u008b\3\2\2\2\33\u0091\3\2\2\2\35\u0097\3\2\2"+
- "\2\37\u009f\3\2\2\2!\u00a1\3\2\2\2#\u00a4\3\2\2\2%\u00a6\3\2\2\2\'\u00a9"+
- "\3\2\2\2)\u00ab\3\2\2\2+\u00ae\3\2\2\2-\u00b0\3\2\2\2/\u00b2\3\2\2\2\61"+
- "\u00b4\3\2\2\2\63\u00b6\3\2\2\2\65\u00b8\3\2\2\2\67\u00ba\3\2\2\29\u00bc"+
- "\3\2\2\2;\u00be\3\2\2\2=\u00c0\3\2\2\2?\u00c2\3\2\2\2A\u00c4\3\2\2\2C"+
- "\u00f2\3\2\2\2E\u00f5\3\2\2\2G\u0123\3\2\2\2I\u0127\3\2\2\2K\u0131\3\2"+
- "\2\2M\u013a\3\2\2\2O\u013c\3\2\2\2Q\u013e\3\2\2\2S\u014f\3\2\2\2U\u015f"+
- "\3\2\2\2W\u0165\3\2\2\2YZ\7c\2\2Z[\7p\2\2[\\\7f\2\2\\\4\3\2\2\2]^\7d\2"+
- "\2^_\7{\2\2_\6\3\2\2\2`a\7h\2\2ab\7c\2\2bc\7n\2\2cd\7u\2\2de\7g\2\2e\b"+
- "\3\2\2\2fg\7k\2\2gh\7p\2\2h\n\3\2\2\2ij\7l\2\2jk\7q\2\2kl\7k\2\2lm\7p"+
- "\2\2m\f\3\2\2\2no\7p\2\2op\7q\2\2pq\7v\2\2q\16\3\2\2\2rs\7p\2\2st\7w\2"+
- "\2tu\7n\2\2uv\7n\2\2v\20\3\2\2\2wx\7q\2\2xy\7h\2\2y\22\3\2\2\2z{\7q\2"+
- "\2{|\7t\2\2|\24\3\2\2\2}~\7u\2\2~\177\7g\2\2\177\u0080\7s\2\2\u0080\u0081"+
- "\7w\2\2\u0081\u0082\7g\2\2\u0082\u0083\7p\2\2\u0083\u0084\7e\2\2\u0084"+
- "\u0085\7g\2\2\u0085\26\3\2\2\2\u0086\u0087\7v\2\2\u0087\u0088\7t\2\2\u0088"+
- "\u0089\7w\2\2\u0089\u008a\7g\2\2\u008a\30\3\2\2\2\u008b\u008c\7w\2\2\u008c"+
- "\u008d\7p\2\2\u008d\u008e\7v\2\2\u008e\u008f\7k\2\2\u008f\u0090\7n\2\2"+
- "\u0090\32\3\2\2\2\u0091\u0092\7y\2\2\u0092\u0093\7j\2\2\u0093\u0094\7"+
- "g\2\2\u0094\u0095\7t\2\2\u0095\u0096\7g\2\2\u0096\34\3\2\2\2\u0097\u0098"+
- "\7y\2\2\u0098\u0099\7k\2\2\u0099\u009a\7v\2\2\u009a\u009b\7j\2\2\u009b"+
- "\36\3\2\2\2\u009c\u00a0\7?\2\2\u009d\u009e\7?\2\2\u009e\u00a0\7?\2\2\u009f"+
- "\u009c\3\2\2\2\u009f\u009d\3\2\2\2\u00a0 \3\2\2\2\u00a1\u00a2\7#\2\2\u00a2"+
- "\u00a3\7?\2\2\u00a3\"\3\2\2\2\u00a4\u00a5\7>\2\2\u00a5$\3\2\2\2\u00a6"+
- "\u00a7\7>\2\2\u00a7\u00a8\7?\2\2\u00a8&\3\2\2\2\u00a9\u00aa\7@\2\2\u00aa"+
- "(\3\2\2\2\u00ab\u00ac\7@\2\2\u00ac\u00ad\7?\2\2\u00ad*\3\2\2\2\u00ae\u00af"+
- "\7-\2\2\u00af,\3\2\2\2\u00b0\u00b1\7/\2\2\u00b1.\3\2\2\2\u00b2\u00b3\7"+
- ",\2\2\u00b3\60\3\2\2\2\u00b4\u00b5\7\61\2\2\u00b5\62\3\2\2\2\u00b6\u00b7"+
- "\7\'\2\2\u00b7\64\3\2\2\2\u00b8\u00b9\7\60\2\2\u00b9\66\3\2\2\2\u00ba"+
- "\u00bb\7.\2\2\u00bb8\3\2\2\2\u00bc\u00bd\7]\2\2\u00bd:\3\2\2\2\u00be\u00bf"+
- "\7_\2\2\u00bf<\3\2\2\2\u00c0\u00c1\7*\2\2\u00c1>\3\2\2\2\u00c2\u00c3\7"+
- "+\2\2\u00c3@\3\2\2\2\u00c4\u00c5\7~\2\2\u00c5B\3\2\2\2\u00c6\u00cc\7)"+
- "\2\2\u00c7\u00c8\7^\2\2\u00c8\u00cb\t\2\2\2\u00c9\u00cb\n\3\2\2\u00ca"+
- "\u00c7\3\2\2\2\u00ca\u00c9\3\2\2\2\u00cb\u00ce\3\2\2\2\u00cc\u00ca\3\2"+
- "\2\2\u00cc\u00cd\3\2\2\2\u00cd\u00cf\3\2\2\2\u00ce\u00cc\3\2\2\2\u00cf"+
- "\u00f3\7)\2\2\u00d0\u00d6\7$\2\2\u00d1\u00d2\7^\2\2\u00d2\u00d5\t\2\2"+
- "\2\u00d3\u00d5\n\4\2\2\u00d4\u00d1\3\2\2\2\u00d4\u00d3\3\2\2\2\u00d5\u00d8"+
- "\3\2\2\2\u00d6\u00d4\3\2\2\2\u00d6\u00d7\3\2\2\2\u00d7\u00d9\3\2\2\2\u00d8"+
- "\u00d6\3\2\2\2\u00d9\u00f3\7$\2\2\u00da\u00db\7A\2\2\u00db\u00dc\7$\2"+
- "\2\u00dc\u00e2\3\2\2\2\u00dd\u00de\7^\2\2\u00de\u00e1\7$\2\2\u00df\u00e1"+
- "\n\5\2\2\u00e0\u00dd\3\2\2\2\u00e0\u00df\3\2\2\2\u00e1\u00e4\3\2\2\2\u00e2"+
- "\u00e0\3\2\2\2\u00e2\u00e3\3\2\2\2\u00e3\u00e5\3\2\2\2\u00e4\u00e2\3\2"+
- "\2\2\u00e5\u00f3\7$\2\2\u00e6\u00e7\7A\2\2\u00e7\u00e8\7)\2\2\u00e8\u00ee"+
- "\3\2\2\2\u00e9\u00ea\7^\2\2\u00ea\u00ed\7)\2\2\u00eb\u00ed\n\6\2\2\u00ec"+
- "\u00e9\3\2\2\2\u00ec\u00eb\3\2\2\2\u00ed\u00f0\3\2\2\2\u00ee\u00ec\3\2"+
- "\2\2\u00ee\u00ef\3\2\2\2\u00ef\u00f1\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f1"+
- "\u00f3\7)\2\2\u00f2\u00c6\3\2\2\2\u00f2\u00d0\3\2\2\2\u00f2\u00da\3\2"+
- "\2\2\u00f2\u00e6\3\2\2\2\u00f3D\3\2\2\2\u00f4\u00f6\5M\'\2\u00f5\u00f4"+
- "\3\2\2\2\u00f6\u00f7\3\2\2\2\u00f7\u00f5\3\2\2\2\u00f7\u00f8\3\2\2\2\u00f8"+
- "F\3\2\2\2\u00f9\u00fb\5M\'\2\u00fa\u00f9\3\2\2\2\u00fb\u00fc\3\2\2\2\u00fc"+
- "\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u00fe\3\2\2\2\u00fe\u0102\5\65"+
- "\33\2\u00ff\u0101\5M\'\2\u0100\u00ff\3\2\2\2\u0101\u0104\3\2\2\2\u0102"+
- "\u0100\3\2\2\2\u0102\u0103\3\2\2\2\u0103\u0124\3\2\2\2\u0104\u0102\3\2"+
- "\2\2\u0105\u0107\5\65\33\2\u0106\u0108\5M\'\2\u0107\u0106\3\2\2\2\u0108"+
- "\u0109\3\2\2\2\u0109\u0107\3\2\2\2\u0109\u010a\3\2\2\2\u010a\u0124\3\2"+
- "\2\2\u010b\u010d\5M\'\2\u010c\u010b\3\2\2\2\u010d\u010e\3\2\2\2\u010e"+
- "\u010c\3\2\2\2\u010e\u010f\3\2\2\2\u010f\u0117\3\2\2\2\u0110\u0114\5\65"+
- "\33\2\u0111\u0113\5M\'\2\u0112\u0111\3\2\2\2\u0113\u0116\3\2\2\2\u0114"+
- "\u0112\3\2\2\2\u0114\u0115\3\2\2\2\u0115\u0118\3\2\2\2\u0116\u0114\3\2"+
- "\2\2\u0117\u0110\3\2\2\2\u0117\u0118\3\2\2\2\u0118\u0119\3\2\2\2\u0119"+
- "\u011a\5K&\2\u011a\u0124\3\2\2\2\u011b\u011d\5\65\33\2\u011c\u011e\5M"+
- "\'\2\u011d\u011c\3\2\2\2\u011e\u011f\3\2\2\2\u011f\u011d\3\2\2\2\u011f"+
- "\u0120\3\2\2\2\u0120\u0121\3\2\2\2\u0121\u0122\5K&\2\u0122\u0124\3\2\2"+
- "\2\u0123\u00fa\3\2\2\2\u0123\u0105\3\2\2\2\u0123\u010c\3\2\2\2\u0123\u011b"+
- "\3\2\2\2\u0124H\3\2\2\2\u0125\u0128\5O(\2\u0126\u0128\7a\2\2\u0127\u0125"+
- "\3\2\2\2\u0127\u0126\3\2\2\2\u0128\u012e\3\2\2\2\u0129\u012d\5O(\2\u012a"+
- "\u012d\5M\'\2\u012b\u012d\7a\2\2\u012c\u0129\3\2\2\2\u012c\u012a\3\2\2"+
- "\2\u012c\u012b\3\2\2\2\u012d\u0130\3\2\2\2\u012e\u012c\3\2\2\2\u012e\u012f"+
- "\3\2\2\2\u012fJ\3\2\2\2\u0130\u012e\3\2\2\2\u0131\u0133\t\7\2\2\u0132"+
- "\u0134\t\b\2\2\u0133\u0132\3\2\2\2\u0133\u0134\3\2\2\2\u0134\u0136\3\2"+
- "\2\2\u0135\u0137\5M\'\2\u0136\u0135\3\2\2\2\u0137\u0138\3\2\2\2\u0138"+
- "\u0136\3\2\2\2\u0138\u0139\3\2\2\2\u0139L\3\2\2\2\u013a\u013b\t\t\2\2"+
- "\u013bN\3\2\2\2\u013c\u013d\t\n\2\2\u013dP\3\2\2\2\u013e\u013f\7\61\2"+
- "\2\u013f\u0140\7\61\2\2\u0140\u0144\3\2\2\2\u0141\u0143\n\13\2\2\u0142"+
- "\u0141\3\2\2\2\u0143\u0146\3\2\2\2\u0144\u0142\3\2\2\2\u0144\u0145\3\2"+
- "\2\2\u0145\u0148\3\2\2\2\u0146\u0144\3\2\2\2\u0147\u0149\7\17\2\2\u0148"+
- "\u0147\3\2\2\2\u0148\u0149\3\2\2\2\u0149\u014b\3\2\2\2\u014a\u014c\7\f"+
- "\2\2\u014b\u014a\3\2\2\2\u014b\u014c\3\2\2\2\u014c\u014d\3\2\2\2\u014d"+
- "\u014e\b)\2\2\u014eR\3\2\2\2\u014f\u0150\7\61\2\2\u0150\u0151\7,\2\2\u0151"+
- "\u0156\3\2\2\2\u0152\u0155\5S*\2\u0153\u0155\13\2\2\2\u0154\u0152\3\2"+
- "\2\2\u0154\u0153\3\2\2\2\u0155\u0158\3\2\2\2\u0156\u0157\3\2\2\2\u0156"+
- "\u0154\3\2\2\2\u0157\u0159\3\2\2\2\u0158\u0156\3\2\2\2\u0159\u015a\7,"+
- "\2\2\u015a\u015b\7\61\2\2\u015b\u015c\3\2\2\2\u015c\u015d\b*\2\2\u015d"+
- "T\3\2\2\2\u015e\u0160\t\f\2\2\u015f\u015e\3\2\2\2\u0160\u0161\3\2\2\2"+
- "\u0161\u015f\3\2\2\2\u0161\u0162\3\2\2\2\u0162\u0163\3\2\2\2\u0163\u0164"+
- "\b+\2\2\u0164V\3\2\2\2\u0165\u0166\13\2\2\2\u0166X\3\2\2\2!\2\u009f\u00ca"+
- "\u00cc\u00d4\u00d6\u00e0\u00e2\u00ec\u00ee\u00f2\u00f7\u00fc\u0102\u0109"+
- "\u010e\u0114\u0117\u011f\u0123\u0127\u012c\u012e\u0133\u0138\u0144\u0148"+
- "\u014b\u0154\u0156\u0161\3\2\3\2";
+ "\3 \3 \3!\3!\3\"\3\"\7\"\u00c9\n\"\f\"\16\"\u00cc\13\"\3\"\3\"\3#\3#\3"+
+ "#\3#\7#\u00d4\n#\f#\16#\u00d7\13#\3#\3#\3#\3#\3#\7#\u00de\n#\f#\16#\u00e1"+
+ "\13#\3#\3#\3#\3#\3#\3#\3#\7#\u00ea\n#\f#\16#\u00ed\13#\3#\3#\3#\3#\3#"+
+ "\3#\3#\7#\u00f6\n#\f#\16#\u00f9\13#\3#\5#\u00fc\n#\3$\6$\u00ff\n$\r$\16"+
+ "$\u0100\3%\6%\u0104\n%\r%\16%\u0105\3%\3%\7%\u010a\n%\f%\16%\u010d\13"+
+ "%\3%\3%\6%\u0111\n%\r%\16%\u0112\3%\6%\u0116\n%\r%\16%\u0117\3%\3%\7%"+
+ "\u011c\n%\f%\16%\u011f\13%\5%\u0121\n%\3%\3%\3%\3%\6%\u0127\n%\r%\16%"+
+ "\u0128\3%\3%\5%\u012d\n%\3&\3&\5&\u0131\n&\3&\3&\3&\7&\u0136\n&\f&\16"+
+ "&\u0139\13&\3\'\3\'\5\'\u013d\n\'\3\'\6\'\u0140\n\'\r\'\16\'\u0141\3("+
+ "\3(\3)\3)\3*\3*\3*\3*\7*\u014c\n*\f*\16*\u014f\13*\3*\5*\u0152\n*\3*\5"+
+ "*\u0155\n*\3*\3*\3+\3+\3+\3+\3+\7+\u015e\n+\f+\16+\u0161\13+\3+\3+\3+"+
+ "\3+\3+\3,\6,\u0169\n,\r,\16,\u016a\3,\3,\3\u015f\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\2O\2Q\2S(U)W*\3\2\17\3\2bb\n\2$$))^^ddhhppttvv\6\2\f\f\17\17))^^\6\2"+
+ "\f\f\17\17$$^^\5\2\f\f\17\17$$\5\2\f\f\17\17))\4\2BBaa\4\2GGgg\4\2--/"+
+ "/\3\2\62;\4\2C\\c|\4\2\f\f\17\17\5\2\13\f\17\17\"\"\u018e\2\3\3\2\2\2"+
+ "\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2"+
+ "\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2"+
+ "\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2"+
+ "\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2"+
+ "\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2"+
+ "\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2"+
+ "\2K\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\3Y\3\2\2\2\5]\3\2\2\2\7`"+
+ "\3\2\2\2\tf\3\2\2\2\13i\3\2\2\2\rn\3\2\2\2\17r\3\2\2\2\21w\3\2\2\2\23"+
+ "z\3\2\2\2\25}\3\2\2\2\27\u0086\3\2\2\2\31\u008b\3\2\2\2\33\u0091\3\2\2"+
+ "\2\35\u0097\3\2\2\2\37\u009f\3\2\2\2!\u00a1\3\2\2\2#\u00a4\3\2\2\2%\u00a6"+
+ "\3\2\2\2\'\u00a9\3\2\2\2)\u00ab\3\2\2\2+\u00ae\3\2\2\2-\u00b0\3\2\2\2"+
+ "/\u00b2\3\2\2\2\61\u00b4\3\2\2\2\63\u00b6\3\2\2\2\65\u00b8\3\2\2\2\67"+
+ "\u00ba\3\2\2\29\u00bc\3\2\2\2;\u00be\3\2\2\2=\u00c0\3\2\2\2?\u00c2\3\2"+
+ "\2\2A\u00c4\3\2\2\2C\u00c6\3\2\2\2E\u00fb\3\2\2\2G\u00fe\3\2\2\2I\u012c"+
+ "\3\2\2\2K\u0130\3\2\2\2M\u013a\3\2\2\2O\u0143\3\2\2\2Q\u0145\3\2\2\2S"+
+ "\u0147\3\2\2\2U\u0158\3\2\2\2W\u0168\3\2\2\2YZ\7c\2\2Z[\7p\2\2[\\\7f\2"+
+ "\2\\\4\3\2\2\2]^\7d\2\2^_\7{\2\2_\6\3\2\2\2`a\7h\2\2ab\7c\2\2bc\7n\2\2"+
+ "cd\7u\2\2de\7g\2\2e\b\3\2\2\2fg\7k\2\2gh\7p\2\2h\n\3\2\2\2ij\7l\2\2jk"+
+ "\7q\2\2kl\7k\2\2lm\7p\2\2m\f\3\2\2\2no\7p\2\2op\7q\2\2pq\7v\2\2q\16\3"+
+ "\2\2\2rs\7p\2\2st\7w\2\2tu\7n\2\2uv\7n\2\2v\20\3\2\2\2wx\7q\2\2xy\7h\2"+
+ "\2y\22\3\2\2\2z{\7q\2\2{|\7t\2\2|\24\3\2\2\2}~\7u\2\2~\177\7g\2\2\177"+
+ "\u0080\7s\2\2\u0080\u0081\7w\2\2\u0081\u0082\7g\2\2\u0082\u0083\7p\2\2"+
+ "\u0083\u0084\7e\2\2\u0084\u0085\7g\2\2\u0085\26\3\2\2\2\u0086\u0087\7"+
+ "v\2\2\u0087\u0088\7t\2\2\u0088\u0089\7w\2\2\u0089\u008a\7g\2\2\u008a\30"+
+ "\3\2\2\2\u008b\u008c\7w\2\2\u008c\u008d\7p\2\2\u008d\u008e\7v\2\2\u008e"+
+ "\u008f\7k\2\2\u008f\u0090\7n\2\2\u0090\32\3\2\2\2\u0091\u0092\7y\2\2\u0092"+
+ "\u0093\7j\2\2\u0093\u0094\7g\2\2\u0094\u0095\7t\2\2\u0095\u0096\7g\2\2"+
+ "\u0096\34\3\2\2\2\u0097\u0098\7y\2\2\u0098\u0099\7k\2\2\u0099\u009a\7"+
+ "v\2\2\u009a\u009b\7j\2\2\u009b\36\3\2\2\2\u009c\u00a0\7?\2\2\u009d\u009e"+
+ "\7?\2\2\u009e\u00a0\7?\2\2\u009f\u009c\3\2\2\2\u009f\u009d\3\2\2\2\u00a0"+
+ " \3\2\2\2\u00a1\u00a2\7#\2\2\u00a2\u00a3\7?\2\2\u00a3\"\3\2\2\2\u00a4"+
+ "\u00a5\7>\2\2\u00a5$\3\2\2\2\u00a6\u00a7\7>\2\2\u00a7\u00a8\7?\2\2\u00a8"+
+ "&\3\2\2\2\u00a9\u00aa\7@\2\2\u00aa(\3\2\2\2\u00ab\u00ac\7@\2\2\u00ac\u00ad"+
+ "\7?\2\2\u00ad*\3\2\2\2\u00ae\u00af\7-\2\2\u00af,\3\2\2\2\u00b0\u00b1\7"+
+ "/\2\2\u00b1.\3\2\2\2\u00b2\u00b3\7,\2\2\u00b3\60\3\2\2\2\u00b4\u00b5\7"+
+ "\61\2\2\u00b5\62\3\2\2\2\u00b6\u00b7\7\'\2\2\u00b7\64\3\2\2\2\u00b8\u00b9"+
+ "\7\60\2\2\u00b9\66\3\2\2\2\u00ba\u00bb\7.\2\2\u00bb8\3\2\2\2\u00bc\u00bd"+
+ "\7]\2\2\u00bd:\3\2\2\2\u00be\u00bf\7_\2\2\u00bf<\3\2\2\2\u00c0\u00c1\7"+
+ "*\2\2\u00c1>\3\2\2\2\u00c2\u00c3\7+\2\2\u00c3@\3\2\2\2\u00c4\u00c5\7~"+
+ "\2\2\u00c5B\3\2\2\2\u00c6\u00ca\7b\2\2\u00c7\u00c9\n\2\2\2\u00c8\u00c7"+
+ "\3\2\2\2\u00c9\u00cc\3\2\2\2\u00ca\u00c8\3\2\2\2\u00ca\u00cb\3\2\2\2\u00cb"+
+ "\u00cd\3\2\2\2\u00cc\u00ca\3\2\2\2\u00cd\u00ce\7b\2\2\u00ceD\3\2\2\2\u00cf"+
+ "\u00d5\7)\2\2\u00d0\u00d1\7^\2\2\u00d1\u00d4\t\3\2\2\u00d2\u00d4\n\4\2"+
+ "\2\u00d3\u00d0\3\2\2\2\u00d3\u00d2\3\2\2\2\u00d4\u00d7\3\2\2\2\u00d5\u00d3"+
+ "\3\2\2\2\u00d5\u00d6\3\2\2\2\u00d6\u00d8\3\2\2\2\u00d7\u00d5\3\2\2\2\u00d8"+
+ "\u00fc\7)\2\2\u00d9\u00df\7$\2\2\u00da\u00db\7^\2\2\u00db\u00de\t\3\2"+
+ "\2\u00dc\u00de\n\5\2\2\u00dd\u00da\3\2\2\2\u00dd\u00dc\3\2\2\2\u00de\u00e1"+
+ "\3\2\2\2\u00df\u00dd\3\2\2\2\u00df\u00e0\3\2\2\2\u00e0\u00e2\3\2\2\2\u00e1"+
+ "\u00df\3\2\2\2\u00e2\u00fc\7$\2\2\u00e3\u00e4\7A\2\2\u00e4\u00e5\7$\2"+
+ "\2\u00e5\u00eb\3\2\2\2\u00e6\u00e7\7^\2\2\u00e7\u00ea\7$\2\2\u00e8\u00ea"+
+ "\n\6\2\2\u00e9\u00e6\3\2\2\2\u00e9\u00e8\3\2\2\2\u00ea\u00ed\3\2\2\2\u00eb"+
+ "\u00e9\3\2\2\2\u00eb\u00ec\3\2\2\2\u00ec\u00ee\3\2\2\2\u00ed\u00eb\3\2"+
+ "\2\2\u00ee\u00fc\7$\2\2\u00ef\u00f0\7A\2\2\u00f0\u00f1\7)\2\2\u00f1\u00f7"+
+ "\3\2\2\2\u00f2\u00f3\7^\2\2\u00f3\u00f6\7)\2\2\u00f4\u00f6\n\7\2\2\u00f5"+
+ "\u00f2\3\2\2\2\u00f5\u00f4\3\2\2\2\u00f6\u00f9\3\2\2\2\u00f7\u00f5\3\2"+
+ "\2\2\u00f7\u00f8\3\2\2\2\u00f8\u00fa\3\2\2\2\u00f9\u00f7\3\2\2\2\u00fa"+
+ "\u00fc\7)\2\2\u00fb\u00cf\3\2\2\2\u00fb\u00d9\3\2\2\2\u00fb\u00e3\3\2"+
+ "\2\2\u00fb\u00ef\3\2\2\2\u00fcF\3\2\2\2\u00fd\u00ff\5O(\2\u00fe\u00fd"+
+ "\3\2\2\2\u00ff\u0100\3\2\2\2\u0100\u00fe\3\2\2\2\u0100\u0101\3\2\2\2\u0101"+
+ "H\3\2\2\2\u0102\u0104\5O(\2\u0103\u0102\3\2\2\2\u0104\u0105\3\2\2\2\u0105"+
+ "\u0103\3\2\2\2\u0105\u0106\3\2\2\2\u0106\u0107\3\2\2\2\u0107\u010b\5\65"+
+ "\33\2\u0108\u010a\5O(\2\u0109\u0108\3\2\2\2\u010a\u010d\3\2\2\2\u010b"+
+ "\u0109\3\2\2\2\u010b\u010c\3\2\2\2\u010c\u012d\3\2\2\2\u010d\u010b\3\2"+
+ "\2\2\u010e\u0110\5\65\33\2\u010f\u0111\5O(\2\u0110\u010f\3\2\2\2\u0111"+
+ "\u0112\3\2\2\2\u0112\u0110\3\2\2\2\u0112\u0113\3\2\2\2\u0113\u012d\3\2"+
+ "\2\2\u0114\u0116\5O(\2\u0115\u0114\3\2\2\2\u0116\u0117\3\2\2\2\u0117\u0115"+
+ "\3\2\2\2\u0117\u0118\3\2\2\2\u0118\u0120\3\2\2\2\u0119\u011d\5\65\33\2"+
+ "\u011a\u011c\5O(\2\u011b\u011a\3\2\2\2\u011c\u011f\3\2\2\2\u011d\u011b"+
+ "\3\2\2\2\u011d\u011e\3\2\2\2\u011e\u0121\3\2\2\2\u011f\u011d\3\2\2\2\u0120"+
+ "\u0119\3\2\2\2\u0120\u0121\3\2\2\2\u0121\u0122\3\2\2\2\u0122\u0123\5M"+
+ "\'\2\u0123\u012d\3\2\2\2\u0124\u0126\5\65\33\2\u0125\u0127\5O(\2\u0126"+
+ "\u0125\3\2\2\2\u0127\u0128\3\2\2\2\u0128\u0126\3\2\2\2\u0128\u0129\3\2"+
+ "\2\2\u0129\u012a\3\2\2\2\u012a\u012b\5M\'\2\u012b\u012d\3\2\2\2\u012c"+
+ "\u0103\3\2\2\2\u012c\u010e\3\2\2\2\u012c\u0115\3\2\2\2\u012c\u0124\3\2"+
+ "\2\2\u012dJ\3\2\2\2\u012e\u0131\5Q)\2\u012f\u0131\t\b\2\2\u0130\u012e"+
+ "\3\2\2\2\u0130\u012f\3\2\2\2\u0131\u0137\3\2\2\2\u0132\u0136\5Q)\2\u0133"+
+ "\u0136\5O(\2\u0134\u0136\7a\2\2\u0135\u0132\3\2\2\2\u0135\u0133\3\2\2"+
+ "\2\u0135\u0134\3\2\2\2\u0136\u0139\3\2\2\2\u0137\u0135\3\2\2\2\u0137\u0138"+
+ "\3\2\2\2\u0138L\3\2\2\2\u0139\u0137\3\2\2\2\u013a\u013c\t\t\2\2\u013b"+
+ "\u013d\t\n\2\2\u013c\u013b\3\2\2\2\u013c\u013d\3\2\2\2\u013d\u013f\3\2"+
+ "\2\2\u013e\u0140\5O(\2\u013f\u013e\3\2\2\2\u0140\u0141\3\2\2\2\u0141\u013f"+
+ "\3\2\2\2\u0141\u0142\3\2\2\2\u0142N\3\2\2\2\u0143\u0144\t\13\2\2\u0144"+
+ "P\3\2\2\2\u0145\u0146\t\f\2\2\u0146R\3\2\2\2\u0147\u0148\7\61\2\2\u0148"+
+ "\u0149\7\61\2\2\u0149\u014d\3\2\2\2\u014a\u014c\n\r\2\2\u014b\u014a\3"+
+ "\2\2\2\u014c\u014f\3\2\2\2\u014d\u014b\3\2\2\2\u014d\u014e\3\2\2\2\u014e"+
+ "\u0151\3\2\2\2\u014f\u014d\3\2\2\2\u0150\u0152\7\17\2\2\u0151\u0150\3"+
+ "\2\2\2\u0151\u0152\3\2\2\2\u0152\u0154\3\2\2\2\u0153\u0155\7\f\2\2\u0154"+
+ "\u0153\3\2\2\2\u0154\u0155\3\2\2\2\u0155\u0156\3\2\2\2\u0156\u0157\b*"+
+ "\2\2\u0157T\3\2\2\2\u0158\u0159\7\61\2\2\u0159\u015a\7,\2\2\u015a\u015f"+
+ "\3\2\2\2\u015b\u015e\5U+\2\u015c\u015e\13\2\2\2\u015d\u015b\3\2\2\2\u015d"+
+ "\u015c\3\2\2\2\u015e\u0161\3\2\2\2\u015f\u0160\3\2\2\2\u015f\u015d\3\2"+
+ "\2\2\u0160\u0162\3\2\2\2\u0161\u015f\3\2\2\2\u0162\u0163\7,\2\2\u0163"+
+ "\u0164\7\61\2\2\u0164\u0165\3\2\2\2\u0165\u0166\b+\2\2\u0166V\3\2\2\2"+
+ "\u0167\u0169\t\16\2\2\u0168\u0167\3\2\2\2\u0169\u016a\3\2\2\2\u016a\u0168"+
+ "\3\2\2\2\u016a\u016b\3\2\2\2\u016b\u016c\3\2\2\2\u016c\u016d\b,\2\2\u016d"+
+ "X\3\2\2\2\"\2\u009f\u00ca\u00d3\u00d5\u00dd\u00df\u00e9\u00eb\u00f5\u00f7"+
+ "\u00fb\u0100\u0105\u010b\u0112\u0117\u011d\u0120\u0128\u012c\u0130\u0135"+
+ "\u0137\u013c\u0141\u014d\u0151\u0154\u015d\u015f\u016a\3\2\3\2";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
index 1b85b38d1be30..1e37a1491db28 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
@@ -309,6 +309,18 @@ interface EqlBaseListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitDereference(EqlBaseParser.DereferenceContext ctx);
+ /**
+ * Enter a parse tree produced by the {@code identifierEscape}
+ * labeled alternative in {@link EqlBaseParser#primaryExpression}.
+ * @param ctx the parse tree
+ */
+ void enterIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx);
+ /**
+ * Exit a parse tree produced by the {@code identifierEscape}
+ * labeled alternative in {@link EqlBaseParser#primaryExpression}.
+ * @param ctx the parse tree
+ */
+ void exitIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx);
/**
* Enter a parse tree produced by the {@code parenthesizedExpression}
* labeled alternative in {@link EqlBaseParser#primaryExpression}.
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
index 8197cd53fe672..dfccf73b78af1 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
@@ -20,9 +20,9 @@ class EqlBaseParser extends Parser {
AND=1, BY=2, FALSE=3, IN=4, JOIN=5, NOT=6, NULL=7, OF=8, OR=9, SEQUENCE=10,
TRUE=11, UNTIL=12, WHERE=13, WITH=14, EQ=15, NEQ=16, LT=17, LTE=18, GT=19,
GTE=20, PLUS=21, MINUS=22, ASTERISK=23, SLASH=24, PERCENT=25, DOT=26,
- COMMA=27, LB=28, RB=29, LP=30, RP=31, PIPE=32, STRING=33, INTEGER_VALUE=34,
- DECIMAL_VALUE=35, IDENTIFIER=36, LINE_COMMENT=37, BRACKETED_COMMENT=38,
- WS=39, UNRECOGNIZED=40;
+ COMMA=27, LB=28, RB=29, LP=30, RP=31, PIPE=32, ESCAPED_IDENTIFIER=33,
+ STRING=34, INTEGER_VALUE=35, DECIMAL_VALUE=36, IDENTIFIER=37, LINE_COMMENT=38,
+ BRACKETED_COMMENT=39, WS=40;
public static final int
RULE_singleStatement = 0, RULE_singleExpression = 1, RULE_statement = 2,
RULE_query = 3, RULE_withParams = 4, RULE_sequence = 5, RULE_join = 6,
@@ -52,8 +52,8 @@ class EqlBaseParser extends Parser {
null, "AND", "BY", "FALSE", "IN", "JOIN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
"TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ", "LT", "LTE", "GT", "GTE",
"PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "DOT", "COMMA", "LB",
- "RB", "LP", "RP", "PIPE", "STRING", "INTEGER_VALUE", "DECIMAL_VALUE",
- "IDENTIFIER", "LINE_COMMENT", "BRACKETED_COMMENT", "WS", "UNRECOGNIZED"
+ "RB", "LP", "RP", "PIPE", "ESCAPED_IDENTIFIER", "STRING", "INTEGER_VALUE",
+ "DECIMAL_VALUE", "IDENTIFIER", "LINE_COMMENT", "BRACKETED_COMMENT", "WS"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
@@ -665,7 +665,7 @@ public final PipeContext pipe() throws RecognitionException {
((PipeContext)_localctx).kind = match(IDENTIFIER);
setState(130);
_la = _input.LA(1);
- if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER))) != 0)) {
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << ESCAPED_IDENTIFIER) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER))) != 0)) {
{
setState(122);
booleanExpression(0);
@@ -1613,6 +1613,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
case NULL:
case TRUE:
case LP:
+ case ESCAPED_IDENTIFIER:
case STRING:
case INTEGER_VALUE:
case DECIMAL_VALUE:
@@ -1819,12 +1820,29 @@ public T accept(ParseTreeVisitor extends T> visitor) {
else return visitor.visitChildren(this);
}
}
+ public static class IdentifierEscapeContext extends PrimaryExpressionContext {
+ public TerminalNode ESCAPED_IDENTIFIER() { return getToken(EqlBaseParser.ESCAPED_IDENTIFIER, 0); }
+ public IdentifierEscapeContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
+ @Override
+ public void enterRule(ParseTreeListener listener) {
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterIdentifierEscape(this);
+ }
+ @Override
+ public void exitRule(ParseTreeListener listener) {
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitIdentifierEscape(this);
+ }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitIdentifierEscape(this);
+ else return visitor.visitChildren(this);
+ }
+ }
public final PrimaryExpressionContext primaryExpression() throws RecognitionException {
PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState());
enterRule(_localctx, 38, RULE_primaryExpression);
try {
- setState(239);
+ setState(240);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) {
case 1:
@@ -1852,14 +1870,22 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
}
break;
case 4:
- _localctx = new ParenthesizedExpressionContext(_localctx);
+ _localctx = new IdentifierEscapeContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(235);
- match(LP);
+ match(ESCAPED_IDENTIFIER);
+ }
+ break;
+ case 5:
+ _localctx = new ParenthesizedExpressionContext(_localctx);
+ enterOuterAlt(_localctx, 5);
+ {
setState(236);
- expression();
+ match(LP);
setState(237);
+ expression();
+ setState(238);
match(RP);
}
break;
@@ -1918,36 +1944,36 @@ public final FunctionExpressionContext functionExpression() throws RecognitionEx
try {
enterOuterAlt(_localctx, 1);
{
- setState(241);
- identifier();
setState(242);
+ identifier();
+ setState(243);
match(LP);
- setState(251);
+ setState(252);
_la = _input.LA(1);
- if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER))) != 0)) {
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << ESCAPED_IDENTIFIER) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER))) != 0)) {
{
- setState(243);
+ setState(244);
expression();
- setState(248);
+ setState(249);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(244);
- match(COMMA);
setState(245);
+ match(COMMA);
+ setState(246);
expression();
}
}
- setState(250);
+ setState(251);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
- setState(253);
+ setState(254);
match(RP);
}
}
@@ -2052,13 +2078,13 @@ public final ConstantContext constant() throws RecognitionException {
ConstantContext _localctx = new ConstantContext(_ctx, getState());
enterRule(_localctx, 42, RULE_constant);
try {
- setState(259);
+ setState(260);
switch (_input.LA(1)) {
case NULL:
_localctx = new NullLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(255);
+ setState(256);
match(NULL);
}
break;
@@ -2067,7 +2093,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new NumericLiteralContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(256);
+ setState(257);
number();
}
break;
@@ -2076,7 +2102,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new BooleanLiteralContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(257);
+ setState(258);
booleanValue();
}
break;
@@ -2084,7 +2110,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new StringLiteralContext(_localctx);
enterOuterAlt(_localctx, 4);
{
- setState(258);
+ setState(259);
string();
}
break;
@@ -2136,7 +2162,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx
try {
enterOuterAlt(_localctx, 1);
{
- setState(261);
+ setState(262);
_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);
@@ -2185,7 +2211,7 @@ public final BooleanValueContext booleanValue() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(263);
+ setState(264);
_la = _input.LA(1);
if ( !(_la==FALSE || _la==TRUE) ) {
_errHandler.recoverInline(this);
@@ -2255,43 +2281,43 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(265);
+ setState(266);
identifier();
- setState(277);
+ setState(278);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,33,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
- setState(275);
+ setState(276);
switch (_input.LA(1)) {
case DOT:
{
- setState(266);
- match(DOT);
setState(267);
+ match(DOT);
+ setState(268);
identifier();
}
break;
case LB:
{
- setState(268);
+ setState(269);
match(LB);
- setState(270);
+ setState(271);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
- setState(269);
+ setState(270);
match(INTEGER_VALUE);
}
}
- setState(272);
+ setState(273);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==INTEGER_VALUE );
- setState(274);
+ setState(275);
match(RB);
}
break;
@@ -2300,7 +2326,7 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException {
}
}
}
- setState(279);
+ setState(280);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,33,_ctx);
}
@@ -2344,7 +2370,7 @@ public final IdentifierContext identifier() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(280);
+ setState(281);
match(IDENTIFIER);
}
}
@@ -2390,9 +2416,9 @@ public final TimeUnitContext timeUnit() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(282);
- number();
setState(283);
+ number();
+ setState(284);
((TimeUnitContext)_localctx).unit = match(IDENTIFIER);
}
}
@@ -2457,13 +2483,13 @@ public final NumberContext number() throws RecognitionException {
NumberContext _localctx = new NumberContext(_ctx, getState());
enterRule(_localctx, 54, RULE_number);
try {
- setState(287);
+ setState(288);
switch (_input.LA(1)) {
case DECIMAL_VALUE:
_localctx = new DecimalLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(285);
+ setState(286);
match(DECIMAL_VALUE);
}
break;
@@ -2471,7 +2497,7 @@ public final NumberContext number() throws RecognitionException {
_localctx = new IntegerLiteralContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(286);
+ setState(287);
match(INTEGER_VALUE);
}
break;
@@ -2517,7 +2543,7 @@ public final StringContext string() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(289);
+ setState(290);
match(STRING);
}
}
@@ -2563,7 +2589,7 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
}
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3*\u0126\4\2\t\2\4"+
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3*\u0127\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"+
@@ -2581,19 +2607,19 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
"\u00c8\n\23\3\23\3\23\3\23\3\23\3\23\7\23\u00cf\n\23\f\23\16\23\u00d2"+
"\13\23\3\23\3\23\3\24\3\24\3\24\3\24\5\24\u00da\n\24\3\24\3\24\3\24\3"+
"\24\3\24\3\24\3\24\3\24\3\24\3\24\7\24\u00e6\n\24\f\24\16\24\u00e9\13"+
- "\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u00f2\n\25\3\26\3\26\3\26"+
- "\3\26\3\26\7\26\u00f9\n\26\f\26\16\26\u00fc\13\26\5\26\u00fe\n\26\3\26"+
- "\3\26\3\27\3\27\3\27\3\27\5\27\u0106\n\27\3\30\3\30\3\31\3\31\3\32\3\32"+
- "\3\32\3\32\3\32\6\32\u0111\n\32\r\32\16\32\u0112\3\32\7\32\u0116\n\32"+
- "\f\32\16\32\u0119\13\32\3\33\3\33\3\34\3\34\3\34\3\35\3\35\5\35\u0122"+
+ "\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u00f3\n\25\3\26\3\26"+
+ "\3\26\3\26\3\26\7\26\u00fa\n\26\f\26\16\26\u00fd\13\26\5\26\u00ff\n\26"+
+ "\3\26\3\26\3\27\3\27\3\27\3\27\5\27\u0107\n\27\3\30\3\30\3\31\3\31\3\32"+
+ "\3\32\3\32\3\32\3\32\6\32\u0112\n\32\r\32\16\32\u0113\3\32\7\32\u0117"+
+ "\n\32\f\32\16\32\u011a\13\32\3\33\3\33\3\34\3\34\3\34\3\35\3\35\5\35\u0123"+
"\n\35\3\36\3\36\3\36\2\4 &\37\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 "+
- "\"$&(*,.\60\62\64\668:\2\6\3\2\27\30\3\2\31\33\3\2\21\26\4\2\5\5\r\r\u0133"+
+ "\"$&(*,.\60\62\64\668:\2\6\3\2\27\30\3\2\31\33\3\2\21\26\4\2\5\5\r\r\u0135"+
"\2<\3\2\2\2\4?\3\2\2\2\6B\3\2\2\2\bM\3\2\2\2\nO\3\2\2\2\fX\3\2\2\2\16"+
"m\3\2\2\2\20{\3\2\2\2\22\u0086\3\2\2\2\24\u008c\3\2\2\2\26\u0095\3\2\2"+
"\2\30\u0099\3\2\2\2\32\u00a3\3\2\2\2\34\u00a7\3\2\2\2\36\u00ab\3\2\2\2"+
- " \u00b5\3\2\2\2\"\u00c2\3\2\2\2$\u00c7\3\2\2\2&\u00d9\3\2\2\2(\u00f1\3"+
- "\2\2\2*\u00f3\3\2\2\2,\u0105\3\2\2\2.\u0107\3\2\2\2\60\u0109\3\2\2\2\62"+
- "\u010b\3\2\2\2\64\u011a\3\2\2\2\66\u011c\3\2\2\28\u0121\3\2\2\2:\u0123"+
+ " \u00b5\3\2\2\2\"\u00c2\3\2\2\2$\u00c7\3\2\2\2&\u00d9\3\2\2\2(\u00f2\3"+
+ "\2\2\2*\u00f4\3\2\2\2,\u0106\3\2\2\2.\u0108\3\2\2\2\60\u010a\3\2\2\2\62"+
+ "\u010c\3\2\2\2\64\u011b\3\2\2\2\66\u011d\3\2\2\28\u0122\3\2\2\2:\u0124"+
"\3\2\2\2<=\5\6\4\2=>\7\2\2\3>\3\3\2\2\2?@\5\36\20\2@A\7\2\2\3A\5\3\2\2"+
"\2BG\5\b\5\2CD\7\"\2\2DF\5\20\t\2EC\3\2\2\2FI\3\2\2\2GE\3\2\2\2GH\3\2"+
"\2\2H\7\3\2\2\2IG\3\2\2\2JN\5\f\7\2KN\5\16\b\2LN\5\34\17\2MJ\3\2\2\2M"+
@@ -2605,10 +2631,10 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
"\2\2\2hk\3\2\2\2ij\7\16\2\2jl\5\30\r\2ki\3\2\2\2kl\3\2\2\2l\r\3\2\2\2"+
"mo\7\7\2\2np\5\24\13\2on\3\2\2\2op\3\2\2\2pq\3\2\2\2qs\5\26\f\2rt\5\26"+
"\f\2sr\3\2\2\2tu\3\2\2\2us\3\2\2\2uv\3\2\2\2vy\3\2\2\2wx\7\16\2\2xz\5"+
- "\26\f\2yw\3\2\2\2yz\3\2\2\2z\17\3\2\2\2{\u0084\7&\2\2|\u0081\5 \21\2}"+
- "~\7\35\2\2~\u0080\5 \21\2\177}\3\2\2\2\u0080\u0083\3\2\2\2\u0081\177\3"+
- "\2\2\2\u0081\u0082\3\2\2\2\u0082\u0085\3\2\2\2\u0083\u0081\3\2\2\2\u0084"+
- "|\3\2\2\2\u0084\u0085\3\2\2\2\u0085\21\3\2\2\2\u0086\u0087\7&\2\2\u0087"+
+ "\26\f\2yw\3\2\2\2yz\3\2\2\2z\17\3\2\2\2{\u0084\7\'\2\2|\u0081\5 \21\2"+
+ "}~\7\35\2\2~\u0080\5 \21\2\177}\3\2\2\2\u0080\u0083\3\2\2\2\u0081\177"+
+ "\3\2\2\2\u0081\u0082\3\2\2\2\u0082\u0085\3\2\2\2\u0083\u0081\3\2\2\2\u0084"+
+ "|\3\2\2\2\u0084\u0085\3\2\2\2\u0085\21\3\2\2\2\u0086\u0087\7\'\2\2\u0087"+
"\u008a\7\21\2\2\u0088\u008b\5\36\20\2\u0089\u008b\5\66\34\2\u008a\u0088"+
"\3\2\2\2\u008a\u0089\3\2\2\2\u008b\23\3\2\2\2\u008c\u008d\7\4\2\2\u008d"+
"\u0092\5\36\20\2\u008e\u008f\7\35\2\2\u008f\u0091\5\36\20\2\u0090\u008e"+
@@ -2641,28 +2667,29 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
"\u00e2\f\3\2\2\u00e2\u00e3\5.\30\2\u00e3\u00e4\5&\24\4\u00e4\u00e6\3\2"+
"\2\2\u00e5\u00db\3\2\2\2\u00e5\u00de\3\2\2\2\u00e5\u00e1\3\2\2\2\u00e6"+
"\u00e9\3\2\2\2\u00e7\u00e5\3\2\2\2\u00e7\u00e8\3\2\2\2\u00e8\'\3\2\2\2"+
- "\u00e9\u00e7\3\2\2\2\u00ea\u00f2\5,\27\2\u00eb\u00f2\5*\26\2\u00ec\u00f2"+
- "\5\62\32\2\u00ed\u00ee\7 \2\2\u00ee\u00ef\5\36\20\2\u00ef\u00f0\7!\2\2"+
- "\u00f0\u00f2\3\2\2\2\u00f1\u00ea\3\2\2\2\u00f1\u00eb\3\2\2\2\u00f1\u00ec"+
- "\3\2\2\2\u00f1\u00ed\3\2\2\2\u00f2)\3\2\2\2\u00f3\u00f4\5\64\33\2\u00f4"+
- "\u00fd\7 \2\2\u00f5\u00fa\5\36\20\2\u00f6\u00f7\7\35\2\2\u00f7\u00f9\5"+
- "\36\20\2\u00f8\u00f6\3\2\2\2\u00f9\u00fc\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fa"+
- "\u00fb\3\2\2\2\u00fb\u00fe\3\2\2\2\u00fc\u00fa\3\2\2\2\u00fd\u00f5\3\2"+
- "\2\2\u00fd\u00fe\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff\u0100\7!\2\2\u0100"+
- "+\3\2\2\2\u0101\u0106\7\t\2\2\u0102\u0106\58\35\2\u0103\u0106\5\60\31"+
- "\2\u0104\u0106\5:\36\2\u0105\u0101\3\2\2\2\u0105\u0102\3\2\2\2\u0105\u0103"+
- "\3\2\2\2\u0105\u0104\3\2\2\2\u0106-\3\2\2\2\u0107\u0108\t\4\2\2\u0108"+
- "/\3\2\2\2\u0109\u010a\t\5\2\2\u010a\61\3\2\2\2\u010b\u0117\5\64\33\2\u010c"+
- "\u010d\7\34\2\2\u010d\u0116\5\64\33\2\u010e\u0110\7\36\2\2\u010f\u0111"+
- "\7$\2\2\u0110\u010f\3\2\2\2\u0111\u0112\3\2\2\2\u0112\u0110\3\2\2\2\u0112"+
- "\u0113\3\2\2\2\u0113\u0114\3\2\2\2\u0114\u0116\7\37\2\2\u0115\u010c\3"+
- "\2\2\2\u0115\u010e\3\2\2\2\u0116\u0119\3\2\2\2\u0117\u0115\3\2\2\2\u0117"+
- "\u0118\3\2\2\2\u0118\63\3\2\2\2\u0119\u0117\3\2\2\2\u011a\u011b\7&\2\2"+
- "\u011b\65\3\2\2\2\u011c\u011d\58\35\2\u011d\u011e\7&\2\2\u011e\67\3\2"+
- "\2\2\u011f\u0122\7%\2\2\u0120\u0122\7$\2\2\u0121\u011f\3\2\2\2\u0121\u0120"+
- "\3\2\2\2\u01229\3\2\2\2\u0123\u0124\7#\2\2\u0124;\3\2\2\2%GMU[_agkouy"+
- "\u0081\u0084\u008a\u0092\u0097\u009d\u00a1\u00b5\u00bd\u00bf\u00c4\u00c7"+
- "\u00d0\u00d9\u00e5\u00e7\u00f1\u00fa\u00fd\u0105\u0112\u0115\u0117\u0121";
+ "\u00e9\u00e7\3\2\2\2\u00ea\u00f3\5,\27\2\u00eb\u00f3\5*\26\2\u00ec\u00f3"+
+ "\5\62\32\2\u00ed\u00f3\7#\2\2\u00ee\u00ef\7 \2\2\u00ef\u00f0\5\36\20\2"+
+ "\u00f0\u00f1\7!\2\2\u00f1\u00f3\3\2\2\2\u00f2\u00ea\3\2\2\2\u00f2\u00eb"+
+ "\3\2\2\2\u00f2\u00ec\3\2\2\2\u00f2\u00ed\3\2\2\2\u00f2\u00ee\3\2\2\2\u00f3"+
+ ")\3\2\2\2\u00f4\u00f5\5\64\33\2\u00f5\u00fe\7 \2\2\u00f6\u00fb\5\36\20"+
+ "\2\u00f7\u00f8\7\35\2\2\u00f8\u00fa\5\36\20\2\u00f9\u00f7\3\2\2\2\u00fa"+
+ "\u00fd\3\2\2\2\u00fb\u00f9\3\2\2\2\u00fb\u00fc\3\2\2\2\u00fc\u00ff\3\2"+
+ "\2\2\u00fd\u00fb\3\2\2\2\u00fe\u00f6\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff"+
+ "\u0100\3\2\2\2\u0100\u0101\7!\2\2\u0101+\3\2\2\2\u0102\u0107\7\t\2\2\u0103"+
+ "\u0107\58\35\2\u0104\u0107\5\60\31\2\u0105\u0107\5:\36\2\u0106\u0102\3"+
+ "\2\2\2\u0106\u0103\3\2\2\2\u0106\u0104\3\2\2\2\u0106\u0105\3\2\2\2\u0107"+
+ "-\3\2\2\2\u0108\u0109\t\4\2\2\u0109/\3\2\2\2\u010a\u010b\t\5\2\2\u010b"+
+ "\61\3\2\2\2\u010c\u0118\5\64\33\2\u010d\u010e\7\34\2\2\u010e\u0117\5\64"+
+ "\33\2\u010f\u0111\7\36\2\2\u0110\u0112\7%\2\2\u0111\u0110\3\2\2\2\u0112"+
+ "\u0113\3\2\2\2\u0113\u0111\3\2\2\2\u0113\u0114\3\2\2\2\u0114\u0115\3\2"+
+ "\2\2\u0115\u0117\7\37\2\2\u0116\u010d\3\2\2\2\u0116\u010f\3\2\2\2\u0117"+
+ "\u011a\3\2\2\2\u0118\u0116\3\2\2\2\u0118\u0119\3\2\2\2\u0119\63\3\2\2"+
+ "\2\u011a\u0118\3\2\2\2\u011b\u011c\7\'\2\2\u011c\65\3\2\2\2\u011d\u011e"+
+ "\58\35\2\u011e\u011f\7\'\2\2\u011f\67\3\2\2\2\u0120\u0123\7&\2\2\u0121"+
+ "\u0123\7%\2\2\u0122\u0120\3\2\2\2\u0122\u0121\3\2\2\2\u01239\3\2\2\2\u0124"+
+ "\u0125\7$\2\2\u0125;\3\2\2\2%GMU[_agkouy\u0081\u0084\u008a\u0092\u0097"+
+ "\u009d\u00a1\u00b5\u00bd\u00bf\u00c4\u00c7\u00d0\u00d9\u00e5\u00e7\u00f2"+
+ "\u00fb\u00fe\u0106\u0113\u0116\u0118\u0122";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
index 280edd132b19d..29a81522f715a 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
@@ -189,6 +189,13 @@ interface EqlBaseVisitor extends ParseTreeVisitor {
* @return the visitor result
*/
T visitDereference(EqlBaseParser.DereferenceContext ctx);
+ /**
+ * Visit a parse tree produced by the {@code identifierEscape}
+ * labeled alternative in {@link EqlBaseParser#primaryExpression}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx);
/**
* Visit a parse tree produced by the {@code parenthesizedExpression}
* labeled alternative in {@link EqlBaseParser#primaryExpression}.
diff --git a/x-pack/plugin/eql/src/test/resources/grammar-queries.eql b/x-pack/plugin/eql/src/test/resources/grammar-queries.eql
index 2b71ed8339623..429a38d7f7172 100644
--- a/x-pack/plugin/eql/src/test/resources/grammar-queries.eql
+++ b/x-pack/plugin/eql/src/test/resources/grammar-queries.eql
@@ -951,3 +951,13 @@ process where length(between(process_name, 'g', 'e')) > 0
process where length(between(process_name, 'g', 'z')) > 0
;
+
+
+// additional queries added for the elasticsearch specific implementation
+// dots will still be interpreted by ES per usual
+something where `my-hyphenated-field` == "value";
+something where `my-hyphenated-field.with.nested.dots` == "value";
+something where `@timestamp` == "2020-01-01 00:00:00";
+something where `some escaped identifier` == "blah";
+something where `some escaped identifier` == "blah";
+something where `some.escaped.identifier` == "blah";
From 37fdda6344718be05db38a14a234ac8a3c6765bd Mon Sep 17 00:00:00 2001
From: Ross Wolf <31489089+rw-access@users.noreply.github.com>
Date: Thu, 16 Jan 2020 18:28:58 -0700
Subject: [PATCH 3/8] Adding keywords to language
---
x-pack/plugin/eql/src/main/antlr/EqlBase.g4 | 16 +-
.../xpack/eql/parser/EqlBaseBaseListener.java | 16 +-
.../xpack/eql/parser/EqlBaseBaseVisitor.java | 9 +-
.../xpack/eql/parser/EqlBaseLexer.java | 296 +++----
.../xpack/eql/parser/EqlBaseListener.java | 18 +-
.../xpack/eql/parser/EqlBaseParser.java | 801 ++++++++----------
.../xpack/eql/parser/EqlBaseVisitor.java | 10 +-
.../src/test/resources/grammar-queries.eql | 12 +-
8 files changed, 543 insertions(+), 635 deletions(-)
diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
index 80f4dfc30b525..82686ce261994 100644
--- a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
+++ b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
@@ -24,11 +24,13 @@ query
| join
| eventQuery
;
-withParams
- : WITH namedParam (COMMA namedParam)*
+
+sequenceParams
+ : WITH (MAXSPAN EQ timeUnit)
;
+
sequence
- : SEQUENCE (by=joinKeys withParams? | withParams by=joinKeys?)?
+ : SEQUENCE (by=joinKeys sequenceParams? | sequenceParams by=joinKeys?)?
sequenceTerm sequenceTerm+
(UNTIL sequenceTerm)?
;
@@ -44,8 +46,6 @@ pipe
;
-namedParam: key=IDENTIFIER EQ (expression | timeUnit);
-
joinKeys
: BY expression (COMMA expression)*
;
@@ -55,7 +55,7 @@ joinTerm
;
sequenceTerm
- : subquery namedParam* (by=joinKeys)?
+ : subquery (FORK (EQ booleanValue)?)? (by=joinKeys)?
;
subquery
@@ -135,7 +135,7 @@ identifier
;
timeUnit
- : number unit=IDENTIFIER
+ : number unit=IDENTIFIER?
;
number
@@ -150,8 +150,10 @@ string
AND: 'and';
BY: 'by';
FALSE: 'false';
+FORK: 'fork';
IN: 'in';
JOIN: 'join';
+MAXSPAN: 'maxspan';
NOT: 'not';
NULL: 'null';
OF: 'of';
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
index f546518ba1a1c..d766fa70c64ac 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
@@ -64,13 +64,13 @@ class EqlBaseBaseListener implements EqlBaseListener {
*
* The default implementation does nothing.
*/
- @Override public void enterWithParams(EqlBaseParser.WithParamsContext ctx) { }
+ @Override public void enterSequenceParams(EqlBaseParser.SequenceParamsContext ctx) { }
/**
* {@inheritDoc}
*
* The default implementation does nothing.
*/
- @Override public void exitWithParams(EqlBaseParser.WithParamsContext ctx) { }
+ @Override public void exitSequenceParams(EqlBaseParser.SequenceParamsContext ctx) { }
/**
* {@inheritDoc}
*
@@ -107,18 +107,6 @@ class EqlBaseBaseListener implements EqlBaseListener {
* The default implementation does nothing.
*/
@Override public void exitPipe(EqlBaseParser.PipeContext ctx) { }
- /**
- * {@inheritDoc}
- *
- * The default implementation does nothing.
- */
- @Override public void enterNamedParam(EqlBaseParser.NamedParamContext ctx) { }
- /**
- * {@inheritDoc}
- *
- * The default implementation does nothing.
- */
- @Override public void exitNamedParam(EqlBaseParser.NamedParamContext ctx) { }
/**
* {@inheritDoc}
*
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
index f6a85e1805ec8..90dc97634cd84 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
@@ -45,7 +45,7 @@ class EqlBaseBaseVisitor extends AbstractParseTreeVisitor implements EqlBa
* The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.
*/
- @Override public T visitWithParams(EqlBaseParser.WithParamsContext ctx) { return visitChildren(ctx); }
+ @Override public T visitSequenceParams(EqlBaseParser.SequenceParamsContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
@@ -67,13 +67,6 @@ class EqlBaseBaseVisitor extends AbstractParseTreeVisitor implements EqlBa
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitPipe(EqlBaseParser.PipeContext ctx) { return visitChildren(ctx); }
- /**
- * {@inheritDoc}
- *
- * The default implementation returns the result of calling
- * {@link #visitChildren} on {@code ctx}.
- */
- @Override public T visitNamedParam(EqlBaseParser.NamedParamContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java
index 66e5db285125c..2fc525ff52796 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseLexer.java
@@ -17,37 +17,39 @@ class EqlBaseLexer extends Lexer {
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
- AND=1, BY=2, FALSE=3, IN=4, JOIN=5, NOT=6, NULL=7, OF=8, OR=9, SEQUENCE=10,
- TRUE=11, UNTIL=12, WHERE=13, WITH=14, EQ=15, NEQ=16, LT=17, LTE=18, GT=19,
- GTE=20, PLUS=21, MINUS=22, ASTERISK=23, SLASH=24, PERCENT=25, DOT=26,
- COMMA=27, LB=28, RB=29, LP=30, RP=31, PIPE=32, ESCAPED_IDENTIFIER=33,
- STRING=34, INTEGER_VALUE=35, DECIMAL_VALUE=36, IDENTIFIER=37, LINE_COMMENT=38,
- BRACKETED_COMMENT=39, WS=40;
+ AND=1, BY=2, FALSE=3, FORK=4, IN=5, JOIN=6, MAXSPAN=7, NOT=8, NULL=9,
+ OF=10, OR=11, SEQUENCE=12, TRUE=13, UNTIL=14, WHERE=15, WITH=16, EQ=17,
+ NEQ=18, LT=19, LTE=20, GT=21, GTE=22, PLUS=23, MINUS=24, ASTERISK=25,
+ SLASH=26, PERCENT=27, DOT=28, COMMA=29, LB=30, RB=31, LP=32, RP=33, PIPE=34,
+ ESCAPED_IDENTIFIER=35, STRING=36, INTEGER_VALUE=37, DECIMAL_VALUE=38,
+ IDENTIFIER=39, LINE_COMMENT=40, BRACKETED_COMMENT=41, WS=42;
public static String[] modeNames = {
"DEFAULT_MODE"
};
public static final String[] ruleNames = {
- "AND", "BY", "FALSE", "IN", "JOIN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
- "TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ", "LT", "LTE", "GT", "GTE",
- "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "DOT", "COMMA", "LB",
- "RB", "LP", "RP", "PIPE", "ESCAPED_IDENTIFIER", "STRING", "INTEGER_VALUE",
- "DECIMAL_VALUE", "IDENTIFIER", "EXPONENT", "DIGIT", "LETTER", "LINE_COMMENT",
- "BRACKETED_COMMENT", "WS"
+ "AND", "BY", "FALSE", "FORK", "IN", "JOIN", "MAXSPAN", "NOT", "NULL",
+ "OF", "OR", "SEQUENCE", "TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ",
+ "LT", "LTE", "GT", "GTE", "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT",
+ "DOT", "COMMA", "LB", "RB", "LP", "RP", "PIPE", "ESCAPED_IDENTIFIER",
+ "STRING", "INTEGER_VALUE", "DECIMAL_VALUE", "IDENTIFIER", "EXPONENT",
+ "DIGIT", "LETTER", "LINE_COMMENT", "BRACKETED_COMMENT", "WS"
};
private static final String[] _LITERAL_NAMES = {
- null, "'and'", "'by'", "'false'", "'in'", "'join'", "'not'", "'null'",
- "'of'", "'or'", "'sequence'", "'true'", "'until'", "'where'", "'with'",
- null, "'!='", "'<'", "'<='", "'>'", "'>='", "'+'", "'-'", "'*'", "'/'",
- "'%'", "'.'", "','", "'['", "']'", "'('", "')'", "'|'"
+ null, "'and'", "'by'", "'false'", "'fork'", "'in'", "'join'", "'maxspan'",
+ "'not'", "'null'", "'of'", "'or'", "'sequence'", "'true'", "'until'",
+ "'where'", "'with'", null, "'!='", "'<'", "'<='", "'>'", "'>='", "'+'",
+ "'-'", "'*'", "'/'", "'%'", "'.'", "','", "'['", "']'", "'('", "')'",
+ "'|'"
};
private static final String[] _SYMBOLIC_NAMES = {
- null, "AND", "BY", "FALSE", "IN", "JOIN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
- "TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ", "LT", "LTE", "GT", "GTE",
- "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "DOT", "COMMA", "LB",
- "RB", "LP", "RP", "PIPE", "ESCAPED_IDENTIFIER", "STRING", "INTEGER_VALUE",
- "DECIMAL_VALUE", "IDENTIFIER", "LINE_COMMENT", "BRACKETED_COMMENT", "WS"
+ null, "AND", "BY", "FALSE", "FORK", "IN", "JOIN", "MAXSPAN", "NOT", "NULL",
+ "OF", "OR", "SEQUENCE", "TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ",
+ "LT", "LTE", "GT", "GTE", "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT",
+ "DOT", "COMMA", "LB", "RB", "LP", "RP", "PIPE", "ESCAPED_IDENTIFIER",
+ "STRING", "INTEGER_VALUE", "DECIMAL_VALUE", "IDENTIFIER", "LINE_COMMENT",
+ "BRACKETED_COMMENT", "WS"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
@@ -104,134 +106,140 @@ public EqlBaseLexer(CharStream input) {
public ATN getATN() { return _ATN; }
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2*\u016e\b\1\4\2\t"+
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2,\u017f\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,\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3"+
- "\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\n"+
- "\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f"+
- "\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3"+
- "\17\3\17\3\17\3\20\3\20\3\20\5\20\u00a0\n\20\3\21\3\21\3\21\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\30\3\30"+
- "\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\37\3\37"+
- "\3 \3 \3!\3!\3\"\3\"\7\"\u00c9\n\"\f\"\16\"\u00cc\13\"\3\"\3\"\3#\3#\3"+
- "#\3#\7#\u00d4\n#\f#\16#\u00d7\13#\3#\3#\3#\3#\3#\7#\u00de\n#\f#\16#\u00e1"+
- "\13#\3#\3#\3#\3#\3#\3#\3#\7#\u00ea\n#\f#\16#\u00ed\13#\3#\3#\3#\3#\3#"+
- "\3#\3#\7#\u00f6\n#\f#\16#\u00f9\13#\3#\5#\u00fc\n#\3$\6$\u00ff\n$\r$\16"+
- "$\u0100\3%\6%\u0104\n%\r%\16%\u0105\3%\3%\7%\u010a\n%\f%\16%\u010d\13"+
- "%\3%\3%\6%\u0111\n%\r%\16%\u0112\3%\6%\u0116\n%\r%\16%\u0117\3%\3%\7%"+
- "\u011c\n%\f%\16%\u011f\13%\5%\u0121\n%\3%\3%\3%\3%\6%\u0127\n%\r%\16%"+
- "\u0128\3%\3%\5%\u012d\n%\3&\3&\5&\u0131\n&\3&\3&\3&\7&\u0136\n&\f&\16"+
- "&\u0139\13&\3\'\3\'\5\'\u013d\n\'\3\'\6\'\u0140\n\'\r\'\16\'\u0141\3("+
- "\3(\3)\3)\3*\3*\3*\3*\7*\u014c\n*\f*\16*\u014f\13*\3*\5*\u0152\n*\3*\5"+
- "*\u0155\n*\3*\3*\3+\3+\3+\3+\3+\7+\u015e\n+\f+\16+\u0161\13+\3+\3+\3+"+
- "\3+\3+\3,\6,\u0169\n,\r,\16,\u016a\3,\3,\3\u015f\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\2O\2Q\2S(U)W*\3\2\17\3\2bb\n\2$$))^^ddhhppttvv\6\2\f\f\17\17))^^\6\2"+
- "\f\f\17\17$$^^\5\2\f\f\17\17$$\5\2\f\f\17\17))\4\2BBaa\4\2GGgg\4\2--/"+
- "/\3\2\62;\4\2C\\c|\4\2\f\f\17\17\5\2\13\f\17\17\"\"\u018e\2\3\3\2\2\2"+
- "\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2"+
- "\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2"+
- "\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2"+
- "\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2"+
- "\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2"+
- "\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2"+
- "\2K\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3\2\2\2\3Y\3\2\2\2\5]\3\2\2\2\7`"+
- "\3\2\2\2\tf\3\2\2\2\13i\3\2\2\2\rn\3\2\2\2\17r\3\2\2\2\21w\3\2\2\2\23"+
- "z\3\2\2\2\25}\3\2\2\2\27\u0086\3\2\2\2\31\u008b\3\2\2\2\33\u0091\3\2\2"+
- "\2\35\u0097\3\2\2\2\37\u009f\3\2\2\2!\u00a1\3\2\2\2#\u00a4\3\2\2\2%\u00a6"+
- "\3\2\2\2\'\u00a9\3\2\2\2)\u00ab\3\2\2\2+\u00ae\3\2\2\2-\u00b0\3\2\2\2"+
- "/\u00b2\3\2\2\2\61\u00b4\3\2\2\2\63\u00b6\3\2\2\2\65\u00b8\3\2\2\2\67"+
- "\u00ba\3\2\2\29\u00bc\3\2\2\2;\u00be\3\2\2\2=\u00c0\3\2\2\2?\u00c2\3\2"+
- "\2\2A\u00c4\3\2\2\2C\u00c6\3\2\2\2E\u00fb\3\2\2\2G\u00fe\3\2\2\2I\u012c"+
- "\3\2\2\2K\u0130\3\2\2\2M\u013a\3\2\2\2O\u0143\3\2\2\2Q\u0145\3\2\2\2S"+
- "\u0147\3\2\2\2U\u0158\3\2\2\2W\u0168\3\2\2\2YZ\7c\2\2Z[\7p\2\2[\\\7f\2"+
- "\2\\\4\3\2\2\2]^\7d\2\2^_\7{\2\2_\6\3\2\2\2`a\7h\2\2ab\7c\2\2bc\7n\2\2"+
- "cd\7u\2\2de\7g\2\2e\b\3\2\2\2fg\7k\2\2gh\7p\2\2h\n\3\2\2\2ij\7l\2\2jk"+
- "\7q\2\2kl\7k\2\2lm\7p\2\2m\f\3\2\2\2no\7p\2\2op\7q\2\2pq\7v\2\2q\16\3"+
- "\2\2\2rs\7p\2\2st\7w\2\2tu\7n\2\2uv\7n\2\2v\20\3\2\2\2wx\7q\2\2xy\7h\2"+
- "\2y\22\3\2\2\2z{\7q\2\2{|\7t\2\2|\24\3\2\2\2}~\7u\2\2~\177\7g\2\2\177"+
- "\u0080\7s\2\2\u0080\u0081\7w\2\2\u0081\u0082\7g\2\2\u0082\u0083\7p\2\2"+
- "\u0083\u0084\7e\2\2\u0084\u0085\7g\2\2\u0085\26\3\2\2\2\u0086\u0087\7"+
- "v\2\2\u0087\u0088\7t\2\2\u0088\u0089\7w\2\2\u0089\u008a\7g\2\2\u008a\30"+
- "\3\2\2\2\u008b\u008c\7w\2\2\u008c\u008d\7p\2\2\u008d\u008e\7v\2\2\u008e"+
- "\u008f\7k\2\2\u008f\u0090\7n\2\2\u0090\32\3\2\2\2\u0091\u0092\7y\2\2\u0092"+
- "\u0093\7j\2\2\u0093\u0094\7g\2\2\u0094\u0095\7t\2\2\u0095\u0096\7g\2\2"+
- "\u0096\34\3\2\2\2\u0097\u0098\7y\2\2\u0098\u0099\7k\2\2\u0099\u009a\7"+
- "v\2\2\u009a\u009b\7j\2\2\u009b\36\3\2\2\2\u009c\u00a0\7?\2\2\u009d\u009e"+
- "\7?\2\2\u009e\u00a0\7?\2\2\u009f\u009c\3\2\2\2\u009f\u009d\3\2\2\2\u00a0"+
- " \3\2\2\2\u00a1\u00a2\7#\2\2\u00a2\u00a3\7?\2\2\u00a3\"\3\2\2\2\u00a4"+
- "\u00a5\7>\2\2\u00a5$\3\2\2\2\u00a6\u00a7\7>\2\2\u00a7\u00a8\7?\2\2\u00a8"+
- "&\3\2\2\2\u00a9\u00aa\7@\2\2\u00aa(\3\2\2\2\u00ab\u00ac\7@\2\2\u00ac\u00ad"+
- "\7?\2\2\u00ad*\3\2\2\2\u00ae\u00af\7-\2\2\u00af,\3\2\2\2\u00b0\u00b1\7"+
- "/\2\2\u00b1.\3\2\2\2\u00b2\u00b3\7,\2\2\u00b3\60\3\2\2\2\u00b4\u00b5\7"+
- "\61\2\2\u00b5\62\3\2\2\2\u00b6\u00b7\7\'\2\2\u00b7\64\3\2\2\2\u00b8\u00b9"+
- "\7\60\2\2\u00b9\66\3\2\2\2\u00ba\u00bb\7.\2\2\u00bb8\3\2\2\2\u00bc\u00bd"+
- "\7]\2\2\u00bd:\3\2\2\2\u00be\u00bf\7_\2\2\u00bf<\3\2\2\2\u00c0\u00c1\7"+
- "*\2\2\u00c1>\3\2\2\2\u00c2\u00c3\7+\2\2\u00c3@\3\2\2\2\u00c4\u00c5\7~"+
- "\2\2\u00c5B\3\2\2\2\u00c6\u00ca\7b\2\2\u00c7\u00c9\n\2\2\2\u00c8\u00c7"+
- "\3\2\2\2\u00c9\u00cc\3\2\2\2\u00ca\u00c8\3\2\2\2\u00ca\u00cb\3\2\2\2\u00cb"+
- "\u00cd\3\2\2\2\u00cc\u00ca\3\2\2\2\u00cd\u00ce\7b\2\2\u00ceD\3\2\2\2\u00cf"+
- "\u00d5\7)\2\2\u00d0\u00d1\7^\2\2\u00d1\u00d4\t\3\2\2\u00d2\u00d4\n\4\2"+
- "\2\u00d3\u00d0\3\2\2\2\u00d3\u00d2\3\2\2\2\u00d4\u00d7\3\2\2\2\u00d5\u00d3"+
- "\3\2\2\2\u00d5\u00d6\3\2\2\2\u00d6\u00d8\3\2\2\2\u00d7\u00d5\3\2\2\2\u00d8"+
- "\u00fc\7)\2\2\u00d9\u00df\7$\2\2\u00da\u00db\7^\2\2\u00db\u00de\t\3\2"+
- "\2\u00dc\u00de\n\5\2\2\u00dd\u00da\3\2\2\2\u00dd\u00dc\3\2\2\2\u00de\u00e1"+
- "\3\2\2\2\u00df\u00dd\3\2\2\2\u00df\u00e0\3\2\2\2\u00e0\u00e2\3\2\2\2\u00e1"+
- "\u00df\3\2\2\2\u00e2\u00fc\7$\2\2\u00e3\u00e4\7A\2\2\u00e4\u00e5\7$\2"+
- "\2\u00e5\u00eb\3\2\2\2\u00e6\u00e7\7^\2\2\u00e7\u00ea\7$\2\2\u00e8\u00ea"+
- "\n\6\2\2\u00e9\u00e6\3\2\2\2\u00e9\u00e8\3\2\2\2\u00ea\u00ed\3\2\2\2\u00eb"+
- "\u00e9\3\2\2\2\u00eb\u00ec\3\2\2\2\u00ec\u00ee\3\2\2\2\u00ed\u00eb\3\2"+
- "\2\2\u00ee\u00fc\7$\2\2\u00ef\u00f0\7A\2\2\u00f0\u00f1\7)\2\2\u00f1\u00f7"+
- "\3\2\2\2\u00f2\u00f3\7^\2\2\u00f3\u00f6\7)\2\2\u00f4\u00f6\n\7\2\2\u00f5"+
- "\u00f2\3\2\2\2\u00f5\u00f4\3\2\2\2\u00f6\u00f9\3\2\2\2\u00f7\u00f5\3\2"+
- "\2\2\u00f7\u00f8\3\2\2\2\u00f8\u00fa\3\2\2\2\u00f9\u00f7\3\2\2\2\u00fa"+
- "\u00fc\7)\2\2\u00fb\u00cf\3\2\2\2\u00fb\u00d9\3\2\2\2\u00fb\u00e3\3\2"+
- "\2\2\u00fb\u00ef\3\2\2\2\u00fcF\3\2\2\2\u00fd\u00ff\5O(\2\u00fe\u00fd"+
- "\3\2\2\2\u00ff\u0100\3\2\2\2\u0100\u00fe\3\2\2\2\u0100\u0101\3\2\2\2\u0101"+
- "H\3\2\2\2\u0102\u0104\5O(\2\u0103\u0102\3\2\2\2\u0104\u0105\3\2\2\2\u0105"+
- "\u0103\3\2\2\2\u0105\u0106\3\2\2\2\u0106\u0107\3\2\2\2\u0107\u010b\5\65"+
- "\33\2\u0108\u010a\5O(\2\u0109\u0108\3\2\2\2\u010a\u010d\3\2\2\2\u010b"+
- "\u0109\3\2\2\2\u010b\u010c\3\2\2\2\u010c\u012d\3\2\2\2\u010d\u010b\3\2"+
- "\2\2\u010e\u0110\5\65\33\2\u010f\u0111\5O(\2\u0110\u010f\3\2\2\2\u0111"+
- "\u0112\3\2\2\2\u0112\u0110\3\2\2\2\u0112\u0113\3\2\2\2\u0113\u012d\3\2"+
- "\2\2\u0114\u0116\5O(\2\u0115\u0114\3\2\2\2\u0116\u0117\3\2\2\2\u0117\u0115"+
- "\3\2\2\2\u0117\u0118\3\2\2\2\u0118\u0120\3\2\2\2\u0119\u011d\5\65\33\2"+
- "\u011a\u011c\5O(\2\u011b\u011a\3\2\2\2\u011c\u011f\3\2\2\2\u011d\u011b"+
- "\3\2\2\2\u011d\u011e\3\2\2\2\u011e\u0121\3\2\2\2\u011f\u011d\3\2\2\2\u0120"+
- "\u0119\3\2\2\2\u0120\u0121\3\2\2\2\u0121\u0122\3\2\2\2\u0122\u0123\5M"+
- "\'\2\u0123\u012d\3\2\2\2\u0124\u0126\5\65\33\2\u0125\u0127\5O(\2\u0126"+
- "\u0125\3\2\2\2\u0127\u0128\3\2\2\2\u0128\u0126\3\2\2\2\u0128\u0129\3\2"+
- "\2\2\u0129\u012a\3\2\2\2\u012a\u012b\5M\'\2\u012b\u012d\3\2\2\2\u012c"+
- "\u0103\3\2\2\2\u012c\u010e\3\2\2\2\u012c\u0115\3\2\2\2\u012c\u0124\3\2"+
- "\2\2\u012dJ\3\2\2\2\u012e\u0131\5Q)\2\u012f\u0131\t\b\2\2\u0130\u012e"+
- "\3\2\2\2\u0130\u012f\3\2\2\2\u0131\u0137\3\2\2\2\u0132\u0136\5Q)\2\u0133"+
- "\u0136\5O(\2\u0134\u0136\7a\2\2\u0135\u0132\3\2\2\2\u0135\u0133\3\2\2"+
- "\2\u0135\u0134\3\2\2\2\u0136\u0139\3\2\2\2\u0137\u0135\3\2\2\2\u0137\u0138"+
- "\3\2\2\2\u0138L\3\2\2\2\u0139\u0137\3\2\2\2\u013a\u013c\t\t\2\2\u013b"+
- "\u013d\t\n\2\2\u013c\u013b\3\2\2\2\u013c\u013d\3\2\2\2\u013d\u013f\3\2"+
- "\2\2\u013e\u0140\5O(\2\u013f\u013e\3\2\2\2\u0140\u0141\3\2\2\2\u0141\u013f"+
- "\3\2\2\2\u0141\u0142\3\2\2\2\u0142N\3\2\2\2\u0143\u0144\t\13\2\2\u0144"+
- "P\3\2\2\2\u0145\u0146\t\f\2\2\u0146R\3\2\2\2\u0147\u0148\7\61\2\2\u0148"+
- "\u0149\7\61\2\2\u0149\u014d\3\2\2\2\u014a\u014c\n\r\2\2\u014b\u014a\3"+
- "\2\2\2\u014c\u014f\3\2\2\2\u014d\u014b\3\2\2\2\u014d\u014e\3\2\2\2\u014e"+
- "\u0151\3\2\2\2\u014f\u014d\3\2\2\2\u0150\u0152\7\17\2\2\u0151\u0150\3"+
- "\2\2\2\u0151\u0152\3\2\2\2\u0152\u0154\3\2\2\2\u0153\u0155\7\f\2\2\u0154"+
- "\u0153\3\2\2\2\u0154\u0155\3\2\2\2\u0155\u0156\3\2\2\2\u0156\u0157\b*"+
- "\2\2\u0157T\3\2\2\2\u0158\u0159\7\61\2\2\u0159\u015a\7,\2\2\u015a\u015f"+
- "\3\2\2\2\u015b\u015e\5U+\2\u015c\u015e\13\2\2\2\u015d\u015b\3\2\2\2\u015d"+
- "\u015c\3\2\2\2\u015e\u0161\3\2\2\2\u015f\u0160\3\2\2\2\u015f\u015d\3\2"+
- "\2\2\u0160\u0162\3\2\2\2\u0161\u015f\3\2\2\2\u0162\u0163\7,\2\2\u0163"+
- "\u0164\7\61\2\2\u0164\u0165\3\2\2\2\u0165\u0166\b+\2\2\u0166V\3\2\2\2"+
- "\u0167\u0169\t\16\2\2\u0168\u0167\3\2\2\2\u0169\u016a\3\2\2\2\u016a\u0168"+
- "\3\2\2\2\u016a\u016b\3\2\2\2\u016b\u016c\3\2\2\2\u016c\u016d\b,\2\2\u016d"+
- "X\3\2\2\2\"\2\u009f\u00ca\u00d3\u00d5\u00dd\u00df\u00e9\u00eb\u00f5\u00f7"+
- "\u00fb\u0100\u0105\u010b\u0112\u0117\u011d\u0120\u0128\u012c\u0130\u0135"+
- "\u0137\u013c\u0141\u014d\u0151\u0154\u015d\u015f\u016a\3\2\3\2";
+ ",\t,\4-\t-\4.\t.\3\2\3\2\3\2\3\2\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3"+
+ "\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b"+
+ "\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\f\3"+
+ "\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3"+
+ "\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21\3"+
+ "\21\3\21\3\21\3\22\3\22\3\22\5\22\u00b1\n\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\33\3\33\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$\7$\u00da\n$\f$\16$\u00dd\13$\3$\3$\3%\3%\3%\3%\7%\u00e5\n"+
+ "%\f%\16%\u00e8\13%\3%\3%\3%\3%\3%\7%\u00ef\n%\f%\16%\u00f2\13%\3%\3%\3"+
+ "%\3%\3%\3%\3%\7%\u00fb\n%\f%\16%\u00fe\13%\3%\3%\3%\3%\3%\3%\3%\7%\u0107"+
+ "\n%\f%\16%\u010a\13%\3%\5%\u010d\n%\3&\6&\u0110\n&\r&\16&\u0111\3\'\6"+
+ "\'\u0115\n\'\r\'\16\'\u0116\3\'\3\'\7\'\u011b\n\'\f\'\16\'\u011e\13\'"+
+ "\3\'\3\'\6\'\u0122\n\'\r\'\16\'\u0123\3\'\6\'\u0127\n\'\r\'\16\'\u0128"+
+ "\3\'\3\'\7\'\u012d\n\'\f\'\16\'\u0130\13\'\5\'\u0132\n\'\3\'\3\'\3\'\3"+
+ "\'\6\'\u0138\n\'\r\'\16\'\u0139\3\'\3\'\5\'\u013e\n\'\3(\3(\5(\u0142\n"+
+ "(\3(\3(\3(\7(\u0147\n(\f(\16(\u014a\13(\3)\3)\5)\u014e\n)\3)\6)\u0151"+
+ "\n)\r)\16)\u0152\3*\3*\3+\3+\3,\3,\3,\3,\7,\u015d\n,\f,\16,\u0160\13,"+
+ "\3,\5,\u0163\n,\3,\5,\u0166\n,\3,\3,\3-\3-\3-\3-\3-\7-\u016f\n-\f-\16"+
+ "-\u0172\13-\3-\3-\3-\3-\3-\3.\6.\u017a\n.\r.\16.\u017b\3.\3.\3\u0170\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\2S\2U\2W*Y+[,\3\2\17\3\2bb\n\2$$))^^ddhhppttv"+
+ "v\6\2\f\f\17\17))^^\6\2\f\f\17\17$$^^\5\2\f\f\17\17$$\5\2\f\f\17\17))"+
+ "\4\2BBaa\4\2GGgg\4\2--//\3\2\62;\4\2C\\c|\4\2\f\f\17\17\5\2\13\f\17\17"+
+ "\"\"\u019f\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2"+
+ "\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27"+
+ "\3\2\2\2\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2"+
+ "\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2"+
+ "\2/\3\2\2\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2"+
+ "\2\2\2;\3\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2"+
+ "\2G\3\2\2\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2W\3\2\2\2\2Y"+
+ "\3\2\2\2\2[\3\2\2\2\3]\3\2\2\2\5a\3\2\2\2\7d\3\2\2\2\tj\3\2\2\2\13o\3"+
+ "\2\2\2\rr\3\2\2\2\17w\3\2\2\2\21\177\3\2\2\2\23\u0083\3\2\2\2\25\u0088"+
+ "\3\2\2\2\27\u008b\3\2\2\2\31\u008e\3\2\2\2\33\u0097\3\2\2\2\35\u009c\3"+
+ "\2\2\2\37\u00a2\3\2\2\2!\u00a8\3\2\2\2#\u00b0\3\2\2\2%\u00b2\3\2\2\2\'"+
+ "\u00b5\3\2\2\2)\u00b7\3\2\2\2+\u00ba\3\2\2\2-\u00bc\3\2\2\2/\u00bf\3\2"+
+ "\2\2\61\u00c1\3\2\2\2\63\u00c3\3\2\2\2\65\u00c5\3\2\2\2\67\u00c7\3\2\2"+
+ "\29\u00c9\3\2\2\2;\u00cb\3\2\2\2=\u00cd\3\2\2\2?\u00cf\3\2\2\2A\u00d1"+
+ "\3\2\2\2C\u00d3\3\2\2\2E\u00d5\3\2\2\2G\u00d7\3\2\2\2I\u010c\3\2\2\2K"+
+ "\u010f\3\2\2\2M\u013d\3\2\2\2O\u0141\3\2\2\2Q\u014b\3\2\2\2S\u0154\3\2"+
+ "\2\2U\u0156\3\2\2\2W\u0158\3\2\2\2Y\u0169\3\2\2\2[\u0179\3\2\2\2]^\7c"+
+ "\2\2^_\7p\2\2_`\7f\2\2`\4\3\2\2\2ab\7d\2\2bc\7{\2\2c\6\3\2\2\2de\7h\2"+
+ "\2ef\7c\2\2fg\7n\2\2gh\7u\2\2hi\7g\2\2i\b\3\2\2\2jk\7h\2\2kl\7q\2\2lm"+
+ "\7t\2\2mn\7m\2\2n\n\3\2\2\2op\7k\2\2pq\7p\2\2q\f\3\2\2\2rs\7l\2\2st\7"+
+ "q\2\2tu\7k\2\2uv\7p\2\2v\16\3\2\2\2wx\7o\2\2xy\7c\2\2yz\7z\2\2z{\7u\2"+
+ "\2{|\7r\2\2|}\7c\2\2}~\7p\2\2~\20\3\2\2\2\177\u0080\7p\2\2\u0080\u0081"+
+ "\7q\2\2\u0081\u0082\7v\2\2\u0082\22\3\2\2\2\u0083\u0084\7p\2\2\u0084\u0085"+
+ "\7w\2\2\u0085\u0086\7n\2\2\u0086\u0087\7n\2\2\u0087\24\3\2\2\2\u0088\u0089"+
+ "\7q\2\2\u0089\u008a\7h\2\2\u008a\26\3\2\2\2\u008b\u008c\7q\2\2\u008c\u008d"+
+ "\7t\2\2\u008d\30\3\2\2\2\u008e\u008f\7u\2\2\u008f\u0090\7g\2\2\u0090\u0091"+
+ "\7s\2\2\u0091\u0092\7w\2\2\u0092\u0093\7g\2\2\u0093\u0094\7p\2\2\u0094"+
+ "\u0095\7e\2\2\u0095\u0096\7g\2\2\u0096\32\3\2\2\2\u0097\u0098\7v\2\2\u0098"+
+ "\u0099\7t\2\2\u0099\u009a\7w\2\2\u009a\u009b\7g\2\2\u009b\34\3\2\2\2\u009c"+
+ "\u009d\7w\2\2\u009d\u009e\7p\2\2\u009e\u009f\7v\2\2\u009f\u00a0\7k\2\2"+
+ "\u00a0\u00a1\7n\2\2\u00a1\36\3\2\2\2\u00a2\u00a3\7y\2\2\u00a3\u00a4\7"+
+ "j\2\2\u00a4\u00a5\7g\2\2\u00a5\u00a6\7t\2\2\u00a6\u00a7\7g\2\2\u00a7 "+
+ "\3\2\2\2\u00a8\u00a9\7y\2\2\u00a9\u00aa\7k\2\2\u00aa\u00ab\7v\2\2\u00ab"+
+ "\u00ac\7j\2\2\u00ac\"\3\2\2\2\u00ad\u00b1\7?\2\2\u00ae\u00af\7?\2\2\u00af"+
+ "\u00b1\7?\2\2\u00b0\u00ad\3\2\2\2\u00b0\u00ae\3\2\2\2\u00b1$\3\2\2\2\u00b2"+
+ "\u00b3\7#\2\2\u00b3\u00b4\7?\2\2\u00b4&\3\2\2\2\u00b5\u00b6\7>\2\2\u00b6"+
+ "(\3\2\2\2\u00b7\u00b8\7>\2\2\u00b8\u00b9\7?\2\2\u00b9*\3\2\2\2\u00ba\u00bb"+
+ "\7@\2\2\u00bb,\3\2\2\2\u00bc\u00bd\7@\2\2\u00bd\u00be\7?\2\2\u00be.\3"+
+ "\2\2\2\u00bf\u00c0\7-\2\2\u00c0\60\3\2\2\2\u00c1\u00c2\7/\2\2\u00c2\62"+
+ "\3\2\2\2\u00c3\u00c4\7,\2\2\u00c4\64\3\2\2\2\u00c5\u00c6\7\61\2\2\u00c6"+
+ "\66\3\2\2\2\u00c7\u00c8\7\'\2\2\u00c88\3\2\2\2\u00c9\u00ca\7\60\2\2\u00ca"+
+ ":\3\2\2\2\u00cb\u00cc\7.\2\2\u00cc<\3\2\2\2\u00cd\u00ce\7]\2\2\u00ce>"+
+ "\3\2\2\2\u00cf\u00d0\7_\2\2\u00d0@\3\2\2\2\u00d1\u00d2\7*\2\2\u00d2B\3"+
+ "\2\2\2\u00d3\u00d4\7+\2\2\u00d4D\3\2\2\2\u00d5\u00d6\7~\2\2\u00d6F\3\2"+
+ "\2\2\u00d7\u00db\7b\2\2\u00d8\u00da\n\2\2\2\u00d9\u00d8\3\2\2\2\u00da"+
+ "\u00dd\3\2\2\2\u00db\u00d9\3\2\2\2\u00db\u00dc\3\2\2\2\u00dc\u00de\3\2"+
+ "\2\2\u00dd\u00db\3\2\2\2\u00de\u00df\7b\2\2\u00dfH\3\2\2\2\u00e0\u00e6"+
+ "\7)\2\2\u00e1\u00e2\7^\2\2\u00e2\u00e5\t\3\2\2\u00e3\u00e5\n\4\2\2\u00e4"+
+ "\u00e1\3\2\2\2\u00e4\u00e3\3\2\2\2\u00e5\u00e8\3\2\2\2\u00e6\u00e4\3\2"+
+ "\2\2\u00e6\u00e7\3\2\2\2\u00e7\u00e9\3\2\2\2\u00e8\u00e6\3\2\2\2\u00e9"+
+ "\u010d\7)\2\2\u00ea\u00f0\7$\2\2\u00eb\u00ec\7^\2\2\u00ec\u00ef\t\3\2"+
+ "\2\u00ed\u00ef\n\5\2\2\u00ee\u00eb\3\2\2\2\u00ee\u00ed\3\2\2\2\u00ef\u00f2"+
+ "\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f3\3\2\2\2\u00f2"+
+ "\u00f0\3\2\2\2\u00f3\u010d\7$\2\2\u00f4\u00f5\7A\2\2\u00f5\u00f6\7$\2"+
+ "\2\u00f6\u00fc\3\2\2\2\u00f7\u00f8\7^\2\2\u00f8\u00fb\7$\2\2\u00f9\u00fb"+
+ "\n\6\2\2\u00fa\u00f7\3\2\2\2\u00fa\u00f9\3\2\2\2\u00fb\u00fe\3\2\2\2\u00fc"+
+ "\u00fa\3\2\2\2\u00fc\u00fd\3\2\2\2\u00fd\u00ff\3\2\2\2\u00fe\u00fc\3\2"+
+ "\2\2\u00ff\u010d\7$\2\2\u0100\u0101\7A\2\2\u0101\u0102\7)\2\2\u0102\u0108"+
+ "\3\2\2\2\u0103\u0104\7^\2\2\u0104\u0107\7)\2\2\u0105\u0107\n\7\2\2\u0106"+
+ "\u0103\3\2\2\2\u0106\u0105\3\2\2\2\u0107\u010a\3\2\2\2\u0108\u0106\3\2"+
+ "\2\2\u0108\u0109\3\2\2\2\u0109\u010b\3\2\2\2\u010a\u0108\3\2\2\2\u010b"+
+ "\u010d\7)\2\2\u010c\u00e0\3\2\2\2\u010c\u00ea\3\2\2\2\u010c\u00f4\3\2"+
+ "\2\2\u010c\u0100\3\2\2\2\u010dJ\3\2\2\2\u010e\u0110\5S*\2\u010f\u010e"+
+ "\3\2\2\2\u0110\u0111\3\2\2\2\u0111\u010f\3\2\2\2\u0111\u0112\3\2\2\2\u0112"+
+ "L\3\2\2\2\u0113\u0115\5S*\2\u0114\u0113\3\2\2\2\u0115\u0116\3\2\2\2\u0116"+
+ "\u0114\3\2\2\2\u0116\u0117\3\2\2\2\u0117\u0118\3\2\2\2\u0118\u011c\59"+
+ "\35\2\u0119\u011b\5S*\2\u011a\u0119\3\2\2\2\u011b\u011e\3\2\2\2\u011c"+
+ "\u011a\3\2\2\2\u011c\u011d\3\2\2\2\u011d\u013e\3\2\2\2\u011e\u011c\3\2"+
+ "\2\2\u011f\u0121\59\35\2\u0120\u0122\5S*\2\u0121\u0120\3\2\2\2\u0122\u0123"+
+ "\3\2\2\2\u0123\u0121\3\2\2\2\u0123\u0124\3\2\2\2\u0124\u013e\3\2\2\2\u0125"+
+ "\u0127\5S*\2\u0126\u0125\3\2\2\2\u0127\u0128\3\2\2\2\u0128\u0126\3\2\2"+
+ "\2\u0128\u0129\3\2\2\2\u0129\u0131\3\2\2\2\u012a\u012e\59\35\2\u012b\u012d"+
+ "\5S*\2\u012c\u012b\3\2\2\2\u012d\u0130\3\2\2\2\u012e\u012c\3\2\2\2\u012e"+
+ "\u012f\3\2\2\2\u012f\u0132\3\2\2\2\u0130\u012e\3\2\2\2\u0131\u012a\3\2"+
+ "\2\2\u0131\u0132\3\2\2\2\u0132\u0133\3\2\2\2\u0133\u0134\5Q)\2\u0134\u013e"+
+ "\3\2\2\2\u0135\u0137\59\35\2\u0136\u0138\5S*\2\u0137\u0136\3\2\2\2\u0138"+
+ "\u0139\3\2\2\2\u0139\u0137\3\2\2\2\u0139\u013a\3\2\2\2\u013a\u013b\3\2"+
+ "\2\2\u013b\u013c\5Q)\2\u013c\u013e\3\2\2\2\u013d\u0114\3\2\2\2\u013d\u011f"+
+ "\3\2\2\2\u013d\u0126\3\2\2\2\u013d\u0135\3\2\2\2\u013eN\3\2\2\2\u013f"+
+ "\u0142\5U+\2\u0140\u0142\t\b\2\2\u0141\u013f\3\2\2\2\u0141\u0140\3\2\2"+
+ "\2\u0142\u0148\3\2\2\2\u0143\u0147\5U+\2\u0144\u0147\5S*\2\u0145\u0147"+
+ "\7a\2\2\u0146\u0143\3\2\2\2\u0146\u0144\3\2\2\2\u0146\u0145\3\2\2\2\u0147"+
+ "\u014a\3\2\2\2\u0148\u0146\3\2\2\2\u0148\u0149\3\2\2\2\u0149P\3\2\2\2"+
+ "\u014a\u0148\3\2\2\2\u014b\u014d\t\t\2\2\u014c\u014e\t\n\2\2\u014d\u014c"+
+ "\3\2\2\2\u014d\u014e\3\2\2\2\u014e\u0150\3\2\2\2\u014f\u0151\5S*\2\u0150"+
+ "\u014f\3\2\2\2\u0151\u0152\3\2\2\2\u0152\u0150\3\2\2\2\u0152\u0153\3\2"+
+ "\2\2\u0153R\3\2\2\2\u0154\u0155\t\13\2\2\u0155T\3\2\2\2\u0156\u0157\t"+
+ "\f\2\2\u0157V\3\2\2\2\u0158\u0159\7\61\2\2\u0159\u015a\7\61\2\2\u015a"+
+ "\u015e\3\2\2\2\u015b\u015d\n\r\2\2\u015c\u015b\3\2\2\2\u015d\u0160\3\2"+
+ "\2\2\u015e\u015c\3\2\2\2\u015e\u015f\3\2\2\2\u015f\u0162\3\2\2\2\u0160"+
+ "\u015e\3\2\2\2\u0161\u0163\7\17\2\2\u0162\u0161\3\2\2\2\u0162\u0163\3"+
+ "\2\2\2\u0163\u0165\3\2\2\2\u0164\u0166\7\f\2\2\u0165\u0164\3\2\2\2\u0165"+
+ "\u0166\3\2\2\2\u0166\u0167\3\2\2\2\u0167\u0168\b,\2\2\u0168X\3\2\2\2\u0169"+
+ "\u016a\7\61\2\2\u016a\u016b\7,\2\2\u016b\u0170\3\2\2\2\u016c\u016f\5Y"+
+ "-\2\u016d\u016f\13\2\2\2\u016e\u016c\3\2\2\2\u016e\u016d\3\2\2\2\u016f"+
+ "\u0172\3\2\2\2\u0170\u0171\3\2\2\2\u0170\u016e\3\2\2\2\u0171\u0173\3\2"+
+ "\2\2\u0172\u0170\3\2\2\2\u0173\u0174\7,\2\2\u0174\u0175\7\61\2\2\u0175"+
+ "\u0176\3\2\2\2\u0176\u0177\b-\2\2\u0177Z\3\2\2\2\u0178\u017a\t\16\2\2"+
+ "\u0179\u0178\3\2\2\2\u017a\u017b\3\2\2\2\u017b\u0179\3\2\2\2\u017b\u017c"+
+ "\3\2\2\2\u017c\u017d\3\2\2\2\u017d\u017e\b.\2\2\u017e\\\3\2\2\2\"\2\u00b0"+
+ "\u00db\u00e4\u00e6\u00ee\u00f0\u00fa\u00fc\u0106\u0108\u010c\u0111\u0116"+
+ "\u011c\u0123\u0128\u012e\u0131\u0139\u013d\u0141\u0146\u0148\u014d\u0152"+
+ "\u015e\u0162\u0165\u016e\u0170\u017b\3\2\3\2";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
index 1e37a1491db28..5d1545d17d3bb 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
@@ -48,15 +48,15 @@ interface EqlBaseListener extends ParseTreeListener {
*/
void exitQuery(EqlBaseParser.QueryContext ctx);
/**
- * Enter a parse tree produced by {@link EqlBaseParser#withParams}.
+ * Enter a parse tree produced by {@link EqlBaseParser#sequenceParams}.
* @param ctx the parse tree
*/
- void enterWithParams(EqlBaseParser.WithParamsContext ctx);
+ void enterSequenceParams(EqlBaseParser.SequenceParamsContext ctx);
/**
- * Exit a parse tree produced by {@link EqlBaseParser#withParams}.
+ * Exit a parse tree produced by {@link EqlBaseParser#sequenceParams}.
* @param ctx the parse tree
*/
- void exitWithParams(EqlBaseParser.WithParamsContext ctx);
+ void exitSequenceParams(EqlBaseParser.SequenceParamsContext ctx);
/**
* Enter a parse tree produced by {@link EqlBaseParser#sequence}.
* @param ctx the parse tree
@@ -87,16 +87,6 @@ interface EqlBaseListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitPipe(EqlBaseParser.PipeContext ctx);
- /**
- * Enter a parse tree produced by {@link EqlBaseParser#namedParam}.
- * @param ctx the parse tree
- */
- void enterNamedParam(EqlBaseParser.NamedParamContext ctx);
- /**
- * Exit a parse tree produced by {@link EqlBaseParser#namedParam}.
- * @param ctx the parse tree
- */
- void exitNamedParam(EqlBaseParser.NamedParamContext ctx);
/**
* Enter a parse tree produced by {@link EqlBaseParser#joinKeys}.
* @param ctx the parse tree
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
index dfccf73b78af1..c3b56271756f5 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
@@ -17,43 +17,44 @@ class EqlBaseParser extends Parser {
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
- AND=1, BY=2, FALSE=3, IN=4, JOIN=5, NOT=6, NULL=7, OF=8, OR=9, SEQUENCE=10,
- TRUE=11, UNTIL=12, WHERE=13, WITH=14, EQ=15, NEQ=16, LT=17, LTE=18, GT=19,
- GTE=20, PLUS=21, MINUS=22, ASTERISK=23, SLASH=24, PERCENT=25, DOT=26,
- COMMA=27, LB=28, RB=29, LP=30, RP=31, PIPE=32, ESCAPED_IDENTIFIER=33,
- STRING=34, INTEGER_VALUE=35, DECIMAL_VALUE=36, IDENTIFIER=37, LINE_COMMENT=38,
- BRACKETED_COMMENT=39, WS=40;
+ AND=1, BY=2, FALSE=3, FORK=4, IN=5, JOIN=6, MAXSPAN=7, NOT=8, NULL=9,
+ OF=10, OR=11, SEQUENCE=12, TRUE=13, UNTIL=14, WHERE=15, WITH=16, EQ=17,
+ NEQ=18, LT=19, LTE=20, GT=21, GTE=22, PLUS=23, MINUS=24, ASTERISK=25,
+ SLASH=26, PERCENT=27, DOT=28, COMMA=29, LB=30, RB=31, LP=32, RP=33, PIPE=34,
+ ESCAPED_IDENTIFIER=35, STRING=36, INTEGER_VALUE=37, DECIMAL_VALUE=38,
+ IDENTIFIER=39, LINE_COMMENT=40, BRACKETED_COMMENT=41, WS=42;
public static final int
RULE_singleStatement = 0, RULE_singleExpression = 1, RULE_statement = 2,
- RULE_query = 3, RULE_withParams = 4, RULE_sequence = 5, RULE_join = 6,
- RULE_pipe = 7, RULE_namedParam = 8, RULE_joinKeys = 9, RULE_joinTerm = 10,
- RULE_sequenceTerm = 11, RULE_subquery = 12, RULE_eventQuery = 13, RULE_expression = 14,
- RULE_booleanExpression = 15, RULE_predicated = 16, RULE_predicate = 17,
- RULE_valueExpression = 18, RULE_primaryExpression = 19, RULE_functionExpression = 20,
- RULE_constant = 21, RULE_comparisonOperator = 22, RULE_booleanValue = 23,
- RULE_qualifiedName = 24, RULE_identifier = 25, RULE_timeUnit = 26, RULE_number = 27,
- RULE_string = 28;
+ RULE_query = 3, RULE_sequenceParams = 4, RULE_sequence = 5, RULE_join = 6,
+ RULE_pipe = 7, RULE_joinKeys = 8, RULE_joinTerm = 9, RULE_sequenceTerm = 10,
+ RULE_subquery = 11, RULE_eventQuery = 12, RULE_expression = 13, RULE_booleanExpression = 14,
+ RULE_predicated = 15, RULE_predicate = 16, RULE_valueExpression = 17,
+ RULE_primaryExpression = 18, RULE_functionExpression = 19, RULE_constant = 20,
+ RULE_comparisonOperator = 21, RULE_booleanValue = 22, RULE_qualifiedName = 23,
+ RULE_identifier = 24, RULE_timeUnit = 25, RULE_number = 26, RULE_string = 27;
public static final String[] ruleNames = {
- "singleStatement", "singleExpression", "statement", "query", "withParams",
- "sequence", "join", "pipe", "namedParam", "joinKeys", "joinTerm", "sequenceTerm",
- "subquery", "eventQuery", "expression", "booleanExpression", "predicated",
- "predicate", "valueExpression", "primaryExpression", "functionExpression",
- "constant", "comparisonOperator", "booleanValue", "qualifiedName", "identifier",
- "timeUnit", "number", "string"
+ "singleStatement", "singleExpression", "statement", "query", "sequenceParams",
+ "sequence", "join", "pipe", "joinKeys", "joinTerm", "sequenceTerm", "subquery",
+ "eventQuery", "expression", "booleanExpression", "predicated", "predicate",
+ "valueExpression", "primaryExpression", "functionExpression", "constant",
+ "comparisonOperator", "booleanValue", "qualifiedName", "identifier", "timeUnit",
+ "number", "string"
};
private static final String[] _LITERAL_NAMES = {
- null, "'and'", "'by'", "'false'", "'in'", "'join'", "'not'", "'null'",
- "'of'", "'or'", "'sequence'", "'true'", "'until'", "'where'", "'with'",
- null, "'!='", "'<'", "'<='", "'>'", "'>='", "'+'", "'-'", "'*'", "'/'",
- "'%'", "'.'", "','", "'['", "']'", "'('", "')'", "'|'"
+ null, "'and'", "'by'", "'false'", "'fork'", "'in'", "'join'", "'maxspan'",
+ "'not'", "'null'", "'of'", "'or'", "'sequence'", "'true'", "'until'",
+ "'where'", "'with'", null, "'!='", "'<'", "'<='", "'>'", "'>='", "'+'",
+ "'-'", "'*'", "'/'", "'%'", "'.'", "','", "'['", "']'", "'('", "')'",
+ "'|'"
};
private static final String[] _SYMBOLIC_NAMES = {
- null, "AND", "BY", "FALSE", "IN", "JOIN", "NOT", "NULL", "OF", "OR", "SEQUENCE",
- "TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ", "LT", "LTE", "GT", "GTE",
- "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT", "DOT", "COMMA", "LB",
- "RB", "LP", "RP", "PIPE", "ESCAPED_IDENTIFIER", "STRING", "INTEGER_VALUE",
- "DECIMAL_VALUE", "IDENTIFIER", "LINE_COMMENT", "BRACKETED_COMMENT", "WS"
+ null, "AND", "BY", "FALSE", "FORK", "IN", "JOIN", "MAXSPAN", "NOT", "NULL",
+ "OF", "OR", "SEQUENCE", "TRUE", "UNTIL", "WHERE", "WITH", "EQ", "NEQ",
+ "LT", "LTE", "GT", "GTE", "PLUS", "MINUS", "ASTERISK", "SLASH", "PERCENT",
+ "DOT", "COMMA", "LB", "RB", "LP", "RP", "PIPE", "ESCAPED_IDENTIFIER",
+ "STRING", "INTEGER_VALUE", "DECIMAL_VALUE", "IDENTIFIER", "LINE_COMMENT",
+ "BRACKETED_COMMENT", "WS"
};
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
@@ -134,9 +135,9 @@ public final SingleStatementContext singleStatement() throws RecognitionExceptio
try {
enterOuterAlt(_localctx, 1);
{
- setState(58);
+ setState(56);
statement();
- setState(59);
+ setState(57);
match(EOF);
}
}
@@ -181,9 +182,9 @@ public final SingleExpressionContext singleExpression() throws RecognitionExcept
try {
enterOuterAlt(_localctx, 1);
{
- setState(61);
+ setState(59);
expression();
- setState(62);
+ setState(60);
match(EOF);
}
}
@@ -238,21 +239,21 @@ public final StatementContext statement() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(64);
+ setState(62);
query();
- setState(69);
+ setState(67);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==PIPE) {
{
{
- setState(65);
+ setState(63);
match(PIPE);
- setState(66);
+ setState(64);
pipe();
}
}
- setState(71);
+ setState(69);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -302,26 +303,26 @@ public final QueryContext query() throws RecognitionException {
QueryContext _localctx = new QueryContext(_ctx, getState());
enterRule(_localctx, 6, RULE_query);
try {
- setState(75);
+ setState(73);
switch (_input.LA(1)) {
case SEQUENCE:
enterOuterAlt(_localctx, 1);
{
- setState(72);
+ setState(70);
sequence();
}
break;
case JOIN:
enterOuterAlt(_localctx, 2);
{
- setState(73);
+ setState(71);
join();
}
break;
case IDENTIFIER:
enterOuterAlt(_localctx, 3);
{
- setState(74);
+ setState(72);
eventQuery();
}
break;
@@ -340,63 +341,47 @@ public final QueryContext query() throws RecognitionException {
return _localctx;
}
- public static class WithParamsContext extends ParserRuleContext {
+ public static class SequenceParamsContext extends ParserRuleContext {
public TerminalNode WITH() { return getToken(EqlBaseParser.WITH, 0); }
- public List namedParam() {
- return getRuleContexts(NamedParamContext.class);
- }
- public NamedParamContext namedParam(int i) {
- return getRuleContext(NamedParamContext.class,i);
- }
- public List COMMA() { return getTokens(EqlBaseParser.COMMA); }
- public TerminalNode COMMA(int i) {
- return getToken(EqlBaseParser.COMMA, i);
+ public TerminalNode MAXSPAN() { return getToken(EqlBaseParser.MAXSPAN, 0); }
+ public TerminalNode EQ() { return getToken(EqlBaseParser.EQ, 0); }
+ public TimeUnitContext timeUnit() {
+ return getRuleContext(TimeUnitContext.class,0);
}
- public WithParamsContext(ParserRuleContext parent, int invokingState) {
+ public SequenceParamsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
- @Override public int getRuleIndex() { return RULE_withParams; }
+ @Override public int getRuleIndex() { return RULE_sequenceParams; }
@Override
public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterWithParams(this);
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterSequenceParams(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitWithParams(this);
+ if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitSequenceParams(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
- if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitWithParams(this);
+ if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitSequenceParams(this);
else return visitor.visitChildren(this);
}
}
- public final WithParamsContext withParams() throws RecognitionException {
- WithParamsContext _localctx = new WithParamsContext(_ctx, getState());
- enterRule(_localctx, 8, RULE_withParams);
- int _la;
+ public final SequenceParamsContext sequenceParams() throws RecognitionException {
+ SequenceParamsContext _localctx = new SequenceParamsContext(_ctx, getState());
+ enterRule(_localctx, 8, RULE_sequenceParams);
try {
enterOuterAlt(_localctx, 1);
{
- setState(77);
+ setState(75);
match(WITH);
+ {
+ setState(76);
+ match(MAXSPAN);
+ setState(77);
+ match(EQ);
setState(78);
- namedParam();
- setState(83);
- _errHandler.sync(this);
- _la = _input.LA(1);
- while (_la==COMMA) {
- {
- {
- setState(79);
- match(COMMA);
- setState(80);
- namedParam();
- }
- }
- setState(85);
- _errHandler.sync(this);
- _la = _input.LA(1);
+ timeUnit();
}
}
}
@@ -420,8 +405,8 @@ public List sequenceTerm() {
public SequenceTermContext sequenceTerm(int i) {
return getRuleContext(SequenceTermContext.class,i);
}
- public WithParamsContext withParams() {
- return getRuleContext(WithParamsContext.class,0);
+ public SequenceParamsContext sequenceParams() {
+ return getRuleContext(SequenceParamsContext.class,0);
}
public TerminalNode UNTIL() { return getToken(EqlBaseParser.UNTIL, 0); }
public JoinKeysContext joinKeys() {
@@ -453,20 +438,20 @@ public final SequenceContext sequence() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(86);
+ setState(80);
match(SEQUENCE);
- setState(95);
+ setState(89);
switch (_input.LA(1)) {
case BY:
{
- setState(87);
+ setState(81);
((SequenceContext)_localctx).by = joinKeys();
- setState(89);
+ setState(83);
_la = _input.LA(1);
if (_la==WITH) {
{
- setState(88);
- withParams();
+ setState(82);
+ sequenceParams();
}
}
@@ -474,13 +459,13 @@ public final SequenceContext sequence() throws RecognitionException {
break;
case WITH:
{
- setState(91);
- withParams();
- setState(93);
+ setState(85);
+ sequenceParams();
+ setState(87);
_la = _input.LA(1);
if (_la==BY) {
{
- setState(92);
+ setState(86);
((SequenceContext)_localctx).by = joinKeys();
}
}
@@ -492,29 +477,29 @@ public final SequenceContext sequence() throws RecognitionException {
default:
throw new NoViableAltException(this);
}
- setState(97);
+ setState(91);
sequenceTerm();
- setState(99);
+ setState(93);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
- setState(98);
+ setState(92);
sequenceTerm();
}
}
- setState(101);
+ setState(95);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==LB );
- setState(105);
+ setState(99);
_la = _input.LA(1);
if (_la==UNTIL) {
{
- setState(103);
+ setState(97);
match(UNTIL);
- setState(104);
+ setState(98);
sequenceTerm();
}
}
@@ -571,40 +556,40 @@ public final JoinContext join() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(107);
+ setState(101);
match(JOIN);
- setState(109);
+ setState(103);
_la = _input.LA(1);
if (_la==BY) {
{
- setState(108);
+ setState(102);
((JoinContext)_localctx).by = joinKeys();
}
}
- setState(111);
+ setState(105);
joinTerm();
- setState(113);
+ setState(107);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
- setState(112);
+ setState(106);
joinTerm();
}
}
- setState(115);
+ setState(109);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==LB );
- setState(119);
+ setState(113);
_la = _input.LA(1);
if (_la==UNTIL) {
{
- setState(117);
+ setState(111);
match(UNTIL);
- setState(118);
+ setState(112);
joinTerm();
}
}
@@ -661,27 +646,27 @@ public final PipeContext pipe() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(121);
+ setState(115);
((PipeContext)_localctx).kind = match(IDENTIFIER);
- setState(130);
+ setState(124);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << ESCAPED_IDENTIFIER) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER))) != 0)) {
{
- setState(122);
+ setState(116);
booleanExpression(0);
- setState(127);
+ setState(121);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(123);
+ setState(117);
match(COMMA);
- setState(124);
+ setState(118);
booleanExpression(0);
}
}
- setState(129);
+ setState(123);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -701,74 +686,6 @@ public final PipeContext pipe() throws RecognitionException {
return _localctx;
}
- public static class NamedParamContext extends ParserRuleContext {
- public Token key;
- public TerminalNode EQ() { return getToken(EqlBaseParser.EQ, 0); }
- public TerminalNode IDENTIFIER() { return getToken(EqlBaseParser.IDENTIFIER, 0); }
- public ExpressionContext expression() {
- return getRuleContext(ExpressionContext.class,0);
- }
- public TimeUnitContext timeUnit() {
- return getRuleContext(TimeUnitContext.class,0);
- }
- public NamedParamContext(ParserRuleContext parent, int invokingState) {
- super(parent, invokingState);
- }
- @Override public int getRuleIndex() { return RULE_namedParam; }
- @Override
- public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterNamedParam(this);
- }
- @Override
- public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitNamedParam(this);
- }
- @Override
- public T accept(ParseTreeVisitor extends T> visitor) {
- if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitNamedParam(this);
- else return visitor.visitChildren(this);
- }
- }
-
- public final NamedParamContext namedParam() throws RecognitionException {
- NamedParamContext _localctx = new NamedParamContext(_ctx, getState());
- enterRule(_localctx, 16, RULE_namedParam);
- try {
- enterOuterAlt(_localctx, 1);
- {
- setState(132);
- ((NamedParamContext)_localctx).key = match(IDENTIFIER);
- setState(133);
- match(EQ);
- setState(136);
- _errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,13,_ctx) ) {
- case 1:
- {
- setState(134);
- expression();
- }
- break;
- case 2:
- {
- setState(135);
- timeUnit();
- }
- break;
- }
- }
- }
- catch (RecognitionException re) {
- _localctx.exception = re;
- _errHandler.reportError(this, re);
- _errHandler.recover(this, re);
- }
- finally {
- exitRule();
- }
- return _localctx;
- }
-
public static class JoinKeysContext extends ParserRuleContext {
public TerminalNode BY() { return getToken(EqlBaseParser.BY, 0); }
public List expression() {
@@ -802,28 +719,28 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final JoinKeysContext joinKeys() throws RecognitionException {
JoinKeysContext _localctx = new JoinKeysContext(_ctx, getState());
- enterRule(_localctx, 18, RULE_joinKeys);
+ enterRule(_localctx, 16, RULE_joinKeys);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(138);
+ setState(126);
match(BY);
- setState(139);
+ setState(127);
expression();
- setState(144);
+ setState(132);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(140);
+ setState(128);
match(COMMA);
- setState(141);
+ setState(129);
expression();
}
}
- setState(146);
+ setState(134);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -869,18 +786,18 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final JoinTermContext joinTerm() throws RecognitionException {
JoinTermContext _localctx = new JoinTermContext(_ctx, getState());
- enterRule(_localctx, 20, RULE_joinTerm);
+ enterRule(_localctx, 18, RULE_joinTerm);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(147);
+ setState(135);
subquery();
- setState(149);
+ setState(137);
_la = _input.LA(1);
if (_la==BY) {
{
- setState(148);
+ setState(136);
((JoinTermContext)_localctx).by = joinKeys();
}
}
@@ -903,15 +820,14 @@ public static class SequenceTermContext extends ParserRuleContext {
public SubqueryContext subquery() {
return getRuleContext(SubqueryContext.class,0);
}
- public List namedParam() {
- return getRuleContexts(NamedParamContext.class);
- }
- public NamedParamContext namedParam(int i) {
- return getRuleContext(NamedParamContext.class,i);
- }
+ public TerminalNode FORK() { return getToken(EqlBaseParser.FORK, 0); }
public JoinKeysContext joinKeys() {
return getRuleContext(JoinKeysContext.class,0);
}
+ public TerminalNode EQ() { return getToken(EqlBaseParser.EQ, 0); }
+ public BooleanValueContext booleanValue() {
+ return getRuleContext(BooleanValueContext.class,0);
+ }
public SequenceTermContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@@ -933,32 +849,38 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final SequenceTermContext sequenceTerm() throws RecognitionException {
SequenceTermContext _localctx = new SequenceTermContext(_ctx, getState());
- enterRule(_localctx, 22, RULE_sequenceTerm);
+ enterRule(_localctx, 20, RULE_sequenceTerm);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(151);
+ setState(139);
subquery();
- setState(155);
- _errHandler.sync(this);
+ setState(145);
_la = _input.LA(1);
- while (_la==IDENTIFIER) {
- {
+ if (_la==FORK) {
{
- setState(152);
- namedParam();
+ setState(140);
+ match(FORK);
+ setState(143);
+ _la = _input.LA(1);
+ if (_la==EQ) {
+ {
+ setState(141);
+ match(EQ);
+ setState(142);
+ booleanValue();
+ }
}
+
}
- setState(157);
- _errHandler.sync(this);
- _la = _input.LA(1);
}
- setState(159);
+
+ setState(148);
_la = _input.LA(1);
if (_la==BY) {
{
- setState(158);
+ setState(147);
((SequenceTermContext)_localctx).by = joinKeys();
}
}
@@ -1003,15 +925,15 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final SubqueryContext subquery() throws RecognitionException {
SubqueryContext _localctx = new SubqueryContext(_ctx, getState());
- enterRule(_localctx, 24, RULE_subquery);
+ enterRule(_localctx, 22, RULE_subquery);
try {
enterOuterAlt(_localctx, 1);
{
- setState(161);
+ setState(150);
match(LB);
- setState(162);
+ setState(151);
eventQuery();
- setState(163);
+ setState(152);
match(RB);
}
}
@@ -1056,15 +978,15 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final EventQueryContext eventQuery() throws RecognitionException {
EventQueryContext _localctx = new EventQueryContext(_ctx, getState());
- enterRule(_localctx, 26, RULE_eventQuery);
+ enterRule(_localctx, 24, RULE_eventQuery);
try {
enterOuterAlt(_localctx, 1);
{
- setState(165);
+ setState(154);
((EventQueryContext)_localctx).event = identifier();
- setState(166);
+ setState(155);
match(WHERE);
- setState(167);
+ setState(156);
expression();
}
}
@@ -1104,11 +1026,11 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final ExpressionContext expression() throws RecognitionException {
ExpressionContext _localctx = new ExpressionContext(_ctx, getState());
- enterRule(_localctx, 28, RULE_expression);
+ enterRule(_localctx, 26, RULE_expression);
try {
enterOuterAlt(_localctx, 1);
{
- setState(169);
+ setState(158);
booleanExpression(0);
}
}
@@ -1234,24 +1156,24 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
int _parentState = getState();
BooleanExpressionContext _localctx = new BooleanExpressionContext(_ctx, _parentState);
BooleanExpressionContext _prevctx = _localctx;
- int _startState = 30;
- enterRecursionRule(_localctx, 30, RULE_booleanExpression, _p);
+ int _startState = 28;
+ enterRecursionRule(_localctx, 28, RULE_booleanExpression, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(179);
+ setState(168);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) {
case 1:
{
_localctx = new LogicalNotContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(172);
+ setState(161);
match(NOT);
- setState(173);
+ setState(162);
booleanExpression(5);
}
break;
@@ -1260,11 +1182,11 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
_localctx = new ProcessCheckContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(174);
+ setState(163);
((ProcessCheckContext)_localctx).relationship = identifier();
- setState(175);
+ setState(164);
match(OF);
- setState(176);
+ setState(165);
subquery();
}
break;
@@ -1273,33 +1195,33 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
_localctx = new BooleanDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(178);
+ setState(167);
predicated();
}
break;
}
_ctx.stop = _input.LT(-1);
- setState(189);
+ setState(178);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,20,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,19,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
- setState(187);
+ setState(176);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) {
case 1:
{
_localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState));
((LogicalBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
- setState(181);
+ setState(170);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
- setState(182);
+ setState(171);
((LogicalBinaryContext)_localctx).operator = match(AND);
- setState(183);
+ setState(172);
((LogicalBinaryContext)_localctx).right = booleanExpression(3);
}
break;
@@ -1308,20 +1230,20 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
_localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState));
((LogicalBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
- setState(184);
+ setState(173);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
- setState(185);
+ setState(174);
((LogicalBinaryContext)_localctx).operator = match(OR);
- setState(186);
+ setState(175);
((LogicalBinaryContext)_localctx).right = booleanExpression(2);
}
break;
}
}
}
- setState(191);
+ setState(180);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,20,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,19,_ctx);
}
}
}
@@ -1364,18 +1286,18 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final PredicatedContext predicated() throws RecognitionException {
PredicatedContext _localctx = new PredicatedContext(_ctx, getState());
- enterRule(_localctx, 32, RULE_predicated);
+ enterRule(_localctx, 30, RULE_predicated);
try {
enterOuterAlt(_localctx, 1);
{
- setState(192);
+ setState(181);
valueExpression(0);
- setState(194);
+ setState(183);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) {
case 1:
{
- setState(193);
+ setState(182);
predicate();
}
break;
@@ -1430,43 +1352,43 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final PredicateContext predicate() throws RecognitionException {
PredicateContext _localctx = new PredicateContext(_ctx, getState());
- enterRule(_localctx, 34, RULE_predicate);
+ enterRule(_localctx, 32, RULE_predicate);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(197);
+ setState(186);
_la = _input.LA(1);
if (_la==NOT) {
{
- setState(196);
+ setState(185);
match(NOT);
}
}
- setState(199);
+ setState(188);
((PredicateContext)_localctx).kind = match(IN);
- setState(200);
+ setState(189);
match(LP);
- setState(201);
+ setState(190);
valueExpression(0);
- setState(206);
+ setState(195);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(202);
+ setState(191);
match(COMMA);
- setState(203);
+ setState(192);
valueExpression(0);
}
}
- setState(208);
+ setState(197);
_errHandler.sync(this);
_la = _input.LA(1);
}
- setState(209);
+ setState(198);
match(RP);
}
}
@@ -1600,14 +1522,14 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
int _parentState = getState();
ValueExpressionContext _localctx = new ValueExpressionContext(_ctx, _parentState);
ValueExpressionContext _prevctx = _localctx;
- int _startState = 36;
- enterRecursionRule(_localctx, 36, RULE_valueExpression, _p);
+ int _startState = 34;
+ enterRecursionRule(_localctx, 34, RULE_valueExpression, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(215);
+ setState(204);
switch (_input.LA(1)) {
case FALSE:
case NULL:
@@ -1623,7 +1545,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_ctx = _localctx;
_prevctx = _localctx;
- setState(212);
+ setState(201);
primaryExpression();
}
break;
@@ -1633,7 +1555,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_localctx = new ArithmeticUnaryContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(213);
+ setState(202);
((ArithmeticUnaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
@@ -1641,7 +1563,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
} else {
consume();
}
- setState(214);
+ setState(203);
valueExpression(4);
}
break;
@@ -1649,25 +1571,25 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
throw new NoViableAltException(this);
}
_ctx.stop = _input.LT(-1);
- setState(229);
+ setState(218);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,26,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,25,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
- setState(227);
+ setState(216);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
case 1:
{
_localctx = new ArithmeticBinaryContext(new ValueExpressionContext(_parentctx, _parentState));
((ArithmeticBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
- setState(217);
+ setState(206);
if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)");
- setState(218);
+ setState(207);
((ArithmeticBinaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ASTERISK) | (1L << SLASH) | (1L << PERCENT))) != 0)) ) {
@@ -1675,7 +1597,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
} else {
consume();
}
- setState(219);
+ setState(208);
((ArithmeticBinaryContext)_localctx).right = valueExpression(4);
}
break;
@@ -1684,9 +1606,9 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_localctx = new ArithmeticBinaryContext(new ValueExpressionContext(_parentctx, _parentState));
((ArithmeticBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
- setState(220);
+ setState(209);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
- setState(221);
+ setState(210);
((ArithmeticBinaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
@@ -1694,7 +1616,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
} else {
consume();
}
- setState(222);
+ setState(211);
((ArithmeticBinaryContext)_localctx).right = valueExpression(3);
}
break;
@@ -1703,20 +1625,20 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_localctx = new ComparisonContext(new ValueExpressionContext(_parentctx, _parentState));
((ComparisonContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
- setState(223);
+ setState(212);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
- setState(224);
+ setState(213);
comparisonOperator();
- setState(225);
+ setState(214);
((ComparisonContext)_localctx).right = valueExpression(2);
}
break;
}
}
}
- setState(231);
+ setState(220);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,26,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,25,_ctx);
}
}
}
@@ -1840,16 +1762,16 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final PrimaryExpressionContext primaryExpression() throws RecognitionException {
PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState());
- enterRule(_localctx, 38, RULE_primaryExpression);
+ enterRule(_localctx, 36, RULE_primaryExpression);
try {
- setState(240);
+ setState(229);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,27,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) {
case 1:
_localctx = new ConstantDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(232);
+ setState(221);
constant();
}
break;
@@ -1857,7 +1779,7 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
_localctx = new FunctionContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(233);
+ setState(222);
functionExpression();
}
break;
@@ -1865,7 +1787,7 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
_localctx = new DereferenceContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(234);
+ setState(223);
qualifiedName();
}
break;
@@ -1873,7 +1795,7 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
_localctx = new IdentifierEscapeContext(_localctx);
enterOuterAlt(_localctx, 4);
{
- setState(235);
+ setState(224);
match(ESCAPED_IDENTIFIER);
}
break;
@@ -1881,11 +1803,11 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
_localctx = new ParenthesizedExpressionContext(_localctx);
enterOuterAlt(_localctx, 5);
{
- setState(236);
+ setState(225);
match(LP);
- setState(237);
+ setState(226);
expression();
- setState(238);
+ setState(227);
match(RP);
}
break;
@@ -1939,41 +1861,41 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final FunctionExpressionContext functionExpression() throws RecognitionException {
FunctionExpressionContext _localctx = new FunctionExpressionContext(_ctx, getState());
- enterRule(_localctx, 40, RULE_functionExpression);
+ enterRule(_localctx, 38, RULE_functionExpression);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(242);
+ setState(231);
identifier();
- setState(243);
+ setState(232);
match(LP);
- setState(252);
+ setState(241);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << ESCAPED_IDENTIFIER) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER))) != 0)) {
{
- setState(244);
+ setState(233);
expression();
- setState(249);
+ setState(238);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(245);
+ setState(234);
match(COMMA);
- setState(246);
+ setState(235);
expression();
}
}
- setState(251);
+ setState(240);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
- setState(254);
+ setState(243);
match(RP);
}
}
@@ -2076,15 +1998,15 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final ConstantContext constant() throws RecognitionException {
ConstantContext _localctx = new ConstantContext(_ctx, getState());
- enterRule(_localctx, 42, RULE_constant);
+ enterRule(_localctx, 40, RULE_constant);
try {
- setState(260);
+ setState(249);
switch (_input.LA(1)) {
case NULL:
_localctx = new NullLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(256);
+ setState(245);
match(NULL);
}
break;
@@ -2093,7 +2015,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new NumericLiteralContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(257);
+ setState(246);
number();
}
break;
@@ -2102,7 +2024,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new BooleanLiteralContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(258);
+ setState(247);
booleanValue();
}
break;
@@ -2110,7 +2032,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new StringLiteralContext(_localctx);
enterOuterAlt(_localctx, 4);
{
- setState(259);
+ setState(248);
string();
}
break;
@@ -2157,12 +2079,12 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final ComparisonOperatorContext comparisonOperator() throws RecognitionException {
ComparisonOperatorContext _localctx = new ComparisonOperatorContext(_ctx, getState());
- enterRule(_localctx, 44, RULE_comparisonOperator);
+ enterRule(_localctx, 42, RULE_comparisonOperator);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(262);
+ setState(251);
_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);
@@ -2206,12 +2128,12 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final BooleanValueContext booleanValue() throws RecognitionException {
BooleanValueContext _localctx = new BooleanValueContext(_ctx, getState());
- enterRule(_localctx, 46, RULE_booleanValue);
+ enterRule(_localctx, 44, RULE_booleanValue);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(264);
+ setState(253);
_la = _input.LA(1);
if ( !(_la==FALSE || _la==TRUE) ) {
_errHandler.recoverInline(this);
@@ -2275,49 +2197,49 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final QualifiedNameContext qualifiedName() throws RecognitionException {
QualifiedNameContext _localctx = new QualifiedNameContext(_ctx, getState());
- enterRule(_localctx, 48, RULE_qualifiedName);
+ enterRule(_localctx, 46, RULE_qualifiedName);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(266);
+ setState(255);
identifier();
- setState(278);
+ setState(267);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,33,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,32,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
- setState(276);
+ setState(265);
switch (_input.LA(1)) {
case DOT:
{
- setState(267);
+ setState(256);
match(DOT);
- setState(268);
+ setState(257);
identifier();
}
break;
case LB:
{
- setState(269);
+ setState(258);
match(LB);
- setState(271);
+ setState(260);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
- setState(270);
+ setState(259);
match(INTEGER_VALUE);
}
}
- setState(273);
+ setState(262);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==INTEGER_VALUE );
- setState(275);
+ setState(264);
match(RB);
}
break;
@@ -2326,9 +2248,9 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException {
}
}
}
- setState(280);
+ setState(269);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,33,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,32,_ctx);
}
}
}
@@ -2366,11 +2288,11 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final IdentifierContext identifier() throws RecognitionException {
IdentifierContext _localctx = new IdentifierContext(_ctx, getState());
- enterRule(_localctx, 50, RULE_identifier);
+ enterRule(_localctx, 48, RULE_identifier);
try {
enterOuterAlt(_localctx, 1);
{
- setState(281);
+ setState(270);
match(IDENTIFIER);
}
}
@@ -2412,14 +2334,22 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final TimeUnitContext timeUnit() throws RecognitionException {
TimeUnitContext _localctx = new TimeUnitContext(_ctx, getState());
- enterRule(_localctx, 52, RULE_timeUnit);
+ enterRule(_localctx, 50, RULE_timeUnit);
+ int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(283);
+ setState(272);
number();
- setState(284);
- ((TimeUnitContext)_localctx).unit = match(IDENTIFIER);
+ setState(274);
+ _la = _input.LA(1);
+ if (_la==IDENTIFIER) {
+ {
+ setState(273);
+ ((TimeUnitContext)_localctx).unit = match(IDENTIFIER);
+ }
+ }
+
}
}
catch (RecognitionException re) {
@@ -2481,15 +2411,15 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final NumberContext number() throws RecognitionException {
NumberContext _localctx = new NumberContext(_ctx, getState());
- enterRule(_localctx, 54, RULE_number);
+ enterRule(_localctx, 52, RULE_number);
try {
- setState(288);
+ setState(278);
switch (_input.LA(1)) {
case DECIMAL_VALUE:
_localctx = new DecimalLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(286);
+ setState(276);
match(DECIMAL_VALUE);
}
break;
@@ -2497,7 +2427,7 @@ public final NumberContext number() throws RecognitionException {
_localctx = new IntegerLiteralContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(287);
+ setState(277);
match(INTEGER_VALUE);
}
break;
@@ -2539,11 +2469,11 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final StringContext string() throws RecognitionException {
StringContext _localctx = new StringContext(_ctx, getState());
- enterRule(_localctx, 56, RULE_string);
+ enterRule(_localctx, 54, RULE_string);
try {
enterOuterAlt(_localctx, 1);
{
- setState(290);
+ setState(280);
match(STRING);
}
}
@@ -2560,9 +2490,9 @@ public final StringContext string() throws RecognitionException {
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
switch (ruleIndex) {
- case 15:
+ case 14:
return booleanExpression_sempred((BooleanExpressionContext)_localctx, predIndex);
- case 18:
+ case 17:
return valueExpression_sempred((ValueExpressionContext)_localctx, predIndex);
}
return true;
@@ -2589,107 +2519,104 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
}
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3*\u0127\4\2\t\2\4"+
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3,\u011d\4\2\t\2\4"+
"\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+
"\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
- "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\3\2\3\2\3\2\3\3\3\3"+
- "\3\3\3\4\3\4\3\4\7\4F\n\4\f\4\16\4I\13\4\3\5\3\5\3\5\5\5N\n\5\3\6\3\6"+
- "\3\6\3\6\7\6T\n\6\f\6\16\6W\13\6\3\7\3\7\3\7\5\7\\\n\7\3\7\3\7\5\7`\n"+
- "\7\5\7b\n\7\3\7\3\7\6\7f\n\7\r\7\16\7g\3\7\3\7\5\7l\n\7\3\b\3\b\5\bp\n"+
- "\b\3\b\3\b\6\bt\n\b\r\b\16\bu\3\b\3\b\5\bz\n\b\3\t\3\t\3\t\3\t\7\t\u0080"+
- "\n\t\f\t\16\t\u0083\13\t\5\t\u0085\n\t\3\n\3\n\3\n\3\n\5\n\u008b\n\n\3"+
- "\13\3\13\3\13\3\13\7\13\u0091\n\13\f\13\16\13\u0094\13\13\3\f\3\f\5\f"+
- "\u0098\n\f\3\r\3\r\7\r\u009c\n\r\f\r\16\r\u009f\13\r\3\r\5\r\u00a2\n\r"+
- "\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\21"+
- "\3\21\3\21\3\21\3\21\5\21\u00b6\n\21\3\21\3\21\3\21\3\21\3\21\3\21\7\21"+
- "\u00be\n\21\f\21\16\21\u00c1\13\21\3\22\3\22\5\22\u00c5\n\22\3\23\5\23"+
- "\u00c8\n\23\3\23\3\23\3\23\3\23\3\23\7\23\u00cf\n\23\f\23\16\23\u00d2"+
- "\13\23\3\23\3\23\3\24\3\24\3\24\3\24\5\24\u00da\n\24\3\24\3\24\3\24\3"+
- "\24\3\24\3\24\3\24\3\24\3\24\3\24\7\24\u00e6\n\24\f\24\16\24\u00e9\13"+
- "\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u00f3\n\25\3\26\3\26"+
- "\3\26\3\26\3\26\7\26\u00fa\n\26\f\26\16\26\u00fd\13\26\5\26\u00ff\n\26"+
- "\3\26\3\26\3\27\3\27\3\27\3\27\5\27\u0107\n\27\3\30\3\30\3\31\3\31\3\32"+
- "\3\32\3\32\3\32\3\32\6\32\u0112\n\32\r\32\16\32\u0113\3\32\7\32\u0117"+
- "\n\32\f\32\16\32\u011a\13\32\3\33\3\33\3\34\3\34\3\34\3\35\3\35\5\35\u0123"+
- "\n\35\3\36\3\36\3\36\2\4 &\37\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 "+
- "\"$&(*,.\60\62\64\668:\2\6\3\2\27\30\3\2\31\33\3\2\21\26\4\2\5\5\r\r\u0135"+
- "\2<\3\2\2\2\4?\3\2\2\2\6B\3\2\2\2\bM\3\2\2\2\nO\3\2\2\2\fX\3\2\2\2\16"+
- "m\3\2\2\2\20{\3\2\2\2\22\u0086\3\2\2\2\24\u008c\3\2\2\2\26\u0095\3\2\2"+
- "\2\30\u0099\3\2\2\2\32\u00a3\3\2\2\2\34\u00a7\3\2\2\2\36\u00ab\3\2\2\2"+
- " \u00b5\3\2\2\2\"\u00c2\3\2\2\2$\u00c7\3\2\2\2&\u00d9\3\2\2\2(\u00f2\3"+
- "\2\2\2*\u00f4\3\2\2\2,\u0106\3\2\2\2.\u0108\3\2\2\2\60\u010a\3\2\2\2\62"+
- "\u010c\3\2\2\2\64\u011b\3\2\2\2\66\u011d\3\2\2\28\u0122\3\2\2\2:\u0124"+
- "\3\2\2\2<=\5\6\4\2=>\7\2\2\3>\3\3\2\2\2?@\5\36\20\2@A\7\2\2\3A\5\3\2\2"+
- "\2BG\5\b\5\2CD\7\"\2\2DF\5\20\t\2EC\3\2\2\2FI\3\2\2\2GE\3\2\2\2GH\3\2"+
- "\2\2H\7\3\2\2\2IG\3\2\2\2JN\5\f\7\2KN\5\16\b\2LN\5\34\17\2MJ\3\2\2\2M"+
- "K\3\2\2\2ML\3\2\2\2N\t\3\2\2\2OP\7\20\2\2PU\5\22\n\2QR\7\35\2\2RT\5\22"+
- "\n\2SQ\3\2\2\2TW\3\2\2\2US\3\2\2\2UV\3\2\2\2V\13\3\2\2\2WU\3\2\2\2Xa\7"+
- "\f\2\2Y[\5\24\13\2Z\\\5\n\6\2[Z\3\2\2\2[\\\3\2\2\2\\b\3\2\2\2]_\5\n\6"+
- "\2^`\5\24\13\2_^\3\2\2\2_`\3\2\2\2`b\3\2\2\2aY\3\2\2\2a]\3\2\2\2ab\3\2"+
- "\2\2bc\3\2\2\2ce\5\30\r\2df\5\30\r\2ed\3\2\2\2fg\3\2\2\2ge\3\2\2\2gh\3"+
- "\2\2\2hk\3\2\2\2ij\7\16\2\2jl\5\30\r\2ki\3\2\2\2kl\3\2\2\2l\r\3\2\2\2"+
- "mo\7\7\2\2np\5\24\13\2on\3\2\2\2op\3\2\2\2pq\3\2\2\2qs\5\26\f\2rt\5\26"+
- "\f\2sr\3\2\2\2tu\3\2\2\2us\3\2\2\2uv\3\2\2\2vy\3\2\2\2wx\7\16\2\2xz\5"+
- "\26\f\2yw\3\2\2\2yz\3\2\2\2z\17\3\2\2\2{\u0084\7\'\2\2|\u0081\5 \21\2"+
- "}~\7\35\2\2~\u0080\5 \21\2\177}\3\2\2\2\u0080\u0083\3\2\2\2\u0081\177"+
- "\3\2\2\2\u0081\u0082\3\2\2\2\u0082\u0085\3\2\2\2\u0083\u0081\3\2\2\2\u0084"+
- "|\3\2\2\2\u0084\u0085\3\2\2\2\u0085\21\3\2\2\2\u0086\u0087\7\'\2\2\u0087"+
- "\u008a\7\21\2\2\u0088\u008b\5\36\20\2\u0089\u008b\5\66\34\2\u008a\u0088"+
- "\3\2\2\2\u008a\u0089\3\2\2\2\u008b\23\3\2\2\2\u008c\u008d\7\4\2\2\u008d"+
- "\u0092\5\36\20\2\u008e\u008f\7\35\2\2\u008f\u0091\5\36\20\2\u0090\u008e"+
- "\3\2\2\2\u0091\u0094\3\2\2\2\u0092\u0090\3\2\2\2\u0092\u0093\3\2\2\2\u0093"+
- "\25\3\2\2\2\u0094\u0092\3\2\2\2\u0095\u0097\5\32\16\2\u0096\u0098\5\24"+
- "\13\2\u0097\u0096\3\2\2\2\u0097\u0098\3\2\2\2\u0098\27\3\2\2\2\u0099\u009d"+
- "\5\32\16\2\u009a\u009c\5\22\n\2\u009b\u009a\3\2\2\2\u009c\u009f\3\2\2"+
- "\2\u009d\u009b\3\2\2\2\u009d\u009e\3\2\2\2\u009e\u00a1\3\2\2\2\u009f\u009d"+
- "\3\2\2\2\u00a0\u00a2\5\24\13\2\u00a1\u00a0\3\2\2\2\u00a1\u00a2\3\2\2\2"+
- "\u00a2\31\3\2\2\2\u00a3\u00a4\7\36\2\2\u00a4\u00a5\5\34\17\2\u00a5\u00a6"+
- "\7\37\2\2\u00a6\33\3\2\2\2\u00a7\u00a8\5\64\33\2\u00a8\u00a9\7\17\2\2"+
- "\u00a9\u00aa\5\36\20\2\u00aa\35\3\2\2\2\u00ab\u00ac\5 \21\2\u00ac\37\3"+
- "\2\2\2\u00ad\u00ae\b\21\1\2\u00ae\u00af\7\b\2\2\u00af\u00b6\5 \21\7\u00b0"+
- "\u00b1\5\64\33\2\u00b1\u00b2\7\n\2\2\u00b2\u00b3\5\32\16\2\u00b3\u00b6"+
- "\3\2\2\2\u00b4\u00b6\5\"\22\2\u00b5\u00ad\3\2\2\2\u00b5\u00b0\3\2\2\2"+
- "\u00b5\u00b4\3\2\2\2\u00b6\u00bf\3\2\2\2\u00b7\u00b8\f\4\2\2\u00b8\u00b9"+
- "\7\3\2\2\u00b9\u00be\5 \21\5\u00ba\u00bb\f\3\2\2\u00bb\u00bc\7\13\2\2"+
- "\u00bc\u00be\5 \21\4\u00bd\u00b7\3\2\2\2\u00bd\u00ba\3\2\2\2\u00be\u00c1"+
- "\3\2\2\2\u00bf\u00bd\3\2\2\2\u00bf\u00c0\3\2\2\2\u00c0!\3\2\2\2\u00c1"+
- "\u00bf\3\2\2\2\u00c2\u00c4\5&\24\2\u00c3\u00c5\5$\23\2\u00c4\u00c3\3\2"+
- "\2\2\u00c4\u00c5\3\2\2\2\u00c5#\3\2\2\2\u00c6\u00c8\7\b\2\2\u00c7\u00c6"+
- "\3\2\2\2\u00c7\u00c8\3\2\2\2\u00c8\u00c9\3\2\2\2\u00c9\u00ca\7\6\2\2\u00ca"+
- "\u00cb\7 \2\2\u00cb\u00d0\5&\24\2\u00cc\u00cd\7\35\2\2\u00cd\u00cf\5&"+
- "\24\2\u00ce\u00cc\3\2\2\2\u00cf\u00d2\3\2\2\2\u00d0\u00ce\3\2\2\2\u00d0"+
- "\u00d1\3\2\2\2\u00d1\u00d3\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d3\u00d4\7!"+
- "\2\2\u00d4%\3\2\2\2\u00d5\u00d6\b\24\1\2\u00d6\u00da\5(\25\2\u00d7\u00d8"+
- "\t\2\2\2\u00d8\u00da\5&\24\6\u00d9\u00d5\3\2\2\2\u00d9\u00d7\3\2\2\2\u00da"+
- "\u00e7\3\2\2\2\u00db\u00dc\f\5\2\2\u00dc\u00dd\t\3\2\2\u00dd\u00e6\5&"+
- "\24\6\u00de\u00df\f\4\2\2\u00df\u00e0\t\2\2\2\u00e0\u00e6\5&\24\5\u00e1"+
- "\u00e2\f\3\2\2\u00e2\u00e3\5.\30\2\u00e3\u00e4\5&\24\4\u00e4\u00e6\3\2"+
- "\2\2\u00e5\u00db\3\2\2\2\u00e5\u00de\3\2\2\2\u00e5\u00e1\3\2\2\2\u00e6"+
- "\u00e9\3\2\2\2\u00e7\u00e5\3\2\2\2\u00e7\u00e8\3\2\2\2\u00e8\'\3\2\2\2"+
- "\u00e9\u00e7\3\2\2\2\u00ea\u00f3\5,\27\2\u00eb\u00f3\5*\26\2\u00ec\u00f3"+
- "\5\62\32\2\u00ed\u00f3\7#\2\2\u00ee\u00ef\7 \2\2\u00ef\u00f0\5\36\20\2"+
- "\u00f0\u00f1\7!\2\2\u00f1\u00f3\3\2\2\2\u00f2\u00ea\3\2\2\2\u00f2\u00eb"+
- "\3\2\2\2\u00f2\u00ec\3\2\2\2\u00f2\u00ed\3\2\2\2\u00f2\u00ee\3\2\2\2\u00f3"+
- ")\3\2\2\2\u00f4\u00f5\5\64\33\2\u00f5\u00fe\7 \2\2\u00f6\u00fb\5\36\20"+
- "\2\u00f7\u00f8\7\35\2\2\u00f8\u00fa\5\36\20\2\u00f9\u00f7\3\2\2\2\u00fa"+
- "\u00fd\3\2\2\2\u00fb\u00f9\3\2\2\2\u00fb\u00fc\3\2\2\2\u00fc\u00ff\3\2"+
- "\2\2\u00fd\u00fb\3\2\2\2\u00fe\u00f6\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff"+
- "\u0100\3\2\2\2\u0100\u0101\7!\2\2\u0101+\3\2\2\2\u0102\u0107\7\t\2\2\u0103"+
- "\u0107\58\35\2\u0104\u0107\5\60\31\2\u0105\u0107\5:\36\2\u0106\u0102\3"+
- "\2\2\2\u0106\u0103\3\2\2\2\u0106\u0104\3\2\2\2\u0106\u0105\3\2\2\2\u0107"+
- "-\3\2\2\2\u0108\u0109\t\4\2\2\u0109/\3\2\2\2\u010a\u010b\t\5\2\2\u010b"+
- "\61\3\2\2\2\u010c\u0118\5\64\33\2\u010d\u010e\7\34\2\2\u010e\u0117\5\64"+
- "\33\2\u010f\u0111\7\36\2\2\u0110\u0112\7%\2\2\u0111\u0110\3\2\2\2\u0112"+
- "\u0113\3\2\2\2\u0113\u0111\3\2\2\2\u0113\u0114\3\2\2\2\u0114\u0115\3\2"+
- "\2\2\u0115\u0117\7\37\2\2\u0116\u010d\3\2\2\2\u0116\u010f\3\2\2\2\u0117"+
- "\u011a\3\2\2\2\u0118\u0116\3\2\2\2\u0118\u0119\3\2\2\2\u0119\63\3\2\2"+
- "\2\u011a\u0118\3\2\2\2\u011b\u011c\7\'\2\2\u011c\65\3\2\2\2\u011d\u011e"+
- "\58\35\2\u011e\u011f\7\'\2\2\u011f\67\3\2\2\2\u0120\u0123\7&\2\2\u0121"+
- "\u0123\7%\2\2\u0122\u0120\3\2\2\2\u0122\u0121\3\2\2\2\u01239\3\2\2\2\u0124"+
- "\u0125\7$\2\2\u0125;\3\2\2\2%GMU[_agkouy\u0081\u0084\u008a\u0092\u0097"+
- "\u009d\u00a1\u00b5\u00bd\u00bf\u00c4\u00c7\u00d0\u00d9\u00e5\u00e7\u00f2"+
- "\u00fb\u00fe\u0106\u0113\u0116\u0118\u0122";
+ "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\3\2\3\2\3\2\3\3\3\3\3\3\3\4\3"+
+ "\4\3\4\7\4D\n\4\f\4\16\4G\13\4\3\5\3\5\3\5\5\5L\n\5\3\6\3\6\3\6\3\6\3"+
+ "\6\3\7\3\7\3\7\5\7V\n\7\3\7\3\7\5\7Z\n\7\5\7\\\n\7\3\7\3\7\6\7`\n\7\r"+
+ "\7\16\7a\3\7\3\7\5\7f\n\7\3\b\3\b\5\bj\n\b\3\b\3\b\6\bn\n\b\r\b\16\bo"+
+ "\3\b\3\b\5\bt\n\b\3\t\3\t\3\t\3\t\7\tz\n\t\f\t\16\t}\13\t\5\t\177\n\t"+
+ "\3\n\3\n\3\n\3\n\7\n\u0085\n\n\f\n\16\n\u0088\13\n\3\13\3\13\5\13\u008c"+
+ "\n\13\3\f\3\f\3\f\3\f\5\f\u0092\n\f\5\f\u0094\n\f\3\f\5\f\u0097\n\f\3"+
+ "\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\17\3\17\3\20\3\20\3\20\3\20\3\20"+
+ "\3\20\3\20\3\20\5\20\u00ab\n\20\3\20\3\20\3\20\3\20\3\20\3\20\7\20\u00b3"+
+ "\n\20\f\20\16\20\u00b6\13\20\3\21\3\21\5\21\u00ba\n\21\3\22\5\22\u00bd"+
+ "\n\22\3\22\3\22\3\22\3\22\3\22\7\22\u00c4\n\22\f\22\16\22\u00c7\13\22"+
+ "\3\22\3\22\3\23\3\23\3\23\3\23\5\23\u00cf\n\23\3\23\3\23\3\23\3\23\3\23"+
+ "\3\23\3\23\3\23\3\23\3\23\7\23\u00db\n\23\f\23\16\23\u00de\13\23\3\24"+
+ "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u00e8\n\24\3\25\3\25\3\25\3\25"+
+ "\3\25\7\25\u00ef\n\25\f\25\16\25\u00f2\13\25\5\25\u00f4\n\25\3\25\3\25"+
+ "\3\26\3\26\3\26\3\26\5\26\u00fc\n\26\3\27\3\27\3\30\3\30\3\31\3\31\3\31"+
+ "\3\31\3\31\6\31\u0107\n\31\r\31\16\31\u0108\3\31\7\31\u010c\n\31\f\31"+
+ "\16\31\u010f\13\31\3\32\3\32\3\33\3\33\5\33\u0115\n\33\3\34\3\34\5\34"+
+ "\u0119\n\34\3\35\3\35\3\35\2\4\36$\36\2\4\6\b\n\f\16\20\22\24\26\30\32"+
+ "\34\36 \"$&(*,.\60\62\64\668\2\6\3\2\31\32\3\2\33\35\3\2\23\30\4\2\5\5"+
+ "\17\17\u012c\2:\3\2\2\2\4=\3\2\2\2\6@\3\2\2\2\bK\3\2\2\2\nM\3\2\2\2\f"+
+ "R\3\2\2\2\16g\3\2\2\2\20u\3\2\2\2\22\u0080\3\2\2\2\24\u0089\3\2\2\2\26"+
+ "\u008d\3\2\2\2\30\u0098\3\2\2\2\32\u009c\3\2\2\2\34\u00a0\3\2\2\2\36\u00aa"+
+ "\3\2\2\2 \u00b7\3\2\2\2\"\u00bc\3\2\2\2$\u00ce\3\2\2\2&\u00e7\3\2\2\2"+
+ "(\u00e9\3\2\2\2*\u00fb\3\2\2\2,\u00fd\3\2\2\2.\u00ff\3\2\2\2\60\u0101"+
+ "\3\2\2\2\62\u0110\3\2\2\2\64\u0112\3\2\2\2\66\u0118\3\2\2\28\u011a\3\2"+
+ "\2\2:;\5\6\4\2;<\7\2\2\3<\3\3\2\2\2=>\5\34\17\2>?\7\2\2\3?\5\3\2\2\2@"+
+ "E\5\b\5\2AB\7$\2\2BD\5\20\t\2CA\3\2\2\2DG\3\2\2\2EC\3\2\2\2EF\3\2\2\2"+
+ "F\7\3\2\2\2GE\3\2\2\2HL\5\f\7\2IL\5\16\b\2JL\5\32\16\2KH\3\2\2\2KI\3\2"+
+ "\2\2KJ\3\2\2\2L\t\3\2\2\2MN\7\22\2\2NO\7\t\2\2OP\7\23\2\2PQ\5\64\33\2"+
+ "Q\13\3\2\2\2R[\7\16\2\2SU\5\22\n\2TV\5\n\6\2UT\3\2\2\2UV\3\2\2\2V\\\3"+
+ "\2\2\2WY\5\n\6\2XZ\5\22\n\2YX\3\2\2\2YZ\3\2\2\2Z\\\3\2\2\2[S\3\2\2\2["+
+ "W\3\2\2\2[\\\3\2\2\2\\]\3\2\2\2]_\5\26\f\2^`\5\26\f\2_^\3\2\2\2`a\3\2"+
+ "\2\2a_\3\2\2\2ab\3\2\2\2be\3\2\2\2cd\7\20\2\2df\5\26\f\2ec\3\2\2\2ef\3"+
+ "\2\2\2f\r\3\2\2\2gi\7\b\2\2hj\5\22\n\2ih\3\2\2\2ij\3\2\2\2jk\3\2\2\2k"+
+ "m\5\24\13\2ln\5\24\13\2ml\3\2\2\2no\3\2\2\2om\3\2\2\2op\3\2\2\2ps\3\2"+
+ "\2\2qr\7\20\2\2rt\5\24\13\2sq\3\2\2\2st\3\2\2\2t\17\3\2\2\2u~\7)\2\2v"+
+ "{\5\36\20\2wx\7\37\2\2xz\5\36\20\2yw\3\2\2\2z}\3\2\2\2{y\3\2\2\2{|\3\2"+
+ "\2\2|\177\3\2\2\2}{\3\2\2\2~v\3\2\2\2~\177\3\2\2\2\177\21\3\2\2\2\u0080"+
+ "\u0081\7\4\2\2\u0081\u0086\5\34\17\2\u0082\u0083\7\37\2\2\u0083\u0085"+
+ "\5\34\17\2\u0084\u0082\3\2\2\2\u0085\u0088\3\2\2\2\u0086\u0084\3\2\2\2"+
+ "\u0086\u0087\3\2\2\2\u0087\23\3\2\2\2\u0088\u0086\3\2\2\2\u0089\u008b"+
+ "\5\30\r\2\u008a\u008c\5\22\n\2\u008b\u008a\3\2\2\2\u008b\u008c\3\2\2\2"+
+ "\u008c\25\3\2\2\2\u008d\u0093\5\30\r\2\u008e\u0091\7\6\2\2\u008f\u0090"+
+ "\7\23\2\2\u0090\u0092\5.\30\2\u0091\u008f\3\2\2\2\u0091\u0092\3\2\2\2"+
+ "\u0092\u0094\3\2\2\2\u0093\u008e\3\2\2\2\u0093\u0094\3\2\2\2\u0094\u0096"+
+ "\3\2\2\2\u0095\u0097\5\22\n\2\u0096\u0095\3\2\2\2\u0096\u0097\3\2\2\2"+
+ "\u0097\27\3\2\2\2\u0098\u0099\7 \2\2\u0099\u009a\5\32\16\2\u009a\u009b"+
+ "\7!\2\2\u009b\31\3\2\2\2\u009c\u009d\5\62\32\2\u009d\u009e\7\21\2\2\u009e"+
+ "\u009f\5\34\17\2\u009f\33\3\2\2\2\u00a0\u00a1\5\36\20\2\u00a1\35\3\2\2"+
+ "\2\u00a2\u00a3\b\20\1\2\u00a3\u00a4\7\n\2\2\u00a4\u00ab\5\36\20\7\u00a5"+
+ "\u00a6\5\62\32\2\u00a6\u00a7\7\f\2\2\u00a7\u00a8\5\30\r\2\u00a8\u00ab"+
+ "\3\2\2\2\u00a9\u00ab\5 \21\2\u00aa\u00a2\3\2\2\2\u00aa\u00a5\3\2\2\2\u00aa"+
+ "\u00a9\3\2\2\2\u00ab\u00b4\3\2\2\2\u00ac\u00ad\f\4\2\2\u00ad\u00ae\7\3"+
+ "\2\2\u00ae\u00b3\5\36\20\5\u00af\u00b0\f\3\2\2\u00b0\u00b1\7\r\2\2\u00b1"+
+ "\u00b3\5\36\20\4\u00b2\u00ac\3\2\2\2\u00b2\u00af\3\2\2\2\u00b3\u00b6\3"+
+ "\2\2\2\u00b4\u00b2\3\2\2\2\u00b4\u00b5\3\2\2\2\u00b5\37\3\2\2\2\u00b6"+
+ "\u00b4\3\2\2\2\u00b7\u00b9\5$\23\2\u00b8\u00ba\5\"\22\2\u00b9\u00b8\3"+
+ "\2\2\2\u00b9\u00ba\3\2\2\2\u00ba!\3\2\2\2\u00bb\u00bd\7\n\2\2\u00bc\u00bb"+
+ "\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00be\3\2\2\2\u00be\u00bf\7\7\2\2\u00bf"+
+ "\u00c0\7\"\2\2\u00c0\u00c5\5$\23\2\u00c1\u00c2\7\37\2\2\u00c2\u00c4\5"+
+ "$\23\2\u00c3\u00c1\3\2\2\2\u00c4\u00c7\3\2\2\2\u00c5\u00c3\3\2\2\2\u00c5"+
+ "\u00c6\3\2\2\2\u00c6\u00c8\3\2\2\2\u00c7\u00c5\3\2\2\2\u00c8\u00c9\7#"+
+ "\2\2\u00c9#\3\2\2\2\u00ca\u00cb\b\23\1\2\u00cb\u00cf\5&\24\2\u00cc\u00cd"+
+ "\t\2\2\2\u00cd\u00cf\5$\23\6\u00ce\u00ca\3\2\2\2\u00ce\u00cc\3\2\2\2\u00cf"+
+ "\u00dc\3\2\2\2\u00d0\u00d1\f\5\2\2\u00d1\u00d2\t\3\2\2\u00d2\u00db\5$"+
+ "\23\6\u00d3\u00d4\f\4\2\2\u00d4\u00d5\t\2\2\2\u00d5\u00db\5$\23\5\u00d6"+
+ "\u00d7\f\3\2\2\u00d7\u00d8\5,\27\2\u00d8\u00d9\5$\23\4\u00d9\u00db\3\2"+
+ "\2\2\u00da\u00d0\3\2\2\2\u00da\u00d3\3\2\2\2\u00da\u00d6\3\2\2\2\u00db"+
+ "\u00de\3\2\2\2\u00dc\u00da\3\2\2\2\u00dc\u00dd\3\2\2\2\u00dd%\3\2\2\2"+
+ "\u00de\u00dc\3\2\2\2\u00df\u00e8\5*\26\2\u00e0\u00e8\5(\25\2\u00e1\u00e8"+
+ "\5\60\31\2\u00e2\u00e8\7%\2\2\u00e3\u00e4\7\"\2\2\u00e4\u00e5\5\34\17"+
+ "\2\u00e5\u00e6\7#\2\2\u00e6\u00e8\3\2\2\2\u00e7\u00df\3\2\2\2\u00e7\u00e0"+
+ "\3\2\2\2\u00e7\u00e1\3\2\2\2\u00e7\u00e2\3\2\2\2\u00e7\u00e3\3\2\2\2\u00e8"+
+ "\'\3\2\2\2\u00e9\u00ea\5\62\32\2\u00ea\u00f3\7\"\2\2\u00eb\u00f0\5\34"+
+ "\17\2\u00ec\u00ed\7\37\2\2\u00ed\u00ef\5\34\17\2\u00ee\u00ec\3\2\2\2\u00ef"+
+ "\u00f2\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f4\3\2"+
+ "\2\2\u00f2\u00f0\3\2\2\2\u00f3\u00eb\3\2\2\2\u00f3\u00f4\3\2\2\2\u00f4"+
+ "\u00f5\3\2\2\2\u00f5\u00f6\7#\2\2\u00f6)\3\2\2\2\u00f7\u00fc\7\13\2\2"+
+ "\u00f8\u00fc\5\66\34\2\u00f9\u00fc\5.\30\2\u00fa\u00fc\58\35\2\u00fb\u00f7"+
+ "\3\2\2\2\u00fb\u00f8\3\2\2\2\u00fb\u00f9\3\2\2\2\u00fb\u00fa\3\2\2\2\u00fc"+
+ "+\3\2\2\2\u00fd\u00fe\t\4\2\2\u00fe-\3\2\2\2\u00ff\u0100\t\5\2\2\u0100"+
+ "/\3\2\2\2\u0101\u010d\5\62\32\2\u0102\u0103\7\36\2\2\u0103\u010c\5\62"+
+ "\32\2\u0104\u0106\7 \2\2\u0105\u0107\7\'\2\2\u0106\u0105\3\2\2\2\u0107"+
+ "\u0108\3\2\2\2\u0108\u0106\3\2\2\2\u0108\u0109\3\2\2\2\u0109\u010a\3\2"+
+ "\2\2\u010a\u010c\7!\2\2\u010b\u0102\3\2\2\2\u010b\u0104\3\2\2\2\u010c"+
+ "\u010f\3\2\2\2\u010d\u010b\3\2\2\2\u010d\u010e\3\2\2\2\u010e\61\3\2\2"+
+ "\2\u010f\u010d\3\2\2\2\u0110\u0111\7)\2\2\u0111\63\3\2\2\2\u0112\u0114"+
+ "\5\66\34\2\u0113\u0115\7)\2\2\u0114\u0113\3\2\2\2\u0114\u0115\3\2\2\2"+
+ "\u0115\65\3\2\2\2\u0116\u0119\7(\2\2\u0117\u0119\7\'\2\2\u0118\u0116\3"+
+ "\2\2\2\u0118\u0117\3\2\2\2\u0119\67\3\2\2\2\u011a\u011b\7&\2\2\u011b9"+
+ "\3\2\2\2%EKUY[aeios{~\u0086\u008b\u0091\u0093\u0096\u00aa\u00b2\u00b4"+
+ "\u00b9\u00bc\u00c5\u00ce\u00da\u00dc\u00e7\u00f0\u00f3\u00fb\u0108\u010b"+
+ "\u010d\u0114\u0118";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
index 29a81522f715a..f77ffa70eba88 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
@@ -35,11 +35,11 @@ interface EqlBaseVisitor extends ParseTreeVisitor {
*/
T visitQuery(EqlBaseParser.QueryContext ctx);
/**
- * Visit a parse tree produced by {@link EqlBaseParser#withParams}.
+ * Visit a parse tree produced by {@link EqlBaseParser#sequenceParams}.
* @param ctx the parse tree
* @return the visitor result
*/
- T visitWithParams(EqlBaseParser.WithParamsContext ctx);
+ T visitSequenceParams(EqlBaseParser.SequenceParamsContext ctx);
/**
* Visit a parse tree produced by {@link EqlBaseParser#sequence}.
* @param ctx the parse tree
@@ -58,12 +58,6 @@ interface EqlBaseVisitor extends ParseTreeVisitor {
* @return the visitor result
*/
T visitPipe(EqlBaseParser.PipeContext ctx);
- /**
- * Visit a parse tree produced by {@link EqlBaseParser#namedParam}.
- * @param ctx the parse tree
- * @return the visitor result
- */
- T visitNamedParam(EqlBaseParser.NamedParamContext ctx);
/**
* Visit a parse tree produced by {@link EqlBaseParser#joinKeys}.
* @param ctx the parse tree
diff --git a/x-pack/plugin/eql/src/test/resources/grammar-queries.eql b/x-pack/plugin/eql/src/test/resources/grammar-queries.eql
index 429a38d7f7172..b61901a58c712 100644
--- a/x-pack/plugin/eql/src/test/resources/grammar-queries.eql
+++ b/x-pack/plugin/eql/src/test/resources/grammar-queries.eql
@@ -253,13 +253,19 @@ sequence by f [file where true] by a,b [process where true] by c,d until [proces
sequence by unique_pid [process where true] [file where true] fork=true;
-sequence by unique_pid [process where true] [file where true] fork=1;
+// no longer supported
+//sequence by unique_pid [process where true] [file where true] fork=1;
sequence by unique_pid [process where true] [file where true] fork=false;
-sequence by unique_pid [process where true] [file where true] fork=0 [network where true];
+// no longer supported
+// sequence by unique_pid [process where true] [file where true] fork=0 [network where true];
+sequence by unique_pid [process where true] [file where true] fork [network where true];
-sequence by unique_pid [process where true] [file where true] fork=0;
+
+// no longer supported
+// sequence by unique_pid [process where true] [file where true] fork=0;
+sequence by unique_pid [process where true] [file where true] fork=true;
/* TESTS FROM
From 8ec422ec58a388e430a0550ee5fc503f56598909 Mon Sep 17 00:00:00 2001
From: Ross Wolf <31489089+rw-access@users.noreply.github.com>
Date: Fri, 17 Jan 2020 10:34:13 -0700
Subject: [PATCH 4/8] EQL: Add checks for unsupported syntax
---
x-pack/plugin/eql/src/main/antlr/EqlBase.g4 | 8 +-
.../xpack/eql/parser/EqlBaseParser.java | 126 +++---
.../xpack/eql/parser/EqlParser.java | 100 ++++-
.../xpack/eql/parser/GrammarTests.java | 27 +-
...ar-queries.eql => unsupported-queries.eql} | 369 +++---------------
.../eql/src/test/resources/valid-queries.eql | 332 ++++++++++++++++
6 files changed, 568 insertions(+), 394 deletions(-)
rename x-pack/plugin/eql/src/test/resources/{grammar-queries.eql => unsupported-queries.eql} (70%)
create mode 100644 x-pack/plugin/eql/src/test/resources/valid-queries.eql
diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
index 82686ce261994..8532c208b5b18 100644
--- a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
+++ b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
@@ -16,7 +16,7 @@ singleExpression
;
statement
- : query (PIPE pipe)*
+ : query pipe*
;
query
@@ -42,7 +42,7 @@ join
;
pipe
- : kind=IDENTIFIER (booleanExpression (COMMA booleanExpression)*)?
+ : PIPE kind=IDENTIFIER (booleanExpression (COMMA booleanExpression)*)?
;
@@ -108,14 +108,14 @@ primaryExpression
;
functionExpression
- : identifier LP (expression (COMMA expression)*)? RP
+ : name=identifier LP (expression (COMMA expression)*)? RP
;
constant
: NULL #nullLiteral
| number #numericLiteral
| booleanValue #booleanLiteral
- | string #stringLiteral
+ | string #stringLiteral
;
comparisonOperator
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
index c3b56271756f5..70fc115d8007b 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
@@ -203,10 +203,6 @@ public static class StatementContext extends ParserRuleContext {
public QueryContext query() {
return getRuleContext(QueryContext.class,0);
}
- public List PIPE() { return getTokens(EqlBaseParser.PIPE); }
- public TerminalNode PIPE(int i) {
- return getToken(EqlBaseParser.PIPE, i);
- }
public List pipe() {
return getRuleContexts(PipeContext.class);
}
@@ -241,19 +237,17 @@ public final StatementContext statement() throws RecognitionException {
{
setState(62);
query();
- setState(67);
+ setState(66);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==PIPE) {
{
{
setState(63);
- match(PIPE);
- setState(64);
pipe();
}
}
- setState(69);
+ setState(68);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -303,26 +297,26 @@ public final QueryContext query() throws RecognitionException {
QueryContext _localctx = new QueryContext(_ctx, getState());
enterRule(_localctx, 6, RULE_query);
try {
- setState(73);
+ setState(72);
switch (_input.LA(1)) {
case SEQUENCE:
enterOuterAlt(_localctx, 1);
{
- setState(70);
+ setState(69);
sequence();
}
break;
case JOIN:
enterOuterAlt(_localctx, 2);
{
- setState(71);
+ setState(70);
join();
}
break;
case IDENTIFIER:
enterOuterAlt(_localctx, 3);
{
- setState(72);
+ setState(71);
eventQuery();
}
break;
@@ -373,14 +367,14 @@ public final SequenceParamsContext sequenceParams() throws RecognitionException
try {
enterOuterAlt(_localctx, 1);
{
- setState(75);
+ setState(74);
match(WITH);
{
- setState(76);
+ setState(75);
match(MAXSPAN);
- setState(77);
+ setState(76);
match(EQ);
- setState(78);
+ setState(77);
timeUnit();
}
}
@@ -438,19 +432,19 @@ public final SequenceContext sequence() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(80);
+ setState(79);
match(SEQUENCE);
- setState(89);
+ setState(88);
switch (_input.LA(1)) {
case BY:
{
- setState(81);
+ setState(80);
((SequenceContext)_localctx).by = joinKeys();
- setState(83);
+ setState(82);
_la = _input.LA(1);
if (_la==WITH) {
{
- setState(82);
+ setState(81);
sequenceParams();
}
}
@@ -459,13 +453,13 @@ public final SequenceContext sequence() throws RecognitionException {
break;
case WITH:
{
- setState(85);
+ setState(84);
sequenceParams();
- setState(87);
+ setState(86);
_la = _input.LA(1);
if (_la==BY) {
{
- setState(86);
+ setState(85);
((SequenceContext)_localctx).by = joinKeys();
}
}
@@ -477,29 +471,29 @@ public final SequenceContext sequence() throws RecognitionException {
default:
throw new NoViableAltException(this);
}
- setState(91);
+ setState(90);
sequenceTerm();
- setState(93);
+ setState(92);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
- setState(92);
+ setState(91);
sequenceTerm();
}
}
- setState(95);
+ setState(94);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==LB );
- setState(99);
+ setState(98);
_la = _input.LA(1);
if (_la==UNTIL) {
{
- setState(97);
+ setState(96);
match(UNTIL);
- setState(98);
+ setState(97);
sequenceTerm();
}
}
@@ -556,40 +550,40 @@ public final JoinContext join() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(101);
+ setState(100);
match(JOIN);
- setState(103);
+ setState(102);
_la = _input.LA(1);
if (_la==BY) {
{
- setState(102);
+ setState(101);
((JoinContext)_localctx).by = joinKeys();
}
}
- setState(105);
+ setState(104);
joinTerm();
- setState(107);
+ setState(106);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
- setState(106);
+ setState(105);
joinTerm();
}
}
- setState(109);
+ setState(108);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==LB );
- setState(113);
+ setState(112);
_la = _input.LA(1);
if (_la==UNTIL) {
{
- setState(111);
+ setState(110);
match(UNTIL);
- setState(112);
+ setState(111);
joinTerm();
}
}
@@ -609,6 +603,7 @@ public final JoinContext join() throws RecognitionException {
public static class PipeContext extends ParserRuleContext {
public Token kind;
+ public TerminalNode PIPE() { return getToken(EqlBaseParser.PIPE, 0); }
public TerminalNode IDENTIFIER() { return getToken(EqlBaseParser.IDENTIFIER, 0); }
public List booleanExpression() {
return getRuleContexts(BooleanExpressionContext.class);
@@ -646,6 +641,8 @@ public final PipeContext pipe() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
+ setState(114);
+ match(PIPE);
setState(115);
((PipeContext)_localctx).kind = match(IDENTIFIER);
setState(124);
@@ -1825,11 +1822,12 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
}
public static class FunctionExpressionContext extends ParserRuleContext {
+ public IdentifierContext name;
+ public TerminalNode LP() { return getToken(EqlBaseParser.LP, 0); }
+ public TerminalNode RP() { return getToken(EqlBaseParser.RP, 0); }
public IdentifierContext identifier() {
return getRuleContext(IdentifierContext.class,0);
}
- public TerminalNode LP() { return getToken(EqlBaseParser.LP, 0); }
- public TerminalNode RP() { return getToken(EqlBaseParser.RP, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
@@ -1867,7 +1865,7 @@ public final FunctionExpressionContext functionExpression() throws RecognitionEx
enterOuterAlt(_localctx, 1);
{
setState(231);
- identifier();
+ ((FunctionExpressionContext)_localctx).name = identifier();
setState(232);
match(LP);
setState(241);
@@ -2524,11 +2522,11 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
"\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\3\2\3\2\3\2\3\3\3\3\3\3\3\4\3"+
- "\4\3\4\7\4D\n\4\f\4\16\4G\13\4\3\5\3\5\3\5\5\5L\n\5\3\6\3\6\3\6\3\6\3"+
- "\6\3\7\3\7\3\7\5\7V\n\7\3\7\3\7\5\7Z\n\7\5\7\\\n\7\3\7\3\7\6\7`\n\7\r"+
- "\7\16\7a\3\7\3\7\5\7f\n\7\3\b\3\b\5\bj\n\b\3\b\3\b\6\bn\n\b\r\b\16\bo"+
- "\3\b\3\b\5\bt\n\b\3\t\3\t\3\t\3\t\7\tz\n\t\f\t\16\t}\13\t\5\t\177\n\t"+
- "\3\n\3\n\3\n\3\n\7\n\u0085\n\n\f\n\16\n\u0088\13\n\3\13\3\13\5\13\u008c"+
+ "\4\7\4C\n\4\f\4\16\4F\13\4\3\5\3\5\3\5\5\5K\n\5\3\6\3\6\3\6\3\6\3\6\3"+
+ "\7\3\7\3\7\5\7U\n\7\3\7\3\7\5\7Y\n\7\5\7[\n\7\3\7\3\7\6\7_\n\7\r\7\16"+
+ "\7`\3\7\3\7\5\7e\n\7\3\b\3\b\5\bi\n\b\3\b\3\b\6\bm\n\b\r\b\16\bn\3\b\3"+
+ "\b\5\bs\n\b\3\t\3\t\3\t\3\t\3\t\7\tz\n\t\f\t\16\t}\13\t\5\t\177\n\t\3"+
+ "\n\3\n\3\n\3\n\7\n\u0085\n\n\f\n\16\n\u0088\13\n\3\13\3\13\5\13\u008c"+
"\n\13\3\f\3\f\3\f\3\f\5\f\u0092\n\f\5\f\u0094\n\f\3\f\5\f\u0097\n\f\3"+
"\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\17\3\17\3\20\3\20\3\20\3\20\3\20"+
"\3\20\3\20\3\20\5\20\u00ab\n\20\3\20\3\20\3\20\3\20\3\20\3\20\7\20\u00b3"+
@@ -2543,25 +2541,25 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
"\16\31\u010f\13\31\3\32\3\32\3\33\3\33\5\33\u0115\n\33\3\34\3\34\5\34"+
"\u0119\n\34\3\35\3\35\3\35\2\4\36$\36\2\4\6\b\n\f\16\20\22\24\26\30\32"+
"\34\36 \"$&(*,.\60\62\64\668\2\6\3\2\31\32\3\2\33\35\3\2\23\30\4\2\5\5"+
- "\17\17\u012c\2:\3\2\2\2\4=\3\2\2\2\6@\3\2\2\2\bK\3\2\2\2\nM\3\2\2\2\f"+
- "R\3\2\2\2\16g\3\2\2\2\20u\3\2\2\2\22\u0080\3\2\2\2\24\u0089\3\2\2\2\26"+
+ "\17\17\u012c\2:\3\2\2\2\4=\3\2\2\2\6@\3\2\2\2\bJ\3\2\2\2\nL\3\2\2\2\f"+
+ "Q\3\2\2\2\16f\3\2\2\2\20t\3\2\2\2\22\u0080\3\2\2\2\24\u0089\3\2\2\2\26"+
"\u008d\3\2\2\2\30\u0098\3\2\2\2\32\u009c\3\2\2\2\34\u00a0\3\2\2\2\36\u00aa"+
"\3\2\2\2 \u00b7\3\2\2\2\"\u00bc\3\2\2\2$\u00ce\3\2\2\2&\u00e7\3\2\2\2"+
"(\u00e9\3\2\2\2*\u00fb\3\2\2\2,\u00fd\3\2\2\2.\u00ff\3\2\2\2\60\u0101"+
"\3\2\2\2\62\u0110\3\2\2\2\64\u0112\3\2\2\2\66\u0118\3\2\2\28\u011a\3\2"+
"\2\2:;\5\6\4\2;<\7\2\2\3<\3\3\2\2\2=>\5\34\17\2>?\7\2\2\3?\5\3\2\2\2@"+
- "E\5\b\5\2AB\7$\2\2BD\5\20\t\2CA\3\2\2\2DG\3\2\2\2EC\3\2\2\2EF\3\2\2\2"+
- "F\7\3\2\2\2GE\3\2\2\2HL\5\f\7\2IL\5\16\b\2JL\5\32\16\2KH\3\2\2\2KI\3\2"+
- "\2\2KJ\3\2\2\2L\t\3\2\2\2MN\7\22\2\2NO\7\t\2\2OP\7\23\2\2PQ\5\64\33\2"+
- "Q\13\3\2\2\2R[\7\16\2\2SU\5\22\n\2TV\5\n\6\2UT\3\2\2\2UV\3\2\2\2V\\\3"+
- "\2\2\2WY\5\n\6\2XZ\5\22\n\2YX\3\2\2\2YZ\3\2\2\2Z\\\3\2\2\2[S\3\2\2\2["+
- "W\3\2\2\2[\\\3\2\2\2\\]\3\2\2\2]_\5\26\f\2^`\5\26\f\2_^\3\2\2\2`a\3\2"+
- "\2\2a_\3\2\2\2ab\3\2\2\2be\3\2\2\2cd\7\20\2\2df\5\26\f\2ec\3\2\2\2ef\3"+
- "\2\2\2f\r\3\2\2\2gi\7\b\2\2hj\5\22\n\2ih\3\2\2\2ij\3\2\2\2jk\3\2\2\2k"+
- "m\5\24\13\2ln\5\24\13\2ml\3\2\2\2no\3\2\2\2om\3\2\2\2op\3\2\2\2ps\3\2"+
- "\2\2qr\7\20\2\2rt\5\24\13\2sq\3\2\2\2st\3\2\2\2t\17\3\2\2\2u~\7)\2\2v"+
- "{\5\36\20\2wx\7\37\2\2xz\5\36\20\2yw\3\2\2\2z}\3\2\2\2{y\3\2\2\2{|\3\2"+
- "\2\2|\177\3\2\2\2}{\3\2\2\2~v\3\2\2\2~\177\3\2\2\2\177\21\3\2\2\2\u0080"+
+ "D\5\b\5\2AC\5\20\t\2BA\3\2\2\2CF\3\2\2\2DB\3\2\2\2DE\3\2\2\2E\7\3\2\2"+
+ "\2FD\3\2\2\2GK\5\f\7\2HK\5\16\b\2IK\5\32\16\2JG\3\2\2\2JH\3\2\2\2JI\3"+
+ "\2\2\2K\t\3\2\2\2LM\7\22\2\2MN\7\t\2\2NO\7\23\2\2OP\5\64\33\2P\13\3\2"+
+ "\2\2QZ\7\16\2\2RT\5\22\n\2SU\5\n\6\2TS\3\2\2\2TU\3\2\2\2U[\3\2\2\2VX\5"+
+ "\n\6\2WY\5\22\n\2XW\3\2\2\2XY\3\2\2\2Y[\3\2\2\2ZR\3\2\2\2ZV\3\2\2\2Z["+
+ "\3\2\2\2[\\\3\2\2\2\\^\5\26\f\2]_\5\26\f\2^]\3\2\2\2_`\3\2\2\2`^\3\2\2"+
+ "\2`a\3\2\2\2ad\3\2\2\2bc\7\20\2\2ce\5\26\f\2db\3\2\2\2de\3\2\2\2e\r\3"+
+ "\2\2\2fh\7\b\2\2gi\5\22\n\2hg\3\2\2\2hi\3\2\2\2ij\3\2\2\2jl\5\24\13\2"+
+ "km\5\24\13\2lk\3\2\2\2mn\3\2\2\2nl\3\2\2\2no\3\2\2\2or\3\2\2\2pq\7\20"+
+ "\2\2qs\5\24\13\2rp\3\2\2\2rs\3\2\2\2s\17\3\2\2\2tu\7$\2\2u~\7)\2\2v{\5"+
+ "\36\20\2wx\7\37\2\2xz\5\36\20\2yw\3\2\2\2z}\3\2\2\2{y\3\2\2\2{|\3\2\2"+
+ "\2|\177\3\2\2\2}{\3\2\2\2~v\3\2\2\2~\177\3\2\2\2\177\21\3\2\2\2\u0080"+
"\u0081\7\4\2\2\u0081\u0086\5\34\17\2\u0082\u0083\7\37\2\2\u0083\u0085"+
"\5\34\17\2\u0084\u0082\3\2\2\2\u0085\u0088\3\2\2\2\u0086\u0084\3\2\2\2"+
"\u0086\u0087\3\2\2\2\u0087\23\3\2\2\2\u0088\u0086\3\2\2\2\u0089\u008b"+
@@ -2614,7 +2612,7 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
"\5\66\34\2\u0113\u0115\7)\2\2\u0114\u0113\3\2\2\2\u0114\u0115\3\2\2\2"+
"\u0115\65\3\2\2\2\u0116\u0119\7(\2\2\u0117\u0119\7\'\2\2\u0118\u0116\3"+
"\2\2\2\u0118\u0117\3\2\2\2\u0119\67\3\2\2\2\u011a\u011b\7&\2\2\u011b9"+
- "\3\2\2\2%EKUY[aeios{~\u0086\u008b\u0091\u0093\u0096\u00aa\u00b2\u00b4"+
+ "\3\2\2\2%DJTXZ`dhnr{~\u0086\u008b\u0091\u0093\u0096\u00aa\u00b2\u00b4"+
"\u00b9\u00bc\u00c5\u00ce\u00da\u00dc\u00e7\u00f0\u00f3\u00fb\u0108\u010b"+
"\u010d\u0114\u0118";
public static final ATN _ATN =
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java
index 762747301ef50..ac8a723ea6324 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java
@@ -6,7 +6,6 @@
package org.elasticsearch.xpack.eql.parser;
import org.antlr.v4.runtime.BaseErrorListener;
-import org.antlr.v4.runtime.CommonToken;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.DiagnosticErrorListener;
import org.antlr.v4.runtime.Parser;
@@ -17,7 +16,6 @@
import org.antlr.v4.runtime.atn.ATNConfigSet;
import org.antlr.v4.runtime.atn.PredictionMode;
import org.antlr.v4.runtime.dfa.DFA;
-import org.antlr.v4.runtime.misc.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.antlr.v4.runtime.ANTLRInputStream;
@@ -36,7 +34,7 @@ public class EqlParser {
private static final Logger log = LogManager.getLogger();
- private final boolean DEBUG = true;
+ private final boolean DEBUG = false;
/**
* Parses an EQL statement into execution plan
@@ -127,6 +125,102 @@ private class PostProcessor extends EqlBaseBaseListener {
this.ruleNames = ruleNames;
}
+
+ @Override
+ public void exitFunctionExpression(EqlBaseParser.FunctionExpressionContext context) {
+ String functionName = context.name.getText();
+ Token token = context.name.IDENTIFIER().getSymbol();
+
+ switch (functionName) {
+ case "add":
+ case "between":
+ case "cidrMatch":
+ case "concat":
+ case "divide":
+ case "endsWith":
+ case "indexOf":
+ case "length":
+ case "match":
+ case "modulo":
+ case "multiply":
+ case "number":
+ case "startsWith":
+ case "string":
+ case "stringContains":
+ case "substring":
+ case "subtract":
+ case "wildcard":
+ break;
+
+ case "arrayContains":
+ case "arrayCount":
+ case "arraySearch":
+ throw new ParsingException(
+ "unsupported function " + functionName,
+ null,
+ token.getLine(),
+ token.getCharPositionInLine());
+
+ default:
+ throw new ParsingException(
+ "unknown function " + functionName,
+ null,
+ token.getLine(),
+ token.getCharPositionInLine());
+ }
+ }
+
+ @Override
+ public void exitJoin(EqlBaseParser.JoinContext context) {
+ Token token = context.JOIN().getSymbol();
+ throw new ParsingException(
+ "join is not supported",
+ null,
+ token.getLine(),
+ token.getCharPositionInLine());
+ }
+
+ @Override
+ public void exitPipe(EqlBaseParser.PipeContext context) {
+ Token token = context.PIPE().getSymbol();
+ throw new ParsingException(
+ "pipes are not supported",
+ null,
+ token.getLine(),
+ token.getCharPositionInLine());
+ }
+
+ @Override
+ public void exitProcessCheck(EqlBaseParser.ProcessCheckContext context) {
+ Token token = context.relationship.IDENTIFIER().getSymbol();
+ throw new ParsingException(
+ "process relationships are not supported",
+ null,
+ token.getLine(),
+ token.getCharPositionInLine());
+ }
+
+ @Override
+ public void exitSequence(EqlBaseParser.SequenceContext context) {
+ Token token = context.SEQUENCE().getSymbol();
+ throw new ParsingException(
+ "sequence is not supported",
+ null,
+ token.getLine(),
+ token.getCharPositionInLine());
+ }
+
+ @Override
+ public void exitQualifiedName(EqlBaseParser.QualifiedNameContext context) {
+ if (context.INTEGER_VALUE().size() > 0) {
+ Token firstIndex = context.INTEGER_VALUE(0).getSymbol();
+ throw new ParsingException(
+ "array indexes are not supported",
+ null,
+ firstIndex.getLine(),
+ firstIndex.getCharPositionInLine());
+ }
+ }
}
private static final BaseErrorListener ERROR_LISTENER = new BaseErrorListener() {
diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
index 3273979c60410..e2860a2e68999 100644
--- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
+++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
@@ -10,6 +10,7 @@
import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.xpack.ql.tree.Source;
+import org.junit.Assert;
import java.io.BufferedReader;
import java.io.IOException;
@@ -28,9 +29,9 @@
*/
public class GrammarTests extends ESTestCase {
- public void testGrammar() throws Exception {
+ public void testValidQueries() throws Exception {
EqlParser parser = new EqlParser();
- List> lines = readQueries("/grammar-queries.eql");
+ List> lines = readQueries("/valid-queries.eql");
for (Tuple line : lines) {
String q = line.v1();
try {
@@ -38,10 +39,28 @@ public void testGrammar() throws Exception {
} catch (ParsingException pe) {
if (pe.getErrorMessage().startsWith("Does not know how to handle")) {
// ignore for now
+ } else {
+ throw new ParsingException(new Source(pe.getLineNumber() + line.v2() - 1, pe.getColumnNumber(), q),
+ pe.getErrorMessage() + " inside statement <{}>", q);
}
- else {
+ }
+ }
+ }
+ public void testUnsupportedQueries() throws Exception {
+ EqlParser parser = new EqlParser();
+ List> lines = readQueries("/unsupported-queries.eql");
+ for (Tuple line : lines) {
+ String q = line.v1();
+ try {
+ parser.createStatement(q);
+
+ fail("Query not identified as unsupported: " + q);
+ } catch (ParsingException pe) {
+ if (pe.getErrorMessage().contains("supported")) {
+ // the error we actually expect
+ } else {
throw new ParsingException(new Source(pe.getLineNumber() + line.v2() - 1, pe.getColumnNumber(), q),
- pe.getErrorMessage() + " inside statement <{}>", q);
+ pe.getErrorMessage() + " inside statement <{}>", q);
}
}
}
diff --git a/x-pack/plugin/eql/src/test/resources/grammar-queries.eql b/x-pack/plugin/eql/src/test/resources/unsupported-queries.eql
similarity index 70%
rename from x-pack/plugin/eql/src/test/resources/grammar-queries.eql
rename to x-pack/plugin/eql/src/test/resources/unsupported-queries.eql
index b61901a58c712..477b3efd51270 100644
--- a/x-pack/plugin/eql/src/test/resources/grammar-queries.eql
+++ b/x-pack/plugin/eql/src/test/resources/unsupported-queries.eql
@@ -1,14 +1,3 @@
-process where process_name == "svchost.exe" and command_line != "* -k *";
-process where process_name in ('ipconfig.exe', 'netstat.exe', 'systeminfo.exe', 'route.exe');
-process where subtype.create and wildcard(command_line, "*.ost *", "*.pst *")
-;
-
-process where subtype.create and
- process_name == "attrib.exe" and command_line == "* +h*"
-;
-
-file where file_name == "*Library/Preferences/*.plist";
-
//
// Pipes
@@ -96,67 +85,7 @@ until [process where event_subtype_full == "termination_event"]
-/* UNIT TESTS FROM
- * https://github.com/endgameinc/eql/blob/master/tests/test_parser.py
- */
-
-file where true;
-
-file where true and true;
-
-file where false or true;
-
-registry where not pid;
-
-process where process_name == "net.exe" and command_line == "* user*.exe";
-
-process where command_line == "~!@#$%^&*();'[]{}\\|<>?,./:\"-= ' ";
-
-process where
-
- pid == 4;
-
-process where process_name in ("net.exe", "cmd.exe", "at.exe");
-
-process where command_line == "*.exe *admin*" or command_line == "* a b*";
-
-process where pid in (1,2,3,4,5,6,7,8) and abc == 100 and def == 200 and ghi == 300 and jkl == x;
-
-process where ppid != pid;
-
-image_load where not x != y;
-
-image_load where not x == y;
-
-image_load where not not not not x < y;
-
-image_load where not x <= y;
-
-image_load where not x >= y;
-
-image_load where not x > y;
-
-process where _leadingUnderscore == 100;
-
-network where 1 * 2 + 3 * 4 + 10 / 2 == 2 + 12 + 5;
-
-file where 1 - -2;
-
-file where 1 + (-2);
-
-file where 1 * (-2);
-file where 3 * -length(file_path);
-
-network where a * b + c * d + e / f == g + h + i;
-
-network where a * (b + c * d) + e / f == g + h + i;
-
-process where pid == 4 or pid == 5 or pid == 6 or pid == 7 or pid == 8;
-
-network where pid == 0 or pid == 4 or (ppid == 0 or ppid = 4) or (abc == defgh) and process_name == "*" ;
-
-network where pid = 4;
process where descendant of [process where process_name == "lsass.exe"] and process_name == "cmd.exe";
@@ -201,21 +130,7 @@ process where 1==1 | count user_name, unique_pid, concat(field2,a,bc);
process where 1==1 | unique user_name, concat(field2,a,bc), field2;
-registry where a.b;
-
-registry where a[0];
-
-registry where a.b.c.d.e;
-
-registry where a.b.c[0];
-
-registry where a[0].b;
-
-registry where a[0][1].b;
-
-registry where a[0].b[1];
-registry where topField.subField[100].subsubField == 0;
process where true | filter true;
@@ -225,7 +140,10 @@ process where 1==1 | filter abc == def and 1 != 2;
process where 1==1 | count process_name | filter percent > 0.5;
-process where a > 100000000000000000000000000000000;
+
+
+
+
any where true | unique a, b, c | sort a, b, c | count;
@@ -268,24 +186,17 @@ sequence by unique_pid [process where true] [file where true] fork [network wher
sequence by unique_pid [process where true] [file where true] fork=true;
-/* TESTS FROM
- * https://raw.githubusercontent.com/endgameinc/eql/master/eql/etc/test_queries.toml
- */
-process where serial_event_id = 1;
-process where serial_event_id < 4;
-process where true | head 6;
-process where false;
-process where missing_field != null;
+/* TESTS FROM
+ * https://raw.githubusercontent.com/endgameinc/eql/master/eql/etc/test_queries.toml
+ */
+process where true | head 6;
process where bad_field == null | head 5;
-process where process_name == "impossible name" or (serial_event_id < 4.5 and serial_event_id >= 3.1)
-;
-
process where serial_event_id <= 8 and serial_event_id > 7
| filter serial_event_id == 8;
@@ -305,43 +216,21 @@ process where true
| tail 2
;
-process where serial_event_id<=8 and serial_event_id > 7
-;
-
-process where exit_code >= 0;
-
-process where 0 <= exit_code;
-
-process where exit_code <= 0;
-
-process where exit_code < 1;
-
-process where exit_code > -1;
-
-process where -1 < exit_code;
process where not (exit_code > -1)
and serial_event_id in (58, 64, 69, 74, 80, 85, 90, 93, 94)
| head 10
;
+
process where not (exit_code > -1) | head 7;
process where not (-1 < exit_code) | head 7;
-process where exit_code > 0;
-
-process where exit_code < 0;
-
-process where 0 < exit_code;
-
-process where 0 > exit_code;
-process where (serial_event_id<=8 and serial_event_id > 7) and (opcode=3 and opcode>2);
+process where process_name == "VMACTHLP.exe" and unique_pid == 12 | filter true;
-process where (serial_event_id<9 and serial_event_id >= 7) or (opcode == pid);
-process where process_name == "VMACTHLP.exe" and unique_pid == 12 | filter true;
process where process_name in ("python.exe", "SMSS.exe", "explorer.exe")
| unique process_name;
@@ -375,11 +264,8 @@ process where process_name in ("python.exe", "smss.exe")
| head 5
| unique process_name, parent_process_name;
-registry where length(bytes_written_string_list) == 2 and bytes_written_string_list[1] == "EN";
-registry where key_path == "*\\MACHINE\\SAM\\SAM\\*\\Account\\Us*ers\\00*03E9\\F";
-process where process_path == "*\\red_ttp\\wininit.*" and opcode in (0,1,2,3,4);
file where file_name == "csrss.exe" and opcode=0
and descendant of [process where opcode in (1,3) and process_name="cmd.exe"]
@@ -398,26 +284,12 @@ process where opcode=1 and process_name == "smss.exe"
]
;
-file where file_path="*\\red_ttp\\winin*.*"
- and opcode in (0,1,2) and user_name="vagrant"
-;
-
-file where file_path="*\\red_ttp\\winin*.*"
- and opcode not in (0,1,2) and user_name="vagrant"
-;
-
-file where file_path="*\\red_ttp\\winin*.*"
- and opcode not in (3, 4, 5, 6 ,7) and user_name="vagrant"
-;
-file where file_name in ("wininit.exe", "lsass.exe") and opcode == 2
-;
file where true
| tail 3;
-process where opcode in (1,3) and process_name in (parent_process_name, "SYSTEM")
-;
+
file where true
| tail 4
@@ -606,28 +478,12 @@ join
[process where opcode in (1,3) and process_name == "smss.exe"]
;
-process where fake_field == "*";
-
-process where fake_field != "*"
-| head 4;
-
-process where not (fake_field == "*")
-| head 4;
-
-registry where invalid_field_name != null;
-
-registry where length(bad_field) > 0
-;
-
-process where opcode == 1
- and process_name in ("net.exe", "net1.exe")
- and not (parent_process_name == "net.exe"
- and process_name == "net1.exe")
- and command_line == "*group *admin*" and command_line != "* /add*";
any where true
| unique event_type_full;
+
+
process where opcode=1 and process_name in ("services.exe", "smss.exe", "lsass.exe")
and descendant of [process where process_name == "cmd.exe" ];
@@ -664,7 +520,9 @@ file where process_name = "python.exe"
file where event of [process where process_name = "python.exe" ]
| unique unique_pid;
-process where process_name = "python.exe";
+
+
+
process where event of [process where process_name = "python.exe" ];
@@ -720,55 +578,8 @@ sequence
[process where true] by unique_ppid
| head 4;
-process where command_line == "*%*" ;
-
-process where command_line == "*%*%*" ;
-
-process where command_line == "%*%*" ;
-any where process_name == "svchost.exe"
-| unique_count event_type_full, process_name;
-
-any where process_name == "svchost.exe"
-| sort event_type_full, serial_event_id
-| unique_count event_type_full, process_name;
-
-any where process_name == "svchost.exe"
-| unique_count event_type_full, opcode
-| filter count == 7;
-any where process_name == "svchost.exe"
-| unique_count event_type_full, opcode
-| filter percent >= .5
-;
-
-registry where arrayContains(bytes_written_string_list, 'En-uS');
-
-registry where arrayContains(bytes_written_string_list, 'En');
-
-registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] == 'EN-us'
-;
-
-registry where bytes_written_string_list[0] == 'EN-us'
-;
-
-registry where bytes_written_string_list[1] == 'EN'
-;
-
-process where matchLite(?'.*?net1\s+localgroup\s+.*?', command_line)
-;
-
-process where matchLite(?'.*?net1\s+\w+\s+.*?', command_line)
-;
-
-process where matchLite(?'.*?net1\s+\w{4,15}\s+.*?', command_line)
-;
-
-process where match(?'.*?net1\s+\w{4,15}\s+.*?', command_line)
-;
-
-process where matchLite(?'.*?net1\s+[localgrup]{4,15}\s+.*?', command_line)
-;
process where 'net.EXE' == original_file_name
| filter process_name="net*.exe"
@@ -782,84 +593,52 @@ process where original_file_name == process_name
| filter length(original_file_name) > 0
;
-file where opcode=0 and startsWith(file_name, 'exploRER.')
-;
-
-file where opcode=0 and startsWith(file_name, 'expLORER.exe')
-;
-
-file where opcode=0 and endsWith(file_name, 'loREr.exe');
-
-file where opcode=0 and startsWith(file_name, 'explORER.EXE');
-file where opcode=0 and startsWith('explorer.exeaaaaaaaa', file_name);
-file where opcode=0 and serial_event_id = 88 and startsWith('explorer.exeaAAAA', 'EXPLORER.exe');
-
-file where opcode=0 and stringContains('ABCDEFGHIexplorer.exeJKLMNOP', file_name)
-;
-
-file where opcode=0 and indexOf(file_name, 'plore') == 2 and not indexOf(file_name, '.pf')
-;
-
-file where opcode=0 and indexOf(file_name, 'explorer.') and indexOf(file_name, 'plore', 100)
-;
+process where process_name != original_file_name
+| filter length(original_file_name) > 0;
-file where opcode=0 and indexOf(file_name, 'plorer.', 0) == 2;
-file where opcode=0 and indexOf(file_name, 'plorer.', 2);
-file where opcode=0 and indexOf(file_name, 'plorer.', 4);
-file where opcode=0 and indexOf(file_name, 'thing that never happened');
+sequence by unique_pid [process where opcode=1 and process_name == 'msbuild.exe'] [network where true];
-file where opcode=0 and indexOf(file_name, 'plorer.', 2) == 2;
+process where fake_field != "*"
+| head 4;
-file where opcode=0 and indexOf(file_name, 'explorer.', 0) == 0;
+process where not (fake_field == "*")
+| head 4;
-file where serial_event_id=88 and substring(file_name, 0, 4) == 'expl'
-;
+any where process_name == "svchost.exe"
+| unique_count event_type_full, process_name;
-file where serial_event_id=88 and substring(file_name, 1, 3) == 'xp'
-;
+any where process_name == "svchost.exe"
+| sort event_type_full, serial_event_id
+| unique_count event_type_full, process_name;
-file where serial_event_id=88 and substring(file_name, -4) == '.exe'
-;
+any where process_name == "svchost.exe"
+| unique_count event_type_full, opcode
+| filter count == 7;
-file where serial_event_id=88 and substring(file_name, -4, -1) == '.ex'
+any where process_name == "svchost.exe"
+| unique_count event_type_full, opcode
+| filter percent >= .5
;
-process where add(serial_event_id, 0) == 1 and add(0, 1) == serial_event_id;
-
-process where subtract(serial_event_id, -5) == 6;
-process where multiply(6, serial_event_id) == 30 and divide(30, 4.0) == 7.5;
-
-process where modulo(11, add(serial_event_id, 1)) == serial_event_id;
-
-process where serial_event_id == number('5');
-
-process where serial_event_id == number('0x32', 16);
-
-process where serial_event_id == number('32', 16);
+// array functions
+registry where arrayContains(bytes_written_string_list, 'En-uS');
+registry where arrayContains(bytes_written_string_list, 'En');
-process where number(serial_event_id) == number(5);
-process where concat(serial_event_id, ':', process_name, opcode) == '5:winINIT.exe3'
+network where mysterious_field
+ and arraySearch(mysterious_field.subarray, s, true)
;
-process where process_name != original_file_name
-| filter length(original_file_name) > 0;
-
-sequence by unique_pid [process where opcode=1 and process_name == 'msbuild.exe'] [network where true];
-
registry where arraySearch(bytes_written_string_list, a, a == 'en-us');
registry where arraySearch(bytes_written_string_list, a, endsWith(a, '-us'));
-network where mysterious_field
- and arraySearch(mysterious_field.subarray, s, true)
-;
network where mysterious_field and arraySearch(mysterious_field.subarray, s, false)
;
@@ -890,11 +669,6 @@ network where mysterious_field
arraySearch(sub1.c, nested, nested.x.y == mysterious_field.outer_cross_match))
;
-network where safe(divide(process_name, process_name))
-;
-
-file where serial_event_id == 82 and (true == (process_name in ('svchost.EXE', 'bad.exe', 'bad2.exe')))
-;
registry where arrayCount(bytes_written_string_list, s, s == '*-us') == 1
;
@@ -905,65 +679,22 @@ registry where arrayCount(bytes_written_string_list, s, s == '*en*') == 2
registry where arrayContains(bytes_written_string_list, "missing", "en-US")
;
-file where serial_event_id - 1 == 81;
-
-file where serial_event_id + 1 == 83;
-
-file where serial_event_id * 2 == 164;
-
-file where serial_event_id / 2 == 41;
-
-file where serial_event_id % 40 == 2;
-
-process where between(process_name, "s", "e") == "yst"
-;
-
-process where between(process_name, "s", "e", false) == "yst"
-;
-
-process where between(process_name, "s", "e", false, true) == "yst"
-;
-
-process where between(process_name, "s", "e", false, true) == "t"
-;
-
-process where between(process_name, "S", "e", false, true) == "yst"
-;
-
-process where between(process_name, "s", "e", true) == "ystem Idle Proc"
-;
-
-file where between(file_path, "dev", ".json", false) == "\\testlogs\\something"
-;
-
-file where between(file_path, "dev", ".json", true) == "\\testlogs\\something"
-;
-
-network where cidrMatch(source_address, "10.6.48.157/8")
-;
-
-network where cidrMatch(source_address, "192.168.0.0/16")
-;
-
-network where cidrMatch(source_address, "192.168.0.0/16", "10.6.48.157/8")
-
-;
+// array fields
-network where cidrMatch(source_address, "0.0.0.0/0")
+registry where length(bytes_written_string_list) == 2 and bytes_written_string_list[1] == "EN";
+registry where length(bytes_written_string_list) > 0 and bytes_written_string_list[0] == 'EN-us'
;
-process where length(between(process_name, 'g', 'e')) > 0
+registry where bytes_written_string_list[0] == 'EN-us'
;
-process where length(between(process_name, 'g', 'z')) > 0
+registry where bytes_written_string_list[1] == 'EN'
;
-// additional queries added for the elasticsearch specific implementation
-// dots will still be interpreted by ES per usual
-something where `my-hyphenated-field` == "value";
-something where `my-hyphenated-field.with.nested.dots` == "value";
-something where `@timestamp` == "2020-01-01 00:00:00";
-something where `some escaped identifier` == "blah";
-something where `some escaped identifier` == "blah";
-something where `some.escaped.identifier` == "blah";
+registry where a[0];
+registry where a.b.c[0];
+registry where a[0].b;
+registry where a[0][1].b;
+registry where a[0].b[1];
+registry where topField.subField[100].subsubField == 0;
diff --git a/x-pack/plugin/eql/src/test/resources/valid-queries.eql b/x-pack/plugin/eql/src/test/resources/valid-queries.eql
new file mode 100644
index 0000000000000..20abf8ec4f33e
--- /dev/null
+++ b/x-pack/plugin/eql/src/test/resources/valid-queries.eql
@@ -0,0 +1,332 @@
+process where process_name == "svchost.exe" and command_line != "* -k *";
+process where process_name in ('ipconfig.exe', 'netstat.exe', 'systeminfo.exe', 'route.exe');
+process where subtype.create and wildcard(command_line, "*.ost *", "*.pst *")
+;
+
+process where subtype.create and
+ process_name == "attrib.exe" and command_line == "* +h*"
+;
+
+file where file_name == "*Library/Preferences/*.plist";
+
+/* UNIT TESTS FROM
+ * https://github.com/endgameinc/eql/blob/master/tests/test_parser.py
+ */
+
+file where true;
+
+file where true and true;
+
+file where false or true;
+
+registry where not pid;
+
+process where process_name == "net.exe" and command_line == "* user*.exe";
+
+process where command_line == "~!@#$%^&*();'[]{}\\|<>?,./:\"-= ' ";
+
+process where
+
+ pid == 4;
+
+process where process_name in ("net.exe", "cmd.exe", "at.exe");
+
+process where command_line == "*.exe *admin*" or command_line == "* a b*";
+
+process where pid in (1,2,3,4,5,6,7,8) and abc == 100 and def == 200 and ghi == 300 and jkl == x;
+
+process where ppid != pid;
+
+image_load where not x != y;
+
+image_load where not x == y;
+
+image_load where not not not not x < y;
+
+image_load where not x <= y;
+
+image_load where not x >= y;
+
+image_load where not x > y;
+
+process where _leadingUnderscore == 100;
+
+network where 1 * 2 + 3 * 4 + 10 / 2 == 2 + 12 + 5;
+
+file where 1 - -2;
+
+file where 1 + (-2);
+
+file where 1 * (-2);
+
+file where 3 * -length(file_path);
+
+network where a * b + c * d + e / f == g + h + i;
+
+network where a * (b + c * d) + e / f == g + h + i;
+
+process where pid == 4 or pid == 5 or pid == 6 or pid == 7 or pid == 8;
+
+network where pid == 0 or pid == 4 or (ppid == 0 or ppid = 4) or (abc == defgh) and process_name == "*" ;
+
+network where pid = 4;
+
+
+registry where a.b;
+
+registry where a.b.c.d.e;
+
+
+
+
+process where a > 100000000000000000000000000000000;
+
+
+
+/* TESTS FROM
+ * https://raw.githubusercontent.com/endgameinc/eql/master/eql/etc/test_queries.toml
+ */
+process where serial_event_id = 1;
+
+process where serial_event_id < 4;
+
+
+process where false;
+
+process where missing_field != null;
+
+process where process_name == "impossible name" or (serial_event_id < 4.5 and serial_event_id >= 3.1)
+;
+
+
+process where serial_event_id<=8 and serial_event_id > 7
+;
+
+process where exit_code >= 0;
+
+process where 0 <= exit_code;
+
+process where exit_code <= 0;
+
+process where exit_code < 1;
+
+process where exit_code > -1;
+
+process where -1 < exit_code;
+
+process where exit_code > 0;
+
+process where exit_code < 0;
+
+process where 0 < exit_code;
+
+process where 0 > exit_code;
+
+process where (serial_event_id<=8 and serial_event_id > 7) and (opcode=3 and opcode>2);
+
+process where (serial_event_id<9 and serial_event_id >= 7) or (opcode == pid);
+
+
+
+registry where key_path == "*\\MACHINE\\SAM\\SAM\\*\\Account\\Us*ers\\00*03E9\\F";
+
+process where process_path == "*\\red_ttp\\wininit.*" and opcode in (0,1,2,3,4);
+
+
+file where file_path="*\\red_ttp\\winin*.*"
+ and opcode in (0,1,2) and user_name="vagrant"
+;
+
+file where file_path="*\\red_ttp\\winin*.*"
+ and opcode not in (0,1,2) and user_name="vagrant"
+;
+
+file where file_path="*\\red_ttp\\winin*.*"
+ and opcode not in (3, 4, 5, 6 ,7) and user_name="vagrant"
+;
+
+file where file_name in ("wininit.exe", "lsass.exe") and opcode == 2
+;
+
+
+process where opcode in (1,3) and process_name in (parent_process_name, "SYSTEM")
+;
+
+
+process where fake_field == "*";
+
+
+registry where invalid_field_name != null;
+
+registry where length(bad_field) > 0
+;
+
+process where opcode == 1
+ and process_name in ("net.exe", "net1.exe")
+ and not (parent_process_name == "net.exe"
+ and process_name == "net1.exe")
+ and command_line == "*group *admin*" and command_line != "* /add*";
+
+
+
+process where process_name = "python.exe";
+
+process where command_line == "*%*" ;
+
+process where command_line == "*%*%*" ;
+
+process where command_line == "%*%*" ;
+
+
+process where match(?'.*?net1\s+localgroup\s+.*?', command_line)
+;
+
+process where match(?'.*?net1\s+\w+\s+.*?', command_line)
+;
+
+process where match(?'.*?net1\s+\w{4,15}\s+.*?', command_line)
+;
+
+process where match(?'.*?net1\s+\w{4,15}\s+.*?', command_line)
+;
+
+process where match(?'.*?net1\s+[localgrup]{4,15}\s+.*?', command_line)
+;
+
+file where opcode=0 and startsWith(file_name, 'exploRER.')
+;
+
+file where opcode=0 and startsWith(file_name, 'expLORER.exe')
+;
+
+file where opcode=0 and endsWith(file_name, 'loREr.exe');
+
+file where opcode=0 and startsWith(file_name, 'explORER.EXE');
+
+file where opcode=0 and startsWith('explorer.exeaaaaaaaa', file_name);
+
+file where opcode=0 and serial_event_id = 88 and startsWith('explorer.exeaAAAA', 'EXPLORER.exe');
+
+file where opcode=0 and stringContains('ABCDEFGHIexplorer.exeJKLMNOP', file_name)
+;
+
+file where opcode=0 and indexOf(file_name, 'plore') == 2 and not indexOf(file_name, '.pf')
+;
+
+file where opcode=0 and indexOf(file_name, 'explorer.') and indexOf(file_name, 'plore', 100)
+;
+
+file where opcode=0 and indexOf(file_name, 'plorer.', 0) == 2;
+
+file where opcode=0 and indexOf(file_name, 'plorer.', 2);
+
+file where opcode=0 and indexOf(file_name, 'plorer.', 4);
+
+file where opcode=0 and indexOf(file_name, 'thing that never happened');
+
+file where opcode=0 and indexOf(file_name, 'plorer.', 2) == 2;
+
+file where opcode=0 and indexOf(file_name, 'explorer.', 0) == 0;
+
+file where serial_event_id=88 and substring(file_name, 0, 4) == 'expl'
+;
+
+file where serial_event_id=88 and substring(file_name, 1, 3) == 'xp'
+;
+
+file where serial_event_id=88 and substring(file_name, -4) == '.exe'
+;
+
+file where serial_event_id=88 and substring(file_name, -4, -1) == '.ex'
+;
+
+process where add(serial_event_id, 0) == 1 and add(0, 1) == serial_event_id;
+
+process where subtract(serial_event_id, -5) == 6;
+
+process where multiply(6, serial_event_id) == 30 and divide(30, 4.0) == 7.5;
+
+process where modulo(11, add(serial_event_id, 1)) == serial_event_id;
+
+process where serial_event_id == number('5');
+
+process where serial_event_id == number('0x32', 16);
+
+process where serial_event_id == number('32', 16);
+
+process where number(serial_event_id) == number(5);
+
+process where concat(serial_event_id, ':', process_name, opcode) == '5:winINIT.exe3'
+;
+
+
+// undocumented function -- removing support
+// network where safe(divide(process_name, process_name))
+//;
+
+file where serial_event_id == 82 and (true == (process_name in ('svchost.EXE', 'bad.exe', 'bad2.exe')))
+;
+
+
+file where serial_event_id - 1 == 81;
+
+file where serial_event_id + 1 == 83;
+
+file where serial_event_id * 2 == 164;
+
+file where serial_event_id / 2 == 41;
+
+file where serial_event_id % 40 == 2;
+
+process where between(process_name, "s", "e") == "yst"
+;
+
+process where between(process_name, "s", "e", false) == "yst"
+;
+
+process where between(process_name, "s", "e", false, true) == "yst"
+;
+
+process where between(process_name, "s", "e", false, true) == "t"
+;
+
+process where between(process_name, "S", "e", false, true) == "yst"
+;
+
+process where between(process_name, "s", "e", true) == "ystem Idle Proc"
+;
+
+file where between(file_path, "dev", ".json", false) == "\\testlogs\\something"
+;
+
+file where between(file_path, "dev", ".json", true) == "\\testlogs\\something"
+;
+
+network where cidrMatch(source_address, "10.6.48.157/8")
+;
+
+network where cidrMatch(source_address, "192.168.0.0/16")
+;
+
+network where cidrMatch(source_address, "192.168.0.0/16", "10.6.48.157/8")
+
+;
+
+network where cidrMatch(source_address, "0.0.0.0/0")
+;
+
+process where length(between(process_name, 'g', 'e')) > 0
+;
+
+process where length(between(process_name, 'g', 'z')) > 0
+;
+
+
+// additional queries added for the elasticsearch specific implementation
+// dots will still be interpreted by ES per usual
+something where `my-hyphenated-field` == "value";
+something where `my-hyphenated-field.with.nested.dots` == "value";
+something where `@timestamp` == "2020-01-01 00:00:00";
+something where `some escaped identifier` == "blah";
+something where `some escaped identifier` == "blah";
+something where `some.escaped.identifier` == "blah";
From c8fc383c57b191a60295c414f6ad298d1f3bfc8e Mon Sep 17 00:00:00 2001
From: Ross Wolf <31489089+rw-access@users.noreply.github.com>
Date: Tue, 21 Jan 2020 08:58:28 -0700
Subject: [PATCH 5/8] EQL: Testing updates and PR feedback
---
.../xpack/eql/parser/GrammarTests.java | 25 ++++++++-----------
...alid-queries.eql => queries-supported.eql} | 0
...ed-queries.eql => queries-unsupported.eql} | 0
3 files changed, 11 insertions(+), 14 deletions(-)
rename x-pack/plugin/eql/src/test/resources/{valid-queries.eql => queries-supported.eql} (100%)
rename x-pack/plugin/eql/src/test/resources/{unsupported-queries.eql => queries-unsupported.eql} (100%)
diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
index e2860a2e68999..2616dc9d7a36d 100644
--- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
+++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
@@ -10,7 +10,6 @@
import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.xpack.ql.tree.Source;
-import org.junit.Assert;
import java.io.BufferedReader;
import java.io.IOException;
@@ -29,11 +28,12 @@
*/
public class GrammarTests extends ESTestCase {
- public void testValidQueries() throws Exception {
+ public void testSupportedQueries() throws Exception {
EqlParser parser = new EqlParser();
- List> lines = readQueries("/valid-queries.eql");
+ List> lines = readQueries("/queries-supported.eql");
for (Tuple line : lines) {
String q = line.v1();
+
try {
parser.createStatement(q);
} catch (ParsingException pe) {
@@ -48,20 +48,17 @@ public void testValidQueries() throws Exception {
}
public void testUnsupportedQueries() throws Exception {
EqlParser parser = new EqlParser();
- List> lines = readQueries("/unsupported-queries.eql");
+ List> lines = readQueries("/queries-unsupported.eql");
for (Tuple line : lines) {
String q = line.v1();
- try {
- parser.createStatement(q);
+ ParsingException pe = expectThrows(
+ ParsingException.class,
+ "Query not identified as unsupported: " + q,
+ () -> parser.createStatement(q));
- fail("Query not identified as unsupported: " + q);
- } catch (ParsingException pe) {
- if (pe.getErrorMessage().contains("supported")) {
- // the error we actually expect
- } else {
- throw new ParsingException(new Source(pe.getLineNumber() + line.v2() - 1, pe.getColumnNumber(), q),
- pe.getErrorMessage() + " inside statement <{}>", q);
- }
+ if (!pe.getErrorMessage().contains("supported")) {
+ throw new ParsingException(new Source(pe.getLineNumber() + line.v2() - 1, pe.getColumnNumber(), q),
+ pe.getErrorMessage() + " inside statement <{}>", q);
}
}
}
diff --git a/x-pack/plugin/eql/src/test/resources/valid-queries.eql b/x-pack/plugin/eql/src/test/resources/queries-supported.eql
similarity index 100%
rename from x-pack/plugin/eql/src/test/resources/valid-queries.eql
rename to x-pack/plugin/eql/src/test/resources/queries-supported.eql
diff --git a/x-pack/plugin/eql/src/test/resources/unsupported-queries.eql b/x-pack/plugin/eql/src/test/resources/queries-unsupported.eql
similarity index 100%
rename from x-pack/plugin/eql/src/test/resources/unsupported-queries.eql
rename to x-pack/plugin/eql/src/test/resources/queries-unsupported.eql
From 988215e7ac2500990c31efb1032bad3d33a40d56 Mon Sep 17 00:00:00 2001
From: Ross Wolf <31489089+rw-access@users.noreply.github.com>
Date: Tue, 21 Jan 2020 10:32:49 -0700
Subject: [PATCH 6/8] EQL: Add string escapes
---
.../xpack/eql/parser/AbstractBuilder.java | 59 ++++++++++++++++++-
.../xpack/eql/parser/GrammarTests.java | 15 +++++
2 files changed, 72 insertions(+), 2 deletions(-)
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/AbstractBuilder.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/AbstractBuilder.java
index 93c6728b6ae84..86a81fa41f7f8 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/AbstractBuilder.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/AbstractBuilder.java
@@ -17,6 +17,8 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
/**
* Base parsing visitor class offering utility methods.
@@ -120,7 +122,60 @@ static String string(TerminalNode node) {
static String unquoteString(String text) {
// remove leading and trailing ' for strings and also eliminate escaped single quotes
- return text == null ? null : text.substring(1, text.length() - 1).replace("''", "'");
+ if (text == null) {
+ return null;
+ }
+
+ // unescaped strings can be interpreted directly
+ if (text.startsWith("?")) {
+ return text.substring(2, text.length() - 1);
+ }
+
+ text = text.substring(1, text.length() - 1);
+ Pattern regex = Pattern.compile("\\\\.");
+ StringBuffer resultString = new StringBuffer();
+ Matcher regexMatcher = regex.matcher(text);
+
+ while (regexMatcher.find()) {
+ String source = regexMatcher.group();
+ String replacement;
+
+ switch (source) {
+ case "\\t":
+ replacement = "\t";
+ break;
+ case "\\b":
+ replacement = "\b";
+ break;
+ case "\\f":
+ replacement = "\f";
+ break;
+ case "\\n":
+ replacement = "\n";
+ break;
+ case "\\r":
+ replacement = "\r";
+ break;
+ case "\\\"":
+ replacement = "\"";
+ break;
+ case "\\'":
+ replacement = "'";
+ break;
+ case "\\\\":
+ // will be interpreted as regex, so we have to escape it
+ replacement = "\\\\";
+ break;
+ default:
+ replacement = source;
+ }
+
+ regexMatcher.appendReplacement(resultString, replacement);
+
+ }
+ regexMatcher.appendTail(resultString);
+
+ return resultString.toString();
}
@Override
@@ -128,4 +183,4 @@ public Object visitTerminal(TerminalNode node) {
Source source = source(node);
throw new ParsingException(source, "Does not know how to handle {}", source.text());
}
-}
\ No newline at end of file
+}
diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
index 2616dc9d7a36d..7357cd28af1a8 100644
--- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
+++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
@@ -28,6 +28,21 @@
*/
public class GrammarTests extends ESTestCase {
+ public void testStrings() throws Exception {
+ assertEquals("1. hello\"world", AstBuilder.unquoteString("'1. hello\"world'"));
+ assertEquals("2. hello'world", AstBuilder.unquoteString("\"2. hello'world\""));
+ assertEquals("3. hello\nworld", AstBuilder.unquoteString("'3. hello\\nworld'"));
+ assertEquals("4. hello\\\nworld", AstBuilder.unquoteString("'4. hello\\\\\\nworld'"));
+ assertEquals("5. hello\\\"world", AstBuilder.unquoteString("'5. hello\\\\\\\"world'"));
+
+ // test for unescaped strings: ?"...." or ?'....'
+ assertEquals("6. hello\"world", AstBuilder.unquoteString("?'1. hello\"world'"));
+ assertEquals("7. hello'world", AstBuilder.unquoteString("?\"2. hello'world\""));
+ assertEquals("8. hello\\nworld", AstBuilder.unquoteString("?'3. hello\\nworld'"));
+ assertEquals("9. hello\\\\\\nworld", AstBuilder.unquoteString("?'4. hello\\\\\\nworld'"));
+ assertEquals("10. hello\\\\\\\"world", AstBuilder.unquoteString("?'5. hello\\\\\\\"world'"));
+ }
+
public void testSupportedQueries() throws Exception {
EqlParser parser = new EqlParser();
List> lines = readQueries("/queries-supported.eql");
From c0deb0115c8309186448ff1e072b98eb725d1efc Mon Sep 17 00:00:00 2001
From: Ross Wolf <31489089+rw-access@users.noreply.github.com>
Date: Tue, 21 Jan 2020 10:48:14 -0700
Subject: [PATCH 7/8] EQL: Cleanup grammar for identifier
---
x-pack/plugin/eql/src/main/antlr/EqlBase.g4 | 6 +-
.../xpack/eql/parser/EqlBaseBaseListener.java | 12 -
.../xpack/eql/parser/EqlBaseBaseVisitor.java | 7 -
.../xpack/eql/parser/EqlBaseListener.java | 12 -
.../xpack/eql/parser/EqlBaseParser.java | 362 ++++++++----------
.../xpack/eql/parser/EqlBaseVisitor.java | 7 -
.../xpack/eql/parser/EqlParser.java | 6 +-
.../xpack/eql/parser/GrammarTests.java | 22 +-
8 files changed, 188 insertions(+), 246 deletions(-)
diff --git a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4 b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
index 8532c208b5b18..8e26ec9b753df 100644
--- a/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
+++ b/x-pack/plugin/eql/src/main/antlr/EqlBase.g4
@@ -72,7 +72,7 @@ expression
booleanExpression
: NOT booleanExpression #logicalNot
- | relationship=identifier OF subquery #processCheck
+ | relationship=IDENTIFIER OF subquery #processCheck
| predicated #booleanDefault
| left=booleanExpression operator=AND right=booleanExpression #logicalBinary
| left=booleanExpression operator=OR right=booleanExpression #logicalBinary
@@ -103,12 +103,11 @@ primaryExpression
: constant #constantDefault
| functionExpression #function
| qualifiedName #dereference
- | ESCAPED_IDENTIFIER #identifierEscape
| LP expression RP #parenthesizedExpression
;
functionExpression
- : name=identifier LP (expression (COMMA expression)*)? RP
+ : name=IDENTIFIER LP (expression (COMMA expression)*)? RP
;
constant
@@ -132,6 +131,7 @@ qualifiedName
identifier
: IDENTIFIER
+ | ESCAPED_IDENTIFIER
;
timeUnit
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
index d766fa70c64ac..1290235e7a40a 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseListener.java
@@ -335,18 +335,6 @@ class EqlBaseBaseListener implements EqlBaseListener {
* The default implementation does nothing.
*/
@Override public void exitDereference(EqlBaseParser.DereferenceContext ctx) { }
- /**
- * {@inheritDoc}
- *
- * The default implementation does nothing.
- */
- @Override public void enterIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx) { }
- /**
- * {@inheritDoc}
- *
- * The default implementation does nothing.
- */
- @Override public void exitIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx) { }
/**
* {@inheritDoc}
*
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
index 90dc97634cd84..cd981a4baf101 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseBaseVisitor.java
@@ -200,13 +200,6 @@ class EqlBaseBaseVisitor extends AbstractParseTreeVisitor implements EqlBa
* {@link #visitChildren} on {@code ctx}.
*/
@Override public T visitDereference(EqlBaseParser.DereferenceContext ctx) { return visitChildren(ctx); }
- /**
- * {@inheritDoc}
- *
- * The default implementation returns the result of calling
- * {@link #visitChildren} on {@code ctx}.
- */
- @Override public T visitIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
index 5d1545d17d3bb..43cd93d136c44 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseListener.java
@@ -299,18 +299,6 @@ interface EqlBaseListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitDereference(EqlBaseParser.DereferenceContext ctx);
- /**
- * Enter a parse tree produced by the {@code identifierEscape}
- * labeled alternative in {@link EqlBaseParser#primaryExpression}.
- * @param ctx the parse tree
- */
- void enterIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx);
- /**
- * Exit a parse tree produced by the {@code identifierEscape}
- * labeled alternative in {@link EqlBaseParser#primaryExpression}.
- * @param ctx the parse tree
- */
- void exitIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx);
/**
* Enter a parse tree produced by the {@code parenthesizedExpression}
* labeled alternative in {@link EqlBaseParser#primaryExpression}.
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
index 70fc115d8007b..1bed5e7169e92 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseParser.java
@@ -313,6 +313,7 @@ public final QueryContext query() throws RecognitionException {
join();
}
break;
+ case ESCAPED_IDENTIFIER:
case IDENTIFIER:
enterOuterAlt(_localctx, 3);
{
@@ -1093,14 +1094,12 @@ public T accept(ParseTreeVisitor extends T> visitor) {
}
}
public static class ProcessCheckContext extends BooleanExpressionContext {
- public IdentifierContext relationship;
+ public Token relationship;
public TerminalNode OF() { return getToken(EqlBaseParser.OF, 0); }
public SubqueryContext subquery() {
return getRuleContext(SubqueryContext.class,0);
}
- public IdentifierContext identifier() {
- return getRuleContext(IdentifierContext.class,0);
- }
+ public TerminalNode IDENTIFIER() { return getToken(EqlBaseParser.IDENTIFIER, 0); }
public ProcessCheckContext(BooleanExpressionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
@@ -1159,7 +1158,7 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(168);
+ setState(167);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,17,_ctx) ) {
case 1:
@@ -1180,7 +1179,7 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
_ctx = _localctx;
_prevctx = _localctx;
setState(163);
- ((ProcessCheckContext)_localctx).relationship = identifier();
+ ((ProcessCheckContext)_localctx).relationship = match(IDENTIFIER);
setState(164);
match(OF);
setState(165);
@@ -1192,13 +1191,13 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
_localctx = new BooleanDefaultContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(167);
+ setState(166);
predicated();
}
break;
}
_ctx.stop = _input.LT(-1);
- setState(178);
+ setState(177);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,19,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
@@ -1206,7 +1205,7 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
- setState(176);
+ setState(175);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) {
case 1:
@@ -1214,11 +1213,11 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
_localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState));
((LogicalBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
- setState(170);
+ setState(169);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
- setState(171);
+ setState(170);
((LogicalBinaryContext)_localctx).operator = match(AND);
- setState(172);
+ setState(171);
((LogicalBinaryContext)_localctx).right = booleanExpression(3);
}
break;
@@ -1227,18 +1226,18 @@ private BooleanExpressionContext booleanExpression(int _p) throws RecognitionExc
_localctx = new LogicalBinaryContext(new BooleanExpressionContext(_parentctx, _parentState));
((LogicalBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_booleanExpression);
- setState(173);
+ setState(172);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
- setState(174);
+ setState(173);
((LogicalBinaryContext)_localctx).operator = match(OR);
- setState(175);
+ setState(174);
((LogicalBinaryContext)_localctx).right = booleanExpression(2);
}
break;
}
}
}
- setState(180);
+ setState(179);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,19,_ctx);
}
@@ -1287,14 +1286,14 @@ public final PredicatedContext predicated() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(181);
+ setState(180);
valueExpression(0);
- setState(183);
+ setState(182);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) {
case 1:
{
- setState(182);
+ setState(181);
predicate();
}
break;
@@ -1354,38 +1353,38 @@ public final PredicateContext predicate() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(186);
+ setState(185);
_la = _input.LA(1);
if (_la==NOT) {
{
- setState(185);
+ setState(184);
match(NOT);
}
}
- setState(188);
+ setState(187);
((PredicateContext)_localctx).kind = match(IN);
- setState(189);
+ setState(188);
match(LP);
- setState(190);
+ setState(189);
valueExpression(0);
- setState(195);
+ setState(194);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(191);
+ setState(190);
match(COMMA);
- setState(192);
+ setState(191);
valueExpression(0);
}
}
- setState(197);
+ setState(196);
_errHandler.sync(this);
_la = _input.LA(1);
}
- setState(198);
+ setState(197);
match(RP);
}
}
@@ -1526,7 +1525,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(204);
+ setState(203);
switch (_input.LA(1)) {
case FALSE:
case NULL:
@@ -1542,7 +1541,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_ctx = _localctx;
_prevctx = _localctx;
- setState(201);
+ setState(200);
primaryExpression();
}
break;
@@ -1552,7 +1551,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_localctx = new ArithmeticUnaryContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(202);
+ setState(201);
((ArithmeticUnaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
@@ -1560,7 +1559,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
} else {
consume();
}
- setState(203);
+ setState(202);
valueExpression(4);
}
break;
@@ -1568,7 +1567,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
throw new NoViableAltException(this);
}
_ctx.stop = _input.LT(-1);
- setState(218);
+ setState(217);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,25,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
@@ -1576,7 +1575,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
- setState(216);
+ setState(215);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) {
case 1:
@@ -1584,9 +1583,9 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_localctx = new ArithmeticBinaryContext(new ValueExpressionContext(_parentctx, _parentState));
((ArithmeticBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
- setState(206);
+ setState(205);
if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)");
- setState(207);
+ setState(206);
((ArithmeticBinaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << ASTERISK) | (1L << SLASH) | (1L << PERCENT))) != 0)) ) {
@@ -1594,7 +1593,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
} else {
consume();
}
- setState(208);
+ setState(207);
((ArithmeticBinaryContext)_localctx).right = valueExpression(4);
}
break;
@@ -1603,9 +1602,9 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_localctx = new ArithmeticBinaryContext(new ValueExpressionContext(_parentctx, _parentState));
((ArithmeticBinaryContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
- setState(209);
+ setState(208);
if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)");
- setState(210);
+ setState(209);
((ArithmeticBinaryContext)_localctx).operator = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
@@ -1613,7 +1612,7 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
} else {
consume();
}
- setState(211);
+ setState(210);
((ArithmeticBinaryContext)_localctx).right = valueExpression(3);
}
break;
@@ -1622,18 +1621,18 @@ private ValueExpressionContext valueExpression(int _p) throws RecognitionExcepti
_localctx = new ComparisonContext(new ValueExpressionContext(_parentctx, _parentState));
((ComparisonContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_valueExpression);
- setState(212);
+ setState(211);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
- setState(213);
+ setState(212);
comparisonOperator();
- setState(214);
+ setState(213);
((ComparisonContext)_localctx).right = valueExpression(2);
}
break;
}
}
}
- setState(220);
+ setState(219);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,25,_ctx);
}
@@ -1739,36 +1738,19 @@ public T accept(ParseTreeVisitor extends T> visitor) {
else return visitor.visitChildren(this);
}
}
- public static class IdentifierEscapeContext extends PrimaryExpressionContext {
- public TerminalNode ESCAPED_IDENTIFIER() { return getToken(EqlBaseParser.ESCAPED_IDENTIFIER, 0); }
- public IdentifierEscapeContext(PrimaryExpressionContext ctx) { copyFrom(ctx); }
- @Override
- public void enterRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).enterIdentifierEscape(this);
- }
- @Override
- public void exitRule(ParseTreeListener listener) {
- if ( listener instanceof EqlBaseListener ) ((EqlBaseListener)listener).exitIdentifierEscape(this);
- }
- @Override
- public T accept(ParseTreeVisitor extends T> visitor) {
- if ( visitor instanceof EqlBaseVisitor ) return ((EqlBaseVisitor extends T>)visitor).visitIdentifierEscape(this);
- else return visitor.visitChildren(this);
- }
- }
public final PrimaryExpressionContext primaryExpression() throws RecognitionException {
PrimaryExpressionContext _localctx = new PrimaryExpressionContext(_ctx, getState());
enterRule(_localctx, 36, RULE_primaryExpression);
try {
- setState(229);
+ setState(227);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) {
case 1:
_localctx = new ConstantDefaultContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(221);
+ setState(220);
constant();
}
break;
@@ -1776,7 +1758,7 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
_localctx = new FunctionContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(222);
+ setState(221);
functionExpression();
}
break;
@@ -1784,27 +1766,19 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
_localctx = new DereferenceContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(223);
+ setState(222);
qualifiedName();
}
break;
case 4:
- _localctx = new IdentifierEscapeContext(_localctx);
- enterOuterAlt(_localctx, 4);
- {
- setState(224);
- match(ESCAPED_IDENTIFIER);
- }
- break;
- case 5:
_localctx = new ParenthesizedExpressionContext(_localctx);
- enterOuterAlt(_localctx, 5);
+ enterOuterAlt(_localctx, 4);
{
- setState(225);
+ setState(223);
match(LP);
- setState(226);
+ setState(224);
expression();
- setState(227);
+ setState(225);
match(RP);
}
break;
@@ -1822,12 +1796,10 @@ public final PrimaryExpressionContext primaryExpression() throws RecognitionExce
}
public static class FunctionExpressionContext extends ParserRuleContext {
- public IdentifierContext name;
+ public Token name;
public TerminalNode LP() { return getToken(EqlBaseParser.LP, 0); }
public TerminalNode RP() { return getToken(EqlBaseParser.RP, 0); }
- public IdentifierContext identifier() {
- return getRuleContext(IdentifierContext.class,0);
- }
+ public TerminalNode IDENTIFIER() { return getToken(EqlBaseParser.IDENTIFIER, 0); }
public List expression() {
return getRuleContexts(ExpressionContext.class);
}
@@ -1864,36 +1836,36 @@ public final FunctionExpressionContext functionExpression() throws RecognitionEx
try {
enterOuterAlt(_localctx, 1);
{
- setState(231);
- ((FunctionExpressionContext)_localctx).name = identifier();
- setState(232);
+ setState(229);
+ ((FunctionExpressionContext)_localctx).name = match(IDENTIFIER);
+ setState(230);
match(LP);
- setState(241);
+ setState(239);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FALSE) | (1L << NOT) | (1L << NULL) | (1L << TRUE) | (1L << PLUS) | (1L << MINUS) | (1L << LP) | (1L << ESCAPED_IDENTIFIER) | (1L << STRING) | (1L << INTEGER_VALUE) | (1L << DECIMAL_VALUE) | (1L << IDENTIFIER))) != 0)) {
{
- setState(233);
+ setState(231);
expression();
- setState(238);
+ setState(236);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(234);
+ setState(232);
match(COMMA);
- setState(235);
+ setState(233);
expression();
}
}
- setState(240);
+ setState(238);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
- setState(243);
+ setState(241);
match(RP);
}
}
@@ -1998,13 +1970,13 @@ public final ConstantContext constant() throws RecognitionException {
ConstantContext _localctx = new ConstantContext(_ctx, getState());
enterRule(_localctx, 40, RULE_constant);
try {
- setState(249);
+ setState(247);
switch (_input.LA(1)) {
case NULL:
_localctx = new NullLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(245);
+ setState(243);
match(NULL);
}
break;
@@ -2013,7 +1985,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new NumericLiteralContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(246);
+ setState(244);
number();
}
break;
@@ -2022,7 +1994,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new BooleanLiteralContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(247);
+ setState(245);
booleanValue();
}
break;
@@ -2030,7 +2002,7 @@ public final ConstantContext constant() throws RecognitionException {
_localctx = new StringLiteralContext(_localctx);
enterOuterAlt(_localctx, 4);
{
- setState(248);
+ setState(246);
string();
}
break;
@@ -2082,7 +2054,7 @@ public final ComparisonOperatorContext comparisonOperator() throws RecognitionEx
try {
enterOuterAlt(_localctx, 1);
{
- setState(251);
+ setState(249);
_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);
@@ -2131,7 +2103,7 @@ public final BooleanValueContext booleanValue() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(253);
+ setState(251);
_la = _input.LA(1);
if ( !(_la==FALSE || _la==TRUE) ) {
_errHandler.recoverInline(this);
@@ -2201,43 +2173,43 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(255);
+ setState(253);
identifier();
- setState(267);
+ setState(265);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,32,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
- setState(265);
+ setState(263);
switch (_input.LA(1)) {
case DOT:
{
- setState(256);
+ setState(254);
match(DOT);
- setState(257);
+ setState(255);
identifier();
}
break;
case LB:
{
- setState(258);
+ setState(256);
match(LB);
- setState(260);
+ setState(258);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
- setState(259);
+ setState(257);
match(INTEGER_VALUE);
}
}
- setState(262);
+ setState(260);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==INTEGER_VALUE );
- setState(264);
+ setState(262);
match(RB);
}
break;
@@ -2246,7 +2218,7 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException {
}
}
}
- setState(269);
+ setState(267);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,32,_ctx);
}
@@ -2265,6 +2237,7 @@ public final QualifiedNameContext qualifiedName() throws RecognitionException {
public static class IdentifierContext extends ParserRuleContext {
public TerminalNode IDENTIFIER() { return getToken(EqlBaseParser.IDENTIFIER, 0); }
+ public TerminalNode ESCAPED_IDENTIFIER() { return getToken(EqlBaseParser.ESCAPED_IDENTIFIER, 0); }
public IdentifierContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@@ -2287,11 +2260,17 @@ public T accept(ParseTreeVisitor extends T> visitor) {
public final IdentifierContext identifier() throws RecognitionException {
IdentifierContext _localctx = new IdentifierContext(_ctx, getState());
enterRule(_localctx, 48, RULE_identifier);
+ int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(270);
- match(IDENTIFIER);
+ setState(268);
+ _la = _input.LA(1);
+ if ( !(_la==ESCAPED_IDENTIFIER || _la==IDENTIFIER) ) {
+ _errHandler.recoverInline(this);
+ } else {
+ consume();
+ }
}
}
catch (RecognitionException re) {
@@ -2337,13 +2316,13 @@ public final TimeUnitContext timeUnit() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(272);
+ setState(270);
number();
- setState(274);
+ setState(272);
_la = _input.LA(1);
if (_la==IDENTIFIER) {
{
- setState(273);
+ setState(271);
((TimeUnitContext)_localctx).unit = match(IDENTIFIER);
}
}
@@ -2411,13 +2390,13 @@ public final NumberContext number() throws RecognitionException {
NumberContext _localctx = new NumberContext(_ctx, getState());
enterRule(_localctx, 52, RULE_number);
try {
- setState(278);
+ setState(276);
switch (_input.LA(1)) {
case DECIMAL_VALUE:
_localctx = new DecimalLiteralContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(276);
+ setState(274);
match(DECIMAL_VALUE);
}
break;
@@ -2425,7 +2404,7 @@ public final NumberContext number() throws RecognitionException {
_localctx = new IntegerLiteralContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(277);
+ setState(275);
match(INTEGER_VALUE);
}
break;
@@ -2471,7 +2450,7 @@ public final StringContext string() throws RecognitionException {
try {
enterOuterAlt(_localctx, 1);
{
- setState(280);
+ setState(278);
match(STRING);
}
}
@@ -2517,7 +2496,7 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
}
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3,\u011d\4\2\t\2\4"+
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3,\u011b\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"+
@@ -2529,34 +2508,34 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
"\n\3\n\3\n\3\n\7\n\u0085\n\n\f\n\16\n\u0088\13\n\3\13\3\13\5\13\u008c"+
"\n\13\3\f\3\f\3\f\3\f\5\f\u0092\n\f\5\f\u0094\n\f\3\f\5\f\u0097\n\f\3"+
"\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3\17\3\17\3\20\3\20\3\20\3\20\3\20"+
- "\3\20\3\20\3\20\5\20\u00ab\n\20\3\20\3\20\3\20\3\20\3\20\3\20\7\20\u00b3"+
- "\n\20\f\20\16\20\u00b6\13\20\3\21\3\21\5\21\u00ba\n\21\3\22\5\22\u00bd"+
- "\n\22\3\22\3\22\3\22\3\22\3\22\7\22\u00c4\n\22\f\22\16\22\u00c7\13\22"+
- "\3\22\3\22\3\23\3\23\3\23\3\23\5\23\u00cf\n\23\3\23\3\23\3\23\3\23\3\23"+
- "\3\23\3\23\3\23\3\23\3\23\7\23\u00db\n\23\f\23\16\23\u00de\13\23\3\24"+
- "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u00e8\n\24\3\25\3\25\3\25\3\25"+
- "\3\25\7\25\u00ef\n\25\f\25\16\25\u00f2\13\25\5\25\u00f4\n\25\3\25\3\25"+
- "\3\26\3\26\3\26\3\26\5\26\u00fc\n\26\3\27\3\27\3\30\3\30\3\31\3\31\3\31"+
- "\3\31\3\31\6\31\u0107\n\31\r\31\16\31\u0108\3\31\7\31\u010c\n\31\f\31"+
- "\16\31\u010f\13\31\3\32\3\32\3\33\3\33\5\33\u0115\n\33\3\34\3\34\5\34"+
- "\u0119\n\34\3\35\3\35\3\35\2\4\36$\36\2\4\6\b\n\f\16\20\22\24\26\30\32"+
- "\34\36 \"$&(*,.\60\62\64\668\2\6\3\2\31\32\3\2\33\35\3\2\23\30\4\2\5\5"+
- "\17\17\u012c\2:\3\2\2\2\4=\3\2\2\2\6@\3\2\2\2\bJ\3\2\2\2\nL\3\2\2\2\f"+
- "Q\3\2\2\2\16f\3\2\2\2\20t\3\2\2\2\22\u0080\3\2\2\2\24\u0089\3\2\2\2\26"+
- "\u008d\3\2\2\2\30\u0098\3\2\2\2\32\u009c\3\2\2\2\34\u00a0\3\2\2\2\36\u00aa"+
- "\3\2\2\2 \u00b7\3\2\2\2\"\u00bc\3\2\2\2$\u00ce\3\2\2\2&\u00e7\3\2\2\2"+
- "(\u00e9\3\2\2\2*\u00fb\3\2\2\2,\u00fd\3\2\2\2.\u00ff\3\2\2\2\60\u0101"+
- "\3\2\2\2\62\u0110\3\2\2\2\64\u0112\3\2\2\2\66\u0118\3\2\2\28\u011a\3\2"+
- "\2\2:;\5\6\4\2;<\7\2\2\3<\3\3\2\2\2=>\5\34\17\2>?\7\2\2\3?\5\3\2\2\2@"+
- "D\5\b\5\2AC\5\20\t\2BA\3\2\2\2CF\3\2\2\2DB\3\2\2\2DE\3\2\2\2E\7\3\2\2"+
- "\2FD\3\2\2\2GK\5\f\7\2HK\5\16\b\2IK\5\32\16\2JG\3\2\2\2JH\3\2\2\2JI\3"+
- "\2\2\2K\t\3\2\2\2LM\7\22\2\2MN\7\t\2\2NO\7\23\2\2OP\5\64\33\2P\13\3\2"+
- "\2\2QZ\7\16\2\2RT\5\22\n\2SU\5\n\6\2TS\3\2\2\2TU\3\2\2\2U[\3\2\2\2VX\5"+
- "\n\6\2WY\5\22\n\2XW\3\2\2\2XY\3\2\2\2Y[\3\2\2\2ZR\3\2\2\2ZV\3\2\2\2Z["+
- "\3\2\2\2[\\\3\2\2\2\\^\5\26\f\2]_\5\26\f\2^]\3\2\2\2_`\3\2\2\2`^\3\2\2"+
- "\2`a\3\2\2\2ad\3\2\2\2bc\7\20\2\2ce\5\26\f\2db\3\2\2\2de\3\2\2\2e\r\3"+
- "\2\2\2fh\7\b\2\2gi\5\22\n\2hg\3\2\2\2hi\3\2\2\2ij\3\2\2\2jl\5\24\13\2"+
- "km\5\24\13\2lk\3\2\2\2mn\3\2\2\2nl\3\2\2\2no\3\2\2\2or\3\2\2\2pq\7\20"+
+ "\3\20\3\20\5\20\u00aa\n\20\3\20\3\20\3\20\3\20\3\20\3\20\7\20\u00b2\n"+
+ "\20\f\20\16\20\u00b5\13\20\3\21\3\21\5\21\u00b9\n\21\3\22\5\22\u00bc\n"+
+ "\22\3\22\3\22\3\22\3\22\3\22\7\22\u00c3\n\22\f\22\16\22\u00c6\13\22\3"+
+ "\22\3\22\3\23\3\23\3\23\3\23\5\23\u00ce\n\23\3\23\3\23\3\23\3\23\3\23"+
+ "\3\23\3\23\3\23\3\23\3\23\7\23\u00da\n\23\f\23\16\23\u00dd\13\23\3\24"+
+ "\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u00e6\n\24\3\25\3\25\3\25\3\25\3\25"+
+ "\7\25\u00ed\n\25\f\25\16\25\u00f0\13\25\5\25\u00f2\n\25\3\25\3\25\3\26"+
+ "\3\26\3\26\3\26\5\26\u00fa\n\26\3\27\3\27\3\30\3\30\3\31\3\31\3\31\3\31"+
+ "\3\31\6\31\u0105\n\31\r\31\16\31\u0106\3\31\7\31\u010a\n\31\f\31\16\31"+
+ "\u010d\13\31\3\32\3\32\3\33\3\33\5\33\u0113\n\33\3\34\3\34\5\34\u0117"+
+ "\n\34\3\35\3\35\3\35\2\4\36$\36\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36"+
+ " \"$&(*,.\60\62\64\668\2\7\3\2\31\32\3\2\33\35\3\2\23\30\4\2\5\5\17\17"+
+ "\4\2%%))\u0129\2:\3\2\2\2\4=\3\2\2\2\6@\3\2\2\2\bJ\3\2\2\2\nL\3\2\2\2"+
+ "\fQ\3\2\2\2\16f\3\2\2\2\20t\3\2\2\2\22\u0080\3\2\2\2\24\u0089\3\2\2\2"+
+ "\26\u008d\3\2\2\2\30\u0098\3\2\2\2\32\u009c\3\2\2\2\34\u00a0\3\2\2\2\36"+
+ "\u00a9\3\2\2\2 \u00b6\3\2\2\2\"\u00bb\3\2\2\2$\u00cd\3\2\2\2&\u00e5\3"+
+ "\2\2\2(\u00e7\3\2\2\2*\u00f9\3\2\2\2,\u00fb\3\2\2\2.\u00fd\3\2\2\2\60"+
+ "\u00ff\3\2\2\2\62\u010e\3\2\2\2\64\u0110\3\2\2\2\66\u0116\3\2\2\28\u0118"+
+ "\3\2\2\2:;\5\6\4\2;<\7\2\2\3<\3\3\2\2\2=>\5\34\17\2>?\7\2\2\3?\5\3\2\2"+
+ "\2@D\5\b\5\2AC\5\20\t\2BA\3\2\2\2CF\3\2\2\2DB\3\2\2\2DE\3\2\2\2E\7\3\2"+
+ "\2\2FD\3\2\2\2GK\5\f\7\2HK\5\16\b\2IK\5\32\16\2JG\3\2\2\2JH\3\2\2\2JI"+
+ "\3\2\2\2K\t\3\2\2\2LM\7\22\2\2MN\7\t\2\2NO\7\23\2\2OP\5\64\33\2P\13\3"+
+ "\2\2\2QZ\7\16\2\2RT\5\22\n\2SU\5\n\6\2TS\3\2\2\2TU\3\2\2\2U[\3\2\2\2V"+
+ "X\5\n\6\2WY\5\22\n\2XW\3\2\2\2XY\3\2\2\2Y[\3\2\2\2ZR\3\2\2\2ZV\3\2\2\2"+
+ "Z[\3\2\2\2[\\\3\2\2\2\\^\5\26\f\2]_\5\26\f\2^]\3\2\2\2_`\3\2\2\2`^\3\2"+
+ "\2\2`a\3\2\2\2ad\3\2\2\2bc\7\20\2\2ce\5\26\f\2db\3\2\2\2de\3\2\2\2e\r"+
+ "\3\2\2\2fh\7\b\2\2gi\5\22\n\2hg\3\2\2\2hi\3\2\2\2ij\3\2\2\2jl\5\24\13"+
+ "\2km\5\24\13\2lk\3\2\2\2mn\3\2\2\2nl\3\2\2\2no\3\2\2\2or\3\2\2\2pq\7\20"+
"\2\2qs\5\24\13\2rp\3\2\2\2rs\3\2\2\2s\17\3\2\2\2tu\7$\2\2u~\7)\2\2v{\5"+
"\36\20\2wx\7\37\2\2xz\5\36\20\2yw\3\2\2\2z}\3\2\2\2{y\3\2\2\2{|\3\2\2"+
"\2|\177\3\2\2\2}{\3\2\2\2~v\3\2\2\2~\177\3\2\2\2\177\21\3\2\2\2\u0080"+
@@ -2571,50 +2550,49 @@ private boolean valueExpression_sempred(ValueExpressionContext _localctx, int pr
"\u0097\27\3\2\2\2\u0098\u0099\7 \2\2\u0099\u009a\5\32\16\2\u009a\u009b"+
"\7!\2\2\u009b\31\3\2\2\2\u009c\u009d\5\62\32\2\u009d\u009e\7\21\2\2\u009e"+
"\u009f\5\34\17\2\u009f\33\3\2\2\2\u00a0\u00a1\5\36\20\2\u00a1\35\3\2\2"+
- "\2\u00a2\u00a3\b\20\1\2\u00a3\u00a4\7\n\2\2\u00a4\u00ab\5\36\20\7\u00a5"+
- "\u00a6\5\62\32\2\u00a6\u00a7\7\f\2\2\u00a7\u00a8\5\30\r\2\u00a8\u00ab"+
- "\3\2\2\2\u00a9\u00ab\5 \21\2\u00aa\u00a2\3\2\2\2\u00aa\u00a5\3\2\2\2\u00aa"+
- "\u00a9\3\2\2\2\u00ab\u00b4\3\2\2\2\u00ac\u00ad\f\4\2\2\u00ad\u00ae\7\3"+
- "\2\2\u00ae\u00b3\5\36\20\5\u00af\u00b0\f\3\2\2\u00b0\u00b1\7\r\2\2\u00b1"+
- "\u00b3\5\36\20\4\u00b2\u00ac\3\2\2\2\u00b2\u00af\3\2\2\2\u00b3\u00b6\3"+
- "\2\2\2\u00b4\u00b2\3\2\2\2\u00b4\u00b5\3\2\2\2\u00b5\37\3\2\2\2\u00b6"+
- "\u00b4\3\2\2\2\u00b7\u00b9\5$\23\2\u00b8\u00ba\5\"\22\2\u00b9\u00b8\3"+
- "\2\2\2\u00b9\u00ba\3\2\2\2\u00ba!\3\2\2\2\u00bb\u00bd\7\n\2\2\u00bc\u00bb"+
- "\3\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00be\3\2\2\2\u00be\u00bf\7\7\2\2\u00bf"+
- "\u00c0\7\"\2\2\u00c0\u00c5\5$\23\2\u00c1\u00c2\7\37\2\2\u00c2\u00c4\5"+
- "$\23\2\u00c3\u00c1\3\2\2\2\u00c4\u00c7\3\2\2\2\u00c5\u00c3\3\2\2\2\u00c5"+
- "\u00c6\3\2\2\2\u00c6\u00c8\3\2\2\2\u00c7\u00c5\3\2\2\2\u00c8\u00c9\7#"+
- "\2\2\u00c9#\3\2\2\2\u00ca\u00cb\b\23\1\2\u00cb\u00cf\5&\24\2\u00cc\u00cd"+
- "\t\2\2\2\u00cd\u00cf\5$\23\6\u00ce\u00ca\3\2\2\2\u00ce\u00cc\3\2\2\2\u00cf"+
- "\u00dc\3\2\2\2\u00d0\u00d1\f\5\2\2\u00d1\u00d2\t\3\2\2\u00d2\u00db\5$"+
- "\23\6\u00d3\u00d4\f\4\2\2\u00d4\u00d5\t\2\2\2\u00d5\u00db\5$\23\5\u00d6"+
- "\u00d7\f\3\2\2\u00d7\u00d8\5,\27\2\u00d8\u00d9\5$\23\4\u00d9\u00db\3\2"+
- "\2\2\u00da\u00d0\3\2\2\2\u00da\u00d3\3\2\2\2\u00da\u00d6\3\2\2\2\u00db"+
- "\u00de\3\2\2\2\u00dc\u00da\3\2\2\2\u00dc\u00dd\3\2\2\2\u00dd%\3\2\2\2"+
- "\u00de\u00dc\3\2\2\2\u00df\u00e8\5*\26\2\u00e0\u00e8\5(\25\2\u00e1\u00e8"+
- "\5\60\31\2\u00e2\u00e8\7%\2\2\u00e3\u00e4\7\"\2\2\u00e4\u00e5\5\34\17"+
- "\2\u00e5\u00e6\7#\2\2\u00e6\u00e8\3\2\2\2\u00e7\u00df\3\2\2\2\u00e7\u00e0"+
- "\3\2\2\2\u00e7\u00e1\3\2\2\2\u00e7\u00e2\3\2\2\2\u00e7\u00e3\3\2\2\2\u00e8"+
- "\'\3\2\2\2\u00e9\u00ea\5\62\32\2\u00ea\u00f3\7\"\2\2\u00eb\u00f0\5\34"+
- "\17\2\u00ec\u00ed\7\37\2\2\u00ed\u00ef\5\34\17\2\u00ee\u00ec\3\2\2\2\u00ef"+
- "\u00f2\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f0\u00f1\3\2\2\2\u00f1\u00f4\3\2"+
- "\2\2\u00f2\u00f0\3\2\2\2\u00f3\u00eb\3\2\2\2\u00f3\u00f4\3\2\2\2\u00f4"+
- "\u00f5\3\2\2\2\u00f5\u00f6\7#\2\2\u00f6)\3\2\2\2\u00f7\u00fc\7\13\2\2"+
- "\u00f8\u00fc\5\66\34\2\u00f9\u00fc\5.\30\2\u00fa\u00fc\58\35\2\u00fb\u00f7"+
- "\3\2\2\2\u00fb\u00f8\3\2\2\2\u00fb\u00f9\3\2\2\2\u00fb\u00fa\3\2\2\2\u00fc"+
- "+\3\2\2\2\u00fd\u00fe\t\4\2\2\u00fe-\3\2\2\2\u00ff\u0100\t\5\2\2\u0100"+
- "/\3\2\2\2\u0101\u010d\5\62\32\2\u0102\u0103\7\36\2\2\u0103\u010c\5\62"+
- "\32\2\u0104\u0106\7 \2\2\u0105\u0107\7\'\2\2\u0106\u0105\3\2\2\2\u0107"+
- "\u0108\3\2\2\2\u0108\u0106\3\2\2\2\u0108\u0109\3\2\2\2\u0109\u010a\3\2"+
- "\2\2\u010a\u010c\7!\2\2\u010b\u0102\3\2\2\2\u010b\u0104\3\2\2\2\u010c"+
- "\u010f\3\2\2\2\u010d\u010b\3\2\2\2\u010d\u010e\3\2\2\2\u010e\61\3\2\2"+
- "\2\u010f\u010d\3\2\2\2\u0110\u0111\7)\2\2\u0111\63\3\2\2\2\u0112\u0114"+
- "\5\66\34\2\u0113\u0115\7)\2\2\u0114\u0113\3\2\2\2\u0114\u0115\3\2\2\2"+
- "\u0115\65\3\2\2\2\u0116\u0119\7(\2\2\u0117\u0119\7\'\2\2\u0118\u0116\3"+
- "\2\2\2\u0118\u0117\3\2\2\2\u0119\67\3\2\2\2\u011a\u011b\7&\2\2\u011b9"+
- "\3\2\2\2%DJTXZ`dhnr{~\u0086\u008b\u0091\u0093\u0096\u00aa\u00b2\u00b4"+
- "\u00b9\u00bc\u00c5\u00ce\u00da\u00dc\u00e7\u00f0\u00f3\u00fb\u0108\u010b"+
- "\u010d\u0114\u0118";
+ "\2\u00a2\u00a3\b\20\1\2\u00a3\u00a4\7\n\2\2\u00a4\u00aa\5\36\20\7\u00a5"+
+ "\u00a6\7)\2\2\u00a6\u00a7\7\f\2\2\u00a7\u00aa\5\30\r\2\u00a8\u00aa\5 "+
+ "\21\2\u00a9\u00a2\3\2\2\2\u00a9\u00a5\3\2\2\2\u00a9\u00a8\3\2\2\2\u00aa"+
+ "\u00b3\3\2\2\2\u00ab\u00ac\f\4\2\2\u00ac\u00ad\7\3\2\2\u00ad\u00b2\5\36"+
+ "\20\5\u00ae\u00af\f\3\2\2\u00af\u00b0\7\r\2\2\u00b0\u00b2\5\36\20\4\u00b1"+
+ "\u00ab\3\2\2\2\u00b1\u00ae\3\2\2\2\u00b2\u00b5\3\2\2\2\u00b3\u00b1\3\2"+
+ "\2\2\u00b3\u00b4\3\2\2\2\u00b4\37\3\2\2\2\u00b5\u00b3\3\2\2\2\u00b6\u00b8"+
+ "\5$\23\2\u00b7\u00b9\5\"\22\2\u00b8\u00b7\3\2\2\2\u00b8\u00b9\3\2\2\2"+
+ "\u00b9!\3\2\2\2\u00ba\u00bc\7\n\2\2\u00bb\u00ba\3\2\2\2\u00bb\u00bc\3"+
+ "\2\2\2\u00bc\u00bd\3\2\2\2\u00bd\u00be\7\7\2\2\u00be\u00bf\7\"\2\2\u00bf"+
+ "\u00c4\5$\23\2\u00c0\u00c1\7\37\2\2\u00c1\u00c3\5$\23\2\u00c2\u00c0\3"+
+ "\2\2\2\u00c3\u00c6\3\2\2\2\u00c4\u00c2\3\2\2\2\u00c4\u00c5\3\2\2\2\u00c5"+
+ "\u00c7\3\2\2\2\u00c6\u00c4\3\2\2\2\u00c7\u00c8\7#\2\2\u00c8#\3\2\2\2\u00c9"+
+ "\u00ca\b\23\1\2\u00ca\u00ce\5&\24\2\u00cb\u00cc\t\2\2\2\u00cc\u00ce\5"+
+ "$\23\6\u00cd\u00c9\3\2\2\2\u00cd\u00cb\3\2\2\2\u00ce\u00db\3\2\2\2\u00cf"+
+ "\u00d0\f\5\2\2\u00d0\u00d1\t\3\2\2\u00d1\u00da\5$\23\6\u00d2\u00d3\f\4"+
+ "\2\2\u00d3\u00d4\t\2\2\2\u00d4\u00da\5$\23\5\u00d5\u00d6\f\3\2\2\u00d6"+
+ "\u00d7\5,\27\2\u00d7\u00d8\5$\23\4\u00d8\u00da\3\2\2\2\u00d9\u00cf\3\2"+
+ "\2\2\u00d9\u00d2\3\2\2\2\u00d9\u00d5\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\u00e6\5*\26\2\u00df\u00e6\5(\25\2\u00e0\u00e6\5\60\31\2\u00e1\u00e2"+
+ "\7\"\2\2\u00e2\u00e3\5\34\17\2\u00e3\u00e4\7#\2\2\u00e4\u00e6\3\2\2\2"+
+ "\u00e5\u00de\3\2\2\2\u00e5\u00df\3\2\2\2\u00e5\u00e0\3\2\2\2\u00e5\u00e1"+
+ "\3\2\2\2\u00e6\'\3\2\2\2\u00e7\u00e8\7)\2\2\u00e8\u00f1\7\"\2\2\u00e9"+
+ "\u00ee\5\34\17\2\u00ea\u00eb\7\37\2\2\u00eb\u00ed\5\34\17\2\u00ec\u00ea"+
+ "\3\2\2\2\u00ed\u00f0\3\2\2\2\u00ee\u00ec\3\2\2\2\u00ee\u00ef\3\2\2\2\u00ef"+
+ "\u00f2\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f1\u00e9\3\2\2\2\u00f1\u00f2\3\2"+
+ "\2\2\u00f2\u00f3\3\2\2\2\u00f3\u00f4\7#\2\2\u00f4)\3\2\2\2\u00f5\u00fa"+
+ "\7\13\2\2\u00f6\u00fa\5\66\34\2\u00f7\u00fa\5.\30\2\u00f8\u00fa\58\35"+
+ "\2\u00f9\u00f5\3\2\2\2\u00f9\u00f6\3\2\2\2\u00f9\u00f7\3\2\2\2\u00f9\u00f8"+
+ "\3\2\2\2\u00fa+\3\2\2\2\u00fb\u00fc\t\4\2\2\u00fc-\3\2\2\2\u00fd\u00fe"+
+ "\t\5\2\2\u00fe/\3\2\2\2\u00ff\u010b\5\62\32\2\u0100\u0101\7\36\2\2\u0101"+
+ "\u010a\5\62\32\2\u0102\u0104\7 \2\2\u0103\u0105\7\'\2\2\u0104\u0103\3"+
+ "\2\2\2\u0105\u0106\3\2\2\2\u0106\u0104\3\2\2\2\u0106\u0107\3\2\2\2\u0107"+
+ "\u0108\3\2\2\2\u0108\u010a\7!\2\2\u0109\u0100\3\2\2\2\u0109\u0102\3\2"+
+ "\2\2\u010a\u010d\3\2\2\2\u010b\u0109\3\2\2\2\u010b\u010c\3\2\2\2\u010c"+
+ "\61\3\2\2\2\u010d\u010b\3\2\2\2\u010e\u010f\t\6\2\2\u010f\63\3\2\2\2\u0110"+
+ "\u0112\5\66\34\2\u0111\u0113\7)\2\2\u0112\u0111\3\2\2\2\u0112\u0113\3"+
+ "\2\2\2\u0113\65\3\2\2\2\u0114\u0117\7(\2\2\u0115\u0117\7\'\2\2\u0116\u0114"+
+ "\3\2\2\2\u0116\u0115\3\2\2\2\u0117\67\3\2\2\2\u0118\u0119\7&\2\2\u0119"+
+ "9\3\2\2\2%DJTXZ`dhnr{~\u0086\u008b\u0091\u0093\u0096\u00a9\u00b1\u00b3"+
+ "\u00b8\u00bb\u00c4\u00cd\u00d9\u00db\u00e5\u00ee\u00f1\u00f9\u0106\u0109"+
+ "\u010b\u0112\u0116";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
index f77ffa70eba88..ec386d12c1c38 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlBaseVisitor.java
@@ -183,13 +183,6 @@ interface EqlBaseVisitor extends ParseTreeVisitor {
* @return the visitor result
*/
T visitDereference(EqlBaseParser.DereferenceContext ctx);
- /**
- * Visit a parse tree produced by the {@code identifierEscape}
- * labeled alternative in {@link EqlBaseParser#primaryExpression}.
- * @param ctx the parse tree
- * @return the visitor result
- */
- T visitIdentifierEscape(EqlBaseParser.IdentifierEscapeContext ctx);
/**
* Visit a parse tree produced by the {@code parenthesizedExpression}
* labeled alternative in {@link EqlBaseParser#primaryExpression}.
diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java
index ac8a723ea6324..1f82b63e01de3 100644
--- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java
+++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/parser/EqlParser.java
@@ -128,8 +128,8 @@ private class PostProcessor extends EqlBaseBaseListener {
@Override
public void exitFunctionExpression(EqlBaseParser.FunctionExpressionContext context) {
- String functionName = context.name.getText();
- Token token = context.name.IDENTIFIER().getSymbol();
+ Token token = context.name;
+ String functionName = token.getText();
switch (functionName) {
case "add":
@@ -192,7 +192,7 @@ public void exitPipe(EqlBaseParser.PipeContext context) {
@Override
public void exitProcessCheck(EqlBaseParser.ProcessCheckContext context) {
- Token token = context.relationship.IDENTIFIER().getSymbol();
+ Token token = context.relationship;
throw new ParsingException(
"process relationships are not supported",
null,
diff --git a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
index 7357cd28af1a8..d2f9f5ae856bf 100644
--- a/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
+++ b/x-pack/plugin/eql/src/test/java/org/elasticsearch/xpack/eql/parser/GrammarTests.java
@@ -29,18 +29,20 @@
public class GrammarTests extends ESTestCase {
public void testStrings() throws Exception {
- assertEquals("1. hello\"world", AstBuilder.unquoteString("'1. hello\"world'"));
- assertEquals("2. hello'world", AstBuilder.unquoteString("\"2. hello'world\""));
- assertEquals("3. hello\nworld", AstBuilder.unquoteString("'3. hello\\nworld'"));
- assertEquals("4. hello\\\nworld", AstBuilder.unquoteString("'4. hello\\\\\\nworld'"));
- assertEquals("5. hello\\\"world", AstBuilder.unquoteString("'5. hello\\\\\\\"world'"));
+ assertEquals("hello\"world", AstBuilder.unquoteString("'hello\"world'"));
+ assertEquals("hello'world", AstBuilder.unquoteString("\"hello'world\""));
+ assertEquals("hello\nworld", AstBuilder.unquoteString("'hello\\nworld'"));
+ assertEquals("hello\\\nworld", AstBuilder.unquoteString("'hello\\\\\\nworld'"));
+ assertEquals("hello\\\"world", AstBuilder.unquoteString("'hello\\\\\\\"world'"));
// test for unescaped strings: ?"...." or ?'....'
- assertEquals("6. hello\"world", AstBuilder.unquoteString("?'1. hello\"world'"));
- assertEquals("7. hello'world", AstBuilder.unquoteString("?\"2. hello'world\""));
- assertEquals("8. hello\\nworld", AstBuilder.unquoteString("?'3. hello\\nworld'"));
- assertEquals("9. hello\\\\\\nworld", AstBuilder.unquoteString("?'4. hello\\\\\\nworld'"));
- assertEquals("10. hello\\\\\\\"world", AstBuilder.unquoteString("?'5. hello\\\\\\\"world'"));
+ assertEquals("hello\"world", AstBuilder.unquoteString("?'hello\"world'"));
+ assertEquals("hello\\\"world", AstBuilder.unquoteString("?'hello\\\"world'"));
+ assertEquals("hello'world", AstBuilder.unquoteString("?\"hello'world\""));
+ assertEquals("hello\\nworld", AstBuilder.unquoteString("?'hello\\nworld'"));
+ assertEquals("hello\\\\nworld", AstBuilder.unquoteString("?'hello\\\\nworld'"));
+ assertEquals("hello\\\\\\nworld", AstBuilder.unquoteString("?'hello\\\\\\nworld'"));
+ assertEquals("hello\\\\\\\"world", AstBuilder.unquoteString("?'hello\\\\\\\"world'"));
}
public void testSupportedQueries() throws Exception {
From 66aa579abf7d4da52fcb69dddf8057f2c614c32d Mon Sep 17 00:00:00 2001
From: Ross Wolf <31489089+rw-access@users.noreply.github.com>
Date: Thu, 23 Jan 2020 09:06:07 -0700
Subject: [PATCH 8/8] EQL: Remove tabs from .eql tests
---
x-pack/plugin/eql/src/test/resources/queries-supported.eql | 2 +-
x-pack/plugin/eql/src/test/resources/queries-unsupported.eql | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/x-pack/plugin/eql/src/test/resources/queries-supported.eql b/x-pack/plugin/eql/src/test/resources/queries-supported.eql
index 20abf8ec4f33e..8326d558ba47a 100644
--- a/x-pack/plugin/eql/src/test/resources/queries-supported.eql
+++ b/x-pack/plugin/eql/src/test/resources/queries-supported.eql
@@ -27,7 +27,7 @@ process where command_line == "~!@#$%^&*();'[]{}\\|<>?,./:\"-= ' ";
process where
- pid == 4;
+ pid == 4;
process where process_name in ("net.exe", "cmd.exe", "at.exe");
diff --git a/x-pack/plugin/eql/src/test/resources/queries-unsupported.eql b/x-pack/plugin/eql/src/test/resources/queries-unsupported.eql
index 477b3efd51270..08d0d1582750d 100644
--- a/x-pack/plugin/eql/src/test/resources/queries-unsupported.eql
+++ b/x-pack/plugin/eql/src/test/resources/queries-unsupported.eql
@@ -89,7 +89,7 @@ until [process where event_subtype_full == "termination_event"]
process where descendant of [process where process_name == "lsass.exe"] and process_name == "cmd.exe";
- join [process where process_name == "*"] [file where file_path == "*"
+ join [process where process_name == "*"] [file where file_path == "*"
];
join by pid [process where name == "*"] [file where path == "*"] until [process where opcode == 2];