From 3b7e5849ebed8d6996bdcada45bfdd6653da639d Mon Sep 17 00:00:00 2001 From: Blake Rouse Date: Tue, 2 Jul 2024 18:50:53 -0400 Subject: [PATCH] Add ability to escape variable expansion in policy (#5035) * Add ability to escape variables. * Make go vet happy. * Generate NOTICE.txt. * Add changelog. --- NOTICE.txt | 50 +- ...ability-to-escape-variables-in-policy.yaml | 34 + go.mod | 2 +- go.sum | 4 +- internal/pkg/agent/transpiler/vars.go | 9 +- internal/pkg/agent/transpiler/vars_test.go | 6 + internal/pkg/eql/Eql.g4 | 2 + internal/pkg/eql/eql_test.go | 13 +- internal/pkg/eql/expression.go | 2 +- internal/pkg/eql/parser/Eql.interp | 4 +- internal/pkg/eql/parser/Eql.tokens | 6 +- internal/pkg/eql/parser/EqlLexer.interp | 5 +- internal/pkg/eql/parser/EqlLexer.tokens | 6 +- internal/pkg/eql/parser/eql_base_listener.go | 10 +- internal/pkg/eql/parser/eql_base_visitor.go | 8 +- internal/pkg/eql/parser/eql_lexer.go | 323 ++-- internal/pkg/eql/parser/eql_listener.go | 10 +- internal/pkg/eql/parser/eql_parser.go | 1319 ++++++++++------- internal/pkg/eql/parser/eql_visitor.go | 7 +- internal/pkg/eql/visitor.go | 9 +- 20 files changed, 1102 insertions(+), 727 deletions(-) create mode 100644 changelog/fragments/1719935188-Add-ability-to-escape-variables-in-policy.yaml diff --git a/NOTICE.txt b/NOTICE.txt index 058227466f7..d2403d56652 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -42,39 +42,41 @@ SOFTWARE. -------------------------------------------------------------------------------- -Dependency : github.com/antlr/antlr4/runtime/Go/antlr/v4 -Version: v4.0.0-20230321174746-8dcc6526cfb1 +Dependency : github.com/antlr4-go/antlr/v4 +Version: v4.13.0 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/antlr/antlr4/runtime/!go/antlr/v4@v4.0.0-20230321174746-8dcc6526cfb1/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/antlr4-go/antlr/v4@v4.13.0/LICENSE: -Copyright 2021 The ANTLR Project +Copyright (c) 2012-2023 The ANTLR Project. All rights reserved. -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. +3. Neither name of copyright holders nor the names of its contributors +may be used to endorse or promote products derived from this software +without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- diff --git a/changelog/fragments/1719935188-Add-ability-to-escape-variables-in-policy.yaml b/changelog/fragments/1719935188-Add-ability-to-escape-variables-in-policy.yaml new file mode 100644 index 00000000000..6cec7ddc2fe --- /dev/null +++ b/changelog/fragments/1719935188-Add-ability-to-escape-variables-in-policy.yaml @@ -0,0 +1,34 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: enhancement + +# Change summary; a 80ish characters long description of the change. +summary: Add ability to escape variables in policy + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +description: | + Adds the ability to escape variables with prefix of '$' allow variables such as `$${...}` to be escaped and + included in the computed policy as `${...}`. + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: elastic-agent + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +pr: https://github.com/elastic/elastic-agent/pull/5035 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +issue: https://github.com/elastic/elastic-agent/issues/2177 diff --git a/go.mod b/go.mod index cdc82666446..954ab596bff 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.4 require ( github.com/Microsoft/go-winio v0.6.2 - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230321174746-8dcc6526cfb1 + github.com/antlr4-go/antlr/v4 v4.13.0 github.com/billgraziano/dpapi v0.4.0 github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2 github.com/cavaliercoder/go-rpm v0.0.0-20190131055624-7a9c54e3d83e diff --git a/go.sum b/go.sum index b86ccf76709..c6bf91a5b39 100644 --- a/go.sum +++ b/go.sum @@ -499,8 +499,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuW github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/antlr/antlr4/runtime/Go/antlr v1.4.10/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230321174746-8dcc6526cfb1 h1:X8MJ0fnN5FPdcGF5Ij2/OW+HgiJrRg3AfHAx1PJtIzM= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230321174746-8dcc6526cfb1/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= diff --git a/internal/pkg/agent/transpiler/vars.go b/internal/pkg/agent/transpiler/vars.go index be8aa074095..277d6c483e3 100644 --- a/internal/pkg/agent/transpiler/vars.go +++ b/internal/pkg/agent/transpiler/vars.go @@ -14,7 +14,7 @@ import ( "github.com/elastic/elastic-agent/internal/pkg/core/composable" ) -var varsRegex = regexp.MustCompile(`\${([\p{L}\d\s\\\-_|.'":\/]*)}`) +var varsRegex = regexp.MustCompile(`\$\$?{([\p{L}\d\s\\\-_|.'":\/]*)}`) // ErrNoMatch is return when the replace didn't fail, just that no vars match to perform the replace. var ErrNoMatch = fmt.Errorf("no matching vars") @@ -53,6 +53,13 @@ func (v *Vars) Replace(value string) (Node, error) { lastIndex := 0 for _, r := range matchIdxs { for i := 0; i < len(r); i += 4 { + if value[r[i]+1] == '$' { + // match on an escaped var, append the raw string with the '$' prefix removed + result += value[lastIndex:r[0]] + value[r[i]+1:r[i+1]] + lastIndex = r[1] + continue + } + // match on a non-escaped var vars, err := extractVars(value[r[i+2]:r[i+3]]) if err != nil { return nil, fmt.Errorf(`error parsing variable "%s": %w`, value[r[i]:r[i+1]], err) diff --git a/internal/pkg/agent/transpiler/vars_test.go b/internal/pkg/agent/transpiler/vars_test.go index 0843e1a73a1..356cd47c9b1 100644 --- a/internal/pkg/agent/transpiler/vars_test.go +++ b/internal/pkg/agent/transpiler/vars_test.go @@ -203,6 +203,12 @@ func TestVars_Replace(t *testing.T) { false, true, }, + { + `start $${keep} ${un-der_score.key1} $${un-der_score.key1}`, + NewStrVal(`start ${keep} data1 ${un-der_score.key1}`), + false, + false, + }, } for _, test := range tests { t.Run(test.Input, func(t *testing.T) { diff --git a/internal/pkg/eql/Eql.g4 b/internal/pkg/eql/Eql.g4 index 44163f02ca8..b51ba2ac177 100644 --- a/internal/pkg/eql/Eql.g4 +++ b/internal/pkg/eql/Eql.g4 @@ -31,6 +31,7 @@ LARR: '['; RARR: ']'; LDICT: '{'; RDICT: '}'; +BEGIN_EVARIABLE: '$${'; BEGIN_VARIABLE: '${'; expList: exp EOF; @@ -71,6 +72,7 @@ exp | left=exp AND right=exp # ExpLogicalAnd | left=exp OR right=exp # ExpLogicalOR | boolean # ExpBoolean +| BEGIN_EVARIABLE variableExp RDICT # ExpEVariable | BEGIN_VARIABLE variableExp RDICT # ExpVariable | NAME LPAR arguments? RPAR # ExpFunction | LARR array? RARR # ExpArray diff --git a/internal/pkg/eql/eql_test.go b/internal/pkg/eql/eql_test.go index a89086479c7..fd650997583 100644 --- a/internal/pkg/eql/eql_test.go +++ b/internal/pkg/eql/eql_test.go @@ -9,7 +9,7 @@ import ( "os" "testing" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -58,6 +58,10 @@ func TestEql(t *testing.T) { result bool err bool }{ + // escaped variables (not allowed) + {expression: "$${env.HOSTNAME|host.name|'fallback'}", err: true}, + {expression: "$${env.HOSTNAME}", err: true}, + // variables {expression: "${env.HOSTNAME|host.name|'fallback'} == 'my-hostname'", result: true}, {expression: "${env.MISSING|host.name|'fallback'} == 'host-name'", result: true}, @@ -72,6 +76,12 @@ func TestEql(t *testing.T) { {expression: "${'dash-value'} == 'dash-value'", result: true}, {expression: "${data.with/slash} == 'some/path'", result: true}, + // constant of variables + {expression: "'${env.HOSTNAME}' == '${env.HOSTNAME}'", result: true}, + {expression: "'${env.HOSTNAME}' == '${env.HOSTSAME}'", result: false}, + {expression: "'$${env.HOSTNAME}' == '$${env.HOSTNAME}'", result: true}, + {expression: "'$${env.HOSTNAME}' == '$${env.HOSTSAME}'", result: false}, + // boolean {expression: "true", result: true}, {expression: "false", result: false}, @@ -356,6 +366,7 @@ func TestEql(t *testing.T) { store := &testVarStore{ vars: map[string]interface{}{ "env.HOSTNAME": "my-hostname", + "env.HOSTSAME": "my-hostname", "host.name": "host-name", "data.array": []interface{}{"array1", "array2", "array3"}, "data.with-dash": "dash-value", diff --git a/internal/pkg/eql/expression.go b/internal/pkg/eql/expression.go index 0c76a6176ed..49700bd7f35 100644 --- a/internal/pkg/eql/expression.go +++ b/internal/pkg/eql/expression.go @@ -8,7 +8,7 @@ import ( "errors" "fmt" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" "github.com/hashicorp/go-multierror" "github.com/elastic/elastic-agent/internal/pkg/eql/parser" diff --git a/internal/pkg/eql/parser/Eql.interp b/internal/pkg/eql/parser/Eql.interp index af52ef67a8b..ec0a026dbf2 100644 --- a/internal/pkg/eql/parser/Eql.interp +++ b/internal/pkg/eql/parser/Eql.interp @@ -32,6 +32,7 @@ null ']' '{' '}' +'$${' '${' token symbolic names: @@ -68,6 +69,7 @@ LARR RARR LDICT RDICT +BEGIN_EVARIABLE BEGIN_VARIABLE rule names: @@ -84,4 +86,4 @@ dict atn: -[4, 1, 33, 142, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 31, 8, 2, 1, 3, 1, 3, 1, 3, 3, 3, 36, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 41, 8, 4, 10, 4, 12, 4, 44, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 61, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 66, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 71, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 77, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 109, 8, 5, 10, 5, 12, 5, 112, 9, 5, 1, 6, 1, 6, 1, 6, 5, 6, 117, 8, 6, 10, 6, 12, 6, 120, 9, 6, 1, 7, 1, 7, 1, 7, 5, 7, 125, 8, 7, 10, 7, 12, 7, 128, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 137, 8, 9, 10, 9, 12, 9, 140, 9, 9, 1, 9, 0, 1, 10, 10, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 5, 1, 0, 17, 18, 1, 0, 25, 26, 1, 0, 12, 14, 1, 0, 10, 11, 2, 0, 23, 23, 25, 26, 163, 0, 20, 1, 0, 0, 0, 2, 23, 1, 0, 0, 0, 4, 30, 1, 0, 0, 0, 6, 35, 1, 0, 0, 0, 8, 37, 1, 0, 0, 0, 10, 76, 1, 0, 0, 0, 12, 113, 1, 0, 0, 0, 14, 121, 1, 0, 0, 0, 16, 129, 1, 0, 0, 0, 18, 133, 1, 0, 0, 0, 20, 21, 3, 10, 5, 0, 21, 22, 5, 0, 0, 1, 22, 1, 1, 0, 0, 0, 23, 24, 7, 0, 0, 0, 24, 3, 1, 0, 0, 0, 25, 31, 5, 25, 0, 0, 26, 31, 5, 26, 0, 0, 27, 31, 5, 19, 0, 0, 28, 31, 5, 20, 0, 0, 29, 31, 3, 2, 1, 0, 30, 25, 1, 0, 0, 0, 30, 26, 1, 0, 0, 0, 30, 27, 1, 0, 0, 0, 30, 28, 1, 0, 0, 0, 30, 29, 1, 0, 0, 0, 31, 5, 1, 0, 0, 0, 32, 36, 5, 23, 0, 0, 33, 36, 5, 24, 0, 0, 34, 36, 3, 4, 2, 0, 35, 32, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 34, 1, 0, 0, 0, 36, 7, 1, 0, 0, 0, 37, 42, 3, 6, 3, 0, 38, 39, 5, 1, 0, 0, 39, 41, 3, 6, 3, 0, 40, 38, 1, 0, 0, 0, 41, 44, 1, 0, 0, 0, 42, 40, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 9, 1, 0, 0, 0, 44, 42, 1, 0, 0, 0, 45, 46, 6, 5, -1, 0, 46, 47, 5, 27, 0, 0, 47, 48, 3, 10, 5, 0, 48, 49, 5, 28, 0, 0, 49, 77, 1, 0, 0, 0, 50, 51, 5, 22, 0, 0, 51, 77, 3, 10, 5, 17, 52, 77, 3, 2, 1, 0, 53, 54, 5, 33, 0, 0, 54, 55, 3, 8, 4, 0, 55, 56, 5, 32, 0, 0, 56, 77, 1, 0, 0, 0, 57, 58, 5, 23, 0, 0, 58, 60, 5, 27, 0, 0, 59, 61, 3, 12, 6, 0, 60, 59, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 77, 5, 28, 0, 0, 63, 65, 5, 29, 0, 0, 64, 66, 3, 14, 7, 0, 65, 64, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 77, 5, 30, 0, 0, 68, 70, 5, 31, 0, 0, 69, 71, 3, 18, 9, 0, 70, 69, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 77, 5, 32, 0, 0, 73, 77, 7, 1, 0, 0, 74, 77, 5, 19, 0, 0, 75, 77, 5, 20, 0, 0, 76, 45, 1, 0, 0, 0, 76, 50, 1, 0, 0, 0, 76, 52, 1, 0, 0, 0, 76, 53, 1, 0, 0, 0, 76, 57, 1, 0, 0, 0, 76, 63, 1, 0, 0, 0, 76, 68, 1, 0, 0, 0, 76, 73, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 76, 75, 1, 0, 0, 0, 77, 110, 1, 0, 0, 0, 78, 79, 10, 19, 0, 0, 79, 80, 7, 2, 0, 0, 80, 109, 3, 10, 5, 20, 81, 82, 10, 18, 0, 0, 82, 83, 7, 3, 0, 0, 83, 109, 3, 10, 5, 19, 84, 85, 10, 16, 0, 0, 85, 86, 5, 4, 0, 0, 86, 109, 3, 10, 5, 17, 87, 88, 10, 15, 0, 0, 88, 89, 5, 5, 0, 0, 89, 109, 3, 10, 5, 16, 90, 91, 10, 14, 0, 0, 91, 92, 5, 9, 0, 0, 92, 109, 3, 10, 5, 15, 93, 94, 10, 13, 0, 0, 94, 95, 5, 8, 0, 0, 95, 109, 3, 10, 5, 14, 96, 97, 10, 12, 0, 0, 97, 98, 5, 7, 0, 0, 98, 109, 3, 10, 5, 13, 99, 100, 10, 11, 0, 0, 100, 101, 5, 6, 0, 0, 101, 109, 3, 10, 5, 12, 102, 103, 10, 10, 0, 0, 103, 104, 5, 15, 0, 0, 104, 109, 3, 10, 5, 11, 105, 106, 10, 9, 0, 0, 106, 107, 5, 16, 0, 0, 107, 109, 3, 10, 5, 10, 108, 78, 1, 0, 0, 0, 108, 81, 1, 0, 0, 0, 108, 84, 1, 0, 0, 0, 108, 87, 1, 0, 0, 0, 108, 90, 1, 0, 0, 0, 108, 93, 1, 0, 0, 0, 108, 96, 1, 0, 0, 0, 108, 99, 1, 0, 0, 0, 108, 102, 1, 0, 0, 0, 108, 105, 1, 0, 0, 0, 109, 112, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 111, 11, 1, 0, 0, 0, 112, 110, 1, 0, 0, 0, 113, 118, 3, 10, 5, 0, 114, 115, 5, 2, 0, 0, 115, 117, 3, 10, 5, 0, 116, 114, 1, 0, 0, 0, 117, 120, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 121, 126, 3, 4, 2, 0, 122, 123, 5, 2, 0, 0, 123, 125, 3, 4, 2, 0, 124, 122, 1, 0, 0, 0, 125, 128, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, 15, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 129, 130, 7, 4, 0, 0, 130, 131, 5, 3, 0, 0, 131, 132, 3, 4, 2, 0, 132, 17, 1, 0, 0, 0, 133, 138, 3, 16, 8, 0, 134, 135, 5, 2, 0, 0, 135, 137, 3, 16, 8, 0, 136, 134, 1, 0, 0, 0, 137, 140, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 19, 1, 0, 0, 0, 140, 138, 1, 0, 0, 0, 12, 30, 35, 42, 60, 65, 70, 76, 108, 110, 118, 126, 138] \ No newline at end of file +[4, 1, 34, 146, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 31, 8, 2, 1, 3, 1, 3, 1, 3, 3, 3, 36, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 41, 8, 4, 10, 4, 12, 4, 44, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 65, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 70, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 75, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 81, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 113, 8, 5, 10, 5, 12, 5, 116, 9, 5, 1, 6, 1, 6, 1, 6, 5, 6, 121, 8, 6, 10, 6, 12, 6, 124, 9, 6, 1, 7, 1, 7, 1, 7, 5, 7, 129, 8, 7, 10, 7, 12, 7, 132, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 141, 8, 9, 10, 9, 12, 9, 144, 9, 9, 1, 9, 0, 1, 10, 10, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 5, 1, 0, 17, 18, 1, 0, 25, 26, 1, 0, 12, 14, 1, 0, 10, 11, 2, 0, 23, 23, 25, 26, 168, 0, 20, 1, 0, 0, 0, 2, 23, 1, 0, 0, 0, 4, 30, 1, 0, 0, 0, 6, 35, 1, 0, 0, 0, 8, 37, 1, 0, 0, 0, 10, 80, 1, 0, 0, 0, 12, 117, 1, 0, 0, 0, 14, 125, 1, 0, 0, 0, 16, 133, 1, 0, 0, 0, 18, 137, 1, 0, 0, 0, 20, 21, 3, 10, 5, 0, 21, 22, 5, 0, 0, 1, 22, 1, 1, 0, 0, 0, 23, 24, 7, 0, 0, 0, 24, 3, 1, 0, 0, 0, 25, 31, 5, 25, 0, 0, 26, 31, 5, 26, 0, 0, 27, 31, 5, 19, 0, 0, 28, 31, 5, 20, 0, 0, 29, 31, 3, 2, 1, 0, 30, 25, 1, 0, 0, 0, 30, 26, 1, 0, 0, 0, 30, 27, 1, 0, 0, 0, 30, 28, 1, 0, 0, 0, 30, 29, 1, 0, 0, 0, 31, 5, 1, 0, 0, 0, 32, 36, 5, 23, 0, 0, 33, 36, 5, 24, 0, 0, 34, 36, 3, 4, 2, 0, 35, 32, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 34, 1, 0, 0, 0, 36, 7, 1, 0, 0, 0, 37, 42, 3, 6, 3, 0, 38, 39, 5, 1, 0, 0, 39, 41, 3, 6, 3, 0, 40, 38, 1, 0, 0, 0, 41, 44, 1, 0, 0, 0, 42, 40, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 9, 1, 0, 0, 0, 44, 42, 1, 0, 0, 0, 45, 46, 6, 5, -1, 0, 46, 47, 5, 27, 0, 0, 47, 48, 3, 10, 5, 0, 48, 49, 5, 28, 0, 0, 49, 81, 1, 0, 0, 0, 50, 51, 5, 22, 0, 0, 51, 81, 3, 10, 5, 18, 52, 81, 3, 2, 1, 0, 53, 54, 5, 33, 0, 0, 54, 55, 3, 8, 4, 0, 55, 56, 5, 32, 0, 0, 56, 81, 1, 0, 0, 0, 57, 58, 5, 34, 0, 0, 58, 59, 3, 8, 4, 0, 59, 60, 5, 32, 0, 0, 60, 81, 1, 0, 0, 0, 61, 62, 5, 23, 0, 0, 62, 64, 5, 27, 0, 0, 63, 65, 3, 12, 6, 0, 64, 63, 1, 0, 0, 0, 64, 65, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 81, 5, 28, 0, 0, 67, 69, 5, 29, 0, 0, 68, 70, 3, 14, 7, 0, 69, 68, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 81, 5, 30, 0, 0, 72, 74, 5, 31, 0, 0, 73, 75, 3, 18, 9, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 81, 5, 32, 0, 0, 77, 81, 7, 1, 0, 0, 78, 81, 5, 19, 0, 0, 79, 81, 5, 20, 0, 0, 80, 45, 1, 0, 0, 0, 80, 50, 1, 0, 0, 0, 80, 52, 1, 0, 0, 0, 80, 53, 1, 0, 0, 0, 80, 57, 1, 0, 0, 0, 80, 61, 1, 0, 0, 0, 80, 67, 1, 0, 0, 0, 80, 72, 1, 0, 0, 0, 80, 77, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 79, 1, 0, 0, 0, 81, 114, 1, 0, 0, 0, 82, 83, 10, 20, 0, 0, 83, 84, 7, 2, 0, 0, 84, 113, 3, 10, 5, 21, 85, 86, 10, 19, 0, 0, 86, 87, 7, 3, 0, 0, 87, 113, 3, 10, 5, 20, 88, 89, 10, 17, 0, 0, 89, 90, 5, 4, 0, 0, 90, 113, 3, 10, 5, 18, 91, 92, 10, 16, 0, 0, 92, 93, 5, 5, 0, 0, 93, 113, 3, 10, 5, 17, 94, 95, 10, 15, 0, 0, 95, 96, 5, 9, 0, 0, 96, 113, 3, 10, 5, 16, 97, 98, 10, 14, 0, 0, 98, 99, 5, 8, 0, 0, 99, 113, 3, 10, 5, 15, 100, 101, 10, 13, 0, 0, 101, 102, 5, 7, 0, 0, 102, 113, 3, 10, 5, 14, 103, 104, 10, 12, 0, 0, 104, 105, 5, 6, 0, 0, 105, 113, 3, 10, 5, 13, 106, 107, 10, 11, 0, 0, 107, 108, 5, 15, 0, 0, 108, 113, 3, 10, 5, 12, 109, 110, 10, 10, 0, 0, 110, 111, 5, 16, 0, 0, 111, 113, 3, 10, 5, 11, 112, 82, 1, 0, 0, 0, 112, 85, 1, 0, 0, 0, 112, 88, 1, 0, 0, 0, 112, 91, 1, 0, 0, 0, 112, 94, 1, 0, 0, 0, 112, 97, 1, 0, 0, 0, 112, 100, 1, 0, 0, 0, 112, 103, 1, 0, 0, 0, 112, 106, 1, 0, 0, 0, 112, 109, 1, 0, 0, 0, 113, 116, 1, 0, 0, 0, 114, 112, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 11, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 117, 122, 3, 10, 5, 0, 118, 119, 5, 2, 0, 0, 119, 121, 3, 10, 5, 0, 120, 118, 1, 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 13, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 130, 3, 4, 2, 0, 126, 127, 5, 2, 0, 0, 127, 129, 3, 4, 2, 0, 128, 126, 1, 0, 0, 0, 129, 132, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 15, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 133, 134, 7, 4, 0, 0, 134, 135, 5, 3, 0, 0, 135, 136, 3, 4, 2, 0, 136, 17, 1, 0, 0, 0, 137, 142, 3, 16, 8, 0, 138, 139, 5, 2, 0, 0, 139, 141, 3, 16, 8, 0, 140, 138, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 19, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 12, 30, 35, 42, 64, 69, 74, 80, 112, 114, 122, 130, 142] \ No newline at end of file diff --git a/internal/pkg/eql/parser/Eql.tokens b/internal/pkg/eql/parser/Eql.tokens index 80081750b0b..63a99013f81 100644 --- a/internal/pkg/eql/parser/Eql.tokens +++ b/internal/pkg/eql/parser/Eql.tokens @@ -30,7 +30,8 @@ LARR=29 RARR=30 LDICT=31 RDICT=32 -BEGIN_VARIABLE=33 +BEGIN_EVARIABLE=33 +BEGIN_VARIABLE=34 '|'=1 ','=2 ':'=3 @@ -51,4 +52,5 @@ BEGIN_VARIABLE=33 ']'=30 '{'=31 '}'=32 -'${'=33 +'$${'=33 +'${'=34 diff --git a/internal/pkg/eql/parser/EqlLexer.interp b/internal/pkg/eql/parser/EqlLexer.interp index b6adbc72f6e..82652ed6633 100644 --- a/internal/pkg/eql/parser/EqlLexer.interp +++ b/internal/pkg/eql/parser/EqlLexer.interp @@ -32,6 +32,7 @@ null ']' '{' '}' +'$${' '${' token symbolic names: @@ -68,6 +69,7 @@ LARR RARR LDICT RDICT +BEGIN_EVARIABLE BEGIN_VARIABLE rule names: @@ -103,6 +105,7 @@ LARR RARR LDICT RDICT +BEGIN_EVARIABLE BEGIN_VARIABLE channel names: @@ -113,4 +116,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 33, 228, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 106, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 112, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 122, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 134, 8, 17, 1, 18, 3, 18, 137, 8, 18, 1, 18, 4, 18, 140, 8, 18, 11, 18, 12, 18, 141, 1, 18, 1, 18, 4, 18, 146, 8, 18, 11, 18, 12, 18, 147, 1, 19, 3, 19, 151, 8, 19, 1, 19, 4, 19, 154, 8, 19, 11, 19, 12, 19, 155, 1, 20, 4, 20, 159, 8, 20, 11, 20, 12, 20, 160, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 3, 21, 171, 8, 21, 1, 22, 1, 22, 5, 22, 175, 8, 22, 10, 22, 12, 22, 178, 9, 22, 1, 23, 4, 23, 181, 8, 23, 11, 23, 12, 23, 182, 1, 23, 1, 23, 4, 23, 187, 8, 23, 11, 23, 12, 23, 188, 5, 23, 191, 8, 23, 10, 23, 12, 23, 194, 9, 23, 1, 24, 1, 24, 5, 24, 198, 8, 24, 10, 24, 12, 24, 201, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 207, 8, 25, 10, 25, 12, 25, 210, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 0, 0, 33, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 1, 0, 8, 1, 0, 45, 45, 1, 0, 48, 57, 3, 0, 9, 10, 13, 13, 32, 32, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 5, 0, 45, 45, 47, 57, 65, 90, 95, 95, 97, 122, 3, 0, 10, 10, 13, 13, 39, 39, 3, 0, 10, 10, 13, 13, 34, 34, 244, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 1, 67, 1, 0, 0, 0, 3, 69, 1, 0, 0, 0, 5, 71, 1, 0, 0, 0, 7, 73, 1, 0, 0, 0, 9, 76, 1, 0, 0, 0, 11, 79, 1, 0, 0, 0, 13, 81, 1, 0, 0, 0, 15, 83, 1, 0, 0, 0, 17, 86, 1, 0, 0, 0, 19, 89, 1, 0, 0, 0, 21, 91, 1, 0, 0, 0, 23, 93, 1, 0, 0, 0, 25, 95, 1, 0, 0, 0, 27, 97, 1, 0, 0, 0, 29, 105, 1, 0, 0, 0, 31, 111, 1, 0, 0, 0, 33, 121, 1, 0, 0, 0, 35, 133, 1, 0, 0, 0, 37, 136, 1, 0, 0, 0, 39, 150, 1, 0, 0, 0, 41, 158, 1, 0, 0, 0, 43, 170, 1, 0, 0, 0, 45, 172, 1, 0, 0, 0, 47, 180, 1, 0, 0, 0, 49, 195, 1, 0, 0, 0, 51, 204, 1, 0, 0, 0, 53, 213, 1, 0, 0, 0, 55, 215, 1, 0, 0, 0, 57, 217, 1, 0, 0, 0, 59, 219, 1, 0, 0, 0, 61, 221, 1, 0, 0, 0, 63, 223, 1, 0, 0, 0, 65, 225, 1, 0, 0, 0, 67, 68, 5, 124, 0, 0, 68, 2, 1, 0, 0, 0, 69, 70, 5, 44, 0, 0, 70, 4, 1, 0, 0, 0, 71, 72, 5, 58, 0, 0, 72, 6, 1, 0, 0, 0, 73, 74, 5, 61, 0, 0, 74, 75, 5, 61, 0, 0, 75, 8, 1, 0, 0, 0, 76, 77, 5, 33, 0, 0, 77, 78, 5, 61, 0, 0, 78, 10, 1, 0, 0, 0, 79, 80, 5, 62, 0, 0, 80, 12, 1, 0, 0, 0, 81, 82, 5, 60, 0, 0, 82, 14, 1, 0, 0, 0, 83, 84, 5, 62, 0, 0, 84, 85, 5, 61, 0, 0, 85, 16, 1, 0, 0, 0, 86, 87, 5, 60, 0, 0, 87, 88, 5, 61, 0, 0, 88, 18, 1, 0, 0, 0, 89, 90, 5, 43, 0, 0, 90, 20, 1, 0, 0, 0, 91, 92, 5, 45, 0, 0, 92, 22, 1, 0, 0, 0, 93, 94, 5, 42, 0, 0, 94, 24, 1, 0, 0, 0, 95, 96, 5, 47, 0, 0, 96, 26, 1, 0, 0, 0, 97, 98, 5, 37, 0, 0, 98, 28, 1, 0, 0, 0, 99, 100, 5, 97, 0, 0, 100, 101, 5, 110, 0, 0, 101, 106, 5, 100, 0, 0, 102, 103, 5, 65, 0, 0, 103, 104, 5, 78, 0, 0, 104, 106, 5, 68, 0, 0, 105, 99, 1, 0, 0, 0, 105, 102, 1, 0, 0, 0, 106, 30, 1, 0, 0, 0, 107, 108, 5, 111, 0, 0, 108, 112, 5, 114, 0, 0, 109, 110, 5, 79, 0, 0, 110, 112, 5, 82, 0, 0, 111, 107, 1, 0, 0, 0, 111, 109, 1, 0, 0, 0, 112, 32, 1, 0, 0, 0, 113, 114, 5, 116, 0, 0, 114, 115, 5, 114, 0, 0, 115, 116, 5, 117, 0, 0, 116, 122, 5, 101, 0, 0, 117, 118, 5, 84, 0, 0, 118, 119, 5, 82, 0, 0, 119, 120, 5, 85, 0, 0, 120, 122, 5, 69, 0, 0, 121, 113, 1, 0, 0, 0, 121, 117, 1, 0, 0, 0, 122, 34, 1, 0, 0, 0, 123, 124, 5, 102, 0, 0, 124, 125, 5, 97, 0, 0, 125, 126, 5, 108, 0, 0, 126, 127, 5, 115, 0, 0, 127, 134, 5, 101, 0, 0, 128, 129, 5, 70, 0, 0, 129, 130, 5, 65, 0, 0, 130, 131, 5, 76, 0, 0, 131, 132, 5, 83, 0, 0, 132, 134, 5, 69, 0, 0, 133, 123, 1, 0, 0, 0, 133, 128, 1, 0, 0, 0, 134, 36, 1, 0, 0, 0, 135, 137, 7, 0, 0, 0, 136, 135, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 139, 1, 0, 0, 0, 138, 140, 7, 1, 0, 0, 139, 138, 1, 0, 0, 0, 140, 141, 1, 0, 0, 0, 141, 139, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 5, 46, 0, 0, 144, 146, 7, 1, 0, 0, 145, 144, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, 148, 38, 1, 0, 0, 0, 149, 151, 7, 0, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 154, 7, 1, 0, 0, 153, 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 40, 1, 0, 0, 0, 157, 159, 7, 2, 0, 0, 158, 157, 1, 0, 0, 0, 159, 160, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 163, 6, 20, 0, 0, 163, 42, 1, 0, 0, 0, 164, 165, 5, 78, 0, 0, 165, 166, 5, 79, 0, 0, 166, 171, 5, 84, 0, 0, 167, 168, 5, 110, 0, 0, 168, 169, 5, 111, 0, 0, 169, 171, 5, 116, 0, 0, 170, 164, 1, 0, 0, 0, 170, 167, 1, 0, 0, 0, 171, 44, 1, 0, 0, 0, 172, 176, 7, 3, 0, 0, 173, 175, 7, 4, 0, 0, 174, 173, 1, 0, 0, 0, 175, 178, 1, 0, 0, 0, 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 46, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 179, 181, 7, 5, 0, 0, 180, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 192, 1, 0, 0, 0, 184, 186, 5, 46, 0, 0, 185, 187, 7, 5, 0, 0, 186, 185, 1, 0, 0, 0, 187, 188, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, 184, 1, 0, 0, 0, 191, 194, 1, 0, 0, 0, 192, 190, 1, 0, 0, 0, 192, 193, 1, 0, 0, 0, 193, 48, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 195, 199, 5, 39, 0, 0, 196, 198, 8, 6, 0, 0, 197, 196, 1, 0, 0, 0, 198, 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 202, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 5, 39, 0, 0, 203, 50, 1, 0, 0, 0, 204, 208, 5, 34, 0, 0, 205, 207, 8, 7, 0, 0, 206, 205, 1, 0, 0, 0, 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, 211, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 5, 34, 0, 0, 212, 52, 1, 0, 0, 0, 213, 214, 5, 40, 0, 0, 214, 54, 1, 0, 0, 0, 215, 216, 5, 41, 0, 0, 216, 56, 1, 0, 0, 0, 217, 218, 5, 91, 0, 0, 218, 58, 1, 0, 0, 0, 219, 220, 5, 93, 0, 0, 220, 60, 1, 0, 0, 0, 221, 222, 5, 123, 0, 0, 222, 62, 1, 0, 0, 0, 223, 224, 5, 125, 0, 0, 224, 64, 1, 0, 0, 0, 225, 226, 5, 36, 0, 0, 226, 227, 5, 123, 0, 0, 227, 66, 1, 0, 0, 0, 18, 0, 105, 111, 121, 133, 136, 141, 147, 150, 155, 160, 170, 176, 182, 188, 192, 199, 208, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 34, 234, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 108, 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 114, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 124, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 136, 8, 17, 1, 18, 3, 18, 139, 8, 18, 1, 18, 4, 18, 142, 8, 18, 11, 18, 12, 18, 143, 1, 18, 1, 18, 4, 18, 148, 8, 18, 11, 18, 12, 18, 149, 1, 19, 3, 19, 153, 8, 19, 1, 19, 4, 19, 156, 8, 19, 11, 19, 12, 19, 157, 1, 20, 4, 20, 161, 8, 20, 11, 20, 12, 20, 162, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 3, 21, 173, 8, 21, 1, 22, 1, 22, 5, 22, 177, 8, 22, 10, 22, 12, 22, 180, 9, 22, 1, 23, 4, 23, 183, 8, 23, 11, 23, 12, 23, 184, 1, 23, 1, 23, 4, 23, 189, 8, 23, 11, 23, 12, 23, 190, 5, 23, 193, 8, 23, 10, 23, 12, 23, 196, 9, 23, 1, 24, 1, 24, 5, 24, 200, 8, 24, 10, 24, 12, 24, 203, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 209, 8, 25, 10, 25, 12, 25, 212, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 0, 0, 34, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 1, 0, 8, 1, 0, 45, 45, 1, 0, 48, 57, 3, 0, 9, 10, 13, 13, 32, 32, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 5, 0, 45, 45, 47, 57, 65, 90, 95, 95, 97, 122, 3, 0, 10, 10, 13, 13, 39, 39, 3, 0, 10, 10, 13, 13, 34, 34, 250, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 1, 69, 1, 0, 0, 0, 3, 71, 1, 0, 0, 0, 5, 73, 1, 0, 0, 0, 7, 75, 1, 0, 0, 0, 9, 78, 1, 0, 0, 0, 11, 81, 1, 0, 0, 0, 13, 83, 1, 0, 0, 0, 15, 85, 1, 0, 0, 0, 17, 88, 1, 0, 0, 0, 19, 91, 1, 0, 0, 0, 21, 93, 1, 0, 0, 0, 23, 95, 1, 0, 0, 0, 25, 97, 1, 0, 0, 0, 27, 99, 1, 0, 0, 0, 29, 107, 1, 0, 0, 0, 31, 113, 1, 0, 0, 0, 33, 123, 1, 0, 0, 0, 35, 135, 1, 0, 0, 0, 37, 138, 1, 0, 0, 0, 39, 152, 1, 0, 0, 0, 41, 160, 1, 0, 0, 0, 43, 172, 1, 0, 0, 0, 45, 174, 1, 0, 0, 0, 47, 182, 1, 0, 0, 0, 49, 197, 1, 0, 0, 0, 51, 206, 1, 0, 0, 0, 53, 215, 1, 0, 0, 0, 55, 217, 1, 0, 0, 0, 57, 219, 1, 0, 0, 0, 59, 221, 1, 0, 0, 0, 61, 223, 1, 0, 0, 0, 63, 225, 1, 0, 0, 0, 65, 227, 1, 0, 0, 0, 67, 231, 1, 0, 0, 0, 69, 70, 5, 124, 0, 0, 70, 2, 1, 0, 0, 0, 71, 72, 5, 44, 0, 0, 72, 4, 1, 0, 0, 0, 73, 74, 5, 58, 0, 0, 74, 6, 1, 0, 0, 0, 75, 76, 5, 61, 0, 0, 76, 77, 5, 61, 0, 0, 77, 8, 1, 0, 0, 0, 78, 79, 5, 33, 0, 0, 79, 80, 5, 61, 0, 0, 80, 10, 1, 0, 0, 0, 81, 82, 5, 62, 0, 0, 82, 12, 1, 0, 0, 0, 83, 84, 5, 60, 0, 0, 84, 14, 1, 0, 0, 0, 85, 86, 5, 62, 0, 0, 86, 87, 5, 61, 0, 0, 87, 16, 1, 0, 0, 0, 88, 89, 5, 60, 0, 0, 89, 90, 5, 61, 0, 0, 90, 18, 1, 0, 0, 0, 91, 92, 5, 43, 0, 0, 92, 20, 1, 0, 0, 0, 93, 94, 5, 45, 0, 0, 94, 22, 1, 0, 0, 0, 95, 96, 5, 42, 0, 0, 96, 24, 1, 0, 0, 0, 97, 98, 5, 47, 0, 0, 98, 26, 1, 0, 0, 0, 99, 100, 5, 37, 0, 0, 100, 28, 1, 0, 0, 0, 101, 102, 5, 97, 0, 0, 102, 103, 5, 110, 0, 0, 103, 108, 5, 100, 0, 0, 104, 105, 5, 65, 0, 0, 105, 106, 5, 78, 0, 0, 106, 108, 5, 68, 0, 0, 107, 101, 1, 0, 0, 0, 107, 104, 1, 0, 0, 0, 108, 30, 1, 0, 0, 0, 109, 110, 5, 111, 0, 0, 110, 114, 5, 114, 0, 0, 111, 112, 5, 79, 0, 0, 112, 114, 5, 82, 0, 0, 113, 109, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 32, 1, 0, 0, 0, 115, 116, 5, 116, 0, 0, 116, 117, 5, 114, 0, 0, 117, 118, 5, 117, 0, 0, 118, 124, 5, 101, 0, 0, 119, 120, 5, 84, 0, 0, 120, 121, 5, 82, 0, 0, 121, 122, 5, 85, 0, 0, 122, 124, 5, 69, 0, 0, 123, 115, 1, 0, 0, 0, 123, 119, 1, 0, 0, 0, 124, 34, 1, 0, 0, 0, 125, 126, 5, 102, 0, 0, 126, 127, 5, 97, 0, 0, 127, 128, 5, 108, 0, 0, 128, 129, 5, 115, 0, 0, 129, 136, 5, 101, 0, 0, 130, 131, 5, 70, 0, 0, 131, 132, 5, 65, 0, 0, 132, 133, 5, 76, 0, 0, 133, 134, 5, 83, 0, 0, 134, 136, 5, 69, 0, 0, 135, 125, 1, 0, 0, 0, 135, 130, 1, 0, 0, 0, 136, 36, 1, 0, 0, 0, 137, 139, 7, 0, 0, 0, 138, 137, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 141, 1, 0, 0, 0, 140, 142, 7, 1, 0, 0, 141, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 147, 5, 46, 0, 0, 146, 148, 7, 1, 0, 0, 147, 146, 1, 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, 147, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 38, 1, 0, 0, 0, 151, 153, 7, 0, 0, 0, 152, 151, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 155, 1, 0, 0, 0, 154, 156, 7, 1, 0, 0, 155, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 40, 1, 0, 0, 0, 159, 161, 7, 2, 0, 0, 160, 159, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 165, 6, 20, 0, 0, 165, 42, 1, 0, 0, 0, 166, 167, 5, 78, 0, 0, 167, 168, 5, 79, 0, 0, 168, 173, 5, 84, 0, 0, 169, 170, 5, 110, 0, 0, 170, 171, 5, 111, 0, 0, 171, 173, 5, 116, 0, 0, 172, 166, 1, 0, 0, 0, 172, 169, 1, 0, 0, 0, 173, 44, 1, 0, 0, 0, 174, 178, 7, 3, 0, 0, 175, 177, 7, 4, 0, 0, 176, 175, 1, 0, 0, 0, 177, 180, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 46, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 181, 183, 7, 5, 0, 0, 182, 181, 1, 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 194, 1, 0, 0, 0, 186, 188, 5, 46, 0, 0, 187, 189, 7, 5, 0, 0, 188, 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 193, 1, 0, 0, 0, 192, 186, 1, 0, 0, 0, 193, 196, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 48, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 197, 201, 5, 39, 0, 0, 198, 200, 8, 6, 0, 0, 199, 198, 1, 0, 0, 0, 200, 203, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 201, 202, 1, 0, 0, 0, 202, 204, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 204, 205, 5, 39, 0, 0, 205, 50, 1, 0, 0, 0, 206, 210, 5, 34, 0, 0, 207, 209, 8, 7, 0, 0, 208, 207, 1, 0, 0, 0, 209, 212, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 213, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 214, 5, 34, 0, 0, 214, 52, 1, 0, 0, 0, 215, 216, 5, 40, 0, 0, 216, 54, 1, 0, 0, 0, 217, 218, 5, 41, 0, 0, 218, 56, 1, 0, 0, 0, 219, 220, 5, 91, 0, 0, 220, 58, 1, 0, 0, 0, 221, 222, 5, 93, 0, 0, 222, 60, 1, 0, 0, 0, 223, 224, 5, 123, 0, 0, 224, 62, 1, 0, 0, 0, 225, 226, 5, 125, 0, 0, 226, 64, 1, 0, 0, 0, 227, 228, 5, 36, 0, 0, 228, 229, 5, 36, 0, 0, 229, 230, 5, 123, 0, 0, 230, 66, 1, 0, 0, 0, 231, 232, 5, 36, 0, 0, 232, 233, 5, 123, 0, 0, 233, 68, 1, 0, 0, 0, 18, 0, 107, 113, 123, 135, 138, 143, 149, 152, 157, 162, 172, 178, 184, 190, 194, 201, 210, 1, 6, 0, 0] \ No newline at end of file diff --git a/internal/pkg/eql/parser/EqlLexer.tokens b/internal/pkg/eql/parser/EqlLexer.tokens index 80081750b0b..63a99013f81 100644 --- a/internal/pkg/eql/parser/EqlLexer.tokens +++ b/internal/pkg/eql/parser/EqlLexer.tokens @@ -30,7 +30,8 @@ LARR=29 RARR=30 LDICT=31 RDICT=32 -BEGIN_VARIABLE=33 +BEGIN_EVARIABLE=33 +BEGIN_VARIABLE=34 '|'=1 ','=2 ':'=3 @@ -51,4 +52,5 @@ BEGIN_VARIABLE=33 ']'=30 '{'=31 '}'=32 -'${'=33 +'$${'=33 +'${'=34 diff --git a/internal/pkg/eql/parser/eql_base_listener.go b/internal/pkg/eql/parser/eql_base_listener.go index c9c88fd28f0..fd1210433ae 100644 --- a/internal/pkg/eql/parser/eql_base_listener.go +++ b/internal/pkg/eql/parser/eql_base_listener.go @@ -2,11 +2,11 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Code generated from Eql.g4 by ANTLR 4.12.0. DO NOT EDIT. +// Code generated from Eql.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Eql -import "github.com/antlr/antlr4/runtime/Go/antlr/v4" +import "github.com/antlr4-go/antlr/v4" // BaseEqlListener is a complete listener for a parse tree produced by EqlParser. type BaseEqlListener struct{} @@ -61,6 +61,12 @@ func (s *BaseEqlListener) EnterExpArithmeticNEQ(ctx *ExpArithmeticNEQContext) {} // ExitExpArithmeticNEQ is called when production ExpArithmeticNEQ is exited. func (s *BaseEqlListener) ExitExpArithmeticNEQ(ctx *ExpArithmeticNEQContext) {} +// EnterExpEVariable is called when production ExpEVariable is entered. +func (s *BaseEqlListener) EnterExpEVariable(ctx *ExpEVariableContext) {} + +// ExitExpEVariable is called when production ExpEVariable is exited. +func (s *BaseEqlListener) ExitExpEVariable(ctx *ExpEVariableContext) {} + // EnterExpArithmeticEQ is called when production ExpArithmeticEQ is entered. func (s *BaseEqlListener) EnterExpArithmeticEQ(ctx *ExpArithmeticEQContext) {} diff --git a/internal/pkg/eql/parser/eql_base_visitor.go b/internal/pkg/eql/parser/eql_base_visitor.go index 42b6cb3b432..5a9b34b06aa 100644 --- a/internal/pkg/eql/parser/eql_base_visitor.go +++ b/internal/pkg/eql/parser/eql_base_visitor.go @@ -2,11 +2,11 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Code generated from Eql.g4 by ANTLR 4.12.0. DO NOT EDIT. +// Code generated from Eql.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Eql -import "github.com/antlr/antlr4/runtime/Go/antlr/v4" +import "github.com/antlr4-go/antlr/v4" type BaseEqlVisitor struct { *antlr.BaseParseTreeVisitor @@ -36,6 +36,10 @@ func (v *BaseEqlVisitor) VisitExpArithmeticNEQ(ctx *ExpArithmeticNEQContext) int return v.VisitChildren(ctx) } +func (v *BaseEqlVisitor) VisitExpEVariable(ctx *ExpEVariableContext) interface{} { + return v.VisitChildren(ctx) +} + func (v *BaseEqlVisitor) VisitExpArithmeticEQ(ctx *ExpArithmeticEQContext) interface{} { return v.VisitChildren(ctx) } diff --git a/internal/pkg/eql/parser/eql_lexer.go b/internal/pkg/eql/parser/eql_lexer.go index 0822d94b4e8..c7c0c883b93 100644 --- a/internal/pkg/eql/parser/eql_lexer.go +++ b/internal/pkg/eql/parser/eql_lexer.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Code generated from Eql.g4 by ANTLR 4.12.0. DO NOT EDIT. +// Code generated from Eql.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser @@ -11,7 +11,7 @@ import ( "sync" "unicode" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" ) // Suppress unused import error @@ -26,151 +26,153 @@ type EqlLexer struct { // TODO: EOF string } -var eqllexerLexerStaticData struct { +var EqlLexerLexerStaticData struct { once sync.Once serializedATN []int32 - channelNames []string - modeNames []string - literalNames []string - symbolicNames []string - ruleNames []string - predictionContextCache *antlr.PredictionContextCache + ChannelNames []string + ModeNames []string + LiteralNames []string + SymbolicNames []string + RuleNames []string + PredictionContextCache *antlr.PredictionContextCache atn *antlr.ATN decisionToDFA []*antlr.DFA } func eqllexerLexerInit() { - staticData := &eqllexerLexerStaticData - staticData.channelNames = []string{ + staticData := &EqlLexerLexerStaticData + staticData.ChannelNames = []string{ "DEFAULT_TOKEN_CHANNEL", "HIDDEN", } - staticData.modeNames = []string{ + staticData.ModeNames = []string{ "DEFAULT_MODE", } - staticData.literalNames = []string{ + staticData.LiteralNames = []string{ "", "'|'", "','", "':'", "'=='", "'!='", "'>'", "'<'", "'>='", "'<='", "'+'", "'-'", "'*'", "'/'", "'%'", "", "", "", "", "", "", "", "", "", - "", "", "", "'('", "')'", "'['", "']'", "'{'", "'}'", "'${'", + "", "", "", "'('", "')'", "'['", "']'", "'{'", "'}'", "'$${'", "'${'", } - staticData.symbolicNames = []string{ + staticData.SymbolicNames = []string{ "", "", "", "", "EQ", "NEQ", "GT", "LT", "GTE", "LTE", "ADD", "SUB", "MUL", "DIV", "MOD", "AND", "OR", "TRUE", "FALSE", "FLOAT", "NUMBER", "WHITESPACE", "NOT", "NAME", "VNAME", "STEXT", "DTEXT", "LPAR", "RPAR", - "LARR", "RARR", "LDICT", "RDICT", "BEGIN_VARIABLE", + "LARR", "RARR", "LDICT", "RDICT", "BEGIN_EVARIABLE", "BEGIN_VARIABLE", } - staticData.ruleNames = []string{ + staticData.RuleNames = []string{ "T__0", "T__1", "T__2", "EQ", "NEQ", "GT", "LT", "GTE", "LTE", "ADD", "SUB", "MUL", "DIV", "MOD", "AND", "OR", "TRUE", "FALSE", "FLOAT", "NUMBER", "WHITESPACE", "NOT", "NAME", "VNAME", "STEXT", "DTEXT", "LPAR", "RPAR", - "LARR", "RARR", "LDICT", "RDICT", "BEGIN_VARIABLE", + "LARR", "RARR", "LDICT", "RDICT", "BEGIN_EVARIABLE", "BEGIN_VARIABLE", } - staticData.predictionContextCache = antlr.NewPredictionContextCache() + staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 0, 33, 228, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, + 4, 0, 34, 234, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, - 31, 7, 31, 2, 32, 7, 32, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, - 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 8, - 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, - 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 106, 8, 14, 1, - 15, 1, 15, 1, 15, 1, 15, 3, 15, 112, 8, 15, 1, 16, 1, 16, 1, 16, 1, 16, - 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 122, 8, 16, 1, 17, 1, 17, 1, 17, 1, - 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 134, 8, 17, 1, 18, - 3, 18, 137, 8, 18, 1, 18, 4, 18, 140, 8, 18, 11, 18, 12, 18, 141, 1, 18, - 1, 18, 4, 18, 146, 8, 18, 11, 18, 12, 18, 147, 1, 19, 3, 19, 151, 8, 19, - 1, 19, 4, 19, 154, 8, 19, 11, 19, 12, 19, 155, 1, 20, 4, 20, 159, 8, 20, - 11, 20, 12, 20, 160, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, - 21, 3, 21, 171, 8, 21, 1, 22, 1, 22, 5, 22, 175, 8, 22, 10, 22, 12, 22, - 178, 9, 22, 1, 23, 4, 23, 181, 8, 23, 11, 23, 12, 23, 182, 1, 23, 1, 23, - 4, 23, 187, 8, 23, 11, 23, 12, 23, 188, 5, 23, 191, 8, 23, 10, 23, 12, - 23, 194, 9, 23, 1, 24, 1, 24, 5, 24, 198, 8, 24, 10, 24, 12, 24, 201, 9, - 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 207, 8, 25, 10, 25, 12, 25, 210, - 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, - 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 0, 0, 33, 1, 1, 3, - 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, - 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, - 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, - 61, 31, 63, 32, 65, 33, 1, 0, 8, 1, 0, 45, 45, 1, 0, 48, 57, 3, 0, 9, 10, - 13, 13, 32, 32, 3, 0, 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, - 95, 97, 122, 5, 0, 45, 45, 47, 57, 65, 90, 95, 95, 97, 122, 3, 0, 10, 10, - 13, 13, 39, 39, 3, 0, 10, 10, 13, 13, 34, 34, 244, 0, 1, 1, 0, 0, 0, 0, - 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, - 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, - 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, - 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, - 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, - 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, - 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, - 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, - 0, 65, 1, 0, 0, 0, 1, 67, 1, 0, 0, 0, 3, 69, 1, 0, 0, 0, 5, 71, 1, 0, 0, - 0, 7, 73, 1, 0, 0, 0, 9, 76, 1, 0, 0, 0, 11, 79, 1, 0, 0, 0, 13, 81, 1, - 0, 0, 0, 15, 83, 1, 0, 0, 0, 17, 86, 1, 0, 0, 0, 19, 89, 1, 0, 0, 0, 21, - 91, 1, 0, 0, 0, 23, 93, 1, 0, 0, 0, 25, 95, 1, 0, 0, 0, 27, 97, 1, 0, 0, - 0, 29, 105, 1, 0, 0, 0, 31, 111, 1, 0, 0, 0, 33, 121, 1, 0, 0, 0, 35, 133, - 1, 0, 0, 0, 37, 136, 1, 0, 0, 0, 39, 150, 1, 0, 0, 0, 41, 158, 1, 0, 0, - 0, 43, 170, 1, 0, 0, 0, 45, 172, 1, 0, 0, 0, 47, 180, 1, 0, 0, 0, 49, 195, - 1, 0, 0, 0, 51, 204, 1, 0, 0, 0, 53, 213, 1, 0, 0, 0, 55, 215, 1, 0, 0, - 0, 57, 217, 1, 0, 0, 0, 59, 219, 1, 0, 0, 0, 61, 221, 1, 0, 0, 0, 63, 223, - 1, 0, 0, 0, 65, 225, 1, 0, 0, 0, 67, 68, 5, 124, 0, 0, 68, 2, 1, 0, 0, - 0, 69, 70, 5, 44, 0, 0, 70, 4, 1, 0, 0, 0, 71, 72, 5, 58, 0, 0, 72, 6, - 1, 0, 0, 0, 73, 74, 5, 61, 0, 0, 74, 75, 5, 61, 0, 0, 75, 8, 1, 0, 0, 0, - 76, 77, 5, 33, 0, 0, 77, 78, 5, 61, 0, 0, 78, 10, 1, 0, 0, 0, 79, 80, 5, - 62, 0, 0, 80, 12, 1, 0, 0, 0, 81, 82, 5, 60, 0, 0, 82, 14, 1, 0, 0, 0, - 83, 84, 5, 62, 0, 0, 84, 85, 5, 61, 0, 0, 85, 16, 1, 0, 0, 0, 86, 87, 5, - 60, 0, 0, 87, 88, 5, 61, 0, 0, 88, 18, 1, 0, 0, 0, 89, 90, 5, 43, 0, 0, - 90, 20, 1, 0, 0, 0, 91, 92, 5, 45, 0, 0, 92, 22, 1, 0, 0, 0, 93, 94, 5, - 42, 0, 0, 94, 24, 1, 0, 0, 0, 95, 96, 5, 47, 0, 0, 96, 26, 1, 0, 0, 0, - 97, 98, 5, 37, 0, 0, 98, 28, 1, 0, 0, 0, 99, 100, 5, 97, 0, 0, 100, 101, - 5, 110, 0, 0, 101, 106, 5, 100, 0, 0, 102, 103, 5, 65, 0, 0, 103, 104, - 5, 78, 0, 0, 104, 106, 5, 68, 0, 0, 105, 99, 1, 0, 0, 0, 105, 102, 1, 0, - 0, 0, 106, 30, 1, 0, 0, 0, 107, 108, 5, 111, 0, 0, 108, 112, 5, 114, 0, - 0, 109, 110, 5, 79, 0, 0, 110, 112, 5, 82, 0, 0, 111, 107, 1, 0, 0, 0, - 111, 109, 1, 0, 0, 0, 112, 32, 1, 0, 0, 0, 113, 114, 5, 116, 0, 0, 114, - 115, 5, 114, 0, 0, 115, 116, 5, 117, 0, 0, 116, 122, 5, 101, 0, 0, 117, - 118, 5, 84, 0, 0, 118, 119, 5, 82, 0, 0, 119, 120, 5, 85, 0, 0, 120, 122, - 5, 69, 0, 0, 121, 113, 1, 0, 0, 0, 121, 117, 1, 0, 0, 0, 122, 34, 1, 0, - 0, 0, 123, 124, 5, 102, 0, 0, 124, 125, 5, 97, 0, 0, 125, 126, 5, 108, - 0, 0, 126, 127, 5, 115, 0, 0, 127, 134, 5, 101, 0, 0, 128, 129, 5, 70, - 0, 0, 129, 130, 5, 65, 0, 0, 130, 131, 5, 76, 0, 0, 131, 132, 5, 83, 0, - 0, 132, 134, 5, 69, 0, 0, 133, 123, 1, 0, 0, 0, 133, 128, 1, 0, 0, 0, 134, - 36, 1, 0, 0, 0, 135, 137, 7, 0, 0, 0, 136, 135, 1, 0, 0, 0, 136, 137, 1, - 0, 0, 0, 137, 139, 1, 0, 0, 0, 138, 140, 7, 1, 0, 0, 139, 138, 1, 0, 0, - 0, 140, 141, 1, 0, 0, 0, 141, 139, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, - 143, 1, 0, 0, 0, 143, 145, 5, 46, 0, 0, 144, 146, 7, 1, 0, 0, 145, 144, - 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 147, 148, 1, 0, - 0, 0, 148, 38, 1, 0, 0, 0, 149, 151, 7, 0, 0, 0, 150, 149, 1, 0, 0, 0, - 150, 151, 1, 0, 0, 0, 151, 153, 1, 0, 0, 0, 152, 154, 7, 1, 0, 0, 153, - 152, 1, 0, 0, 0, 154, 155, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, - 1, 0, 0, 0, 156, 40, 1, 0, 0, 0, 157, 159, 7, 2, 0, 0, 158, 157, 1, 0, - 0, 0, 159, 160, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, - 161, 162, 1, 0, 0, 0, 162, 163, 6, 20, 0, 0, 163, 42, 1, 0, 0, 0, 164, - 165, 5, 78, 0, 0, 165, 166, 5, 79, 0, 0, 166, 171, 5, 84, 0, 0, 167, 168, - 5, 110, 0, 0, 168, 169, 5, 111, 0, 0, 169, 171, 5, 116, 0, 0, 170, 164, - 1, 0, 0, 0, 170, 167, 1, 0, 0, 0, 171, 44, 1, 0, 0, 0, 172, 176, 7, 3, - 0, 0, 173, 175, 7, 4, 0, 0, 174, 173, 1, 0, 0, 0, 175, 178, 1, 0, 0, 0, - 176, 174, 1, 0, 0, 0, 176, 177, 1, 0, 0, 0, 177, 46, 1, 0, 0, 0, 178, 176, - 1, 0, 0, 0, 179, 181, 7, 5, 0, 0, 180, 179, 1, 0, 0, 0, 181, 182, 1, 0, - 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 192, 1, 0, 0, 0, - 184, 186, 5, 46, 0, 0, 185, 187, 7, 5, 0, 0, 186, 185, 1, 0, 0, 0, 187, - 188, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, - 1, 0, 0, 0, 190, 184, 1, 0, 0, 0, 191, 194, 1, 0, 0, 0, 192, 190, 1, 0, - 0, 0, 192, 193, 1, 0, 0, 0, 193, 48, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, - 195, 199, 5, 39, 0, 0, 196, 198, 8, 6, 0, 0, 197, 196, 1, 0, 0, 0, 198, - 201, 1, 0, 0, 0, 199, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 202, - 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 202, 203, 5, 39, 0, 0, 203, 50, 1, 0, - 0, 0, 204, 208, 5, 34, 0, 0, 205, 207, 8, 7, 0, 0, 206, 205, 1, 0, 0, 0, - 207, 210, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 208, 209, 1, 0, 0, 0, 209, - 211, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 211, 212, 5, 34, 0, 0, 212, 52, - 1, 0, 0, 0, 213, 214, 5, 40, 0, 0, 214, 54, 1, 0, 0, 0, 215, 216, 5, 41, - 0, 0, 216, 56, 1, 0, 0, 0, 217, 218, 5, 91, 0, 0, 218, 58, 1, 0, 0, 0, - 219, 220, 5, 93, 0, 0, 220, 60, 1, 0, 0, 0, 221, 222, 5, 123, 0, 0, 222, - 62, 1, 0, 0, 0, 223, 224, 5, 125, 0, 0, 224, 64, 1, 0, 0, 0, 225, 226, - 5, 36, 0, 0, 226, 227, 5, 123, 0, 0, 227, 66, 1, 0, 0, 0, 18, 0, 105, 111, - 121, 133, 136, 141, 147, 150, 155, 160, 170, 176, 182, 188, 192, 199, 208, - 1, 6, 0, 0, + 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, + 2, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, + 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, + 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 108, + 8, 14, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 114, 8, 15, 1, 16, 1, 16, 1, + 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 124, 8, 16, 1, 17, 1, 17, + 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 136, 8, + 17, 1, 18, 3, 18, 139, 8, 18, 1, 18, 4, 18, 142, 8, 18, 11, 18, 12, 18, + 143, 1, 18, 1, 18, 4, 18, 148, 8, 18, 11, 18, 12, 18, 149, 1, 19, 3, 19, + 153, 8, 19, 1, 19, 4, 19, 156, 8, 19, 11, 19, 12, 19, 157, 1, 20, 4, 20, + 161, 8, 20, 11, 20, 12, 20, 162, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, + 21, 1, 21, 1, 21, 3, 21, 173, 8, 21, 1, 22, 1, 22, 5, 22, 177, 8, 22, 10, + 22, 12, 22, 180, 9, 22, 1, 23, 4, 23, 183, 8, 23, 11, 23, 12, 23, 184, + 1, 23, 1, 23, 4, 23, 189, 8, 23, 11, 23, 12, 23, 190, 5, 23, 193, 8, 23, + 10, 23, 12, 23, 196, 9, 23, 1, 24, 1, 24, 5, 24, 200, 8, 24, 10, 24, 12, + 24, 203, 9, 24, 1, 24, 1, 24, 1, 25, 1, 25, 5, 25, 209, 8, 25, 10, 25, + 12, 25, 212, 9, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, + 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 32, + 1, 33, 1, 33, 1, 33, 0, 0, 34, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, + 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, + 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, + 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, + 1, 0, 8, 1, 0, 45, 45, 1, 0, 48, 57, 3, 0, 9, 10, 13, 13, 32, 32, 3, 0, + 65, 90, 95, 95, 97, 122, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 5, 0, 45, + 45, 47, 57, 65, 90, 95, 95, 97, 122, 3, 0, 10, 10, 13, 13, 39, 39, 3, 0, + 10, 10, 13, 13, 34, 34, 250, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, + 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, + 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, + 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, + 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, + 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, + 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, + 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, + 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, + 67, 1, 0, 0, 0, 1, 69, 1, 0, 0, 0, 3, 71, 1, 0, 0, 0, 5, 73, 1, 0, 0, 0, + 7, 75, 1, 0, 0, 0, 9, 78, 1, 0, 0, 0, 11, 81, 1, 0, 0, 0, 13, 83, 1, 0, + 0, 0, 15, 85, 1, 0, 0, 0, 17, 88, 1, 0, 0, 0, 19, 91, 1, 0, 0, 0, 21, 93, + 1, 0, 0, 0, 23, 95, 1, 0, 0, 0, 25, 97, 1, 0, 0, 0, 27, 99, 1, 0, 0, 0, + 29, 107, 1, 0, 0, 0, 31, 113, 1, 0, 0, 0, 33, 123, 1, 0, 0, 0, 35, 135, + 1, 0, 0, 0, 37, 138, 1, 0, 0, 0, 39, 152, 1, 0, 0, 0, 41, 160, 1, 0, 0, + 0, 43, 172, 1, 0, 0, 0, 45, 174, 1, 0, 0, 0, 47, 182, 1, 0, 0, 0, 49, 197, + 1, 0, 0, 0, 51, 206, 1, 0, 0, 0, 53, 215, 1, 0, 0, 0, 55, 217, 1, 0, 0, + 0, 57, 219, 1, 0, 0, 0, 59, 221, 1, 0, 0, 0, 61, 223, 1, 0, 0, 0, 63, 225, + 1, 0, 0, 0, 65, 227, 1, 0, 0, 0, 67, 231, 1, 0, 0, 0, 69, 70, 5, 124, 0, + 0, 70, 2, 1, 0, 0, 0, 71, 72, 5, 44, 0, 0, 72, 4, 1, 0, 0, 0, 73, 74, 5, + 58, 0, 0, 74, 6, 1, 0, 0, 0, 75, 76, 5, 61, 0, 0, 76, 77, 5, 61, 0, 0, + 77, 8, 1, 0, 0, 0, 78, 79, 5, 33, 0, 0, 79, 80, 5, 61, 0, 0, 80, 10, 1, + 0, 0, 0, 81, 82, 5, 62, 0, 0, 82, 12, 1, 0, 0, 0, 83, 84, 5, 60, 0, 0, + 84, 14, 1, 0, 0, 0, 85, 86, 5, 62, 0, 0, 86, 87, 5, 61, 0, 0, 87, 16, 1, + 0, 0, 0, 88, 89, 5, 60, 0, 0, 89, 90, 5, 61, 0, 0, 90, 18, 1, 0, 0, 0, + 91, 92, 5, 43, 0, 0, 92, 20, 1, 0, 0, 0, 93, 94, 5, 45, 0, 0, 94, 22, 1, + 0, 0, 0, 95, 96, 5, 42, 0, 0, 96, 24, 1, 0, 0, 0, 97, 98, 5, 47, 0, 0, + 98, 26, 1, 0, 0, 0, 99, 100, 5, 37, 0, 0, 100, 28, 1, 0, 0, 0, 101, 102, + 5, 97, 0, 0, 102, 103, 5, 110, 0, 0, 103, 108, 5, 100, 0, 0, 104, 105, + 5, 65, 0, 0, 105, 106, 5, 78, 0, 0, 106, 108, 5, 68, 0, 0, 107, 101, 1, + 0, 0, 0, 107, 104, 1, 0, 0, 0, 108, 30, 1, 0, 0, 0, 109, 110, 5, 111, 0, + 0, 110, 114, 5, 114, 0, 0, 111, 112, 5, 79, 0, 0, 112, 114, 5, 82, 0, 0, + 113, 109, 1, 0, 0, 0, 113, 111, 1, 0, 0, 0, 114, 32, 1, 0, 0, 0, 115, 116, + 5, 116, 0, 0, 116, 117, 5, 114, 0, 0, 117, 118, 5, 117, 0, 0, 118, 124, + 5, 101, 0, 0, 119, 120, 5, 84, 0, 0, 120, 121, 5, 82, 0, 0, 121, 122, 5, + 85, 0, 0, 122, 124, 5, 69, 0, 0, 123, 115, 1, 0, 0, 0, 123, 119, 1, 0, + 0, 0, 124, 34, 1, 0, 0, 0, 125, 126, 5, 102, 0, 0, 126, 127, 5, 97, 0, + 0, 127, 128, 5, 108, 0, 0, 128, 129, 5, 115, 0, 0, 129, 136, 5, 101, 0, + 0, 130, 131, 5, 70, 0, 0, 131, 132, 5, 65, 0, 0, 132, 133, 5, 76, 0, 0, + 133, 134, 5, 83, 0, 0, 134, 136, 5, 69, 0, 0, 135, 125, 1, 0, 0, 0, 135, + 130, 1, 0, 0, 0, 136, 36, 1, 0, 0, 0, 137, 139, 7, 0, 0, 0, 138, 137, 1, + 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 141, 1, 0, 0, 0, 140, 142, 7, 1, 0, + 0, 141, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, + 144, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 147, 5, 46, 0, 0, 146, 148, + 7, 1, 0, 0, 147, 146, 1, 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, 147, 1, 0, + 0, 0, 149, 150, 1, 0, 0, 0, 150, 38, 1, 0, 0, 0, 151, 153, 7, 0, 0, 0, + 152, 151, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 155, 1, 0, 0, 0, 154, + 156, 7, 1, 0, 0, 155, 154, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 155, + 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 40, 1, 0, 0, 0, 159, 161, 7, 2, + 0, 0, 160, 159, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 160, 1, 0, 0, 0, + 162, 163, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 165, 6, 20, 0, 0, 165, + 42, 1, 0, 0, 0, 166, 167, 5, 78, 0, 0, 167, 168, 5, 79, 0, 0, 168, 173, + 5, 84, 0, 0, 169, 170, 5, 110, 0, 0, 170, 171, 5, 111, 0, 0, 171, 173, + 5, 116, 0, 0, 172, 166, 1, 0, 0, 0, 172, 169, 1, 0, 0, 0, 173, 44, 1, 0, + 0, 0, 174, 178, 7, 3, 0, 0, 175, 177, 7, 4, 0, 0, 176, 175, 1, 0, 0, 0, + 177, 180, 1, 0, 0, 0, 178, 176, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, + 46, 1, 0, 0, 0, 180, 178, 1, 0, 0, 0, 181, 183, 7, 5, 0, 0, 182, 181, 1, + 0, 0, 0, 183, 184, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 184, 185, 1, 0, 0, + 0, 185, 194, 1, 0, 0, 0, 186, 188, 5, 46, 0, 0, 187, 189, 7, 5, 0, 0, 188, + 187, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, + 1, 0, 0, 0, 191, 193, 1, 0, 0, 0, 192, 186, 1, 0, 0, 0, 193, 196, 1, 0, + 0, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 48, 1, 0, 0, 0, + 196, 194, 1, 0, 0, 0, 197, 201, 5, 39, 0, 0, 198, 200, 8, 6, 0, 0, 199, + 198, 1, 0, 0, 0, 200, 203, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 201, 202, + 1, 0, 0, 0, 202, 204, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 204, 205, 5, 39, + 0, 0, 205, 50, 1, 0, 0, 0, 206, 210, 5, 34, 0, 0, 207, 209, 8, 7, 0, 0, + 208, 207, 1, 0, 0, 0, 209, 212, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 210, + 211, 1, 0, 0, 0, 211, 213, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 213, 214, + 5, 34, 0, 0, 214, 52, 1, 0, 0, 0, 215, 216, 5, 40, 0, 0, 216, 54, 1, 0, + 0, 0, 217, 218, 5, 41, 0, 0, 218, 56, 1, 0, 0, 0, 219, 220, 5, 91, 0, 0, + 220, 58, 1, 0, 0, 0, 221, 222, 5, 93, 0, 0, 222, 60, 1, 0, 0, 0, 223, 224, + 5, 123, 0, 0, 224, 62, 1, 0, 0, 0, 225, 226, 5, 125, 0, 0, 226, 64, 1, + 0, 0, 0, 227, 228, 5, 36, 0, 0, 228, 229, 5, 36, 0, 0, 229, 230, 5, 123, + 0, 0, 230, 66, 1, 0, 0, 0, 231, 232, 5, 36, 0, 0, 232, 233, 5, 123, 0, + 0, 233, 68, 1, 0, 0, 0, 18, 0, 107, 113, 123, 135, 138, 143, 149, 152, + 157, 162, 172, 178, 184, 190, 194, 201, 210, 1, 6, 0, 0, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -187,7 +189,7 @@ func eqllexerLexerInit() { // NewEqlLexer(). You can call this function if you wish to initialize the static state ahead // of time. func EqlLexerInit() { - staticData := &eqllexerLexerStaticData + staticData := &EqlLexerLexerStaticData staticData.once.Do(eqllexerLexerInit) } @@ -196,13 +198,13 @@ func NewEqlLexer(input antlr.CharStream) *EqlLexer { EqlLexerInit() l := new(EqlLexer) l.BaseLexer = antlr.NewBaseLexer(input) - staticData := &eqllexerLexerStaticData - l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache) - l.channelNames = staticData.channelNames - l.modeNames = staticData.modeNames - l.RuleNames = staticData.ruleNames - l.LiteralNames = staticData.literalNames - l.SymbolicNames = staticData.symbolicNames + staticData := &EqlLexerLexerStaticData + l.Interpreter = antlr.NewLexerATNSimulator(l, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) + l.channelNames = staticData.ChannelNames + l.modeNames = staticData.ModeNames + l.RuleNames = staticData.RuleNames + l.LiteralNames = staticData.LiteralNames + l.SymbolicNames = staticData.SymbolicNames l.GrammarFileName = "Eql.g4" // TODO: l.EOF = antlr.TokenEOF @@ -211,37 +213,38 @@ func NewEqlLexer(input antlr.CharStream) *EqlLexer { // EqlLexer tokens. const ( - EqlLexerT__0 = 1 - EqlLexerT__1 = 2 - EqlLexerT__2 = 3 - EqlLexerEQ = 4 - EqlLexerNEQ = 5 - EqlLexerGT = 6 - EqlLexerLT = 7 - EqlLexerGTE = 8 - EqlLexerLTE = 9 - EqlLexerADD = 10 - EqlLexerSUB = 11 - EqlLexerMUL = 12 - EqlLexerDIV = 13 - EqlLexerMOD = 14 - EqlLexerAND = 15 - EqlLexerOR = 16 - EqlLexerTRUE = 17 - EqlLexerFALSE = 18 - EqlLexerFLOAT = 19 - EqlLexerNUMBER = 20 - EqlLexerWHITESPACE = 21 - EqlLexerNOT = 22 - EqlLexerNAME = 23 - EqlLexerVNAME = 24 - EqlLexerSTEXT = 25 - EqlLexerDTEXT = 26 - EqlLexerLPAR = 27 - EqlLexerRPAR = 28 - EqlLexerLARR = 29 - EqlLexerRARR = 30 - EqlLexerLDICT = 31 - EqlLexerRDICT = 32 - EqlLexerBEGIN_VARIABLE = 33 + EqlLexerT__0 = 1 + EqlLexerT__1 = 2 + EqlLexerT__2 = 3 + EqlLexerEQ = 4 + EqlLexerNEQ = 5 + EqlLexerGT = 6 + EqlLexerLT = 7 + EqlLexerGTE = 8 + EqlLexerLTE = 9 + EqlLexerADD = 10 + EqlLexerSUB = 11 + EqlLexerMUL = 12 + EqlLexerDIV = 13 + EqlLexerMOD = 14 + EqlLexerAND = 15 + EqlLexerOR = 16 + EqlLexerTRUE = 17 + EqlLexerFALSE = 18 + EqlLexerFLOAT = 19 + EqlLexerNUMBER = 20 + EqlLexerWHITESPACE = 21 + EqlLexerNOT = 22 + EqlLexerNAME = 23 + EqlLexerVNAME = 24 + EqlLexerSTEXT = 25 + EqlLexerDTEXT = 26 + EqlLexerLPAR = 27 + EqlLexerRPAR = 28 + EqlLexerLARR = 29 + EqlLexerRARR = 30 + EqlLexerLDICT = 31 + EqlLexerRDICT = 32 + EqlLexerBEGIN_EVARIABLE = 33 + EqlLexerBEGIN_VARIABLE = 34 ) diff --git a/internal/pkg/eql/parser/eql_listener.go b/internal/pkg/eql/parser/eql_listener.go index e6017758c36..1d036aabbce 100644 --- a/internal/pkg/eql/parser/eql_listener.go +++ b/internal/pkg/eql/parser/eql_listener.go @@ -2,11 +2,11 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Code generated from Eql.g4 by ANTLR 4.12.0. DO NOT EDIT. +// Code generated from Eql.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Eql -import "github.com/antlr/antlr4/runtime/Go/antlr/v4" +import "github.com/antlr4-go/antlr/v4" // EqlListener is a complete listener for a parse tree produced by EqlParser. type EqlListener interface { @@ -30,6 +30,9 @@ type EqlListener interface { // EnterExpArithmeticNEQ is called when entering the ExpArithmeticNEQ production. EnterExpArithmeticNEQ(c *ExpArithmeticNEQContext) + // EnterExpEVariable is called when entering the ExpEVariable production. + EnterExpEVariable(c *ExpEVariableContext) + // EnterExpArithmeticEQ is called when entering the ExpArithmeticEQ production. EnterExpArithmeticEQ(c *ExpArithmeticEQContext) @@ -117,6 +120,9 @@ type EqlListener interface { // ExitExpArithmeticNEQ is called when exiting the ExpArithmeticNEQ production. ExitExpArithmeticNEQ(c *ExpArithmeticNEQContext) + // ExitExpEVariable is called when exiting the ExpEVariable production. + ExitExpEVariable(c *ExpEVariableContext) + // ExitExpArithmeticEQ is called when exiting the ExpArithmeticEQ production. ExitExpArithmeticEQ(c *ExpArithmeticEQContext) diff --git a/internal/pkg/eql/parser/eql_parser.go b/internal/pkg/eql/parser/eql_parser.go index d8b526b6e86..29231d382a5 100644 --- a/internal/pkg/eql/parser/eql_parser.go +++ b/internal/pkg/eql/parser/eql_parser.go @@ -2,7 +2,7 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Code generated from Eql.g4 by ANTLR 4.12.0. DO NOT EDIT. +// Code generated from Eql.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Eql @@ -11,7 +11,7 @@ import ( "strconv" "sync" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" ) // Suppress unused import errors @@ -23,100 +23,102 @@ type EqlParser struct { *antlr.BaseParser } -var eqlParserStaticData struct { +var EqlParserStaticData struct { once sync.Once serializedATN []int32 - literalNames []string - symbolicNames []string - ruleNames []string - predictionContextCache *antlr.PredictionContextCache + LiteralNames []string + SymbolicNames []string + RuleNames []string + PredictionContextCache *antlr.PredictionContextCache atn *antlr.ATN decisionToDFA []*antlr.DFA } func eqlParserInit() { - staticData := &eqlParserStaticData - staticData.literalNames = []string{ + staticData := &EqlParserStaticData + staticData.LiteralNames = []string{ "", "'|'", "','", "':'", "'=='", "'!='", "'>'", "'<'", "'>='", "'<='", "'+'", "'-'", "'*'", "'/'", "'%'", "", "", "", "", "", "", "", "", "", - "", "", "", "'('", "')'", "'['", "']'", "'{'", "'}'", "'${'", + "", "", "", "'('", "')'", "'['", "']'", "'{'", "'}'", "'$${'", "'${'", } - staticData.symbolicNames = []string{ + staticData.SymbolicNames = []string{ "", "", "", "", "EQ", "NEQ", "GT", "LT", "GTE", "LTE", "ADD", "SUB", "MUL", "DIV", "MOD", "AND", "OR", "TRUE", "FALSE", "FLOAT", "NUMBER", "WHITESPACE", "NOT", "NAME", "VNAME", "STEXT", "DTEXT", "LPAR", "RPAR", - "LARR", "RARR", "LDICT", "RDICT", "BEGIN_VARIABLE", + "LARR", "RARR", "LDICT", "RDICT", "BEGIN_EVARIABLE", "BEGIN_VARIABLE", } - staticData.ruleNames = []string{ + staticData.RuleNames = []string{ "expList", "boolean", "constant", "variable", "variableExp", "exp", "arguments", "array", "key", "dict", } - staticData.predictionContextCache = antlr.NewPredictionContextCache() + staticData.PredictionContextCache = antlr.NewPredictionContextCache() staticData.serializedATN = []int32{ - 4, 1, 33, 142, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, + 4, 1, 34, 146, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 31, 8, 2, 1, 3, 1, 3, 1, 3, 3, 3, 36, 8, 3, 1, 4, 1, 4, 1, 4, 5, 4, 41, 8, 4, 10, 4, 12, 4, 44, 9, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, - 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 61, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 66, - 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 71, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 77, - 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, - 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, - 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 109, 8, 5, 10, 5, 12, 5, - 112, 9, 5, 1, 6, 1, 6, 1, 6, 5, 6, 117, 8, 6, 10, 6, 12, 6, 120, 9, 6, - 1, 7, 1, 7, 1, 7, 5, 7, 125, 8, 7, 10, 7, 12, 7, 128, 9, 7, 1, 8, 1, 8, - 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 137, 8, 9, 10, 9, 12, 9, 140, 9, 9, - 1, 9, 0, 1, 10, 10, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 5, 1, 0, 17, - 18, 1, 0, 25, 26, 1, 0, 12, 14, 1, 0, 10, 11, 2, 0, 23, 23, 25, 26, 163, - 0, 20, 1, 0, 0, 0, 2, 23, 1, 0, 0, 0, 4, 30, 1, 0, 0, 0, 6, 35, 1, 0, 0, - 0, 8, 37, 1, 0, 0, 0, 10, 76, 1, 0, 0, 0, 12, 113, 1, 0, 0, 0, 14, 121, - 1, 0, 0, 0, 16, 129, 1, 0, 0, 0, 18, 133, 1, 0, 0, 0, 20, 21, 3, 10, 5, - 0, 21, 22, 5, 0, 0, 1, 22, 1, 1, 0, 0, 0, 23, 24, 7, 0, 0, 0, 24, 3, 1, - 0, 0, 0, 25, 31, 5, 25, 0, 0, 26, 31, 5, 26, 0, 0, 27, 31, 5, 19, 0, 0, - 28, 31, 5, 20, 0, 0, 29, 31, 3, 2, 1, 0, 30, 25, 1, 0, 0, 0, 30, 26, 1, - 0, 0, 0, 30, 27, 1, 0, 0, 0, 30, 28, 1, 0, 0, 0, 30, 29, 1, 0, 0, 0, 31, - 5, 1, 0, 0, 0, 32, 36, 5, 23, 0, 0, 33, 36, 5, 24, 0, 0, 34, 36, 3, 4, - 2, 0, 35, 32, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 35, 34, 1, 0, 0, 0, 36, 7, - 1, 0, 0, 0, 37, 42, 3, 6, 3, 0, 38, 39, 5, 1, 0, 0, 39, 41, 3, 6, 3, 0, - 40, 38, 1, 0, 0, 0, 41, 44, 1, 0, 0, 0, 42, 40, 1, 0, 0, 0, 42, 43, 1, - 0, 0, 0, 43, 9, 1, 0, 0, 0, 44, 42, 1, 0, 0, 0, 45, 46, 6, 5, -1, 0, 46, - 47, 5, 27, 0, 0, 47, 48, 3, 10, 5, 0, 48, 49, 5, 28, 0, 0, 49, 77, 1, 0, - 0, 0, 50, 51, 5, 22, 0, 0, 51, 77, 3, 10, 5, 17, 52, 77, 3, 2, 1, 0, 53, - 54, 5, 33, 0, 0, 54, 55, 3, 8, 4, 0, 55, 56, 5, 32, 0, 0, 56, 77, 1, 0, - 0, 0, 57, 58, 5, 23, 0, 0, 58, 60, 5, 27, 0, 0, 59, 61, 3, 12, 6, 0, 60, - 59, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 77, 5, 28, - 0, 0, 63, 65, 5, 29, 0, 0, 64, 66, 3, 14, 7, 0, 65, 64, 1, 0, 0, 0, 65, - 66, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 77, 5, 30, 0, 0, 68, 70, 5, 31, - 0, 0, 69, 71, 3, 18, 9, 0, 70, 69, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, - 72, 1, 0, 0, 0, 72, 77, 5, 32, 0, 0, 73, 77, 7, 1, 0, 0, 74, 77, 5, 19, - 0, 0, 75, 77, 5, 20, 0, 0, 76, 45, 1, 0, 0, 0, 76, 50, 1, 0, 0, 0, 76, - 52, 1, 0, 0, 0, 76, 53, 1, 0, 0, 0, 76, 57, 1, 0, 0, 0, 76, 63, 1, 0, 0, - 0, 76, 68, 1, 0, 0, 0, 76, 73, 1, 0, 0, 0, 76, 74, 1, 0, 0, 0, 76, 75, - 1, 0, 0, 0, 77, 110, 1, 0, 0, 0, 78, 79, 10, 19, 0, 0, 79, 80, 7, 2, 0, - 0, 80, 109, 3, 10, 5, 20, 81, 82, 10, 18, 0, 0, 82, 83, 7, 3, 0, 0, 83, - 109, 3, 10, 5, 19, 84, 85, 10, 16, 0, 0, 85, 86, 5, 4, 0, 0, 86, 109, 3, - 10, 5, 17, 87, 88, 10, 15, 0, 0, 88, 89, 5, 5, 0, 0, 89, 109, 3, 10, 5, - 16, 90, 91, 10, 14, 0, 0, 91, 92, 5, 9, 0, 0, 92, 109, 3, 10, 5, 15, 93, - 94, 10, 13, 0, 0, 94, 95, 5, 8, 0, 0, 95, 109, 3, 10, 5, 14, 96, 97, 10, - 12, 0, 0, 97, 98, 5, 7, 0, 0, 98, 109, 3, 10, 5, 13, 99, 100, 10, 11, 0, - 0, 100, 101, 5, 6, 0, 0, 101, 109, 3, 10, 5, 12, 102, 103, 10, 10, 0, 0, - 103, 104, 5, 15, 0, 0, 104, 109, 3, 10, 5, 11, 105, 106, 10, 9, 0, 0, 106, - 107, 5, 16, 0, 0, 107, 109, 3, 10, 5, 10, 108, 78, 1, 0, 0, 0, 108, 81, - 1, 0, 0, 0, 108, 84, 1, 0, 0, 0, 108, 87, 1, 0, 0, 0, 108, 90, 1, 0, 0, - 0, 108, 93, 1, 0, 0, 0, 108, 96, 1, 0, 0, 0, 108, 99, 1, 0, 0, 0, 108, - 102, 1, 0, 0, 0, 108, 105, 1, 0, 0, 0, 109, 112, 1, 0, 0, 0, 110, 108, - 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 111, 11, 1, 0, 0, 0, 112, 110, 1, 0, - 0, 0, 113, 118, 3, 10, 5, 0, 114, 115, 5, 2, 0, 0, 115, 117, 3, 10, 5, - 0, 116, 114, 1, 0, 0, 0, 117, 120, 1, 0, 0, 0, 118, 116, 1, 0, 0, 0, 118, - 119, 1, 0, 0, 0, 119, 13, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 121, 126, 3, - 4, 2, 0, 122, 123, 5, 2, 0, 0, 123, 125, 3, 4, 2, 0, 124, 122, 1, 0, 0, - 0, 125, 128, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 126, 127, 1, 0, 0, 0, 127, - 15, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 129, 130, 7, 4, 0, 0, 130, 131, 5, - 3, 0, 0, 131, 132, 3, 4, 2, 0, 132, 17, 1, 0, 0, 0, 133, 138, 3, 16, 8, - 0, 134, 135, 5, 2, 0, 0, 135, 137, 3, 16, 8, 0, 136, 134, 1, 0, 0, 0, 137, - 140, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 19, 1, - 0, 0, 0, 140, 138, 1, 0, 0, 0, 12, 30, 35, 42, 60, 65, 70, 76, 108, 110, - 118, 126, 138, + 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 65, 8, 5, 1, + 5, 1, 5, 1, 5, 3, 5, 70, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 75, 8, 5, 1, 5, + 1, 5, 1, 5, 1, 5, 3, 5, 81, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, + 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, + 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, + 5, 113, 8, 5, 10, 5, 12, 5, 116, 9, 5, 1, 6, 1, 6, 1, 6, 5, 6, 121, 8, + 6, 10, 6, 12, 6, 124, 9, 6, 1, 7, 1, 7, 1, 7, 5, 7, 129, 8, 7, 10, 7, 12, + 7, 132, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 5, 9, 141, 8, 9, + 10, 9, 12, 9, 144, 9, 9, 1, 9, 0, 1, 10, 10, 0, 2, 4, 6, 8, 10, 12, 14, + 16, 18, 0, 5, 1, 0, 17, 18, 1, 0, 25, 26, 1, 0, 12, 14, 1, 0, 10, 11, 2, + 0, 23, 23, 25, 26, 168, 0, 20, 1, 0, 0, 0, 2, 23, 1, 0, 0, 0, 4, 30, 1, + 0, 0, 0, 6, 35, 1, 0, 0, 0, 8, 37, 1, 0, 0, 0, 10, 80, 1, 0, 0, 0, 12, + 117, 1, 0, 0, 0, 14, 125, 1, 0, 0, 0, 16, 133, 1, 0, 0, 0, 18, 137, 1, + 0, 0, 0, 20, 21, 3, 10, 5, 0, 21, 22, 5, 0, 0, 1, 22, 1, 1, 0, 0, 0, 23, + 24, 7, 0, 0, 0, 24, 3, 1, 0, 0, 0, 25, 31, 5, 25, 0, 0, 26, 31, 5, 26, + 0, 0, 27, 31, 5, 19, 0, 0, 28, 31, 5, 20, 0, 0, 29, 31, 3, 2, 1, 0, 30, + 25, 1, 0, 0, 0, 30, 26, 1, 0, 0, 0, 30, 27, 1, 0, 0, 0, 30, 28, 1, 0, 0, + 0, 30, 29, 1, 0, 0, 0, 31, 5, 1, 0, 0, 0, 32, 36, 5, 23, 0, 0, 33, 36, + 5, 24, 0, 0, 34, 36, 3, 4, 2, 0, 35, 32, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, + 35, 34, 1, 0, 0, 0, 36, 7, 1, 0, 0, 0, 37, 42, 3, 6, 3, 0, 38, 39, 5, 1, + 0, 0, 39, 41, 3, 6, 3, 0, 40, 38, 1, 0, 0, 0, 41, 44, 1, 0, 0, 0, 42, 40, + 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 9, 1, 0, 0, 0, 44, 42, 1, 0, 0, 0, + 45, 46, 6, 5, -1, 0, 46, 47, 5, 27, 0, 0, 47, 48, 3, 10, 5, 0, 48, 49, + 5, 28, 0, 0, 49, 81, 1, 0, 0, 0, 50, 51, 5, 22, 0, 0, 51, 81, 3, 10, 5, + 18, 52, 81, 3, 2, 1, 0, 53, 54, 5, 33, 0, 0, 54, 55, 3, 8, 4, 0, 55, 56, + 5, 32, 0, 0, 56, 81, 1, 0, 0, 0, 57, 58, 5, 34, 0, 0, 58, 59, 3, 8, 4, + 0, 59, 60, 5, 32, 0, 0, 60, 81, 1, 0, 0, 0, 61, 62, 5, 23, 0, 0, 62, 64, + 5, 27, 0, 0, 63, 65, 3, 12, 6, 0, 64, 63, 1, 0, 0, 0, 64, 65, 1, 0, 0, + 0, 65, 66, 1, 0, 0, 0, 66, 81, 5, 28, 0, 0, 67, 69, 5, 29, 0, 0, 68, 70, + 3, 14, 7, 0, 69, 68, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, + 71, 81, 5, 30, 0, 0, 72, 74, 5, 31, 0, 0, 73, 75, 3, 18, 9, 0, 74, 73, + 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 81, 5, 32, 0, 0, + 77, 81, 7, 1, 0, 0, 78, 81, 5, 19, 0, 0, 79, 81, 5, 20, 0, 0, 80, 45, 1, + 0, 0, 0, 80, 50, 1, 0, 0, 0, 80, 52, 1, 0, 0, 0, 80, 53, 1, 0, 0, 0, 80, + 57, 1, 0, 0, 0, 80, 61, 1, 0, 0, 0, 80, 67, 1, 0, 0, 0, 80, 72, 1, 0, 0, + 0, 80, 77, 1, 0, 0, 0, 80, 78, 1, 0, 0, 0, 80, 79, 1, 0, 0, 0, 81, 114, + 1, 0, 0, 0, 82, 83, 10, 20, 0, 0, 83, 84, 7, 2, 0, 0, 84, 113, 3, 10, 5, + 21, 85, 86, 10, 19, 0, 0, 86, 87, 7, 3, 0, 0, 87, 113, 3, 10, 5, 20, 88, + 89, 10, 17, 0, 0, 89, 90, 5, 4, 0, 0, 90, 113, 3, 10, 5, 18, 91, 92, 10, + 16, 0, 0, 92, 93, 5, 5, 0, 0, 93, 113, 3, 10, 5, 17, 94, 95, 10, 15, 0, + 0, 95, 96, 5, 9, 0, 0, 96, 113, 3, 10, 5, 16, 97, 98, 10, 14, 0, 0, 98, + 99, 5, 8, 0, 0, 99, 113, 3, 10, 5, 15, 100, 101, 10, 13, 0, 0, 101, 102, + 5, 7, 0, 0, 102, 113, 3, 10, 5, 14, 103, 104, 10, 12, 0, 0, 104, 105, 5, + 6, 0, 0, 105, 113, 3, 10, 5, 13, 106, 107, 10, 11, 0, 0, 107, 108, 5, 15, + 0, 0, 108, 113, 3, 10, 5, 12, 109, 110, 10, 10, 0, 0, 110, 111, 5, 16, + 0, 0, 111, 113, 3, 10, 5, 11, 112, 82, 1, 0, 0, 0, 112, 85, 1, 0, 0, 0, + 112, 88, 1, 0, 0, 0, 112, 91, 1, 0, 0, 0, 112, 94, 1, 0, 0, 0, 112, 97, + 1, 0, 0, 0, 112, 100, 1, 0, 0, 0, 112, 103, 1, 0, 0, 0, 112, 106, 1, 0, + 0, 0, 112, 109, 1, 0, 0, 0, 113, 116, 1, 0, 0, 0, 114, 112, 1, 0, 0, 0, + 114, 115, 1, 0, 0, 0, 115, 11, 1, 0, 0, 0, 116, 114, 1, 0, 0, 0, 117, 122, + 3, 10, 5, 0, 118, 119, 5, 2, 0, 0, 119, 121, 3, 10, 5, 0, 120, 118, 1, + 0, 0, 0, 121, 124, 1, 0, 0, 0, 122, 120, 1, 0, 0, 0, 122, 123, 1, 0, 0, + 0, 123, 13, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 125, 130, 3, 4, 2, 0, 126, + 127, 5, 2, 0, 0, 127, 129, 3, 4, 2, 0, 128, 126, 1, 0, 0, 0, 129, 132, + 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 15, 1, 0, + 0, 0, 132, 130, 1, 0, 0, 0, 133, 134, 7, 4, 0, 0, 134, 135, 5, 3, 0, 0, + 135, 136, 3, 4, 2, 0, 136, 17, 1, 0, 0, 0, 137, 142, 3, 16, 8, 0, 138, + 139, 5, 2, 0, 0, 139, 141, 3, 16, 8, 0, 140, 138, 1, 0, 0, 0, 141, 144, + 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 19, 1, 0, + 0, 0, 144, 142, 1, 0, 0, 0, 12, 30, 35, 42, 64, 69, 74, 80, 112, 114, 122, + 130, 142, } deserializer := antlr.NewATNDeserializer(nil) staticData.atn = deserializer.Deserialize(staticData.serializedATN) @@ -133,7 +135,7 @@ func eqlParserInit() { // NewEqlParser(). You can call this function if you wish to initialize the static state ahead // of time. func EqlParserInit() { - staticData := &eqlParserStaticData + staticData := &EqlParserStaticData staticData.once.Do(eqlParserInit) } @@ -142,11 +144,11 @@ func NewEqlParser(input antlr.TokenStream) *EqlParser { EqlParserInit() this := new(EqlParser) this.BaseParser = antlr.NewBaseParser(input) - staticData := &eqlParserStaticData - this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.predictionContextCache) - this.RuleNames = staticData.ruleNames - this.LiteralNames = staticData.literalNames - this.SymbolicNames = staticData.symbolicNames + staticData := &EqlParserStaticData + this.Interpreter = antlr.NewParserATNSimulator(this, staticData.atn, staticData.decisionToDFA, staticData.PredictionContextCache) + this.RuleNames = staticData.RuleNames + this.LiteralNames = staticData.LiteralNames + this.SymbolicNames = staticData.SymbolicNames this.GrammarFileName = "Eql.g4" return this @@ -154,40 +156,41 @@ func NewEqlParser(input antlr.TokenStream) *EqlParser { // EqlParser tokens. const ( - EqlParserEOF = antlr.TokenEOF - EqlParserT__0 = 1 - EqlParserT__1 = 2 - EqlParserT__2 = 3 - EqlParserEQ = 4 - EqlParserNEQ = 5 - EqlParserGT = 6 - EqlParserLT = 7 - EqlParserGTE = 8 - EqlParserLTE = 9 - EqlParserADD = 10 - EqlParserSUB = 11 - EqlParserMUL = 12 - EqlParserDIV = 13 - EqlParserMOD = 14 - EqlParserAND = 15 - EqlParserOR = 16 - EqlParserTRUE = 17 - EqlParserFALSE = 18 - EqlParserFLOAT = 19 - EqlParserNUMBER = 20 - EqlParserWHITESPACE = 21 - EqlParserNOT = 22 - EqlParserNAME = 23 - EqlParserVNAME = 24 - EqlParserSTEXT = 25 - EqlParserDTEXT = 26 - EqlParserLPAR = 27 - EqlParserRPAR = 28 - EqlParserLARR = 29 - EqlParserRARR = 30 - EqlParserLDICT = 31 - EqlParserRDICT = 32 - EqlParserBEGIN_VARIABLE = 33 + EqlParserEOF = antlr.TokenEOF + EqlParserT__0 = 1 + EqlParserT__1 = 2 + EqlParserT__2 = 3 + EqlParserEQ = 4 + EqlParserNEQ = 5 + EqlParserGT = 6 + EqlParserLT = 7 + EqlParserGTE = 8 + EqlParserLTE = 9 + EqlParserADD = 10 + EqlParserSUB = 11 + EqlParserMUL = 12 + EqlParserDIV = 13 + EqlParserMOD = 14 + EqlParserAND = 15 + EqlParserOR = 16 + EqlParserTRUE = 17 + EqlParserFALSE = 18 + EqlParserFLOAT = 19 + EqlParserNUMBER = 20 + EqlParserWHITESPACE = 21 + EqlParserNOT = 22 + EqlParserNAME = 23 + EqlParserVNAME = 24 + EqlParserSTEXT = 25 + EqlParserDTEXT = 26 + EqlParserLPAR = 27 + EqlParserRPAR = 28 + EqlParserLARR = 29 + EqlParserRARR = 30 + EqlParserLDICT = 31 + EqlParserRDICT = 32 + EqlParserBEGIN_EVARIABLE = 33 + EqlParserBEGIN_VARIABLE = 34 ) // EqlParser rules. @@ -220,23 +223,28 @@ type IExpListContext interface { } type ExpListContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyExpListContext() *ExpListContext { var p = new(ExpListContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EqlParserRULE_expList return p } +func InitEmptyExpListContext(p *ExpListContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EqlParserRULE_expList +} + func (*ExpListContext) IsExpListContext() {} func NewExpListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExpListContext { var p = new(ExpListContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EqlParserRULE_expList @@ -297,28 +305,8 @@ func (s *ExpListContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } func (p *EqlParser) ExpList() (localctx IExpListContext) { - this := p - _ = this - localctx = NewExpListContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 0, EqlParserRULE_expList) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(20) @@ -327,8 +315,24 @@ func (p *EqlParser) ExpList() (localctx IExpListContext) { { p.SetState(21) p.Match(EqlParserEOF) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + if false { + goto errorExit // Trick to prevent compiler error if the label is not used + } return localctx } @@ -348,23 +352,28 @@ type IBooleanContext interface { } type BooleanContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyBooleanContext() *BooleanContext { var p = new(BooleanContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EqlParserRULE_boolean return p } +func InitEmptyBooleanContext(p *BooleanContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EqlParserRULE_boolean +} + func (*BooleanContext) IsBooleanContext() {} func NewBooleanContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BooleanContext { var p = new(BooleanContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EqlParserRULE_boolean @@ -413,29 +422,10 @@ func (s *BooleanContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } func (p *EqlParser) Boolean() (localctx IBooleanContext) { - this := p - _ = this - localctx = NewBooleanContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 2, EqlParserRULE_boolean) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(23) @@ -449,6 +439,18 @@ func (p *EqlParser) Boolean() (localctx IBooleanContext) { } } +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + if false { + goto errorExit // Trick to prevent compiler error if the label is not used + } return localctx } @@ -471,23 +473,28 @@ type IConstantContext interface { } type ConstantContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyConstantContext() *ConstantContext { var p = new(ConstantContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EqlParserRULE_constant return p } +func InitEmptyConstantContext(p *ConstantContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EqlParserRULE_constant +} + func (*ConstantContext) IsConstantContext() {} func NewConstantContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ConstantContext { var p = new(ConstantContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EqlParserRULE_constant @@ -560,30 +567,13 @@ func (s *ConstantContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } func (p *EqlParser) Constant() (localctx IConstantContext) { - this := p - _ = this - localctx = NewConstantContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 4, EqlParserRULE_constant) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.SetState(30) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case EqlParserSTEXT: @@ -591,6 +581,10 @@ func (p *EqlParser) Constant() (localctx IConstantContext) { { p.SetState(25) p.Match(EqlParserSTEXT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserDTEXT: @@ -598,6 +592,10 @@ func (p *EqlParser) Constant() (localctx IConstantContext) { { p.SetState(26) p.Match(EqlParserDTEXT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserFLOAT: @@ -605,6 +603,10 @@ func (p *EqlParser) Constant() (localctx IConstantContext) { { p.SetState(27) p.Match(EqlParserFLOAT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserNUMBER: @@ -612,6 +614,10 @@ func (p *EqlParser) Constant() (localctx IConstantContext) { { p.SetState(28) p.Match(EqlParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserTRUE, EqlParserFALSE: @@ -622,9 +628,22 @@ func (p *EqlParser) Constant() (localctx IConstantContext) { } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + if false { + goto errorExit // Trick to prevent compiler error if the label is not used + } return localctx } @@ -645,23 +664,28 @@ type IVariableContext interface { } type VariableContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyVariableContext() *VariableContext { var p = new(VariableContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EqlParserRULE_variable return p } +func InitEmptyVariableContext(p *VariableContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EqlParserRULE_variable +} + func (*VariableContext) IsVariableContext() {} func NewVariableContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *VariableContext { var p = new(VariableContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EqlParserRULE_variable @@ -726,30 +750,13 @@ func (s *VariableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } func (p *EqlParser) Variable() (localctx IVariableContext) { - this := p - _ = this - localctx = NewVariableContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 6, EqlParserRULE_variable) - - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.SetState(35) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case EqlParserNAME: @@ -757,6 +764,10 @@ func (p *EqlParser) Variable() (localctx IVariableContext) { { p.SetState(32) p.Match(EqlParserNAME) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserVNAME: @@ -764,6 +775,10 @@ func (p *EqlParser) Variable() (localctx IVariableContext) { { p.SetState(33) p.Match(EqlParserVNAME) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserTRUE, EqlParserFALSE, EqlParserFLOAT, EqlParserNUMBER, EqlParserSTEXT, EqlParserDTEXT: @@ -774,9 +789,22 @@ func (p *EqlParser) Variable() (localctx IVariableContext) { } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + if false { + goto errorExit // Trick to prevent compiler error if the label is not used + } return localctx } @@ -796,23 +824,28 @@ type IVariableExpContext interface { } type VariableExpContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyVariableExpContext() *VariableExpContext { var p = new(VariableExpContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EqlParserRULE_variableExp return p } +func InitEmptyVariableExpContext(p *VariableExpContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EqlParserRULE_variableExp +} + func (*VariableExpContext) IsVariableExpContext() {} func NewVariableExpContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *VariableExpContext { var p = new(VariableExpContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EqlParserRULE_variableExp @@ -894,29 +927,10 @@ func (s *VariableExpContext) Accept(visitor antlr.ParseTreeVisitor) interface{} } func (p *EqlParser) VariableExp() (localctx IVariableExpContext) { - this := p - _ = this - localctx = NewVariableExpContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 8, EqlParserRULE_variableExp) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { p.SetState(37) @@ -924,12 +938,19 @@ func (p *EqlParser) VariableExp() (localctx IVariableExpContext) { } p.SetState(42) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == EqlParserT__0 { { p.SetState(38) p.Match(EqlParserT__0) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(39) @@ -938,9 +959,24 @@ func (p *EqlParser) VariableExp() (localctx IVariableExpContext) { p.SetState(44) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + if false { + goto errorExit // Trick to prevent compiler error if the label is not used + } return localctx } @@ -955,23 +991,28 @@ type IExpContext interface { } type ExpContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyExpContext() *ExpContext { var p = new(ExpContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EqlParserRULE_exp return p } +func InitEmptyExpContext(p *ExpContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EqlParserRULE_exp +} + func (*ExpContext) IsExpContext() {} func NewExpContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ExpContext { var p = new(ExpContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EqlParserRULE_exp @@ -981,8 +1022,8 @@ func NewExpContext(parser antlr.Parser, parent antlr.ParserRuleContext, invoking func (s *ExpContext) GetParser() antlr.Parser { return s.parser } -func (s *ExpContext) CopyFrom(ctx *ExpContext) { - s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) +func (s *ExpContext) CopyAll(ctx *ExpContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) } func (s *ExpContext) GetRuleContext() antlr.RuleContext { @@ -994,7 +1035,7 @@ func (s *ExpContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) st } type ExpArithmeticNEQContext struct { - *ExpContext + ExpContext left IExpContext right IExpContext } @@ -1002,9 +1043,9 @@ type ExpArithmeticNEQContext struct { func NewExpArithmeticNEQContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpArithmeticNEQContext { var p = new(ExpArithmeticNEQContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1088,8 +1129,72 @@ func (s *ExpArithmeticNEQContext) Accept(visitor antlr.ParseTreeVisitor) interfa } } +type ExpEVariableContext struct { + ExpContext +} + +func NewExpEVariableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpEVariableContext { + var p = new(ExpEVariableContext) + + InitEmptyExpContext(&p.ExpContext) + p.parser = parser + p.CopyAll(ctx.(*ExpContext)) + + return p +} + +func (s *ExpEVariableContext) GetRuleContext() antlr.RuleContext { + return s +} + +func (s *ExpEVariableContext) BEGIN_EVARIABLE() antlr.TerminalNode { + return s.GetToken(EqlParserBEGIN_EVARIABLE, 0) +} + +func (s *ExpEVariableContext) VariableExp() IVariableExpContext { + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IVariableExpContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + + if t == nil { + return nil + } + + return t.(IVariableExpContext) +} + +func (s *ExpEVariableContext) RDICT() antlr.TerminalNode { + return s.GetToken(EqlParserRDICT, 0) +} + +func (s *ExpEVariableContext) EnterRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(EqlListener); ok { + listenerT.EnterExpEVariable(s) + } +} + +func (s *ExpEVariableContext) ExitRule(listener antlr.ParseTreeListener) { + if listenerT, ok := listener.(EqlListener); ok { + listenerT.ExitExpEVariable(s) + } +} + +func (s *ExpEVariableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { + switch t := visitor.(type) { + case EqlVisitor: + return t.VisitExpEVariable(s) + + default: + return t.VisitChildren(s) + } +} + type ExpArithmeticEQContext struct { - *ExpContext + ExpContext left IExpContext right IExpContext } @@ -1097,9 +1202,9 @@ type ExpArithmeticEQContext struct { func NewExpArithmeticEQContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpArithmeticEQContext { var p = new(ExpArithmeticEQContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1184,7 +1289,7 @@ func (s *ExpArithmeticEQContext) Accept(visitor antlr.ParseTreeVisitor) interfac } type ExpArithmeticGTEContext struct { - *ExpContext + ExpContext left IExpContext right IExpContext } @@ -1192,9 +1297,9 @@ type ExpArithmeticGTEContext struct { func NewExpArithmeticGTEContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpArithmeticGTEContext { var p = new(ExpArithmeticGTEContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1279,7 +1384,7 @@ func (s *ExpArithmeticGTEContext) Accept(visitor antlr.ParseTreeVisitor) interfa } type ExpArithmeticLTEContext struct { - *ExpContext + ExpContext left IExpContext right IExpContext } @@ -1287,9 +1392,9 @@ type ExpArithmeticLTEContext struct { func NewExpArithmeticLTEContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpArithmeticLTEContext { var p = new(ExpArithmeticLTEContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1374,7 +1479,7 @@ func (s *ExpArithmeticLTEContext) Accept(visitor antlr.ParseTreeVisitor) interfa } type ExpArithmeticGTContext struct { - *ExpContext + ExpContext left IExpContext right IExpContext } @@ -1382,9 +1487,9 @@ type ExpArithmeticGTContext struct { func NewExpArithmeticGTContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpArithmeticGTContext { var p = new(ExpArithmeticGTContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1469,7 +1574,7 @@ func (s *ExpArithmeticGTContext) Accept(visitor antlr.ParseTreeVisitor) interfac } type ExpArithmeticMulDivModContext struct { - *ExpContext + ExpContext left IExpContext right IExpContext } @@ -1477,9 +1582,9 @@ type ExpArithmeticMulDivModContext struct { func NewExpArithmeticMulDivModContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpArithmeticMulDivModContext { var p = new(ExpArithmeticMulDivModContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1572,15 +1677,15 @@ func (s *ExpArithmeticMulDivModContext) Accept(visitor antlr.ParseTreeVisitor) i } type ExpDictContext struct { - *ExpContext + ExpContext } func NewExpDictContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpDictContext { var p = new(ExpDictContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1636,15 +1741,15 @@ func (s *ExpDictContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } type ExpTextContext struct { - *ExpContext + ExpContext } func NewExpTextContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpTextContext { var p = new(ExpTextContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1684,15 +1789,15 @@ func (s *ExpTextContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } type ExpNumberContext struct { - *ExpContext + ExpContext } func NewExpNumberContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpNumberContext { var p = new(ExpNumberContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1728,7 +1833,7 @@ func (s *ExpNumberContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } type ExpLogicalAndContext struct { - *ExpContext + ExpContext left IExpContext right IExpContext } @@ -1736,9 +1841,9 @@ type ExpLogicalAndContext struct { func NewExpLogicalAndContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpLogicalAndContext { var p = new(ExpLogicalAndContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1823,7 +1928,7 @@ func (s *ExpLogicalAndContext) Accept(visitor antlr.ParseTreeVisitor) interface{ } type ExpLogicalORContext struct { - *ExpContext + ExpContext left IExpContext right IExpContext } @@ -1831,9 +1936,9 @@ type ExpLogicalORContext struct { func NewExpLogicalORContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpLogicalORContext { var p = new(ExpLogicalORContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1918,15 +2023,15 @@ func (s *ExpLogicalORContext) Accept(visitor antlr.ParseTreeVisitor) interface{} } type ExpFloatContext struct { - *ExpContext + ExpContext } func NewExpFloatContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpFloatContext { var p = new(ExpFloatContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -1962,15 +2067,15 @@ func (s *ExpFloatContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } type ExpVariableContext struct { - *ExpContext + ExpContext } func NewExpVariableContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpVariableContext { var p = new(ExpVariableContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -2026,15 +2131,15 @@ func (s *ExpVariableContext) Accept(visitor antlr.ParseTreeVisitor) interface{} } type ExpArrayContext struct { - *ExpContext + ExpContext } func NewExpArrayContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpArrayContext { var p = new(ExpArrayContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -2090,15 +2195,15 @@ func (s *ExpArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } type ExpNotContext struct { - *ExpContext + ExpContext } func NewExpNotContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpNotContext { var p = new(ExpNotContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -2150,15 +2255,15 @@ func (s *ExpNotContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } type ExpInParenContext struct { - *ExpContext + ExpContext } func NewExpInParenContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpInParenContext { var p = new(ExpInParenContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -2214,15 +2319,15 @@ func (s *ExpInParenContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } type ExpBooleanContext struct { - *ExpContext + ExpContext } func NewExpBooleanContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpBooleanContext { var p = new(ExpBooleanContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -2270,7 +2375,7 @@ func (s *ExpBooleanContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } type ExpArithmeticAddSubContext struct { - *ExpContext + ExpContext left IExpContext right IExpContext } @@ -2278,9 +2383,9 @@ type ExpArithmeticAddSubContext struct { func NewExpArithmeticAddSubContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpArithmeticAddSubContext { var p = new(ExpArithmeticAddSubContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -2369,15 +2474,15 @@ func (s *ExpArithmeticAddSubContext) Accept(visitor antlr.ParseTreeVisitor) inte } type ExpFunctionContext struct { - *ExpContext + ExpContext } func NewExpFunctionContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpFunctionContext { var p = new(ExpFunctionContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -2437,7 +2542,7 @@ func (s *ExpFunctionContext) Accept(visitor antlr.ParseTreeVisitor) interface{} } type ExpArithmeticLTContext struct { - *ExpContext + ExpContext left IExpContext right IExpContext } @@ -2445,9 +2550,9 @@ type ExpArithmeticLTContext struct { func NewExpArithmeticLTContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ExpArithmeticLTContext { var p = new(ExpArithmeticLTContext) - p.ExpContext = NewEmptyExpContext() + InitEmptyExpContext(&p.ExpContext) p.parser = parser - p.CopyFrom(ctx.(*ExpContext)) + p.CopyAll(ctx.(*ExpContext)) return p } @@ -2536,10 +2641,8 @@ func (p *EqlParser) Exp() (localctx IExpContext) { } func (p *EqlParser) exp(_p int) (localctx IExpContext) { - this := p - _ = this - var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + _parentState := p.GetState() localctx = NewExpContext(p, p.GetParserRuleContext(), _parentState) var _prevctx IExpContext = localctx @@ -2548,27 +2651,14 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { p.EnterRecursionRule(localctx, 10, EqlParserRULE_exp, _p) var _la int - defer func() { - p.UnrollRecursionContexts(_parentctx) - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - var _alt int p.EnterOuterAlt(localctx, 1) - p.SetState(76) + p.SetState(80) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case EqlParserLPAR: @@ -2579,6 +2669,10 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { { p.SetState(46) p.Match(EqlParserLPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(47) @@ -2587,6 +2681,10 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { { p.SetState(48) p.Match(EqlParserRPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserNOT: @@ -2596,10 +2694,14 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { { p.SetState(50) p.Match(EqlParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(51) - p.exp(17) + p.exp(18) } case EqlParserTRUE, EqlParserFALSE: @@ -2611,13 +2713,17 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { p.Boolean() } - case EqlParserBEGIN_VARIABLE: - localctx = NewExpVariableContext(p, localctx) + case EqlParserBEGIN_EVARIABLE: + localctx = NewExpEVariableContext(p, localctx) p.SetParserRuleContext(localctx) _prevctx = localctx { p.SetState(53) - p.Match(EqlParserBEGIN_VARIABLE) + p.Match(EqlParserBEGIN_EVARIABLE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(54) @@ -2626,6 +2732,35 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { { p.SetState(55) p.Match(EqlParserRDICT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + + case EqlParserBEGIN_VARIABLE: + localctx = NewExpVariableContext(p, localctx) + p.SetParserRuleContext(localctx) + _prevctx = localctx + { + p.SetState(57) + p.Match(EqlParserBEGIN_VARIABLE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } + } + { + p.SetState(58) + p.VariableExp() + } + { + p.SetState(59) + p.Match(EqlParserRDICT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserNAME: @@ -2633,27 +2768,42 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(57) + p.SetState(61) p.Match(EqlParserNAME) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(58) + p.SetState(62) p.Match(EqlParserLPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - p.SetState(60) + p.SetState(64) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) - if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&11523719168) != 0 { + if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&28703588352) != 0 { { - p.SetState(59) + p.SetState(63) p.Arguments() } } { - p.SetState(62) + p.SetState(66) p.Match(EqlParserRPAR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserLARR: @@ -2661,23 +2811,34 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(63) + p.SetState(67) p.Match(EqlParserLARR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - p.SetState(65) + p.SetState(69) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&102629376) != 0 { { - p.SetState(64) + p.SetState(68) p.Array() } } { - p.SetState(67) + p.SetState(71) p.Match(EqlParserRARR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserLDICT: @@ -2685,23 +2846,34 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(68) + p.SetState(72) p.Match(EqlParserLDICT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } - p.SetState(70) + p.SetState(74) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if (int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&109051904) != 0 { { - p.SetState(69) + p.SetState(73) p.Dict() } } { - p.SetState(72) + p.SetState(76) p.Match(EqlParserRDICT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserSTEXT, EqlParserDTEXT: @@ -2709,7 +2881,7 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(73) + p.SetState(77) _la = p.GetTokenStream().LA(1) if !(_la == EqlParserSTEXT || _la == EqlParserDTEXT) { @@ -2725,8 +2897,12 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(74) + p.SetState(78) p.Match(EqlParserFLOAT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case EqlParserNUMBER: @@ -2734,39 +2910,54 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { p.SetParserRuleContext(localctx) _prevctx = localctx { - p.SetState(75) + p.SetState(79) p.Match(EqlParserNUMBER) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) - p.SetState(110) + p.SetState(114) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 8, p.GetParserRuleContext()) - + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { if p.GetParseListeners() != nil { p.TriggerExitRuleEvent() } _prevctx = localctx - p.SetState(108) + p.SetState(112) p.GetErrorHandler().Sync(p) - switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 7, p.GetParserRuleContext()) { + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 7, p.GetParserRuleContext()) { case 1: localctx = NewExpArithmeticMulDivModContext(p, NewExpContext(p, _parentctx, _parentState)) localctx.(*ExpArithmeticMulDivModContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, EqlParserRULE_exp) - p.SetState(78) + p.SetState(82) - if !(p.Precpred(p.GetParserRuleContext(), 19)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 19)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 20)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 20)", "")) + goto errorExit } { - p.SetState(79) + p.SetState(83) _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&28672) != 0) { @@ -2777,9 +2968,9 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { } } { - p.SetState(80) + p.SetState(84) - var _x = p.exp(20) + var _x = p.exp(21) localctx.(*ExpArithmeticMulDivModContext).right = _x } @@ -2789,13 +2980,14 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { localctx.(*ExpArithmeticAddSubContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, EqlParserRULE_exp) - p.SetState(81) + p.SetState(85) - if !(p.Precpred(p.GetParserRuleContext(), 18)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 18)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 19)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 19)", "")) + goto errorExit } { - p.SetState(82) + p.SetState(86) _la = p.GetTokenStream().LA(1) if !(_la == EqlParserADD || _la == EqlParserSUB) { @@ -2806,9 +2998,9 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { } } { - p.SetState(83) + p.SetState(87) - var _x = p.exp(19) + var _x = p.exp(20) localctx.(*ExpArithmeticAddSubContext).right = _x } @@ -2818,19 +3010,24 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { localctx.(*ExpArithmeticEQContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, EqlParserRULE_exp) - p.SetState(84) + p.SetState(88) - if !(p.Precpred(p.GetParserRuleContext(), 16)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 16)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 17)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 17)", "")) + goto errorExit } { - p.SetState(85) + p.SetState(89) p.Match(EqlParserEQ) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(86) + p.SetState(90) - var _x = p.exp(17) + var _x = p.exp(18) localctx.(*ExpArithmeticEQContext).right = _x } @@ -2840,19 +3037,24 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { localctx.(*ExpArithmeticNEQContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, EqlParserRULE_exp) - p.SetState(87) + p.SetState(91) - if !(p.Precpred(p.GetParserRuleContext(), 15)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 15)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 16)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 16)", "")) + goto errorExit } { - p.SetState(88) + p.SetState(92) p.Match(EqlParserNEQ) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(89) + p.SetState(93) - var _x = p.exp(16) + var _x = p.exp(17) localctx.(*ExpArithmeticNEQContext).right = _x } @@ -2862,19 +3064,24 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { localctx.(*ExpArithmeticLTEContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, EqlParserRULE_exp) - p.SetState(90) + p.SetState(94) - if !(p.Precpred(p.GetParserRuleContext(), 14)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 14)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 15)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 15)", "")) + goto errorExit } { - p.SetState(91) + p.SetState(95) p.Match(EqlParserLTE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(92) + p.SetState(96) - var _x = p.exp(15) + var _x = p.exp(16) localctx.(*ExpArithmeticLTEContext).right = _x } @@ -2884,19 +3091,24 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { localctx.(*ExpArithmeticGTEContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, EqlParserRULE_exp) - p.SetState(93) + p.SetState(97) - if !(p.Precpred(p.GetParserRuleContext(), 13)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 13)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 14)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 14)", "")) + goto errorExit } { - p.SetState(94) + p.SetState(98) p.Match(EqlParserGTE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(95) + p.SetState(99) - var _x = p.exp(14) + var _x = p.exp(15) localctx.(*ExpArithmeticGTEContext).right = _x } @@ -2906,19 +3118,24 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { localctx.(*ExpArithmeticLTContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, EqlParserRULE_exp) - p.SetState(96) + p.SetState(100) - if !(p.Precpred(p.GetParserRuleContext(), 12)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 12)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 13)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 13)", "")) + goto errorExit } { - p.SetState(97) + p.SetState(101) p.Match(EqlParserLT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(98) + p.SetState(102) - var _x = p.exp(13) + var _x = p.exp(14) localctx.(*ExpArithmeticLTContext).right = _x } @@ -2928,19 +3145,24 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { localctx.(*ExpArithmeticGTContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, EqlParserRULE_exp) - p.SetState(99) + p.SetState(103) - if !(p.Precpred(p.GetParserRuleContext(), 11)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 11)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 12)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 12)", "")) + goto errorExit } { - p.SetState(100) + p.SetState(104) p.Match(EqlParserGT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(101) + p.SetState(105) - var _x = p.exp(12) + var _x = p.exp(13) localctx.(*ExpArithmeticGTContext).right = _x } @@ -2950,19 +3172,24 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { localctx.(*ExpLogicalAndContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, EqlParserRULE_exp) - p.SetState(102) + p.SetState(106) - if !(p.Precpred(p.GetParserRuleContext(), 10)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 10)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 11)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 11)", "")) + goto errorExit } { - p.SetState(103) + p.SetState(107) p.Match(EqlParserAND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(104) + p.SetState(108) - var _x = p.exp(11) + var _x = p.exp(12) localctx.(*ExpLogicalAndContext).right = _x } @@ -2972,31 +3199,56 @@ func (p *EqlParser) exp(_p int) (localctx IExpContext) { localctx.(*ExpLogicalORContext).left = _prevctx p.PushNewRecursionContext(localctx, _startState, EqlParserRULE_exp) - p.SetState(105) + p.SetState(109) - if !(p.Precpred(p.GetParserRuleContext(), 9)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 9)", "")) + if !(p.Precpred(p.GetParserRuleContext(), 10)) { + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 10)", "")) + goto errorExit } { - p.SetState(106) + p.SetState(110) p.Match(EqlParserOR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(107) + p.SetState(111) - var _x = p.exp(10) + var _x = p.exp(11) localctx.(*ExpLogicalORContext).right = _x } + case antlr.ATNInvalidAltNumber: + goto errorExit } } - p.SetState(112) + p.SetState(116) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 8, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 8, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } } +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.UnrollRecursionContexts(_parentctx) + if false { + goto errorExit // Trick to prevent compiler error if the label is not used + } return localctx } @@ -3016,23 +3268,28 @@ type IArgumentsContext interface { } type ArgumentsContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyArgumentsContext() *ArgumentsContext { var p = new(ArgumentsContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EqlParserRULE_arguments return p } +func InitEmptyArgumentsContext(p *ArgumentsContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EqlParserRULE_arguments +} + func (*ArgumentsContext) IsArgumentsContext() {} func NewArgumentsContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArgumentsContext { var p = new(ArgumentsContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EqlParserRULE_arguments @@ -3114,53 +3371,56 @@ func (s *ArgumentsContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } func (p *EqlParser) Arguments() (localctx IArgumentsContext) { - this := p - _ = this - localctx = NewArgumentsContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 12, EqlParserRULE_arguments) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { - p.SetState(113) + p.SetState(117) p.exp(0) } - p.SetState(118) + p.SetState(122) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == EqlParserT__1 { { - p.SetState(114) + p.SetState(118) p.Match(EqlParserT__1) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(115) + p.SetState(119) p.exp(0) } - p.SetState(120) + p.SetState(124) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + if false { + goto errorExit // Trick to prevent compiler error if the label is not used + } return localctx } @@ -3180,23 +3440,28 @@ type IArrayContext interface { } type ArrayContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyArrayContext() *ArrayContext { var p = new(ArrayContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EqlParserRULE_array return p } +func InitEmptyArrayContext(p *ArrayContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EqlParserRULE_array +} + func (*ArrayContext) IsArrayContext() {} func NewArrayContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ArrayContext { var p = new(ArrayContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EqlParserRULE_array @@ -3278,53 +3543,56 @@ func (s *ArrayContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } func (p *EqlParser) Array() (localctx IArrayContext) { - this := p - _ = this - localctx = NewArrayContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 14, EqlParserRULE_array) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { - p.SetState(121) + p.SetState(125) p.Constant() } - p.SetState(126) + p.SetState(130) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == EqlParserT__1 { { - p.SetState(122) + p.SetState(126) p.Match(EqlParserT__1) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(123) + p.SetState(127) p.Constant() } - p.SetState(128) + p.SetState(132) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + if false { + goto errorExit // Trick to prevent compiler error if the label is not used + } return localctx } @@ -3346,23 +3614,28 @@ type IKeyContext interface { } type KeyContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyKeyContext() *KeyContext { var p = new(KeyContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EqlParserRULE_key return p } +func InitEmptyKeyContext(p *KeyContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EqlParserRULE_key +} + func (*KeyContext) IsKeyContext() {} func NewKeyContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *KeyContext { var p = new(KeyContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EqlParserRULE_key @@ -3431,32 +3704,13 @@ func (s *KeyContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } func (p *EqlParser) Key() (localctx IKeyContext) { - this := p - _ = this - localctx = NewKeyContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 16, EqlParserRULE_key) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { - p.SetState(129) + p.SetState(133) _la = p.GetTokenStream().LA(1) if !((int64(_la) & ^0x3f) == 0 && ((int64(1)<<_la)&109051904) != 0) { @@ -3467,14 +3721,30 @@ func (p *EqlParser) Key() (localctx IKeyContext) { } } { - p.SetState(130) + p.SetState(134) p.Match(EqlParserT__2) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(131) + p.SetState(135) p.Constant() } +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + if false { + goto errorExit // Trick to prevent compiler error if the label is not used + } return localctx } @@ -3494,23 +3764,28 @@ type IDictContext interface { } type DictContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext parser antlr.Parser } func NewEmptyDictContext() *DictContext { var p = new(DictContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) p.RuleIndex = EqlParserRULE_dict return p } +func InitEmptyDictContext(p *DictContext) { + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, nil, -1) + p.RuleIndex = EqlParserRULE_dict +} + func (*DictContext) IsDictContext() {} func NewDictContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DictContext { var p = new(DictContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingState) + antlr.InitBaseParserRuleContext(&p.BaseParserRuleContext, parent, invokingState) p.parser = parser p.RuleIndex = EqlParserRULE_dict @@ -3592,53 +3867,56 @@ func (s *DictContext) Accept(visitor antlr.ParseTreeVisitor) interface{} { } func (p *EqlParser) Dict() (localctx IDictContext) { - this := p - _ = this - localctx = NewDictContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 18, EqlParserRULE_dict) var _la int - defer func() { - p.ExitRule() - }() - - defer func() { - if err := recover(); err != nil { - if v, ok := err.(antlr.RecognitionException); ok { - localctx.SetException(v) - p.GetErrorHandler().ReportError(p, v) - p.GetErrorHandler().Recover(p, v) - } else { - panic(err) - } - } - }() - p.EnterOuterAlt(localctx, 1) { - p.SetState(133) + p.SetState(137) p.Key() } - p.SetState(138) + p.SetState(142) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == EqlParserT__1 { { - p.SetState(134) + p.SetState(138) p.Match(EqlParserT__1) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { - p.SetState(135) + p.SetState(139) p.Key() } - p.SetState(140) + p.SetState(144) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } +errorExit: + if p.HasError() { + v := p.GetError() + localctx.SetException(v) + p.GetErrorHandler().ReportError(p, v) + p.GetErrorHandler().Recover(p, v) + p.SetError(nil) + } + p.ExitRule() + if false { + goto errorExit // Trick to prevent compiler error if the label is not used + } return localctx } @@ -3657,39 +3935,36 @@ func (p *EqlParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int } func (p *EqlParser) Exp_Sempred(localctx antlr.RuleContext, predIndex int) bool { - this := p - _ = this - switch predIndex { case 0: - return p.Precpred(p.GetParserRuleContext(), 19) + return p.Precpred(p.GetParserRuleContext(), 20) case 1: - return p.Precpred(p.GetParserRuleContext(), 18) + return p.Precpred(p.GetParserRuleContext(), 19) case 2: - return p.Precpred(p.GetParserRuleContext(), 16) + return p.Precpred(p.GetParserRuleContext(), 17) case 3: - return p.Precpred(p.GetParserRuleContext(), 15) + return p.Precpred(p.GetParserRuleContext(), 16) case 4: - return p.Precpred(p.GetParserRuleContext(), 14) + return p.Precpred(p.GetParserRuleContext(), 15) case 5: - return p.Precpred(p.GetParserRuleContext(), 13) + return p.Precpred(p.GetParserRuleContext(), 14) case 6: - return p.Precpred(p.GetParserRuleContext(), 12) + return p.Precpred(p.GetParserRuleContext(), 13) case 7: - return p.Precpred(p.GetParserRuleContext(), 11) + return p.Precpred(p.GetParserRuleContext(), 12) case 8: - return p.Precpred(p.GetParserRuleContext(), 10) + return p.Precpred(p.GetParserRuleContext(), 11) case 9: - return p.Precpred(p.GetParserRuleContext(), 9) + return p.Precpred(p.GetParserRuleContext(), 10) default: panic("No predicate with index: " + fmt.Sprint(predIndex)) diff --git a/internal/pkg/eql/parser/eql_visitor.go b/internal/pkg/eql/parser/eql_visitor.go index 296ac30f624..90320364501 100644 --- a/internal/pkg/eql/parser/eql_visitor.go +++ b/internal/pkg/eql/parser/eql_visitor.go @@ -2,11 +2,11 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Code generated from Eql.g4 by ANTLR 4.12.0. DO NOT EDIT. +// Code generated from Eql.g4 by ANTLR 4.13.1. DO NOT EDIT. package parser // Eql -import "github.com/antlr/antlr4/runtime/Go/antlr/v4" +import "github.com/antlr4-go/antlr/v4" // A complete Visitor for a parse tree produced by EqlParser. type EqlVisitor interface { @@ -30,6 +30,9 @@ type EqlVisitor interface { // Visit a parse tree produced by EqlParser#ExpArithmeticNEQ. VisitExpArithmeticNEQ(ctx *ExpArithmeticNEQContext) interface{} + // Visit a parse tree produced by EqlParser#ExpEVariable. + VisitExpEVariable(ctx *ExpEVariableContext) interface{} + // Visit a parse tree produced by EqlParser#ExpArithmeticEQ. VisitExpArithmeticEQ(ctx *ExpArithmeticEQContext) interface{} diff --git a/internal/pkg/eql/visitor.go b/internal/pkg/eql/visitor.go index 511d013025f..7ac4c5eb3ca 100644 --- a/internal/pkg/eql/visitor.go +++ b/internal/pkg/eql/visitor.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/antlr/antlr4/runtime/Go/antlr/v4" + "github.com/antlr4-go/antlr/v4" "github.com/elastic/elastic-agent/internal/pkg/eql/parser" ) @@ -250,6 +250,13 @@ func (v *expVisitor) VisitExpNot(ctx *parser.ExpNotContext) interface{} { return !val } +func (v *expVisitor) VisitExpEVariable(ctx *parser.ExpEVariableContext) interface{} { + // escaped variables are not allowed in Eql conditions + // they should be wrapped in a constant to be allowed as a valid string in the expression + v.err = errors.New("escaped variable $${ is not allowed") + return nil +} + func (v *expVisitor) VisitExpVariable(ctx *parser.ExpVariableContext) interface{} { if ctx.VariableExp() != nil { return ctx.VariableExp().Accept(v)