Skip to content

Commit d13ac5d

Browse files
update antlr
1 parent a322338 commit d13ac5d

18 files changed

+514
-651
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ generate: mod-tidy ## go generate
6868

6969
.PHONY: generate-antlr
7070
generate-antlr: ## generate parser with ANTLRv4, needs JRE (Java Runtime Environment) on the system
71-
@cd pkg/parser/jsonfilter/ && java -jar $(LIB)/antlr-4.9.2-tool.jar -Dlanguage=Go -visitor -no-listener -o parser JSONFilter.g4
71+
@cd pkg/parser/jsonfilter/ && java -jar $(LIB)/antlr-4.11.1-complete.jar -Dlanguage=Go -visitor -no-listener -o parser JSONFilter.g4
7272

7373
.PHONY: test
7474
test-short: # Run sanity unit tests

docker/Dockerfile.antlr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM adoptopenjdk/openjdk11:alpine AS builder
22

33
WORKDIR /opt/antlr4
44

5-
ARG ANTLR_VERSION="4.9.2"
5+
ARG ANTLR_VERSION="4.11.1"
66
ARG MAVEN_OPTS="-Xmx1G"
77

88

go.mod

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/BurntSushi/toml v1.2.1
88
github.com/agnivade/levenshtein v1.1.1
99
github.com/alexmullins/zip v0.0.0-20180717182244-4affb64b04d0
10-
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed
10+
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20221202181307-76fa05c21b12
1111
github.com/aws/aws-sdk-go v1.44.121
1212
github.com/cheggaaa/pb/v3 v3.1.0
1313
github.com/emicklei/proto v1.11.0
@@ -52,6 +52,7 @@ require (
5252
github.com/googleapis/go-type-adapters v1.0.0 // indirect
5353
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
5454
go.etcd.io/etcd/api/v3 v3.5.5 // indirect
55+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
5556
)
5657

5758
require (

go.sum

+4-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5
111111
github.com/alexmullins/zip v0.0.0-20180717182244-4affb64b04d0 h1:BVts5dexXf4i+JX8tXlKT0aKoi38JwTXSe+3WUneX0k=
112112
github.com/alexmullins/zip v0.0.0-20180717182244-4affb64b04d0/go.mod h1:FDIQmoMNJJl5/k7upZEnGvgWVZfFeE6qHeN7iCMbCsA=
113113
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
114-
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed h1:ue9pVfIcP+QMEjfgo/Ez4ZjNZfonGgR6NgjMaJMu1Cg=
115-
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY=
114+
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20221202181307-76fa05c21b12 h1:npHgfD4Tl2WJS3AJaMUi5ynGDPUBfkg3U3fCzDyXZ+4=
115+
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20221202181307-76fa05c21b12/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM=
116116
github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I=
117117
github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM=
118118
github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk=
@@ -856,6 +856,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
856856
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
857857
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
858858
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
859+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
860+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
859861
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
860862
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
861863
golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=

lib/antlr-4.11.1-complete.jar

3.38 MB
Binary file not shown.

pkg/kics/sink.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/Checkmarx/kics/pkg/model"
1212
"github.com/Checkmarx/kics/pkg/parser/jsonfilter/parser"
1313
"github.com/Checkmarx/kics/pkg/utils"
14-
"github.com/antlr/antlr4/runtime/Go/antlr"
14+
"github.com/antlr/antlr4/runtime/Go/antlr/v4"
1515
"github.com/google/uuid"
1616
"github.com/pkg/errors"
1717
"github.com/rs/zerolog/log"

pkg/parser/jsonfilter/json_filter_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"testing"
88

99
"github.com/Checkmarx/kics/pkg/parser/jsonfilter/parser"
10-
"github.com/antlr/antlr4/runtime/Go/antlr"
10+
"github.com/antlr/antlr4/runtime/Go/antlr/v4"
1111
"github.com/stretchr/testify/require"
1212
)
1313

pkg/parser/jsonfilter/parser/JSONFilter.interp

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ literal
7171

7272

7373
atn:
74-
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 29, 92, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 33, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 41, 10, 4, 12, 4, 14, 4, 44, 11, 4, 3, 5, 3, 5, 3, 5, 3, 5, 5, 5, 50, 10, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 7, 7, 58, 10, 7, 12, 7, 14, 7, 61, 11, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 6, 8, 68, 10, 8, 13, 8, 14, 8, 69, 5, 8, 72, 10, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 6, 10, 79, 10, 10, 13, 10, 14, 10, 80, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 5, 10, 90, 10, 10, 3, 10, 2, 3, 6, 11, 2, 4, 6, 8, 10, 12, 14, 16, 18, 2, 4, 3, 2, 14, 21, 4, 2, 4, 4, 28, 28, 2, 97, 2, 20, 3, 2, 2, 2, 4, 22, 3, 2, 2, 2, 6, 32, 3, 2, 2, 2, 8, 45, 3, 2, 2, 2, 10, 51, 3, 2, 2, 2, 12, 54, 3, 2, 2, 2, 14, 71, 3, 2, 2, 2, 16, 73, 3, 2, 2, 2, 18, 89, 3, 2, 2, 2, 20, 21, 5, 4, 3, 2, 21, 3, 3, 2, 2, 2, 22, 23, 7, 5, 2, 2, 23, 24, 5, 6, 4, 2, 24, 25, 7, 6, 2, 2, 25, 5, 3, 2, 2, 2, 26, 27, 8, 4, 1, 2, 27, 28, 7, 7, 2, 2, 28, 29, 5, 6, 4, 2, 29, 30, 7, 8, 2, 2, 30, 33, 3, 2, 2, 2, 31, 33, 5, 8, 5, 2, 32, 26, 3, 2, 2, 2, 32, 31, 3, 2, 2, 2, 33, 42, 3, 2, 2, 2, 34, 35, 12, 5, 2, 2, 35, 36, 7, 12, 2, 2, 36, 41, 5, 6, 4, 6, 37, 38, 12, 4, 2, 2, 38, 39, 7, 13, 2, 2, 39, 41, 5, 6, 4, 5, 40, 34, 3, 2, 2, 2, 40, 37, 3, 2, 2, 2, 41, 44, 3, 2, 2, 2, 42, 40, 3, 2, 2, 2, 42, 43, 3, 2, 2, 2, 43, 7, 3, 2, 2, 2, 44, 42, 3, 2, 2, 2, 45, 46, 5, 10, 6, 2, 46, 49, 5, 16, 9, 2, 47, 50, 5, 18, 10, 2, 48, 50, 5, 12, 7, 2, 49, 47, 3, 2, 2, 2, 49, 48, 3, 2, 2, 2, 50, 9, 3, 2, 2, 2, 51, 52, 7, 3, 2, 2, 52, 53, 5, 12, 7, 2, 53, 11, 3, 2, 2, 2, 54, 59, 5, 14, 8, 2, 55, 56, 7, 11, 2, 2, 56, 58, 5, 14, 8, 2, 57, 55, 3, 2, 2, 2, 58, 61, 3, 2, 2, 2, 59, 57, 3, 2, 2, 2, 59, 60, 3, 2, 2, 2, 60, 13, 3, 2, 2, 2, 61, 59, 3, 2, 2, 2, 62, 72, 7, 26, 2, 2, 63, 67, 7, 26, 2, 2, 64, 65, 7, 9, 2, 2, 65, 66, 7, 28, 2, 2, 66, 68, 7, 10, 2, 2, 67, 64, 3, 2, 2, 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6, 1, 6, 1, 6, 1, 6, 1, 6, 4, 6, 66, 8, 6, 11, 6, 12, 6, 67, 3, 6, 70, 8, 6, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 4, 8, 77, 8, 8, 11, 8, 12, 8, 78, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 88, 8, 8, 1, 8, 0, 1, 4, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 0, 2, 1, 0, 12, 19, 2, 0, 2, 2, 26, 26, 95, 0, 18, 1, 0, 0, 0, 2, 20, 1, 0, 0, 0, 4, 30, 1, 0, 0, 0, 6, 43, 1, 0, 0, 0, 8, 49, 1, 0, 0, 0, 10, 52, 1, 0, 0, 0, 12, 69, 1, 0, 0, 0, 14, 71, 1, 0, 0, 0, 16, 87, 1, 0, 0, 0, 18, 19, 3, 2, 1, 0, 19, 1, 1, 0, 0, 0, 20, 21, 5, 3, 0, 0, 21, 22, 3, 4, 2, 0, 22, 23, 5, 4, 0, 0, 23, 3, 1, 0, 0, 0, 24, 25, 6, 2, -1, 0, 25, 26, 5, 5, 0, 0, 26, 27, 3, 4, 2, 0, 27, 28, 5, 6, 0, 0, 28, 31, 1, 0, 0, 0, 29, 31, 3, 6, 3, 0, 30, 24, 1, 0, 0, 0, 30, 29, 1, 0, 0, 0, 31, 40, 1, 0, 0, 0, 32, 33, 10, 3, 0, 0, 33, 34, 5, 10, 0, 0, 34, 39, 3, 4, 2, 4, 35, 36, 10, 2, 0, 0, 36, 37, 5, 11, 0, 0, 37, 39, 3, 4, 2, 3, 38, 32, 1, 0, 0, 0, 38, 35, 1, 0, 0, 0, 39, 42, 1, 0, 0, 0, 40, 38, 1, 0, 0, 0, 40, 41, 1, 0, 0, 0, 41, 5, 1, 0, 0, 0, 42, 40, 1, 0, 0, 0, 43, 44, 3, 8, 4, 0, 44, 47, 3, 14, 7, 0, 45, 48, 3, 16, 8, 0, 46, 48, 3, 10, 5, 0, 47, 45, 1, 0, 0, 0, 47, 46, 1, 0, 0, 0, 48, 7, 1, 0, 0, 0, 49, 50, 5, 1, 0, 0, 50, 51, 3, 10, 5, 0, 51, 9, 1, 0, 0, 0, 52, 57, 3, 12, 6, 0, 53, 54, 5, 9, 0, 0, 54, 56, 3, 12, 6, 0, 55, 53, 1, 0, 0, 0, 56, 59, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 11, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 60, 70, 5, 24, 0, 0, 61, 65, 5, 24, 0, 0, 62, 63, 5, 7, 0, 0, 63, 64, 5, 26, 0, 0, 64, 66, 5, 8, 0, 0, 65, 62, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 70, 1, 0, 0, 0, 69, 60, 1, 0, 0, 0, 69, 61, 1, 0, 0, 0, 70, 13, 1, 0, 0, 0, 71, 72, 7, 0, 0, 0, 72, 15, 1, 0, 0, 0, 73, 76, 5, 26, 0, 0, 74, 75, 5, 9, 0, 0, 75, 77, 7, 1, 0, 0, 76, 74, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 76, 1, 0, 0, 0, 78, 79, 1, 0, 0, 0, 79, 88, 1, 0, 0, 0, 80, 88, 5, 25, 0, 0, 81, 88, 5, 26, 0, 0, 82, 88, 5, 20, 0, 0, 83, 88, 5, 21, 0, 0, 84, 88, 5, 22, 0, 0, 85, 88, 5, 23, 0, 0, 86, 88, 5, 24, 0, 0, 87, 73, 1, 0, 0, 0, 87, 80, 1, 0, 0, 0, 87, 81, 1, 0, 0, 0, 87, 82, 1, 0, 0, 0, 87, 83, 1, 0, 0, 0, 87, 84, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 87, 86, 1, 0, 0, 0, 88, 17, 1, 0, 0, 0, 9, 30, 38, 40, 47, 57, 67, 69, 78, 87]

0 commit comments

Comments
 (0)