From 0f3cf80d1ae8ea52eb3300462d02099c8581fa5f Mon Sep 17 00:00:00 2001 From: Konrad Kleeberger Date: Sat, 12 Apr 2025 21:26:19 +0200 Subject: [PATCH 1/2] cql: allow ":" in property names --- go.mod | 31 +- go.sum | 35 +- internal/cql/CqlLexer.g4 | 2 +- internal/cql/cql.go | 12 +- internal/cql/cql_lexer.go | 860 ++++--- internal/cql/cql_parser.go | 3094 +++++++++++++++-------- internal/cql/cql_test.go | 7 + internal/cql/cqlparser_base_listener.go | 4 +- internal/cql/cqlparser_listener.go | 4 +- 9 files changed, 2584 insertions(+), 1465 deletions(-) diff --git a/go.mod b/go.mod index 4e19d79f..f6b58c04 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/CrunchyData/pg_featureserv -go 1.13 +go 1.22 require ( - github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220209173558-ad29539cd2e9 + github.com/antlr4-go/antlr/v4 v4.13.1 github.com/getkin/kin-openapi v0.2.0 github.com/gorilla/handlers v1.4.2 github.com/gorilla/mux v1.7.3 @@ -14,3 +14,30 @@ require ( github.com/spf13/viper v1.6.1 github.com/theckman/httpforwarded v0.4.0 ) + +require ( + github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/ghodss/yaml v1.0.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jackc/chunkreader/v2 v2.0.0 // indirect + github.com/jackc/pgconn v1.1.0 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.0.0 // indirect + github.com/jackc/puddle v1.0.0 // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/pelletier/go-toml v1.2.0 // indirect + github.com/spf13/afero v1.1.2 // indirect + github.com/spf13/cast v1.3.0 // indirect + github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/pflag v1.0.3 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 // indirect + gopkg.in/ini.v1 v1.51.0 // indirect + gopkg.in/yaml.v2 v2.2.4 // indirect +) diff --git a/go.sum b/go.sum index 32510834..14f24a17 100644 --- a/go.sum +++ b/go.sum @@ -4,9 +4,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/antlr/antlr4 v0.0.0-20220209173558-ad29539cd2e9 h1:NAjo5dlbySnIEFVRSgPwy+WjEDSY4EL6baGKvvPI/QM= -github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220209173558-ad29539cd2e9 h1:zvkJv+9Pxm1nnEMcKnShREt4qtduHKz4iw4AB4ul0Ao= -github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220209173558-ad29539cd2e9/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -30,16 +29,13 @@ github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/getkin/kin-openapi v0.2.0 h1:PbHHtYZpjKwZtGlIyELgA2DploRrsaXztoNNx9HjwNY= github.com/getkin/kin-openapi v0.2.0/go.mod h1:V1z9xl9oF5Wt7v32ne4FmiF1alpS4dM6mNzoywPOXlk= -github.com/getkin/kin-openapi v0.3.0 h1:xsQ4mA20YJDMgIHdHqMKZ66QUe6/hi+x6yLsTTz8xyQ= -github.com/getkin/kin-openapi v0.32.0 h1:zzeKoKewdKT9bBdRMwYEhJgB2rKSKGFKE1iOKF7KgNs= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-spatial/jivan v0.1.3 h1:UmyYh06iTECHqG+OZ5Vktn1pavEoRj5rBqGFjKy0XyY= -github.com/go-spatial/jivan v0.1.3/go.mod h1:BvRLfq/DOULog8GRavvcifGydUAGP1UrZD7ZO3l9Oi4= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -50,6 +46,7 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= @@ -61,7 +58,6 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0 h1:DUwgMQuuPnS0rhMXenUtZpqZqrR/30NWY+qQvTpSvEs= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -72,10 +68,10 @@ github.com/jackc/pgconn v1.1.0 h1:10i6DMVJOSko/sD3FLpFKBHONzDGKkX8pbLyHC8B92o= github.com/jackc/pgconn v1.1.0/go.mod h1:GgY/Lbj1VonNaVdNUHs9AwWom3yP2eymFQ1C8z9r/Lk= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2 h1:JVX6jT/XfzNqIjye4717ITLaNwV9mWbJx0dLCpcRzdA= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= @@ -98,6 +94,7 @@ github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v1.0.0 h1:rbjAshlgKscNa7j0jAM0uNQflis5o2XUogPMVAwtcsM= github.com/jackc/puddle v1.0.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -105,12 +102,15 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -148,14 +148,16 @@ github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 h1:pntxY8Ary0t43dCZ5dqY4YTJCObLY1kIXl0uzMv+7DE= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -195,8 +197,11 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7 h1:0hQKqeLdqlt5iIwVOBErRisrHJAN57yOiPRQItI20fU= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -222,13 +227,14 @@ golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 h1:ng0gs1AKnRRuEMZoTLLlbOd+C17zUDepwGQBb/n+JVg= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -247,6 +253,7 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= diff --git a/internal/cql/CqlLexer.g4 b/internal/cql/CqlLexer.g4 index 23e4cef8..7647fa74 100644 --- a/internal/cql/CqlLexer.g4 +++ b/internal/cql/CqlLexer.g4 @@ -127,7 +127,7 @@ CharacterStringLiteralStart : QUOTE -> more, mode(STR);// (Character)* QUOTE; Identifier : IdentifierStart IdentifierPart* | DOUBLEQUOTE Identifier DOUBLEQUOTE; IdentifierStart : ALPHA; -IdentifierPart : ALPHA | DIGIT | UNDERSCORE | DOLLAR; +IdentifierPart : ALPHA | DIGIT | UNDERSCORE | DOLLAR | COLON; ALPHA : [A-Za-z]; diff --git a/internal/cql/cql.go b/internal/cql/cql.go index 8e4ff84d..062125f6 100644 --- a/internal/cql/cql.go +++ b/internal/cql/cql.go @@ -19,7 +19,7 @@ import ( "fmt" "strings" - "github.com/antlr/antlr4/runtime/Go/antlr" + "github.com/antlr4-go/antlr/v4" log "github.com/sirupsen/logrus" ) @@ -99,13 +99,13 @@ func (l *CqlErrorListener) SyntaxError(recognizer antlr.Recognizer, offendingSym l.msg = msg } -func (l *CqlErrorListener) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs antlr.ATNConfigSet) { +func (l *CqlErrorListener) ReportAmbiguity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, exact bool, ambigAlts *antlr.BitSet, configs *antlr.ATNConfigSet) { l.errorCount += 1 } -func (l *CqlErrorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs antlr.ATNConfigSet) { +func (l *CqlErrorListener) ReportAttemptingFullContext(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex int, conflictingAlts *antlr.BitSet, configs *antlr.ATNConfigSet) { l.errorCount += 1 } -func (l *CqlErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs antlr.ATNConfigSet) { +func (l *CqlErrorListener) ReportContextSensitivity(recognizer antlr.Parser, dfa *antlr.DFA, startIndex, stopIndex, prediction int, configs *antlr.ATNConfigSet) { l.errorCount += 1 } @@ -166,7 +166,7 @@ func getNodeText(node antlr.TerminalNode) string { // ======================================== type CqlContext struct { - *antlr.BaseParserRuleContext + antlr.BaseParserRuleContext // SQL fragment for the context subtree sql string } @@ -177,7 +177,7 @@ type SqlHolder interface { func NewCqlContext(parent antlr.ParserRuleContext, invokingStateNumber int) *CqlContext { var p = new(CqlContext) - p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(parent, invokingStateNumber) + p.BaseParserRuleContext = *antlr.NewBaseParserRuleContext(parent, invokingStateNumber) return p } diff --git a/internal/cql/cql_lexer.go b/internal/cql/cql_lexer.go index ac47b667..232e4655 100644 --- a/internal/cql/cql_lexer.go +++ b/internal/cql/cql_lexer.go @@ -1,422 +1,19 @@ -// Generated from CqlLexer.g4 by ANTLR 4.7. +// Code generated from CqlLexer.g4 by ANTLR 4.13.2. DO NOT EDIT. package cql import ( "fmt" + "github.com/antlr4-go/antlr/v4" + "sync" "unicode" - - "github.com/antlr/antlr4/runtime/Go/antlr" ) // Suppress unused import error var _ = fmt.Printf +var _ = sync.Once{} var _ = unicode.IsLetter -var serializedLexerAtn = []uint16{ - 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 85, 760, - 8, 1, 8, 1, 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, 4, 11, 9, 11, 4, 12, - 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, - 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, - 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, - 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, - 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, - 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, - 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, - 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, - 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, - 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, - 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, - 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, - 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, - 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, - 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 4, 90, 9, 90, 4, - 91, 9, 91, 4, 92, 9, 92, 4, 93, 9, 93, 4, 94, 9, 94, 4, 95, 9, 95, 4, 96, - 9, 96, 4, 97, 9, 97, 4, 98, 9, 98, 4, 99, 9, 99, 4, 100, 9, 100, 4, 101, - 9, 101, 4, 102, 9, 102, 4, 103, 9, 103, 4, 104, 9, 104, 4, 105, 9, 105, - 4, 106, 9, 106, 4, 107, 9, 107, 4, 108, 9, 108, 4, 109, 9, 109, 4, 110, - 9, 110, 4, 111, 9, 111, 4, 112, 9, 112, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, - 4, 3, 5, 3, 5, 3, 6, 3, 6, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, - 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, - 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 19, 3, 19, 3, 20, 3, 20, 3, - 21, 3, 21, 3, 22, 3, 22, 3, 23, 3, 23, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, - 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 5, 28, 285, - 10, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 32, - 3, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 35, 3, - 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 3, 35, 5, 35, 313, 10, 35, 3, 36, - 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, - 39, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, 3, 40, - 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, - 42, 3, 43, 3, 43, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, - 3, 45, 3, 45, 3, 45, 3, 45, 3, 45, 5, 45, 363, 10, 45, 3, 46, 3, 46, 3, - 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, - 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, - 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, - 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, - 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, - 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, 46, 3, - 46, 3, 46, 3, 46, 5, 46, 433, 10, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, - 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 48, 3, 49, 3, - 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, - 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, - 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, - 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, 52, 3, - 52, 3, 52, 3, 52, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, - 3, 53, 3, 53, 3, 53, 3, 53, 3, 53, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, - 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, 3, 54, - 3, 54, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, 55, 3, - 55, 3, 55, 3, 56, 3, 56, 5, 56, 538, 10, 56, 3, 57, 3, 57, 3, 57, 3, 57, - 3, 57, 3, 58, 3, 58, 7, 58, 547, 10, 58, 12, 58, 14, 58, 550, 11, 58, 3, - 58, 3, 58, 3, 58, 3, 58, 5, 58, 556, 10, 58, 3, 59, 3, 59, 3, 60, 3, 60, - 3, 60, 3, 60, 5, 60, 564, 10, 60, 3, 61, 3, 61, 3, 62, 3, 62, 3, 63, 3, - 63, 3, 64, 3, 64, 3, 65, 3, 65, 3, 66, 3, 66, 3, 67, 3, 67, 3, 68, 3, 68, - 3, 69, 3, 69, 3, 70, 3, 70, 3, 71, 3, 71, 3, 72, 3, 72, 3, 73, 3, 73, 3, - 74, 3, 74, 3, 75, 3, 75, 3, 76, 3, 76, 3, 77, 3, 77, 3, 78, 3, 78, 3, 79, - 3, 79, 3, 80, 3, 80, 3, 81, 3, 81, 3, 81, 3, 82, 3, 82, 3, 83, 3, 83, 3, - 84, 3, 84, 3, 85, 3, 85, 3, 86, 3, 86, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, - 3, 87, 3, 87, 5, 87, 626, 10, 87, 3, 88, 3, 88, 5, 88, 630, 10, 88, 3, - 89, 5, 89, 633, 10, 89, 3, 89, 3, 89, 5, 89, 637, 10, 89, 3, 90, 3, 90, - 3, 90, 5, 90, 642, 10, 90, 5, 90, 644, 10, 90, 3, 90, 3, 90, 3, 90, 5, - 90, 649, 10, 90, 3, 91, 3, 91, 3, 91, 3, 91, 3, 92, 3, 92, 3, 93, 3, 93, - 3, 94, 5, 94, 660, 10, 94, 3, 94, 3, 94, 3, 95, 6, 95, 665, 10, 95, 13, - 95, 14, 95, 666, 3, 96, 3, 96, 5, 96, 671, 10, 96, 3, 97, 3, 97, 3, 98, - 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 3, 98, 5, 98, 684, 10, - 98, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 99, 3, 100, 3, 100, 3, 100, 3, - 100, 3, 100, 3, 101, 3, 101, 3, 101, 3, 102, 3, 102, 3, 102, 3, 103, 3, - 103, 3, 103, 3, 103, 3, 103, 5, 103, 708, 10, 103, 3, 103, 5, 103, 711, - 10, 103, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 3, 104, 5, 104, 719, 10, - 104, 3, 105, 3, 105, 3, 105, 3, 106, 3, 106, 3, 106, 3, 107, 3, 107, 3, - 107, 3, 107, 6, 107, 731, 10, 107, 13, 107, 14, 107, 732, 5, 107, 735, - 10, 107, 3, 108, 3, 108, 3, 108, 3, 108, 3, 109, 6, 109, 742, 10, 109, - 13, 109, 14, 109, 743, 3, 109, 3, 109, 3, 110, 3, 110, 3, 110, 3, 110, - 3, 111, 3, 111, 3, 111, 3, 111, 3, 111, 3, 112, 3, 112, 3, 112, 3, 112, - 2, 2, 113, 4, 2, 6, 2, 8, 2, 10, 2, 12, 2, 14, 2, 16, 2, 18, 2, 20, 2, - 22, 2, 24, 2, 26, 2, 28, 2, 30, 2, 32, 2, 34, 2, 36, 2, 38, 2, 40, 2, 42, - 2, 44, 2, 46, 2, 48, 2, 50, 2, 52, 2, 54, 2, 56, 3, 58, 4, 60, 5, 62, 6, - 64, 7, 66, 8, 68, 9, 70, 10, 72, 11, 74, 12, 76, 13, 78, 14, 80, 15, 82, - 16, 84, 17, 86, 18, 88, 19, 90, 20, 92, 21, 94, 22, 96, 23, 98, 24, 100, - 25, 102, 26, 104, 27, 106, 28, 108, 29, 110, 30, 112, 31, 114, 2, 116, - 32, 118, 33, 120, 34, 122, 35, 124, 36, 126, 37, 128, 38, 130, 39, 132, - 40, 134, 41, 136, 42, 138, 43, 140, 44, 142, 45, 144, 46, 146, 47, 148, - 48, 150, 49, 152, 50, 154, 51, 156, 52, 158, 53, 160, 54, 162, 55, 164, - 56, 166, 57, 168, 58, 170, 59, 172, 60, 174, 61, 176, 62, 178, 63, 180, - 64, 182, 65, 184, 66, 186, 67, 188, 68, 190, 69, 192, 70, 194, 71, 196, - 72, 198, 73, 200, 74, 202, 75, 204, 76, 206, 77, 208, 78, 210, 79, 212, - 80, 214, 81, 216, 82, 218, 83, 220, 84, 222, 85, 224, 2, 4, 2, 3, 32, 4, - 2, 67, 67, 99, 99, 4, 2, 68, 68, 100, 100, 4, 2, 69, 69, 101, 101, 4, 2, - 70, 70, 102, 102, 4, 2, 71, 71, 103, 103, 4, 2, 72, 72, 104, 104, 4, 2, - 73, 73, 105, 105, 4, 2, 74, 74, 106, 106, 4, 2, 75, 75, 107, 107, 4, 2, - 76, 76, 108, 108, 4, 2, 77, 77, 109, 109, 4, 2, 78, 78, 110, 110, 4, 2, - 79, 79, 111, 111, 4, 2, 80, 80, 112, 112, 4, 2, 81, 81, 113, 113, 4, 2, - 82, 82, 114, 114, 4, 2, 83, 83, 115, 115, 4, 2, 84, 84, 116, 116, 4, 2, - 85, 85, 117, 117, 4, 2, 86, 86, 118, 118, 4, 2, 87, 87, 119, 119, 4, 2, - 88, 88, 120, 120, 4, 2, 89, 89, 121, 121, 4, 2, 90, 90, 122, 122, 4, 2, - 91, 91, 123, 123, 4, 2, 92, 92, 124, 124, 4, 2, 67, 92, 99, 124, 3, 2, - 50, 59, 5, 2, 11, 12, 15, 15, 34, 34, 3, 2, 41, 41, 2, 780, 2, 56, 3, 2, - 2, 2, 2, 58, 3, 2, 2, 2, 2, 60, 3, 2, 2, 2, 2, 62, 3, 2, 2, 2, 2, 64, 3, - 2, 2, 2, 2, 66, 3, 2, 2, 2, 2, 68, 3, 2, 2, 2, 2, 70, 3, 2, 2, 2, 2, 72, - 3, 2, 2, 2, 2, 74, 3, 2, 2, 2, 2, 76, 3, 2, 2, 2, 2, 78, 3, 2, 2, 2, 2, - 80, 3, 2, 2, 2, 2, 82, 3, 2, 2, 2, 2, 84, 3, 2, 2, 2, 2, 86, 3, 2, 2, 2, - 2, 88, 3, 2, 2, 2, 2, 90, 3, 2, 2, 2, 2, 92, 3, 2, 2, 2, 2, 94, 3, 2, 2, - 2, 2, 96, 3, 2, 2, 2, 2, 98, 3, 2, 2, 2, 2, 100, 3, 2, 2, 2, 2, 102, 3, - 2, 2, 2, 2, 104, 3, 2, 2, 2, 2, 106, 3, 2, 2, 2, 2, 108, 3, 2, 2, 2, 2, - 110, 3, 2, 2, 2, 2, 112, 3, 2, 2, 2, 2, 114, 3, 2, 2, 2, 2, 116, 3, 2, - 2, 2, 2, 118, 3, 2, 2, 2, 2, 120, 3, 2, 2, 2, 2, 122, 3, 2, 2, 2, 2, 124, - 3, 2, 2, 2, 2, 126, 3, 2, 2, 2, 2, 128, 3, 2, 2, 2, 2, 130, 3, 2, 2, 2, - 2, 132, 3, 2, 2, 2, 2, 134, 3, 2, 2, 2, 2, 136, 3, 2, 2, 2, 2, 138, 3, - 2, 2, 2, 2, 140, 3, 2, 2, 2, 2, 142, 3, 2, 2, 2, 2, 144, 3, 2, 2, 2, 2, - 146, 3, 2, 2, 2, 2, 148, 3, 2, 2, 2, 2, 150, 3, 2, 2, 2, 2, 152, 3, 2, - 2, 2, 2, 154, 3, 2, 2, 2, 2, 156, 3, 2, 2, 2, 2, 158, 3, 2, 2, 2, 2, 160, - 3, 2, 2, 2, 2, 162, 3, 2, 2, 2, 2, 164, 3, 2, 2, 2, 2, 166, 3, 2, 2, 2, - 2, 168, 3, 2, 2, 2, 2, 170, 3, 2, 2, 2, 2, 172, 3, 2, 2, 2, 2, 174, 3, - 2, 2, 2, 2, 176, 3, 2, 2, 2, 2, 178, 3, 2, 2, 2, 2, 180, 3, 2, 2, 2, 2, - 182, 3, 2, 2, 2, 2, 184, 3, 2, 2, 2, 2, 186, 3, 2, 2, 2, 2, 188, 3, 2, - 2, 2, 2, 190, 3, 2, 2, 2, 2, 192, 3, 2, 2, 2, 2, 194, 3, 2, 2, 2, 2, 196, - 3, 2, 2, 2, 2, 198, 3, 2, 2, 2, 2, 200, 3, 2, 2, 2, 2, 202, 3, 2, 2, 2, - 2, 204, 3, 2, 2, 2, 2, 206, 3, 2, 2, 2, 2, 208, 3, 2, 2, 2, 2, 210, 3, - 2, 2, 2, 2, 212, 3, 2, 2, 2, 2, 214, 3, 2, 2, 2, 2, 216, 3, 2, 2, 2, 2, - 218, 3, 2, 2, 2, 3, 220, 3, 2, 2, 2, 3, 222, 3, 2, 2, 2, 3, 224, 3, 2, - 2, 2, 4, 226, 3, 2, 2, 2, 6, 228, 3, 2, 2, 2, 8, 230, 3, 2, 2, 2, 10, 232, - 3, 2, 2, 2, 12, 234, 3, 2, 2, 2, 14, 236, 3, 2, 2, 2, 16, 238, 3, 2, 2, - 2, 18, 240, 3, 2, 2, 2, 20, 242, 3, 2, 2, 2, 22, 244, 3, 2, 2, 2, 24, 246, - 3, 2, 2, 2, 26, 248, 3, 2, 2, 2, 28, 250, 3, 2, 2, 2, 30, 252, 3, 2, 2, - 2, 32, 254, 3, 2, 2, 2, 34, 256, 3, 2, 2, 2, 36, 258, 3, 2, 2, 2, 38, 260, - 3, 2, 2, 2, 40, 262, 3, 2, 2, 2, 42, 264, 3, 2, 2, 2, 44, 266, 3, 2, 2, - 2, 46, 268, 3, 2, 2, 2, 48, 270, 3, 2, 2, 2, 50, 272, 3, 2, 2, 2, 52, 274, - 3, 2, 2, 2, 54, 276, 3, 2, 2, 2, 56, 284, 3, 2, 2, 2, 58, 286, 3, 2, 2, - 2, 60, 288, 3, 2, 2, 2, 62, 290, 3, 2, 2, 2, 64, 292, 3, 2, 2, 2, 66, 295, - 3, 2, 2, 2, 68, 298, 3, 2, 2, 2, 70, 312, 3, 2, 2, 2, 72, 314, 3, 2, 2, - 2, 74, 318, 3, 2, 2, 2, 76, 321, 3, 2, 2, 2, 78, 325, 3, 2, 2, 2, 80, 330, - 3, 2, 2, 2, 82, 336, 3, 2, 2, 2, 84, 344, 3, 2, 2, 2, 86, 347, 3, 2, 2, - 2, 88, 352, 3, 2, 2, 2, 90, 362, 3, 2, 2, 2, 92, 432, 3, 2, 2, 2, 94, 434, - 3, 2, 2, 2, 96, 442, 3, 2, 2, 2, 98, 448, 3, 2, 2, 2, 100, 459, 3, 2, 2, - 2, 102, 467, 3, 2, 2, 2, 104, 478, 3, 2, 2, 2, 106, 494, 3, 2, 2, 2, 108, - 507, 3, 2, 2, 2, 110, 526, 3, 2, 2, 2, 112, 537, 3, 2, 2, 2, 114, 539, - 3, 2, 2, 2, 116, 555, 3, 2, 2, 2, 118, 557, 3, 2, 2, 2, 120, 563, 3, 2, - 2, 2, 122, 565, 3, 2, 2, 2, 124, 567, 3, 2, 2, 2, 126, 569, 3, 2, 2, 2, - 128, 571, 3, 2, 2, 2, 130, 573, 3, 2, 2, 2, 132, 575, 3, 2, 2, 2, 134, - 577, 3, 2, 2, 2, 136, 579, 3, 2, 2, 2, 138, 581, 3, 2, 2, 2, 140, 583, - 3, 2, 2, 2, 142, 585, 3, 2, 2, 2, 144, 587, 3, 2, 2, 2, 146, 589, 3, 2, - 2, 2, 148, 591, 3, 2, 2, 2, 150, 593, 3, 2, 2, 2, 152, 595, 3, 2, 2, 2, - 154, 597, 3, 2, 2, 2, 156, 599, 3, 2, 2, 2, 158, 601, 3, 2, 2, 2, 160, - 603, 3, 2, 2, 2, 162, 605, 3, 2, 2, 2, 164, 608, 3, 2, 2, 2, 166, 610, - 3, 2, 2, 2, 168, 612, 3, 2, 2, 2, 170, 614, 3, 2, 2, 2, 172, 616, 3, 2, - 2, 2, 174, 625, 3, 2, 2, 2, 176, 629, 3, 2, 2, 2, 178, 636, 3, 2, 2, 2, - 180, 648, 3, 2, 2, 2, 182, 650, 3, 2, 2, 2, 184, 654, 3, 2, 2, 2, 186, - 656, 3, 2, 2, 2, 188, 659, 3, 2, 2, 2, 190, 664, 3, 2, 2, 2, 192, 670, - 3, 2, 2, 2, 194, 672, 3, 2, 2, 2, 196, 683, 3, 2, 2, 2, 198, 685, 3, 2, - 2, 2, 200, 691, 3, 2, 2, 2, 202, 696, 3, 2, 2, 2, 204, 699, 3, 2, 2, 2, - 206, 702, 3, 2, 2, 2, 208, 718, 3, 2, 2, 2, 210, 720, 3, 2, 2, 2, 212, - 723, 3, 2, 2, 2, 214, 726, 3, 2, 2, 2, 216, 736, 3, 2, 2, 2, 218, 741, - 3, 2, 2, 2, 220, 747, 3, 2, 2, 2, 222, 751, 3, 2, 2, 2, 224, 756, 3, 2, - 2, 2, 226, 227, 9, 2, 2, 2, 227, 5, 3, 2, 2, 2, 228, 229, 9, 3, 2, 2, 229, - 7, 3, 2, 2, 2, 230, 231, 9, 4, 2, 2, 231, 9, 3, 2, 2, 2, 232, 233, 9, 5, - 2, 2, 233, 11, 3, 2, 2, 2, 234, 235, 9, 6, 2, 2, 235, 13, 3, 2, 2, 2, 236, - 237, 9, 7, 2, 2, 237, 15, 3, 2, 2, 2, 238, 239, 9, 8, 2, 2, 239, 17, 3, - 2, 2, 2, 240, 241, 9, 9, 2, 2, 241, 19, 3, 2, 2, 2, 242, 243, 9, 10, 2, - 2, 243, 21, 3, 2, 2, 2, 244, 245, 9, 11, 2, 2, 245, 23, 3, 2, 2, 2, 246, - 247, 9, 12, 2, 2, 247, 25, 3, 2, 2, 2, 248, 249, 9, 13, 2, 2, 249, 27, - 3, 2, 2, 2, 250, 251, 9, 14, 2, 2, 251, 29, 3, 2, 2, 2, 252, 253, 9, 15, - 2, 2, 253, 31, 3, 2, 2, 2, 254, 255, 9, 16, 2, 2, 255, 33, 3, 2, 2, 2, - 256, 257, 9, 17, 2, 2, 257, 35, 3, 2, 2, 2, 258, 259, 9, 18, 2, 2, 259, - 37, 3, 2, 2, 2, 260, 261, 9, 19, 2, 2, 261, 39, 3, 2, 2, 2, 262, 263, 9, - 20, 2, 2, 263, 41, 3, 2, 2, 2, 264, 265, 9, 21, 2, 2, 265, 43, 3, 2, 2, - 2, 266, 267, 9, 22, 2, 2, 267, 45, 3, 2, 2, 2, 268, 269, 9, 23, 2, 2, 269, - 47, 3, 2, 2, 2, 270, 271, 9, 24, 2, 2, 271, 49, 3, 2, 2, 2, 272, 273, 9, - 25, 2, 2, 273, 51, 3, 2, 2, 2, 274, 275, 9, 26, 2, 2, 275, 53, 3, 2, 2, - 2, 276, 277, 9, 27, 2, 2, 277, 55, 3, 2, 2, 2, 278, 285, 5, 60, 30, 2, - 279, 285, 5, 64, 32, 2, 280, 285, 5, 58, 29, 2, 281, 285, 5, 62, 31, 2, - 282, 285, 5, 68, 34, 2, 283, 285, 5, 66, 33, 2, 284, 278, 3, 2, 2, 2, 284, - 279, 3, 2, 2, 2, 284, 280, 3, 2, 2, 2, 284, 281, 3, 2, 2, 2, 284, 282, - 3, 2, 2, 2, 284, 283, 3, 2, 2, 2, 285, 57, 3, 2, 2, 2, 286, 287, 7, 62, - 2, 2, 287, 59, 3, 2, 2, 2, 288, 289, 7, 63, 2, 2, 289, 61, 3, 2, 2, 2, - 290, 291, 7, 64, 2, 2, 291, 63, 3, 2, 2, 2, 292, 293, 5, 58, 29, 2, 293, - 294, 5, 62, 31, 2, 294, 65, 3, 2, 2, 2, 295, 296, 5, 62, 31, 2, 296, 297, - 5, 60, 30, 2, 297, 67, 3, 2, 2, 2, 298, 299, 5, 58, 29, 2, 299, 300, 5, - 60, 30, 2, 300, 69, 3, 2, 2, 2, 301, 302, 5, 42, 21, 2, 302, 303, 5, 38, - 19, 2, 303, 304, 5, 44, 22, 2, 304, 305, 5, 12, 6, 2, 305, 313, 3, 2, 2, - 2, 306, 307, 5, 14, 7, 2, 307, 308, 5, 4, 2, 2, 308, 309, 5, 26, 13, 2, - 309, 310, 5, 40, 20, 2, 310, 311, 5, 12, 6, 2, 311, 313, 3, 2, 2, 2, 312, - 301, 3, 2, 2, 2, 312, 306, 3, 2, 2, 2, 313, 71, 3, 2, 2, 2, 314, 315, 5, - 4, 2, 2, 315, 316, 5, 30, 15, 2, 316, 317, 5, 10, 5, 2, 317, 73, 3, 2, - 2, 2, 318, 319, 5, 32, 16, 2, 319, 320, 5, 38, 19, 2, 320, 75, 3, 2, 2, - 2, 321, 322, 5, 30, 15, 2, 322, 323, 5, 32, 16, 2, 323, 324, 5, 42, 21, - 2, 324, 77, 3, 2, 2, 2, 325, 326, 5, 26, 13, 2, 326, 327, 5, 20, 10, 2, - 327, 328, 5, 24, 12, 2, 328, 329, 5, 12, 6, 2, 329, 79, 3, 2, 2, 2, 330, - 331, 5, 20, 10, 2, 331, 332, 5, 26, 13, 2, 332, 333, 5, 20, 10, 2, 333, - 334, 5, 24, 12, 2, 334, 335, 5, 12, 6, 2, 335, 81, 3, 2, 2, 2, 336, 337, - 5, 6, 3, 2, 337, 338, 5, 12, 6, 2, 338, 339, 5, 42, 21, 2, 339, 340, 5, - 48, 24, 2, 340, 341, 5, 12, 6, 2, 341, 342, 5, 12, 6, 2, 342, 343, 5, 30, - 15, 2, 343, 83, 3, 2, 2, 2, 344, 345, 5, 20, 10, 2, 345, 346, 5, 40, 20, - 2, 346, 85, 3, 2, 2, 2, 347, 348, 5, 30, 15, 2, 348, 349, 5, 44, 22, 2, - 349, 350, 5, 26, 13, 2, 350, 351, 5, 26, 13, 2, 351, 87, 3, 2, 2, 2, 352, - 353, 5, 20, 10, 2, 353, 354, 5, 30, 15, 2, 354, 89, 3, 2, 2, 2, 355, 363, - 5, 150, 75, 2, 356, 363, 5, 154, 77, 2, 357, 363, 5, 148, 74, 2, 358, 363, - 5, 158, 79, 2, 359, 363, 5, 134, 67, 2, 360, 363, 5, 160, 80, 2, 361, 363, - 5, 162, 81, 2, 362, 355, 3, 2, 2, 2, 362, 356, 3, 2, 2, 2, 362, 357, 3, - 2, 2, 2, 362, 358, 3, 2, 2, 2, 362, 359, 3, 2, 2, 2, 362, 360, 3, 2, 2, - 2, 362, 361, 3, 2, 2, 2, 363, 91, 3, 2, 2, 2, 364, 365, 5, 12, 6, 2, 365, - 366, 5, 36, 18, 2, 366, 367, 5, 44, 22, 2, 367, 368, 5, 4, 2, 2, 368, 369, - 5, 26, 13, 2, 369, 370, 5, 40, 20, 2, 370, 433, 3, 2, 2, 2, 371, 372, 5, - 10, 5, 2, 372, 373, 5, 20, 10, 2, 373, 374, 5, 40, 20, 2, 374, 375, 5, - 22, 11, 2, 375, 376, 5, 32, 16, 2, 376, 377, 5, 20, 10, 2, 377, 378, 5, - 30, 15, 2, 378, 379, 5, 42, 21, 2, 379, 433, 3, 2, 2, 2, 380, 381, 5, 42, - 21, 2, 381, 382, 5, 32, 16, 2, 382, 383, 5, 44, 22, 2, 383, 384, 5, 8, - 4, 2, 384, 385, 5, 18, 9, 2, 385, 386, 5, 12, 6, 2, 386, 387, 5, 40, 20, - 2, 387, 433, 3, 2, 2, 2, 388, 389, 5, 48, 24, 2, 389, 390, 5, 20, 10, 2, - 390, 391, 5, 42, 21, 2, 391, 392, 5, 18, 9, 2, 392, 393, 5, 20, 10, 2, - 393, 394, 5, 30, 15, 2, 394, 433, 3, 2, 2, 2, 395, 396, 5, 32, 16, 2, 396, - 397, 5, 46, 23, 2, 397, 398, 5, 12, 6, 2, 398, 399, 5, 38, 19, 2, 399, - 400, 5, 26, 13, 2, 400, 401, 5, 4, 2, 2, 401, 402, 5, 34, 17, 2, 402, 403, - 5, 40, 20, 2, 403, 433, 3, 2, 2, 2, 404, 405, 5, 8, 4, 2, 405, 406, 5, - 38, 19, 2, 406, 407, 5, 32, 16, 2, 407, 408, 5, 40, 20, 2, 408, 409, 5, - 40, 20, 2, 409, 410, 5, 12, 6, 2, 410, 411, 5, 40, 20, 2, 411, 433, 3, - 2, 2, 2, 412, 413, 5, 20, 10, 2, 413, 414, 5, 30, 15, 2, 414, 415, 5, 42, - 21, 2, 415, 416, 5, 12, 6, 2, 416, 417, 5, 38, 19, 2, 417, 418, 5, 40, - 20, 2, 418, 419, 5, 12, 6, 2, 419, 420, 5, 8, 4, 2, 420, 421, 5, 42, 21, - 2, 421, 422, 5, 40, 20, 2, 422, 433, 3, 2, 2, 2, 423, 424, 5, 8, 4, 2, - 424, 425, 5, 32, 16, 2, 425, 426, 5, 30, 15, 2, 426, 427, 5, 42, 21, 2, - 427, 428, 5, 4, 2, 2, 428, 429, 5, 20, 10, 2, 429, 430, 5, 30, 15, 2, 430, - 431, 5, 40, 20, 2, 431, 433, 3, 2, 2, 2, 432, 364, 3, 2, 2, 2, 432, 371, - 3, 2, 2, 2, 432, 380, 3, 2, 2, 2, 432, 388, 3, 2, 2, 2, 432, 395, 3, 2, - 2, 2, 432, 404, 3, 2, 2, 2, 432, 412, 3, 2, 2, 2, 432, 423, 3, 2, 2, 2, - 433, 93, 3, 2, 2, 2, 434, 435, 5, 10, 5, 2, 435, 436, 5, 48, 24, 2, 436, - 437, 5, 20, 10, 2, 437, 438, 5, 42, 21, 2, 438, 439, 5, 18, 9, 2, 439, - 440, 5, 20, 10, 2, 440, 441, 5, 30, 15, 2, 441, 95, 3, 2, 2, 2, 442, 443, - 5, 34, 17, 2, 443, 444, 5, 32, 16, 2, 444, 445, 5, 20, 10, 2, 445, 446, - 5, 30, 15, 2, 446, 447, 5, 42, 21, 2, 447, 97, 3, 2, 2, 2, 448, 449, 5, - 26, 13, 2, 449, 450, 5, 20, 10, 2, 450, 451, 5, 30, 15, 2, 451, 452, 5, - 12, 6, 2, 452, 453, 5, 40, 20, 2, 453, 454, 5, 42, 21, 2, 454, 455, 5, - 38, 19, 2, 455, 456, 5, 20, 10, 2, 456, 457, 5, 30, 15, 2, 457, 458, 5, - 16, 8, 2, 458, 99, 3, 2, 2, 2, 459, 460, 5, 34, 17, 2, 460, 461, 5, 32, - 16, 2, 461, 462, 5, 26, 13, 2, 462, 463, 5, 52, 26, 2, 463, 464, 5, 16, - 8, 2, 464, 465, 5, 32, 16, 2, 465, 466, 5, 30, 15, 2, 466, 101, 3, 2, 2, - 2, 467, 468, 5, 28, 14, 2, 468, 469, 5, 44, 22, 2, 469, 470, 5, 26, 13, - 2, 470, 471, 5, 42, 21, 2, 471, 472, 5, 20, 10, 2, 472, 473, 5, 34, 17, - 2, 473, 474, 5, 32, 16, 2, 474, 475, 5, 20, 10, 2, 475, 476, 5, 30, 15, - 2, 476, 477, 5, 42, 21, 2, 477, 103, 3, 2, 2, 2, 478, 479, 5, 28, 14, 2, - 479, 480, 5, 44, 22, 2, 480, 481, 5, 26, 13, 2, 481, 482, 5, 42, 21, 2, - 482, 483, 5, 20, 10, 2, 483, 484, 5, 26, 13, 2, 484, 485, 5, 20, 10, 2, - 485, 486, 5, 30, 15, 2, 486, 487, 5, 12, 6, 2, 487, 488, 5, 40, 20, 2, - 488, 489, 5, 42, 21, 2, 489, 490, 5, 38, 19, 2, 490, 491, 5, 20, 10, 2, - 491, 492, 5, 30, 15, 2, 492, 493, 5, 16, 8, 2, 493, 105, 3, 2, 2, 2, 494, - 495, 5, 28, 14, 2, 495, 496, 5, 44, 22, 2, 496, 497, 5, 26, 13, 2, 497, - 498, 5, 42, 21, 2, 498, 499, 5, 20, 10, 2, 499, 500, 5, 34, 17, 2, 500, - 501, 5, 32, 16, 2, 501, 502, 5, 26, 13, 2, 502, 503, 5, 52, 26, 2, 503, - 504, 5, 16, 8, 2, 504, 505, 5, 32, 16, 2, 505, 506, 5, 30, 15, 2, 506, - 107, 3, 2, 2, 2, 507, 508, 5, 16, 8, 2, 508, 509, 5, 12, 6, 2, 509, 510, - 5, 32, 16, 2, 510, 511, 5, 28, 14, 2, 511, 512, 5, 12, 6, 2, 512, 513, - 5, 42, 21, 2, 513, 514, 5, 38, 19, 2, 514, 515, 5, 52, 26, 2, 515, 516, - 5, 8, 4, 2, 516, 517, 5, 32, 16, 2, 517, 518, 5, 26, 13, 2, 518, 519, 5, - 26, 13, 2, 519, 520, 5, 12, 6, 2, 520, 521, 5, 8, 4, 2, 521, 522, 5, 42, - 21, 2, 522, 523, 5, 20, 10, 2, 523, 524, 5, 32, 16, 2, 524, 525, 5, 30, - 15, 2, 525, 109, 3, 2, 2, 2, 526, 527, 5, 12, 6, 2, 527, 528, 5, 30, 15, - 2, 528, 529, 5, 46, 23, 2, 529, 530, 5, 12, 6, 2, 530, 531, 5, 26, 13, - 2, 531, 532, 5, 32, 16, 2, 532, 533, 5, 34, 17, 2, 533, 534, 5, 12, 6, - 2, 534, 111, 3, 2, 2, 2, 535, 538, 5, 176, 88, 2, 536, 538, 5, 178, 89, - 2, 537, 535, 3, 2, 2, 2, 537, 536, 3, 2, 2, 2, 538, 113, 3, 2, 2, 2, 539, - 540, 5, 138, 69, 2, 540, 541, 3, 2, 2, 2, 541, 542, 8, 57, 2, 2, 542, 543, - 8, 57, 3, 2, 543, 115, 3, 2, 2, 2, 544, 548, 5, 118, 59, 2, 545, 547, 5, - 120, 60, 2, 546, 545, 3, 2, 2, 2, 547, 550, 3, 2, 2, 2, 548, 546, 3, 2, - 2, 2, 548, 549, 3, 2, 2, 2, 549, 556, 3, 2, 2, 2, 550, 548, 3, 2, 2, 2, - 551, 552, 5, 132, 66, 2, 552, 553, 5, 116, 58, 2, 553, 554, 5, 132, 66, - 2, 554, 556, 3, 2, 2, 2, 555, 544, 3, 2, 2, 2, 555, 551, 3, 2, 2, 2, 556, - 117, 3, 2, 2, 2, 557, 558, 5, 122, 61, 2, 558, 119, 3, 2, 2, 2, 559, 564, - 5, 122, 61, 2, 560, 564, 5, 124, 62, 2, 561, 564, 5, 130, 65, 2, 562, 564, - 5, 128, 64, 2, 563, 559, 3, 2, 2, 2, 563, 560, 3, 2, 2, 2, 563, 561, 3, - 2, 2, 2, 563, 562, 3, 2, 2, 2, 564, 121, 3, 2, 2, 2, 565, 566, 9, 28, 2, - 2, 566, 123, 3, 2, 2, 2, 567, 568, 9, 29, 2, 2, 568, 125, 3, 2, 2, 2, 569, - 570, 7, 37, 2, 2, 570, 127, 3, 2, 2, 2, 571, 572, 7, 38, 2, 2, 572, 129, - 3, 2, 2, 2, 573, 574, 7, 97, 2, 2, 574, 131, 3, 2, 2, 2, 575, 576, 7, 36, - 2, 2, 576, 133, 3, 2, 2, 2, 577, 578, 7, 39, 2, 2, 578, 135, 3, 2, 2, 2, - 579, 580, 7, 40, 2, 2, 580, 137, 3, 2, 2, 2, 581, 582, 7, 41, 2, 2, 582, - 139, 3, 2, 2, 2, 583, 584, 7, 42, 2, 2, 584, 141, 3, 2, 2, 2, 585, 586, - 7, 43, 2, 2, 586, 143, 3, 2, 2, 2, 587, 588, 7, 93, 2, 2, 588, 145, 3, - 2, 2, 2, 589, 590, 7, 95, 2, 2, 590, 147, 3, 2, 2, 2, 591, 592, 7, 44, - 2, 2, 592, 149, 3, 2, 2, 2, 593, 594, 7, 45, 2, 2, 594, 151, 3, 2, 2, 2, - 595, 596, 7, 46, 2, 2, 596, 153, 3, 2, 2, 2, 597, 598, 7, 47, 2, 2, 598, - 155, 3, 2, 2, 2, 599, 600, 7, 48, 2, 2, 600, 157, 3, 2, 2, 2, 601, 602, - 7, 49, 2, 2, 602, 159, 3, 2, 2, 2, 603, 604, 7, 96, 2, 2, 604, 161, 3, - 2, 2, 2, 605, 606, 7, 126, 2, 2, 606, 607, 7, 126, 2, 2, 607, 163, 3, 2, - 2, 2, 608, 609, 7, 60, 2, 2, 609, 165, 3, 2, 2, 2, 610, 611, 7, 61, 2, - 2, 611, 167, 3, 2, 2, 2, 612, 613, 7, 65, 2, 2, 613, 169, 3, 2, 2, 2, 614, - 615, 7, 126, 2, 2, 615, 171, 3, 2, 2, 2, 616, 617, 4, 50, 51, 2, 617, 173, - 3, 2, 2, 2, 618, 626, 5, 124, 62, 2, 619, 626, 5, 4, 2, 2, 620, 626, 5, - 6, 3, 2, 621, 626, 5, 8, 4, 2, 622, 626, 5, 10, 5, 2, 623, 626, 5, 12, - 6, 2, 624, 626, 5, 14, 7, 2, 625, 618, 3, 2, 2, 2, 625, 619, 3, 2, 2, 2, - 625, 620, 3, 2, 2, 2, 625, 621, 3, 2, 2, 2, 625, 622, 3, 2, 2, 2, 625, - 623, 3, 2, 2, 2, 625, 624, 3, 2, 2, 2, 626, 175, 3, 2, 2, 2, 627, 630, - 5, 180, 90, 2, 628, 630, 5, 182, 91, 2, 629, 627, 3, 2, 2, 2, 629, 628, - 3, 2, 2, 2, 630, 177, 3, 2, 2, 2, 631, 633, 5, 192, 96, 2, 632, 631, 3, - 2, 2, 2, 632, 633, 3, 2, 2, 2, 633, 634, 3, 2, 2, 2, 634, 637, 5, 180, - 90, 2, 635, 637, 5, 182, 91, 2, 636, 632, 3, 2, 2, 2, 636, 635, 3, 2, 2, - 2, 637, 179, 3, 2, 2, 2, 638, 643, 5, 190, 95, 2, 639, 641, 5, 156, 78, - 2, 640, 642, 5, 190, 95, 2, 641, 640, 3, 2, 2, 2, 641, 642, 3, 2, 2, 2, - 642, 644, 3, 2, 2, 2, 643, 639, 3, 2, 2, 2, 643, 644, 3, 2, 2, 2, 644, - 649, 3, 2, 2, 2, 645, 646, 5, 156, 78, 2, 646, 647, 5, 190, 95, 2, 647, - 649, 3, 2, 2, 2, 648, 638, 3, 2, 2, 2, 648, 645, 3, 2, 2, 2, 649, 181, - 3, 2, 2, 2, 650, 651, 5, 184, 92, 2, 651, 652, 9, 6, 2, 2, 652, 653, 5, - 186, 93, 2, 653, 183, 3, 2, 2, 2, 654, 655, 5, 180, 90, 2, 655, 185, 3, - 2, 2, 2, 656, 657, 5, 188, 94, 2, 657, 187, 3, 2, 2, 2, 658, 660, 5, 192, - 96, 2, 659, 658, 3, 2, 2, 2, 659, 660, 3, 2, 2, 2, 660, 661, 3, 2, 2, 2, - 661, 662, 5, 190, 95, 2, 662, 189, 3, 2, 2, 2, 663, 665, 5, 124, 62, 2, - 664, 663, 3, 2, 2, 2, 665, 666, 3, 2, 2, 2, 666, 664, 3, 2, 2, 2, 666, - 667, 3, 2, 2, 2, 667, 191, 3, 2, 2, 2, 668, 671, 5, 150, 75, 2, 669, 671, - 5, 154, 77, 2, 670, 668, 3, 2, 2, 2, 670, 669, 3, 2, 2, 2, 671, 193, 3, - 2, 2, 2, 672, 673, 5, 196, 98, 2, 673, 195, 3, 2, 2, 2, 674, 684, 5, 198, - 99, 2, 675, 676, 5, 198, 99, 2, 676, 677, 7, 86, 2, 2, 677, 678, 5, 206, - 103, 2, 678, 684, 3, 2, 2, 2, 679, 680, 5, 216, 108, 2, 680, 681, 5, 140, - 70, 2, 681, 682, 5, 142, 71, 2, 682, 684, 3, 2, 2, 2, 683, 674, 3, 2, 2, - 2, 683, 675, 3, 2, 2, 2, 683, 679, 3, 2, 2, 2, 684, 197, 3, 2, 2, 2, 685, - 686, 5, 200, 100, 2, 686, 687, 7, 47, 2, 2, 687, 688, 5, 202, 101, 2, 688, - 689, 7, 47, 2, 2, 689, 690, 5, 204, 102, 2, 690, 199, 3, 2, 2, 2, 691, - 692, 5, 124, 62, 2, 692, 693, 5, 124, 62, 2, 693, 694, 5, 124, 62, 2, 694, - 695, 5, 124, 62, 2, 695, 201, 3, 2, 2, 2, 696, 697, 5, 124, 62, 2, 697, - 698, 5, 124, 62, 2, 698, 203, 3, 2, 2, 2, 699, 700, 5, 124, 62, 2, 700, - 701, 5, 124, 62, 2, 701, 205, 3, 2, 2, 2, 702, 703, 5, 210, 105, 2, 703, - 704, 7, 60, 2, 2, 704, 707, 5, 212, 106, 2, 705, 706, 7, 60, 2, 2, 706, - 708, 5, 214, 107, 2, 707, 705, 3, 2, 2, 2, 707, 708, 3, 2, 2, 2, 708, 710, - 3, 2, 2, 2, 709, 711, 5, 208, 104, 2, 710, 709, 3, 2, 2, 2, 710, 711, 3, - 2, 2, 2, 711, 207, 3, 2, 2, 2, 712, 719, 7, 92, 2, 2, 713, 714, 5, 192, - 96, 2, 714, 715, 5, 210, 105, 2, 715, 716, 7, 60, 2, 2, 716, 717, 5, 212, - 106, 2, 717, 719, 3, 2, 2, 2, 718, 712, 3, 2, 2, 2, 718, 713, 3, 2, 2, - 2, 719, 209, 3, 2, 2, 2, 720, 721, 5, 124, 62, 2, 721, 722, 5, 124, 62, - 2, 722, 211, 3, 2, 2, 2, 723, 724, 5, 124, 62, 2, 724, 725, 5, 124, 62, - 2, 725, 213, 3, 2, 2, 2, 726, 727, 5, 124, 62, 2, 727, 734, 5, 124, 62, - 2, 728, 730, 5, 156, 78, 2, 729, 731, 5, 124, 62, 2, 730, 729, 3, 2, 2, - 2, 731, 732, 3, 2, 2, 2, 732, 730, 3, 2, 2, 2, 732, 733, 3, 2, 2, 2, 733, - 735, 3, 2, 2, 2, 734, 728, 3, 2, 2, 2, 734, 735, 3, 2, 2, 2, 735, 215, - 3, 2, 2, 2, 736, 737, 5, 30, 15, 2, 737, 738, 5, 32, 16, 2, 738, 739, 5, - 48, 24, 2, 739, 217, 3, 2, 2, 2, 740, 742, 9, 30, 2, 2, 741, 740, 3, 2, - 2, 2, 742, 743, 3, 2, 2, 2, 743, 741, 3, 2, 2, 2, 743, 744, 3, 2, 2, 2, - 744, 745, 3, 2, 2, 2, 745, 746, 8, 109, 4, 2, 746, 219, 3, 2, 2, 2, 747, - 748, 7, 41, 2, 2, 748, 749, 3, 2, 2, 2, 749, 750, 8, 110, 5, 2, 750, 221, - 3, 2, 2, 2, 751, 752, 7, 41, 2, 2, 752, 753, 7, 41, 2, 2, 753, 754, 3, - 2, 2, 2, 754, 755, 8, 111, 2, 2, 755, 223, 3, 2, 2, 2, 756, 757, 10, 31, - 2, 2, 757, 758, 3, 2, 2, 2, 758, 759, 8, 112, 2, 2, 759, 225, 3, 2, 2, - 2, 29, 2, 3, 284, 312, 362, 432, 537, 548, 555, 563, 625, 629, 632, 636, - 641, 643, 648, 659, 666, 670, 683, 707, 710, 718, 732, 734, 743, 6, 5, - 2, 2, 4, 3, 2, 8, 2, 2, 4, 2, 2, -} - -var lexerDeserializer = antlr.NewATNDeserializer(nil) -var lexerAtn = lexerDeserializer.DeserializeFromUInt16(serializedLexerAtn) - -var lexerChannelNames = []string{ - "DEFAULT_TOKEN_CHANNEL", "HIDDEN", -} - -var lexerModeNames = []string{ - "DEFAULT_MODE", "STR", -} - -var lexerLiteralNames = []string{ - "", "", "'<'", "'='", "'>'", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "'#'", "'$'", "'_'", "'\"'", "'%'", "'&'", "", "'('", "')'", "'['", - "']'", "'*'", "'+'", "','", "'-'", "'.'", "'/'", "'^'", "'||'", "':'", - "';'", "'?'", "'|'", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", "", "", "''''", -} - -var lexerSymbolicNames = []string{ - "", "ComparisonOperator", "LT", "EQ", "GT", "NEQ", "GTEQ", "LTEQ", "BooleanLiteral", - "AND", "OR", "NOT", "LIKE", "ILIKE", "BETWEEN", "IS", "NULL", "IN", "ArithmeticOperator", - "SpatialOperator", "DistanceOperator", "POINT", "LINESTRING", "POLYGON", - "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", "GEOMETRYCOLLECTION", - "ENVELOPE", "NumericLiteral", "Identifier", "IdentifierStart", "IdentifierPart", - "ALPHA", "DIGIT", "OCTOTHORP", "DOLLAR", "UNDERSCORE", "DOUBLEQUOTE", "PERCENT", - "AMPERSAND", "QUOTE", "LEFTPAREN", "RIGHTPAREN", "LEFTSQUAREBRACKET", "RIGHTSQUAREBRACKET", - "ASTERISK", "PLUS", "COMMA", "MINUS", "PERIOD", "SOLIDUS", "CARET", "CONCAT", - "COLON", "SEMICOLON", "QUESTIONMARK", "VERTICALBAR", "BIT", "HEXIT", "UnsignedNumericLiteral", - "SignedNumericLiteral", "ExactNumericLiteral", "ApproximateNumericLiteral", - "Mantissa", "Exponent", "SignedInteger", "UnsignedInteger", "Sign", "TemporalLiteral", - "Instant", "FullDate", "DateYear", "DateMonth", "DateDay", "UtcTime", "TimeZoneOffset", - "TimeHour", "TimeMinute", "TimeSecond", "NOW", "WS", "CharacterStringLiteral", - "QuotedQuote", -} - -var lexerRuleNames = []string{ - "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", - "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "ComparisonOperator", - "LT", "EQ", "GT", "NEQ", "GTEQ", "LTEQ", "BooleanLiteral", "AND", "OR", - "NOT", "LIKE", "ILIKE", "BETWEEN", "IS", "NULL", "IN", "ArithmeticOperator", - "SpatialOperator", "DistanceOperator", "POINT", "LINESTRING", "POLYGON", - "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", "GEOMETRYCOLLECTION", - "ENVELOPE", "NumericLiteral", "CharacterStringLiteralStart", "Identifier", - "IdentifierStart", "IdentifierPart", "ALPHA", "DIGIT", "OCTOTHORP", "DOLLAR", - "UNDERSCORE", "DOUBLEQUOTE", "PERCENT", "AMPERSAND", "QUOTE", "LEFTPAREN", - "RIGHTPAREN", "LEFTSQUAREBRACKET", "RIGHTSQUAREBRACKET", "ASTERISK", "PLUS", - "COMMA", "MINUS", "PERIOD", "SOLIDUS", "CARET", "CONCAT", "COLON", "SEMICOLON", - "QUESTIONMARK", "VERTICALBAR", "BIT", "HEXIT", "UnsignedNumericLiteral", - "SignedNumericLiteral", "ExactNumericLiteral", "ApproximateNumericLiteral", - "Mantissa", "Exponent", "SignedInteger", "UnsignedInteger", "Sign", "TemporalLiteral", - "Instant", "FullDate", "DateYear", "DateMonth", "DateDay", "UtcTime", "TimeZoneOffset", - "TimeHour", "TimeMinute", "TimeSecond", "NOW", "WS", "CharacterStringLiteral", - "QuotedQuote", "Character", -} - type CqlLexer struct { *antlr.BaseLexer channelNames []string @@ -424,26 +21,449 @@ type CqlLexer struct { // TODO: EOF string } -var lexerDecisionToDFA = make([]*antlr.DFA, len(lexerAtn.DecisionToState)) +var CqlLexerLexerStaticData struct { + once sync.Once + serializedATN []int32 + ChannelNames []string + ModeNames []string + LiteralNames []string + SymbolicNames []string + RuleNames []string + PredictionContextCache *antlr.PredictionContextCache + atn *antlr.ATN + decisionToDFA []*antlr.DFA +} -func init() { - for index, ds := range lexerAtn.DecisionToState { - lexerDecisionToDFA[index] = antlr.NewDFA(ds, index) +func cqllexerLexerInit() { + staticData := &CqlLexerLexerStaticData + staticData.ChannelNames = []string{ + "DEFAULT_TOKEN_CHANNEL", "HIDDEN", + } + staticData.ModeNames = []string{ + "DEFAULT_MODE", "STR", + } + staticData.LiteralNames = []string{ + "", "", "'<'", "'='", "'>'", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "'#'", "'$'", "'_'", "'\"'", "'%'", "'&'", "", "'('", "')'", + "'['", "']'", "'*'", "'+'", "','", "'-'", "'.'", "'/'", "'^'", "'||'", + "':'", "';'", "'?'", "'|'", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "''''", + } + staticData.SymbolicNames = []string{ + "", "ComparisonOperator", "LT", "EQ", "GT", "NEQ", "GTEQ", "LTEQ", "BooleanLiteral", + "AND", "OR", "NOT", "LIKE", "ILIKE", "BETWEEN", "IS", "NULL", "IN", + "ArithmeticOperator", "SpatialOperator", "DistanceOperator", "POINT", + "LINESTRING", "POLYGON", "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", + "GEOMETRYCOLLECTION", "ENVELOPE", "NumericLiteral", "Identifier", "IdentifierStart", + "IdentifierPart", "ALPHA", "DIGIT", "OCTOTHORP", "DOLLAR", "UNDERSCORE", + "DOUBLEQUOTE", "PERCENT", "AMPERSAND", "QUOTE", "LEFTPAREN", "RIGHTPAREN", + "LEFTSQUAREBRACKET", "RIGHTSQUAREBRACKET", "ASTERISK", "PLUS", "COMMA", + "MINUS", "PERIOD", "SOLIDUS", "CARET", "CONCAT", "COLON", "SEMICOLON", + "QUESTIONMARK", "VERTICALBAR", "BIT", "HEXIT", "UnsignedNumericLiteral", + "SignedNumericLiteral", "ExactNumericLiteral", "ApproximateNumericLiteral", + "Mantissa", "Exponent", "SignedInteger", "UnsignedInteger", "Sign", + "TemporalLiteral", "Instant", "FullDate", "DateYear", "DateMonth", "DateDay", + "UtcTime", "TimeZoneOffset", "TimeHour", "TimeMinute", "TimeSecond", + "NOW", "WS", "CharacterStringLiteral", "QuotedQuote", + } + staticData.RuleNames = []string{ + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", + "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "ComparisonOperator", + "LT", "EQ", "GT", "NEQ", "GTEQ", "LTEQ", "BooleanLiteral", "AND", "OR", + "NOT", "LIKE", "ILIKE", "BETWEEN", "IS", "NULL", "IN", "ArithmeticOperator", + "SpatialOperator", "DistanceOperator", "POINT", "LINESTRING", "POLYGON", + "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", "GEOMETRYCOLLECTION", + "ENVELOPE", "NumericLiteral", "CharacterStringLiteralStart", "Identifier", + "IdentifierStart", "IdentifierPart", "ALPHA", "DIGIT", "OCTOTHORP", + "DOLLAR", "UNDERSCORE", "DOUBLEQUOTE", "PERCENT", "AMPERSAND", "QUOTE", + "LEFTPAREN", "RIGHTPAREN", "LEFTSQUAREBRACKET", "RIGHTSQUAREBRACKET", + "ASTERISK", "PLUS", "COMMA", "MINUS", "PERIOD", "SOLIDUS", "CARET", + "CONCAT", "COLON", "SEMICOLON", "QUESTIONMARK", "VERTICALBAR", "BIT", + "HEXIT", "UnsignedNumericLiteral", "SignedNumericLiteral", "ExactNumericLiteral", + "ApproximateNumericLiteral", "Mantissa", "Exponent", "SignedInteger", + "UnsignedInteger", "Sign", "TemporalLiteral", "Instant", "FullDate", + "DateYear", "DateMonth", "DateDay", "UtcTime", "TimeZoneOffset", "TimeHour", + "TimeMinute", "TimeSecond", "NOW", "WS", "CharacterStringLiteral", "QuotedQuote", + "Character", + } + staticData.PredictionContextCache = antlr.NewPredictionContextCache() + staticData.serializedATN = []int32{ + 4, 0, 83, 759, 6, -1, 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, 2, 34, 7, 34, 2, 35, 7, + 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, + 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, + 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, + 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, + 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, + 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, + 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, + 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, + 77, 2, 78, 7, 78, 2, 79, 7, 79, 2, 80, 7, 80, 2, 81, 7, 81, 2, 82, 7, 82, + 2, 83, 7, 83, 2, 84, 7, 84, 2, 85, 7, 85, 2, 86, 7, 86, 2, 87, 7, 87, 2, + 88, 7, 88, 2, 89, 7, 89, 2, 90, 7, 90, 2, 91, 7, 91, 2, 92, 7, 92, 2, 93, + 7, 93, 2, 94, 7, 94, 2, 95, 7, 95, 2, 96, 7, 96, 2, 97, 7, 97, 2, 98, 7, + 98, 2, 99, 7, 99, 2, 100, 7, 100, 2, 101, 7, 101, 2, 102, 7, 102, 2, 103, + 7, 103, 2, 104, 7, 104, 2, 105, 7, 105, 2, 106, 7, 106, 2, 107, 7, 107, + 2, 108, 7, 108, 2, 109, 7, 109, 2, 110, 7, 110, 1, 0, 1, 0, 1, 1, 1, 1, + 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, + 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, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, + 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22, 1, 23, 1, 23, + 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 3, + 26, 283, 8, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, + 1, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 1, 33, 1, + 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 1, 33, 3, 33, 311, 8, 33, + 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, + 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, + 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, + 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43, + 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 3, 43, 361, 8, 43, 1, 44, 1, + 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, + 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, + 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, + 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, + 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, + 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, + 44, 1, 44, 1, 44, 1, 44, 3, 44, 431, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, + 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, + 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, 1, 47, + 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 1, + 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, + 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, 50, 1, + 50, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, + 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, + 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, + 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, + 53, 1, 53, 1, 53, 1, 54, 1, 54, 3, 54, 536, 8, 54, 1, 55, 1, 55, 1, 55, + 1, 55, 1, 55, 1, 56, 1, 56, 5, 56, 545, 8, 56, 10, 56, 12, 56, 548, 9, + 56, 1, 56, 1, 56, 1, 56, 1, 56, 3, 56, 554, 8, 56, 1, 57, 1, 57, 1, 58, + 1, 58, 1, 58, 1, 58, 1, 58, 3, 58, 563, 8, 58, 1, 59, 1, 59, 1, 60, 1, + 60, 1, 61, 1, 61, 1, 62, 1, 62, 1, 63, 1, 63, 1, 64, 1, 64, 1, 65, 1, 65, + 1, 66, 1, 66, 1, 67, 1, 67, 1, 68, 1, 68, 1, 69, 1, 69, 1, 70, 1, 70, 1, + 71, 1, 71, 1, 72, 1, 72, 1, 73, 1, 73, 1, 74, 1, 74, 1, 75, 1, 75, 1, 76, + 1, 76, 1, 77, 1, 77, 1, 78, 1, 78, 1, 79, 1, 79, 1, 79, 1, 80, 1, 80, 1, + 81, 1, 81, 1, 82, 1, 82, 1, 83, 1, 83, 1, 84, 1, 84, 1, 85, 1, 85, 1, 85, + 1, 85, 1, 85, 1, 85, 1, 85, 3, 85, 625, 8, 85, 1, 86, 1, 86, 3, 86, 629, + 8, 86, 1, 87, 3, 87, 632, 8, 87, 1, 87, 1, 87, 3, 87, 636, 8, 87, 1, 88, + 1, 88, 1, 88, 3, 88, 641, 8, 88, 3, 88, 643, 8, 88, 1, 88, 1, 88, 1, 88, + 3, 88, 648, 8, 88, 1, 89, 1, 89, 1, 89, 1, 89, 1, 90, 1, 90, 1, 91, 1, + 91, 1, 92, 3, 92, 659, 8, 92, 1, 92, 1, 92, 1, 93, 4, 93, 664, 8, 93, 11, + 93, 12, 93, 665, 1, 94, 1, 94, 3, 94, 670, 8, 94, 1, 95, 1, 95, 1, 96, + 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 1, 96, 3, 96, 683, 8, + 96, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 97, 1, 98, 1, 98, 1, 98, 1, 98, + 1, 98, 1, 99, 1, 99, 1, 99, 1, 100, 1, 100, 1, 100, 1, 101, 1, 101, 1, + 101, 1, 101, 1, 101, 3, 101, 707, 8, 101, 1, 101, 3, 101, 710, 8, 101, + 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 1, 102, 3, 102, 718, 8, 102, 1, + 103, 1, 103, 1, 103, 1, 104, 1, 104, 1, 104, 1, 105, 1, 105, 1, 105, 1, + 105, 4, 105, 730, 8, 105, 11, 105, 12, 105, 731, 3, 105, 734, 8, 105, 1, + 106, 1, 106, 1, 106, 1, 106, 1, 107, 4, 107, 741, 8, 107, 11, 107, 12, + 107, 742, 1, 107, 1, 107, 1, 108, 1, 108, 1, 108, 1, 108, 1, 109, 1, 109, + 1, 109, 1, 109, 1, 109, 1, 110, 1, 110, 1, 110, 1, 110, 0, 0, 111, 2, 0, + 4, 0, 6, 0, 8, 0, 10, 0, 12, 0, 14, 0, 16, 0, 18, 0, 20, 0, 22, 0, 24, + 0, 26, 0, 28, 0, 30, 0, 32, 0, 34, 0, 36, 0, 38, 0, 40, 0, 42, 0, 44, 0, + 46, 0, 48, 0, 50, 0, 52, 0, 54, 1, 56, 2, 58, 3, 60, 4, 62, 5, 64, 6, 66, + 7, 68, 8, 70, 9, 72, 10, 74, 11, 76, 12, 78, 13, 80, 14, 82, 15, 84, 16, + 86, 17, 88, 18, 90, 19, 92, 20, 94, 21, 96, 22, 98, 23, 100, 24, 102, 25, + 104, 26, 106, 27, 108, 28, 110, 29, 112, 0, 114, 30, 116, 31, 118, 32, + 120, 33, 122, 34, 124, 35, 126, 36, 128, 37, 130, 38, 132, 39, 134, 40, + 136, 41, 138, 42, 140, 43, 142, 44, 144, 45, 146, 46, 148, 47, 150, 48, + 152, 49, 154, 50, 156, 51, 158, 52, 160, 53, 162, 54, 164, 55, 166, 56, + 168, 57, 170, 58, 172, 59, 174, 60, 176, 61, 178, 62, 180, 63, 182, 64, + 184, 65, 186, 66, 188, 67, 190, 68, 192, 69, 194, 70, 196, 71, 198, 72, + 200, 73, 202, 74, 204, 75, 206, 76, 208, 77, 210, 78, 212, 79, 214, 80, + 216, 81, 218, 82, 220, 83, 222, 0, 2, 0, 1, 30, 2, 0, 65, 65, 97, 97, 2, + 0, 66, 66, 98, 98, 2, 0, 67, 67, 99, 99, 2, 0, 68, 68, 100, 100, 2, 0, + 69, 69, 101, 101, 2, 0, 70, 70, 102, 102, 2, 0, 71, 71, 103, 103, 2, 0, + 72, 72, 104, 104, 2, 0, 73, 73, 105, 105, 2, 0, 74, 74, 106, 106, 2, 0, + 75, 75, 107, 107, 2, 0, 76, 76, 108, 108, 2, 0, 77, 77, 109, 109, 2, 0, + 78, 78, 110, 110, 2, 0, 79, 79, 111, 111, 2, 0, 80, 80, 112, 112, 2, 0, + 81, 81, 113, 113, 2, 0, 82, 82, 114, 114, 2, 0, 83, 83, 115, 115, 2, 0, + 84, 84, 116, 116, 2, 0, 85, 85, 117, 117, 2, 0, 86, 86, 118, 118, 2, 0, + 87, 87, 119, 119, 2, 0, 88, 88, 120, 120, 2, 0, 89, 89, 121, 121, 2, 0, + 90, 90, 122, 122, 2, 0, 65, 90, 97, 122, 1, 0, 48, 57, 3, 0, 9, 10, 13, + 13, 32, 32, 1, 0, 39, 39, 780, 0, 54, 1, 0, 0, 0, 0, 56, 1, 0, 0, 0, 0, + 58, 1, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 62, 1, 0, 0, 0, 0, 64, 1, 0, 0, 0, + 0, 66, 1, 0, 0, 0, 0, 68, 1, 0, 0, 0, 0, 70, 1, 0, 0, 0, 0, 72, 1, 0, 0, + 0, 0, 74, 1, 0, 0, 0, 0, 76, 1, 0, 0, 0, 0, 78, 1, 0, 0, 0, 0, 80, 1, 0, + 0, 0, 0, 82, 1, 0, 0, 0, 0, 84, 1, 0, 0, 0, 0, 86, 1, 0, 0, 0, 0, 88, 1, + 0, 0, 0, 0, 90, 1, 0, 0, 0, 0, 92, 1, 0, 0, 0, 0, 94, 1, 0, 0, 0, 0, 96, + 1, 0, 0, 0, 0, 98, 1, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0, 102, 1, 0, 0, 0, + 0, 104, 1, 0, 0, 0, 0, 106, 1, 0, 0, 0, 0, 108, 1, 0, 0, 0, 0, 110, 1, + 0, 0, 0, 0, 112, 1, 0, 0, 0, 0, 114, 1, 0, 0, 0, 0, 116, 1, 0, 0, 0, 0, + 118, 1, 0, 0, 0, 0, 120, 1, 0, 0, 0, 0, 122, 1, 0, 0, 0, 0, 124, 1, 0, + 0, 0, 0, 126, 1, 0, 0, 0, 0, 128, 1, 0, 0, 0, 0, 130, 1, 0, 0, 0, 0, 132, + 1, 0, 0, 0, 0, 134, 1, 0, 0, 0, 0, 136, 1, 0, 0, 0, 0, 138, 1, 0, 0, 0, + 0, 140, 1, 0, 0, 0, 0, 142, 1, 0, 0, 0, 0, 144, 1, 0, 0, 0, 0, 146, 1, + 0, 0, 0, 0, 148, 1, 0, 0, 0, 0, 150, 1, 0, 0, 0, 0, 152, 1, 0, 0, 0, 0, + 154, 1, 0, 0, 0, 0, 156, 1, 0, 0, 0, 0, 158, 1, 0, 0, 0, 0, 160, 1, 0, + 0, 0, 0, 162, 1, 0, 0, 0, 0, 164, 1, 0, 0, 0, 0, 166, 1, 0, 0, 0, 0, 168, + 1, 0, 0, 0, 0, 170, 1, 0, 0, 0, 0, 172, 1, 0, 0, 0, 0, 174, 1, 0, 0, 0, + 0, 176, 1, 0, 0, 0, 0, 178, 1, 0, 0, 0, 0, 180, 1, 0, 0, 0, 0, 182, 1, + 0, 0, 0, 0, 184, 1, 0, 0, 0, 0, 186, 1, 0, 0, 0, 0, 188, 1, 0, 0, 0, 0, + 190, 1, 0, 0, 0, 0, 192, 1, 0, 0, 0, 0, 194, 1, 0, 0, 0, 0, 196, 1, 0, + 0, 0, 0, 198, 1, 0, 0, 0, 0, 200, 1, 0, 0, 0, 0, 202, 1, 0, 0, 0, 0, 204, + 1, 0, 0, 0, 0, 206, 1, 0, 0, 0, 0, 208, 1, 0, 0, 0, 0, 210, 1, 0, 0, 0, + 0, 212, 1, 0, 0, 0, 0, 214, 1, 0, 0, 0, 0, 216, 1, 0, 0, 0, 1, 218, 1, + 0, 0, 0, 1, 220, 1, 0, 0, 0, 1, 222, 1, 0, 0, 0, 2, 224, 1, 0, 0, 0, 4, + 226, 1, 0, 0, 0, 6, 228, 1, 0, 0, 0, 8, 230, 1, 0, 0, 0, 10, 232, 1, 0, + 0, 0, 12, 234, 1, 0, 0, 0, 14, 236, 1, 0, 0, 0, 16, 238, 1, 0, 0, 0, 18, + 240, 1, 0, 0, 0, 20, 242, 1, 0, 0, 0, 22, 244, 1, 0, 0, 0, 24, 246, 1, + 0, 0, 0, 26, 248, 1, 0, 0, 0, 28, 250, 1, 0, 0, 0, 30, 252, 1, 0, 0, 0, + 32, 254, 1, 0, 0, 0, 34, 256, 1, 0, 0, 0, 36, 258, 1, 0, 0, 0, 38, 260, + 1, 0, 0, 0, 40, 262, 1, 0, 0, 0, 42, 264, 1, 0, 0, 0, 44, 266, 1, 0, 0, + 0, 46, 268, 1, 0, 0, 0, 48, 270, 1, 0, 0, 0, 50, 272, 1, 0, 0, 0, 52, 274, + 1, 0, 0, 0, 54, 282, 1, 0, 0, 0, 56, 284, 1, 0, 0, 0, 58, 286, 1, 0, 0, + 0, 60, 288, 1, 0, 0, 0, 62, 290, 1, 0, 0, 0, 64, 293, 1, 0, 0, 0, 66, 296, + 1, 0, 0, 0, 68, 310, 1, 0, 0, 0, 70, 312, 1, 0, 0, 0, 72, 316, 1, 0, 0, + 0, 74, 319, 1, 0, 0, 0, 76, 323, 1, 0, 0, 0, 78, 328, 1, 0, 0, 0, 80, 334, + 1, 0, 0, 0, 82, 342, 1, 0, 0, 0, 84, 345, 1, 0, 0, 0, 86, 350, 1, 0, 0, + 0, 88, 360, 1, 0, 0, 0, 90, 430, 1, 0, 0, 0, 92, 432, 1, 0, 0, 0, 94, 440, + 1, 0, 0, 0, 96, 446, 1, 0, 0, 0, 98, 457, 1, 0, 0, 0, 100, 465, 1, 0, 0, + 0, 102, 476, 1, 0, 0, 0, 104, 492, 1, 0, 0, 0, 106, 505, 1, 0, 0, 0, 108, + 524, 1, 0, 0, 0, 110, 535, 1, 0, 0, 0, 112, 537, 1, 0, 0, 0, 114, 553, + 1, 0, 0, 0, 116, 555, 1, 0, 0, 0, 118, 562, 1, 0, 0, 0, 120, 564, 1, 0, + 0, 0, 122, 566, 1, 0, 0, 0, 124, 568, 1, 0, 0, 0, 126, 570, 1, 0, 0, 0, + 128, 572, 1, 0, 0, 0, 130, 574, 1, 0, 0, 0, 132, 576, 1, 0, 0, 0, 134, + 578, 1, 0, 0, 0, 136, 580, 1, 0, 0, 0, 138, 582, 1, 0, 0, 0, 140, 584, + 1, 0, 0, 0, 142, 586, 1, 0, 0, 0, 144, 588, 1, 0, 0, 0, 146, 590, 1, 0, + 0, 0, 148, 592, 1, 0, 0, 0, 150, 594, 1, 0, 0, 0, 152, 596, 1, 0, 0, 0, + 154, 598, 1, 0, 0, 0, 156, 600, 1, 0, 0, 0, 158, 602, 1, 0, 0, 0, 160, + 604, 1, 0, 0, 0, 162, 607, 1, 0, 0, 0, 164, 609, 1, 0, 0, 0, 166, 611, + 1, 0, 0, 0, 168, 613, 1, 0, 0, 0, 170, 615, 1, 0, 0, 0, 172, 624, 1, 0, + 0, 0, 174, 628, 1, 0, 0, 0, 176, 635, 1, 0, 0, 0, 178, 647, 1, 0, 0, 0, + 180, 649, 1, 0, 0, 0, 182, 653, 1, 0, 0, 0, 184, 655, 1, 0, 0, 0, 186, + 658, 1, 0, 0, 0, 188, 663, 1, 0, 0, 0, 190, 669, 1, 0, 0, 0, 192, 671, + 1, 0, 0, 0, 194, 682, 1, 0, 0, 0, 196, 684, 1, 0, 0, 0, 198, 690, 1, 0, + 0, 0, 200, 695, 1, 0, 0, 0, 202, 698, 1, 0, 0, 0, 204, 701, 1, 0, 0, 0, + 206, 717, 1, 0, 0, 0, 208, 719, 1, 0, 0, 0, 210, 722, 1, 0, 0, 0, 212, + 725, 1, 0, 0, 0, 214, 735, 1, 0, 0, 0, 216, 740, 1, 0, 0, 0, 218, 746, + 1, 0, 0, 0, 220, 750, 1, 0, 0, 0, 222, 755, 1, 0, 0, 0, 224, 225, 7, 0, + 0, 0, 225, 3, 1, 0, 0, 0, 226, 227, 7, 1, 0, 0, 227, 5, 1, 0, 0, 0, 228, + 229, 7, 2, 0, 0, 229, 7, 1, 0, 0, 0, 230, 231, 7, 3, 0, 0, 231, 9, 1, 0, + 0, 0, 232, 233, 7, 4, 0, 0, 233, 11, 1, 0, 0, 0, 234, 235, 7, 5, 0, 0, + 235, 13, 1, 0, 0, 0, 236, 237, 7, 6, 0, 0, 237, 15, 1, 0, 0, 0, 238, 239, + 7, 7, 0, 0, 239, 17, 1, 0, 0, 0, 240, 241, 7, 8, 0, 0, 241, 19, 1, 0, 0, + 0, 242, 243, 7, 9, 0, 0, 243, 21, 1, 0, 0, 0, 244, 245, 7, 10, 0, 0, 245, + 23, 1, 0, 0, 0, 246, 247, 7, 11, 0, 0, 247, 25, 1, 0, 0, 0, 248, 249, 7, + 12, 0, 0, 249, 27, 1, 0, 0, 0, 250, 251, 7, 13, 0, 0, 251, 29, 1, 0, 0, + 0, 252, 253, 7, 14, 0, 0, 253, 31, 1, 0, 0, 0, 254, 255, 7, 15, 0, 0, 255, + 33, 1, 0, 0, 0, 256, 257, 7, 16, 0, 0, 257, 35, 1, 0, 0, 0, 258, 259, 7, + 17, 0, 0, 259, 37, 1, 0, 0, 0, 260, 261, 7, 18, 0, 0, 261, 39, 1, 0, 0, + 0, 262, 263, 7, 19, 0, 0, 263, 41, 1, 0, 0, 0, 264, 265, 7, 20, 0, 0, 265, + 43, 1, 0, 0, 0, 266, 267, 7, 21, 0, 0, 267, 45, 1, 0, 0, 0, 268, 269, 7, + 22, 0, 0, 269, 47, 1, 0, 0, 0, 270, 271, 7, 23, 0, 0, 271, 49, 1, 0, 0, + 0, 272, 273, 7, 24, 0, 0, 273, 51, 1, 0, 0, 0, 274, 275, 7, 25, 0, 0, 275, + 53, 1, 0, 0, 0, 276, 283, 3, 58, 28, 0, 277, 283, 3, 62, 30, 0, 278, 283, + 3, 56, 27, 0, 279, 283, 3, 60, 29, 0, 280, 283, 3, 66, 32, 0, 281, 283, + 3, 64, 31, 0, 282, 276, 1, 0, 0, 0, 282, 277, 1, 0, 0, 0, 282, 278, 1, + 0, 0, 0, 282, 279, 1, 0, 0, 0, 282, 280, 1, 0, 0, 0, 282, 281, 1, 0, 0, + 0, 283, 55, 1, 0, 0, 0, 284, 285, 5, 60, 0, 0, 285, 57, 1, 0, 0, 0, 286, + 287, 5, 61, 0, 0, 287, 59, 1, 0, 0, 0, 288, 289, 5, 62, 0, 0, 289, 61, + 1, 0, 0, 0, 290, 291, 3, 56, 27, 0, 291, 292, 3, 60, 29, 0, 292, 63, 1, + 0, 0, 0, 293, 294, 3, 60, 29, 0, 294, 295, 3, 58, 28, 0, 295, 65, 1, 0, + 0, 0, 296, 297, 3, 56, 27, 0, 297, 298, 3, 58, 28, 0, 298, 67, 1, 0, 0, + 0, 299, 300, 3, 40, 19, 0, 300, 301, 3, 36, 17, 0, 301, 302, 3, 42, 20, + 0, 302, 303, 3, 10, 4, 0, 303, 311, 1, 0, 0, 0, 304, 305, 3, 12, 5, 0, + 305, 306, 3, 2, 0, 0, 306, 307, 3, 24, 11, 0, 307, 308, 3, 38, 18, 0, 308, + 309, 3, 10, 4, 0, 309, 311, 1, 0, 0, 0, 310, 299, 1, 0, 0, 0, 310, 304, + 1, 0, 0, 0, 311, 69, 1, 0, 0, 0, 312, 313, 3, 2, 0, 0, 313, 314, 3, 28, + 13, 0, 314, 315, 3, 8, 3, 0, 315, 71, 1, 0, 0, 0, 316, 317, 3, 30, 14, + 0, 317, 318, 3, 36, 17, 0, 318, 73, 1, 0, 0, 0, 319, 320, 3, 28, 13, 0, + 320, 321, 3, 30, 14, 0, 321, 322, 3, 40, 19, 0, 322, 75, 1, 0, 0, 0, 323, + 324, 3, 24, 11, 0, 324, 325, 3, 18, 8, 0, 325, 326, 3, 22, 10, 0, 326, + 327, 3, 10, 4, 0, 327, 77, 1, 0, 0, 0, 328, 329, 3, 18, 8, 0, 329, 330, + 3, 24, 11, 0, 330, 331, 3, 18, 8, 0, 331, 332, 3, 22, 10, 0, 332, 333, + 3, 10, 4, 0, 333, 79, 1, 0, 0, 0, 334, 335, 3, 4, 1, 0, 335, 336, 3, 10, + 4, 0, 336, 337, 3, 40, 19, 0, 337, 338, 3, 46, 22, 0, 338, 339, 3, 10, + 4, 0, 339, 340, 3, 10, 4, 0, 340, 341, 3, 28, 13, 0, 341, 81, 1, 0, 0, + 0, 342, 343, 3, 18, 8, 0, 343, 344, 3, 38, 18, 0, 344, 83, 1, 0, 0, 0, + 345, 346, 3, 28, 13, 0, 346, 347, 3, 42, 20, 0, 347, 348, 3, 24, 11, 0, + 348, 349, 3, 24, 11, 0, 349, 85, 1, 0, 0, 0, 350, 351, 3, 18, 8, 0, 351, + 352, 3, 28, 13, 0, 352, 87, 1, 0, 0, 0, 353, 361, 3, 148, 73, 0, 354, 361, + 3, 152, 75, 0, 355, 361, 3, 146, 72, 0, 356, 361, 3, 156, 77, 0, 357, 361, + 3, 132, 65, 0, 358, 361, 3, 158, 78, 0, 359, 361, 3, 160, 79, 0, 360, 353, + 1, 0, 0, 0, 360, 354, 1, 0, 0, 0, 360, 355, 1, 0, 0, 0, 360, 356, 1, 0, + 0, 0, 360, 357, 1, 0, 0, 0, 360, 358, 1, 0, 0, 0, 360, 359, 1, 0, 0, 0, + 361, 89, 1, 0, 0, 0, 362, 363, 3, 10, 4, 0, 363, 364, 3, 34, 16, 0, 364, + 365, 3, 42, 20, 0, 365, 366, 3, 2, 0, 0, 366, 367, 3, 24, 11, 0, 367, 368, + 3, 38, 18, 0, 368, 431, 1, 0, 0, 0, 369, 370, 3, 8, 3, 0, 370, 371, 3, + 18, 8, 0, 371, 372, 3, 38, 18, 0, 372, 373, 3, 20, 9, 0, 373, 374, 3, 30, + 14, 0, 374, 375, 3, 18, 8, 0, 375, 376, 3, 28, 13, 0, 376, 377, 3, 40, + 19, 0, 377, 431, 1, 0, 0, 0, 378, 379, 3, 40, 19, 0, 379, 380, 3, 30, 14, + 0, 380, 381, 3, 42, 20, 0, 381, 382, 3, 6, 2, 0, 382, 383, 3, 16, 7, 0, + 383, 384, 3, 10, 4, 0, 384, 385, 3, 38, 18, 0, 385, 431, 1, 0, 0, 0, 386, + 387, 3, 46, 22, 0, 387, 388, 3, 18, 8, 0, 388, 389, 3, 40, 19, 0, 389, + 390, 3, 16, 7, 0, 390, 391, 3, 18, 8, 0, 391, 392, 3, 28, 13, 0, 392, 431, + 1, 0, 0, 0, 393, 394, 3, 30, 14, 0, 394, 395, 3, 44, 21, 0, 395, 396, 3, + 10, 4, 0, 396, 397, 3, 36, 17, 0, 397, 398, 3, 24, 11, 0, 398, 399, 3, + 2, 0, 0, 399, 400, 3, 32, 15, 0, 400, 401, 3, 38, 18, 0, 401, 431, 1, 0, + 0, 0, 402, 403, 3, 6, 2, 0, 403, 404, 3, 36, 17, 0, 404, 405, 3, 30, 14, + 0, 405, 406, 3, 38, 18, 0, 406, 407, 3, 38, 18, 0, 407, 408, 3, 10, 4, + 0, 408, 409, 3, 38, 18, 0, 409, 431, 1, 0, 0, 0, 410, 411, 3, 18, 8, 0, + 411, 412, 3, 28, 13, 0, 412, 413, 3, 40, 19, 0, 413, 414, 3, 10, 4, 0, + 414, 415, 3, 36, 17, 0, 415, 416, 3, 38, 18, 0, 416, 417, 3, 10, 4, 0, + 417, 418, 3, 6, 2, 0, 418, 419, 3, 40, 19, 0, 419, 420, 3, 38, 18, 0, 420, + 431, 1, 0, 0, 0, 421, 422, 3, 6, 2, 0, 422, 423, 3, 30, 14, 0, 423, 424, + 3, 28, 13, 0, 424, 425, 3, 40, 19, 0, 425, 426, 3, 2, 0, 0, 426, 427, 3, + 18, 8, 0, 427, 428, 3, 28, 13, 0, 428, 429, 3, 38, 18, 0, 429, 431, 1, + 0, 0, 0, 430, 362, 1, 0, 0, 0, 430, 369, 1, 0, 0, 0, 430, 378, 1, 0, 0, + 0, 430, 386, 1, 0, 0, 0, 430, 393, 1, 0, 0, 0, 430, 402, 1, 0, 0, 0, 430, + 410, 1, 0, 0, 0, 430, 421, 1, 0, 0, 0, 431, 91, 1, 0, 0, 0, 432, 433, 3, + 8, 3, 0, 433, 434, 3, 46, 22, 0, 434, 435, 3, 18, 8, 0, 435, 436, 3, 40, + 19, 0, 436, 437, 3, 16, 7, 0, 437, 438, 3, 18, 8, 0, 438, 439, 3, 28, 13, + 0, 439, 93, 1, 0, 0, 0, 440, 441, 3, 32, 15, 0, 441, 442, 3, 30, 14, 0, + 442, 443, 3, 18, 8, 0, 443, 444, 3, 28, 13, 0, 444, 445, 3, 40, 19, 0, + 445, 95, 1, 0, 0, 0, 446, 447, 3, 24, 11, 0, 447, 448, 3, 18, 8, 0, 448, + 449, 3, 28, 13, 0, 449, 450, 3, 10, 4, 0, 450, 451, 3, 38, 18, 0, 451, + 452, 3, 40, 19, 0, 452, 453, 3, 36, 17, 0, 453, 454, 3, 18, 8, 0, 454, + 455, 3, 28, 13, 0, 455, 456, 3, 14, 6, 0, 456, 97, 1, 0, 0, 0, 457, 458, + 3, 32, 15, 0, 458, 459, 3, 30, 14, 0, 459, 460, 3, 24, 11, 0, 460, 461, + 3, 50, 24, 0, 461, 462, 3, 14, 6, 0, 462, 463, 3, 30, 14, 0, 463, 464, + 3, 28, 13, 0, 464, 99, 1, 0, 0, 0, 465, 466, 3, 26, 12, 0, 466, 467, 3, + 42, 20, 0, 467, 468, 3, 24, 11, 0, 468, 469, 3, 40, 19, 0, 469, 470, 3, + 18, 8, 0, 470, 471, 3, 32, 15, 0, 471, 472, 3, 30, 14, 0, 472, 473, 3, + 18, 8, 0, 473, 474, 3, 28, 13, 0, 474, 475, 3, 40, 19, 0, 475, 101, 1, + 0, 0, 0, 476, 477, 3, 26, 12, 0, 477, 478, 3, 42, 20, 0, 478, 479, 3, 24, + 11, 0, 479, 480, 3, 40, 19, 0, 480, 481, 3, 18, 8, 0, 481, 482, 3, 24, + 11, 0, 482, 483, 3, 18, 8, 0, 483, 484, 3, 28, 13, 0, 484, 485, 3, 10, + 4, 0, 485, 486, 3, 38, 18, 0, 486, 487, 3, 40, 19, 0, 487, 488, 3, 36, + 17, 0, 488, 489, 3, 18, 8, 0, 489, 490, 3, 28, 13, 0, 490, 491, 3, 14, + 6, 0, 491, 103, 1, 0, 0, 0, 492, 493, 3, 26, 12, 0, 493, 494, 3, 42, 20, + 0, 494, 495, 3, 24, 11, 0, 495, 496, 3, 40, 19, 0, 496, 497, 3, 18, 8, + 0, 497, 498, 3, 32, 15, 0, 498, 499, 3, 30, 14, 0, 499, 500, 3, 24, 11, + 0, 500, 501, 3, 50, 24, 0, 501, 502, 3, 14, 6, 0, 502, 503, 3, 30, 14, + 0, 503, 504, 3, 28, 13, 0, 504, 105, 1, 0, 0, 0, 505, 506, 3, 14, 6, 0, + 506, 507, 3, 10, 4, 0, 507, 508, 3, 30, 14, 0, 508, 509, 3, 26, 12, 0, + 509, 510, 3, 10, 4, 0, 510, 511, 3, 40, 19, 0, 511, 512, 3, 36, 17, 0, + 512, 513, 3, 50, 24, 0, 513, 514, 3, 6, 2, 0, 514, 515, 3, 30, 14, 0, 515, + 516, 3, 24, 11, 0, 516, 517, 3, 24, 11, 0, 517, 518, 3, 10, 4, 0, 518, + 519, 3, 6, 2, 0, 519, 520, 3, 40, 19, 0, 520, 521, 3, 18, 8, 0, 521, 522, + 3, 30, 14, 0, 522, 523, 3, 28, 13, 0, 523, 107, 1, 0, 0, 0, 524, 525, 3, + 10, 4, 0, 525, 526, 3, 28, 13, 0, 526, 527, 3, 44, 21, 0, 527, 528, 3, + 10, 4, 0, 528, 529, 3, 24, 11, 0, 529, 530, 3, 30, 14, 0, 530, 531, 3, + 32, 15, 0, 531, 532, 3, 10, 4, 0, 532, 109, 1, 0, 0, 0, 533, 536, 3, 174, + 86, 0, 534, 536, 3, 176, 87, 0, 535, 533, 1, 0, 0, 0, 535, 534, 1, 0, 0, + 0, 536, 111, 1, 0, 0, 0, 537, 538, 3, 136, 67, 0, 538, 539, 1, 0, 0, 0, + 539, 540, 6, 55, 0, 0, 540, 541, 6, 55, 1, 0, 541, 113, 1, 0, 0, 0, 542, + 546, 3, 116, 57, 0, 543, 545, 3, 118, 58, 0, 544, 543, 1, 0, 0, 0, 545, + 548, 1, 0, 0, 0, 546, 544, 1, 0, 0, 0, 546, 547, 1, 0, 0, 0, 547, 554, + 1, 0, 0, 0, 548, 546, 1, 0, 0, 0, 549, 550, 3, 130, 64, 0, 550, 551, 3, + 114, 56, 0, 551, 552, 3, 130, 64, 0, 552, 554, 1, 0, 0, 0, 553, 542, 1, + 0, 0, 0, 553, 549, 1, 0, 0, 0, 554, 115, 1, 0, 0, 0, 555, 556, 3, 120, + 59, 0, 556, 117, 1, 0, 0, 0, 557, 563, 3, 120, 59, 0, 558, 563, 3, 122, + 60, 0, 559, 563, 3, 128, 63, 0, 560, 563, 3, 126, 62, 0, 561, 563, 3, 162, + 80, 0, 562, 557, 1, 0, 0, 0, 562, 558, 1, 0, 0, 0, 562, 559, 1, 0, 0, 0, + 562, 560, 1, 0, 0, 0, 562, 561, 1, 0, 0, 0, 563, 119, 1, 0, 0, 0, 564, + 565, 7, 26, 0, 0, 565, 121, 1, 0, 0, 0, 566, 567, 7, 27, 0, 0, 567, 123, + 1, 0, 0, 0, 568, 569, 5, 35, 0, 0, 569, 125, 1, 0, 0, 0, 570, 571, 5, 36, + 0, 0, 571, 127, 1, 0, 0, 0, 572, 573, 5, 95, 0, 0, 573, 129, 1, 0, 0, 0, + 574, 575, 5, 34, 0, 0, 575, 131, 1, 0, 0, 0, 576, 577, 5, 37, 0, 0, 577, + 133, 1, 0, 0, 0, 578, 579, 5, 38, 0, 0, 579, 135, 1, 0, 0, 0, 580, 581, + 5, 39, 0, 0, 581, 137, 1, 0, 0, 0, 582, 583, 5, 40, 0, 0, 583, 139, 1, + 0, 0, 0, 584, 585, 5, 41, 0, 0, 585, 141, 1, 0, 0, 0, 586, 587, 5, 91, + 0, 0, 587, 143, 1, 0, 0, 0, 588, 589, 5, 93, 0, 0, 589, 145, 1, 0, 0, 0, + 590, 591, 5, 42, 0, 0, 591, 147, 1, 0, 0, 0, 592, 593, 5, 43, 0, 0, 593, + 149, 1, 0, 0, 0, 594, 595, 5, 44, 0, 0, 595, 151, 1, 0, 0, 0, 596, 597, + 5, 45, 0, 0, 597, 153, 1, 0, 0, 0, 598, 599, 5, 46, 0, 0, 599, 155, 1, + 0, 0, 0, 600, 601, 5, 47, 0, 0, 601, 157, 1, 0, 0, 0, 602, 603, 5, 94, + 0, 0, 603, 159, 1, 0, 0, 0, 604, 605, 5, 124, 0, 0, 605, 606, 5, 124, 0, + 0, 606, 161, 1, 0, 0, 0, 607, 608, 5, 58, 0, 0, 608, 163, 1, 0, 0, 0, 609, + 610, 5, 59, 0, 0, 610, 165, 1, 0, 0, 0, 611, 612, 5, 63, 0, 0, 612, 167, + 1, 0, 0, 0, 613, 614, 5, 124, 0, 0, 614, 169, 1, 0, 0, 0, 615, 616, 2, + 48, 49, 0, 616, 171, 1, 0, 0, 0, 617, 625, 3, 122, 60, 0, 618, 625, 3, + 2, 0, 0, 619, 625, 3, 4, 1, 0, 620, 625, 3, 6, 2, 0, 621, 625, 3, 8, 3, + 0, 622, 625, 3, 10, 4, 0, 623, 625, 3, 12, 5, 0, 624, 617, 1, 0, 0, 0, + 624, 618, 1, 0, 0, 0, 624, 619, 1, 0, 0, 0, 624, 620, 1, 0, 0, 0, 624, + 621, 1, 0, 0, 0, 624, 622, 1, 0, 0, 0, 624, 623, 1, 0, 0, 0, 625, 173, + 1, 0, 0, 0, 626, 629, 3, 178, 88, 0, 627, 629, 3, 180, 89, 0, 628, 626, + 1, 0, 0, 0, 628, 627, 1, 0, 0, 0, 629, 175, 1, 0, 0, 0, 630, 632, 3, 190, + 94, 0, 631, 630, 1, 0, 0, 0, 631, 632, 1, 0, 0, 0, 632, 633, 1, 0, 0, 0, + 633, 636, 3, 178, 88, 0, 634, 636, 3, 180, 89, 0, 635, 631, 1, 0, 0, 0, + 635, 634, 1, 0, 0, 0, 636, 177, 1, 0, 0, 0, 637, 642, 3, 188, 93, 0, 638, + 640, 3, 154, 76, 0, 639, 641, 3, 188, 93, 0, 640, 639, 1, 0, 0, 0, 640, + 641, 1, 0, 0, 0, 641, 643, 1, 0, 0, 0, 642, 638, 1, 0, 0, 0, 642, 643, + 1, 0, 0, 0, 643, 648, 1, 0, 0, 0, 644, 645, 3, 154, 76, 0, 645, 646, 3, + 188, 93, 0, 646, 648, 1, 0, 0, 0, 647, 637, 1, 0, 0, 0, 647, 644, 1, 0, + 0, 0, 648, 179, 1, 0, 0, 0, 649, 650, 3, 182, 90, 0, 650, 651, 7, 4, 0, + 0, 651, 652, 3, 184, 91, 0, 652, 181, 1, 0, 0, 0, 653, 654, 3, 178, 88, + 0, 654, 183, 1, 0, 0, 0, 655, 656, 3, 186, 92, 0, 656, 185, 1, 0, 0, 0, + 657, 659, 3, 190, 94, 0, 658, 657, 1, 0, 0, 0, 658, 659, 1, 0, 0, 0, 659, + 660, 1, 0, 0, 0, 660, 661, 3, 188, 93, 0, 661, 187, 1, 0, 0, 0, 662, 664, + 3, 122, 60, 0, 663, 662, 1, 0, 0, 0, 664, 665, 1, 0, 0, 0, 665, 663, 1, + 0, 0, 0, 665, 666, 1, 0, 0, 0, 666, 189, 1, 0, 0, 0, 667, 670, 3, 148, + 73, 0, 668, 670, 3, 152, 75, 0, 669, 667, 1, 0, 0, 0, 669, 668, 1, 0, 0, + 0, 670, 191, 1, 0, 0, 0, 671, 672, 3, 194, 96, 0, 672, 193, 1, 0, 0, 0, + 673, 683, 3, 196, 97, 0, 674, 675, 3, 196, 97, 0, 675, 676, 5, 84, 0, 0, + 676, 677, 3, 204, 101, 0, 677, 683, 1, 0, 0, 0, 678, 679, 3, 214, 106, + 0, 679, 680, 3, 138, 68, 0, 680, 681, 3, 140, 69, 0, 681, 683, 1, 0, 0, + 0, 682, 673, 1, 0, 0, 0, 682, 674, 1, 0, 0, 0, 682, 678, 1, 0, 0, 0, 683, + 195, 1, 0, 0, 0, 684, 685, 3, 198, 98, 0, 685, 686, 5, 45, 0, 0, 686, 687, + 3, 200, 99, 0, 687, 688, 5, 45, 0, 0, 688, 689, 3, 202, 100, 0, 689, 197, + 1, 0, 0, 0, 690, 691, 3, 122, 60, 0, 691, 692, 3, 122, 60, 0, 692, 693, + 3, 122, 60, 0, 693, 694, 3, 122, 60, 0, 694, 199, 1, 0, 0, 0, 695, 696, + 3, 122, 60, 0, 696, 697, 3, 122, 60, 0, 697, 201, 1, 0, 0, 0, 698, 699, + 3, 122, 60, 0, 699, 700, 3, 122, 60, 0, 700, 203, 1, 0, 0, 0, 701, 702, + 3, 208, 103, 0, 702, 703, 5, 58, 0, 0, 703, 706, 3, 210, 104, 0, 704, 705, + 5, 58, 0, 0, 705, 707, 3, 212, 105, 0, 706, 704, 1, 0, 0, 0, 706, 707, + 1, 0, 0, 0, 707, 709, 1, 0, 0, 0, 708, 710, 3, 206, 102, 0, 709, 708, 1, + 0, 0, 0, 709, 710, 1, 0, 0, 0, 710, 205, 1, 0, 0, 0, 711, 718, 5, 90, 0, + 0, 712, 713, 3, 190, 94, 0, 713, 714, 3, 208, 103, 0, 714, 715, 5, 58, + 0, 0, 715, 716, 3, 210, 104, 0, 716, 718, 1, 0, 0, 0, 717, 711, 1, 0, 0, + 0, 717, 712, 1, 0, 0, 0, 718, 207, 1, 0, 0, 0, 719, 720, 3, 122, 60, 0, + 720, 721, 3, 122, 60, 0, 721, 209, 1, 0, 0, 0, 722, 723, 3, 122, 60, 0, + 723, 724, 3, 122, 60, 0, 724, 211, 1, 0, 0, 0, 725, 726, 3, 122, 60, 0, + 726, 733, 3, 122, 60, 0, 727, 729, 3, 154, 76, 0, 728, 730, 3, 122, 60, + 0, 729, 728, 1, 0, 0, 0, 730, 731, 1, 0, 0, 0, 731, 729, 1, 0, 0, 0, 731, + 732, 1, 0, 0, 0, 732, 734, 1, 0, 0, 0, 733, 727, 1, 0, 0, 0, 733, 734, + 1, 0, 0, 0, 734, 213, 1, 0, 0, 0, 735, 736, 3, 28, 13, 0, 736, 737, 3, + 30, 14, 0, 737, 738, 3, 46, 22, 0, 738, 215, 1, 0, 0, 0, 739, 741, 7, 28, + 0, 0, 740, 739, 1, 0, 0, 0, 741, 742, 1, 0, 0, 0, 742, 740, 1, 0, 0, 0, + 742, 743, 1, 0, 0, 0, 743, 744, 1, 0, 0, 0, 744, 745, 6, 107, 2, 0, 745, + 217, 1, 0, 0, 0, 746, 747, 5, 39, 0, 0, 747, 748, 1, 0, 0, 0, 748, 749, + 6, 108, 3, 0, 749, 219, 1, 0, 0, 0, 750, 751, 5, 39, 0, 0, 751, 752, 5, + 39, 0, 0, 752, 753, 1, 0, 0, 0, 753, 754, 6, 109, 0, 0, 754, 221, 1, 0, + 0, 0, 755, 756, 8, 29, 0, 0, 756, 757, 1, 0, 0, 0, 757, 758, 6, 110, 0, + 0, 758, 223, 1, 0, 0, 0, 27, 0, 1, 282, 310, 360, 430, 535, 546, 553, 562, + 624, 628, 631, 635, 640, 642, 647, 658, 665, 669, 682, 706, 709, 717, 731, + 733, 742, 4, 3, 0, 0, 2, 1, 0, 6, 0, 0, 2, 0, 0, + } + deserializer := antlr.NewATNDeserializer(nil) + staticData.atn = deserializer.Deserialize(staticData.serializedATN) + atn := staticData.atn + staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) + decisionToDFA := staticData.decisionToDFA + for index, state := range atn.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(state, index) } } -func NewCqlLexer(input antlr.CharStream) *CqlLexer { +// CqlLexerInit initializes any static state used to implement CqlLexer. By default the +// static state used to implement the lexer is lazily initialized during the first call to +// NewCqlLexer(). You can call this function if you wish to initialize the static state ahead +// of time. +func CqlLexerInit() { + staticData := &CqlLexerLexerStaticData + staticData.once.Do(cqllexerLexerInit) +} +// NewCqlLexer produces a new lexer instance for the optional input antlr.CharStream. +func NewCqlLexer(input antlr.CharStream) *CqlLexer { + CqlLexerInit() l := new(CqlLexer) - l.BaseLexer = antlr.NewBaseLexer(input) - l.Interpreter = antlr.NewLexerATNSimulator(l, lexerAtn, lexerDecisionToDFA, antlr.NewPredictionContextCache()) - - l.channelNames = lexerChannelNames - l.modeNames = lexerModeNames - l.RuleNames = lexerRuleNames - l.LiteralNames = lexerLiteralNames - l.SymbolicNames = lexerSymbolicNames + staticData := &CqlLexerLexerStaticData + 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 = "CqlLexer.g4" // TODO: l.EOF = antlr.TokenEOF diff --git a/internal/cql/cql_parser.go b/internal/cql/cql_parser.go index 02663f42..04422f64 100644 --- a/internal/cql/cql_parser.go +++ b/internal/cql/cql_parser.go @@ -1,216 +1,238 @@ -// Generated from CQLParser.g4 by ANTLR 4.7. +// Code generated from CQLParser.g4 by ANTLR 4.13.2. DO NOT EDIT. package cql // CQLParser import ( "fmt" - "reflect" "strconv" + "sync" - "github.com/antlr/antlr4/runtime/Go/antlr" + "github.com/antlr4-go/antlr/v4" ) // Suppress unused import errors var _ = fmt.Printf -var _ = reflect.Copy var _ = strconv.Itoa - -var parserATN = []uint16{ - 3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 85, 322, - 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, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, - 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, - 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, - 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, - 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, - 9, 34, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 5, 3, 80, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 3, 88, 10, 3, 12, - 3, 14, 3, 91, 11, 3, 3, 4, 3, 4, 5, 4, 95, 10, 4, 3, 5, 3, 5, 3, 5, 5, - 5, 100, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 5, 6, 107, 10, 6, 3, 7, 3, - 7, 3, 7, 3, 7, 3, 8, 3, 8, 5, 8, 115, 10, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, - 9, 5, 9, 122, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 5, 10, - 131, 10, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 7, 10, 138, 10, 10, 12, - 10, 14, 10, 141, 11, 10, 3, 10, 3, 10, 3, 10, 7, 10, 146, 10, 10, 12, 10, - 14, 10, 149, 11, 10, 5, 10, 151, 10, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, - 11, 5, 11, 158, 10, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, - 3, 12, 5, 12, 168, 10, 12, 3, 12, 3, 12, 3, 12, 7, 12, 173, 10, 12, 12, - 12, 14, 12, 176, 11, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 183, - 10, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, - 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, - 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 5, 21, 213, - 10, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 5, 22, - 223, 10, 22, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, - 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 7, 27, 242, - 10, 27, 12, 27, 14, 27, 245, 11, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, - 3, 28, 3, 28, 7, 28, 254, 10, 28, 12, 28, 14, 28, 257, 11, 28, 3, 28, 3, - 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 7, 29, 266, 10, 29, 12, 29, 14, - 29, 269, 11, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 30, 7, 30, - 278, 10, 30, 12, 30, 14, 30, 281, 11, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, - 31, 3, 31, 3, 31, 7, 31, 290, 10, 31, 12, 31, 14, 31, 293, 11, 31, 3, 31, - 3, 31, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, 32, 3, - 32, 3, 32, 3, 33, 3, 33, 3, 33, 3, 33, 7, 33, 312, 10, 33, 12, 33, 14, - 33, 315, 11, 33, 3, 33, 3, 33, 3, 34, 3, 34, 3, 34, 3, 34, 2, 4, 4, 22, - 35, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, - 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 2, 3, 3, 2, - 14, 15, 2, 326, 2, 68, 3, 2, 2, 2, 4, 79, 3, 2, 2, 2, 6, 94, 3, 2, 2, 2, - 8, 99, 3, 2, 2, 2, 10, 106, 3, 2, 2, 2, 12, 108, 3, 2, 2, 2, 14, 112, 3, - 2, 2, 2, 16, 119, 3, 2, 2, 2, 18, 128, 3, 2, 2, 2, 20, 154, 3, 2, 2, 2, - 22, 167, 3, 2, 2, 2, 24, 182, 3, 2, 2, 2, 26, 184, 3, 2, 2, 2, 28, 186, - 3, 2, 2, 2, 30, 188, 3, 2, 2, 2, 32, 190, 3, 2, 2, 2, 34, 192, 3, 2, 2, - 2, 36, 194, 3, 2, 2, 2, 38, 201, 3, 2, 2, 2, 40, 212, 3, 2, 2, 2, 42, 222, - 3, 2, 2, 2, 44, 224, 3, 2, 2, 2, 46, 227, 3, 2, 2, 2, 48, 231, 3, 2, 2, - 2, 50, 234, 3, 2, 2, 2, 52, 237, 3, 2, 2, 2, 54, 248, 3, 2, 2, 2, 56, 260, - 3, 2, 2, 2, 58, 272, 3, 2, 2, 2, 60, 284, 3, 2, 2, 2, 62, 296, 3, 2, 2, - 2, 64, 307, 3, 2, 2, 2, 66, 318, 3, 2, 2, 2, 68, 69, 5, 4, 3, 2, 69, 70, - 7, 2, 2, 3, 70, 3, 3, 2, 2, 2, 71, 72, 8, 3, 1, 2, 72, 73, 7, 44, 2, 2, - 73, 74, 5, 4, 3, 2, 74, 75, 7, 45, 2, 2, 75, 80, 3, 2, 2, 2, 76, 77, 7, - 13, 2, 2, 77, 80, 5, 4, 3, 4, 78, 80, 5, 6, 4, 2, 79, 71, 3, 2, 2, 2, 79, - 76, 3, 2, 2, 2, 79, 78, 3, 2, 2, 2, 80, 89, 3, 2, 2, 2, 81, 82, 12, 6, - 2, 2, 82, 83, 7, 11, 2, 2, 83, 88, 5, 4, 3, 7, 84, 85, 12, 5, 2, 2, 85, - 86, 7, 12, 2, 2, 86, 88, 5, 4, 3, 6, 87, 81, 3, 2, 2, 2, 87, 84, 3, 2, - 2, 2, 88, 91, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 5, - 3, 2, 2, 2, 91, 89, 3, 2, 2, 2, 92, 95, 5, 8, 5, 2, 93, 95, 5, 32, 17, - 2, 94, 92, 3, 2, 2, 2, 94, 93, 3, 2, 2, 2, 95, 7, 3, 2, 2, 2, 96, 100, - 5, 10, 6, 2, 97, 100, 5, 36, 19, 2, 98, 100, 5, 38, 20, 2, 99, 96, 3, 2, - 2, 2, 99, 97, 3, 2, 2, 2, 99, 98, 3, 2, 2, 2, 100, 9, 3, 2, 2, 2, 101, - 107, 5, 12, 7, 2, 102, 107, 5, 14, 8, 2, 103, 107, 5, 16, 9, 2, 104, 107, - 5, 18, 10, 2, 105, 107, 5, 20, 11, 2, 106, 101, 3, 2, 2, 2, 106, 102, 3, - 2, 2, 2, 106, 103, 3, 2, 2, 2, 106, 104, 3, 2, 2, 2, 106, 105, 3, 2, 2, - 2, 107, 11, 3, 2, 2, 2, 108, 109, 5, 22, 12, 2, 109, 110, 7, 3, 2, 2, 110, - 111, 5, 22, 12, 2, 111, 13, 3, 2, 2, 2, 112, 114, 5, 26, 14, 2, 113, 115, - 7, 13, 2, 2, 114, 113, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 116, 3, 2, - 2, 2, 116, 117, 9, 2, 2, 2, 117, 118, 5, 28, 15, 2, 118, 15, 3, 2, 2, 2, - 119, 121, 5, 22, 12, 2, 120, 122, 7, 13, 2, 2, 121, 120, 3, 2, 2, 2, 121, - 122, 3, 2, 2, 2, 122, 123, 3, 2, 2, 2, 123, 124, 7, 16, 2, 2, 124, 125, - 5, 22, 12, 2, 125, 126, 7, 11, 2, 2, 126, 127, 5, 22, 12, 2, 127, 17, 3, - 2, 2, 2, 128, 130, 5, 26, 14, 2, 129, 131, 7, 13, 2, 2, 130, 129, 3, 2, - 2, 2, 130, 131, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 133, 7, 19, 2, 2, - 133, 150, 7, 44, 2, 2, 134, 139, 5, 28, 15, 2, 135, 136, 7, 50, 2, 2, 136, - 138, 5, 28, 15, 2, 137, 135, 3, 2, 2, 2, 138, 141, 3, 2, 2, 2, 139, 137, - 3, 2, 2, 2, 139, 140, 3, 2, 2, 2, 140, 151, 3, 2, 2, 2, 141, 139, 3, 2, - 2, 2, 142, 147, 5, 30, 16, 2, 143, 144, 7, 50, 2, 2, 144, 146, 5, 30, 16, - 2, 145, 143, 3, 2, 2, 2, 146, 149, 3, 2, 2, 2, 147, 145, 3, 2, 2, 2, 147, - 148, 3, 2, 2, 2, 148, 151, 3, 2, 2, 2, 149, 147, 3, 2, 2, 2, 150, 134, - 3, 2, 2, 2, 150, 142, 3, 2, 2, 2, 151, 152, 3, 2, 2, 2, 152, 153, 7, 45, - 2, 2, 153, 19, 3, 2, 2, 2, 154, 155, 5, 26, 14, 2, 155, 157, 7, 17, 2, - 2, 156, 158, 7, 13, 2, 2, 157, 156, 3, 2, 2, 2, 157, 158, 3, 2, 2, 2, 158, - 159, 3, 2, 2, 2, 159, 160, 7, 18, 2, 2, 160, 21, 3, 2, 2, 2, 161, 162, - 8, 12, 1, 2, 162, 168, 5, 24, 13, 2, 163, 164, 7, 44, 2, 2, 164, 165, 5, - 22, 12, 2, 165, 166, 7, 45, 2, 2, 166, 168, 3, 2, 2, 2, 167, 161, 3, 2, - 2, 2, 167, 163, 3, 2, 2, 2, 168, 174, 3, 2, 2, 2, 169, 170, 12, 3, 2, 2, - 170, 171, 7, 20, 2, 2, 171, 173, 5, 22, 12, 4, 172, 169, 3, 2, 2, 2, 173, - 176, 3, 2, 2, 2, 174, 172, 3, 2, 2, 2, 174, 175, 3, 2, 2, 2, 175, 23, 3, - 2, 2, 2, 176, 174, 3, 2, 2, 2, 177, 183, 5, 26, 14, 2, 178, 183, 5, 28, - 15, 2, 179, 183, 5, 30, 16, 2, 180, 183, 5, 32, 17, 2, 181, 183, 5, 34, - 18, 2, 182, 177, 3, 2, 2, 2, 182, 178, 3, 2, 2, 2, 182, 179, 3, 2, 2, 2, - 182, 180, 3, 2, 2, 2, 182, 181, 3, 2, 2, 2, 183, 25, 3, 2, 2, 2, 184, 185, - 7, 32, 2, 2, 185, 27, 3, 2, 2, 2, 186, 187, 7, 84, 2, 2, 187, 29, 3, 2, - 2, 2, 188, 189, 7, 31, 2, 2, 189, 31, 3, 2, 2, 2, 190, 191, 7, 10, 2, 2, - 191, 33, 3, 2, 2, 2, 192, 193, 7, 71, 2, 2, 193, 35, 3, 2, 2, 2, 194, 195, - 7, 21, 2, 2, 195, 196, 7, 44, 2, 2, 196, 197, 5, 40, 21, 2, 197, 198, 7, - 50, 2, 2, 198, 199, 5, 40, 21, 2, 199, 200, 7, 45, 2, 2, 200, 37, 3, 2, - 2, 2, 201, 202, 7, 22, 2, 2, 202, 203, 7, 44, 2, 2, 203, 204, 5, 40, 21, - 2, 204, 205, 7, 50, 2, 2, 205, 206, 5, 40, 21, 2, 206, 207, 7, 50, 2, 2, - 207, 208, 7, 31, 2, 2, 208, 209, 7, 45, 2, 2, 209, 39, 3, 2, 2, 2, 210, - 213, 5, 26, 14, 2, 211, 213, 5, 42, 22, 2, 212, 210, 3, 2, 2, 2, 212, 211, - 3, 2, 2, 2, 213, 41, 3, 2, 2, 2, 214, 223, 5, 44, 23, 2, 215, 223, 5, 48, - 25, 2, 216, 223, 5, 50, 26, 2, 217, 223, 5, 54, 28, 2, 218, 223, 5, 56, - 29, 2, 219, 223, 5, 58, 30, 2, 220, 223, 5, 60, 31, 2, 221, 223, 5, 62, - 32, 2, 222, 214, 3, 2, 2, 2, 222, 215, 3, 2, 2, 2, 222, 216, 3, 2, 2, 2, - 222, 217, 3, 2, 2, 2, 222, 218, 3, 2, 2, 2, 222, 219, 3, 2, 2, 2, 222, - 220, 3, 2, 2, 2, 222, 221, 3, 2, 2, 2, 223, 43, 3, 2, 2, 2, 224, 225, 7, - 23, 2, 2, 225, 226, 5, 46, 24, 2, 226, 45, 3, 2, 2, 2, 227, 228, 7, 44, - 2, 2, 228, 229, 5, 66, 34, 2, 229, 230, 7, 45, 2, 2, 230, 47, 3, 2, 2, - 2, 231, 232, 7, 24, 2, 2, 232, 233, 5, 64, 33, 2, 233, 49, 3, 2, 2, 2, - 234, 235, 7, 25, 2, 2, 235, 236, 5, 52, 27, 2, 236, 51, 3, 2, 2, 2, 237, - 238, 7, 44, 2, 2, 238, 243, 5, 64, 33, 2, 239, 240, 7, 50, 2, 2, 240, 242, - 5, 64, 33, 2, 241, 239, 3, 2, 2, 2, 242, 245, 3, 2, 2, 2, 243, 241, 3, - 2, 2, 2, 243, 244, 3, 2, 2, 2, 244, 246, 3, 2, 2, 2, 245, 243, 3, 2, 2, - 2, 246, 247, 7, 45, 2, 2, 247, 53, 3, 2, 2, 2, 248, 249, 7, 26, 2, 2, 249, - 250, 7, 44, 2, 2, 250, 255, 5, 46, 24, 2, 251, 252, 7, 50, 2, 2, 252, 254, - 5, 46, 24, 2, 253, 251, 3, 2, 2, 2, 254, 257, 3, 2, 2, 2, 255, 253, 3, - 2, 2, 2, 255, 256, 3, 2, 2, 2, 256, 258, 3, 2, 2, 2, 257, 255, 3, 2, 2, - 2, 258, 259, 7, 45, 2, 2, 259, 55, 3, 2, 2, 2, 260, 261, 7, 27, 2, 2, 261, - 262, 7, 44, 2, 2, 262, 267, 5, 64, 33, 2, 263, 264, 7, 50, 2, 2, 264, 266, - 5, 64, 33, 2, 265, 263, 3, 2, 2, 2, 266, 269, 3, 2, 2, 2, 267, 265, 3, - 2, 2, 2, 267, 268, 3, 2, 2, 2, 268, 270, 3, 2, 2, 2, 269, 267, 3, 2, 2, - 2, 270, 271, 7, 45, 2, 2, 271, 57, 3, 2, 2, 2, 272, 273, 7, 28, 2, 2, 273, - 274, 7, 44, 2, 2, 274, 279, 5, 52, 27, 2, 275, 276, 7, 50, 2, 2, 276, 278, - 5, 52, 27, 2, 277, 275, 3, 2, 2, 2, 278, 281, 3, 2, 2, 2, 279, 277, 3, - 2, 2, 2, 279, 280, 3, 2, 2, 2, 280, 282, 3, 2, 2, 2, 281, 279, 3, 2, 2, - 2, 282, 283, 7, 45, 2, 2, 283, 59, 3, 2, 2, 2, 284, 285, 7, 29, 2, 2, 285, - 286, 7, 44, 2, 2, 286, 291, 5, 42, 22, 2, 287, 288, 7, 50, 2, 2, 288, 290, - 5, 42, 22, 2, 289, 287, 3, 2, 2, 2, 290, 293, 3, 2, 2, 2, 291, 289, 3, - 2, 2, 2, 291, 292, 3, 2, 2, 2, 292, 294, 3, 2, 2, 2, 293, 291, 3, 2, 2, - 2, 294, 295, 7, 45, 2, 2, 295, 61, 3, 2, 2, 2, 296, 297, 7, 30, 2, 2, 297, - 298, 7, 44, 2, 2, 298, 299, 7, 31, 2, 2, 299, 300, 7, 50, 2, 2, 300, 301, - 7, 31, 2, 2, 301, 302, 7, 50, 2, 2, 302, 303, 7, 31, 2, 2, 303, 304, 7, - 50, 2, 2, 304, 305, 7, 31, 2, 2, 305, 306, 7, 45, 2, 2, 306, 63, 3, 2, - 2, 2, 307, 308, 7, 44, 2, 2, 308, 313, 5, 66, 34, 2, 309, 310, 7, 50, 2, - 2, 310, 312, 5, 66, 34, 2, 311, 309, 3, 2, 2, 2, 312, 315, 3, 2, 2, 2, - 313, 311, 3, 2, 2, 2, 313, 314, 3, 2, 2, 2, 314, 316, 3, 2, 2, 2, 315, - 313, 3, 2, 2, 2, 316, 317, 7, 45, 2, 2, 317, 65, 3, 2, 2, 2, 318, 319, - 7, 31, 2, 2, 319, 320, 7, 31, 2, 2, 320, 67, 3, 2, 2, 2, 26, 79, 87, 89, - 94, 99, 106, 114, 121, 130, 139, 147, 150, 157, 167, 174, 182, 212, 222, - 243, 255, 267, 279, 291, 313, -} -var deserializer = antlr.NewATNDeserializer(nil) -var deserializedATN = deserializer.DeserializeFromUInt16(parserATN) - -var literalNames = []string{ - "", "", "'<'", "'='", "'>'", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "'#'", "'$'", "'_'", "'\"'", "'%'", "'&'", "", "'('", "')'", "'['", - "']'", "'*'", "'+'", "','", "'-'", "'.'", "'/'", "'^'", "'||'", "':'", - "';'", "'?'", "'|'", "", "", "", "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "", "", "", "", "''''", -} -var symbolicNames = []string{ - "", "ComparisonOperator", "LT", "EQ", "GT", "NEQ", "GTEQ", "LTEQ", "BooleanLiteral", - "AND", "OR", "NOT", "LIKE", "ILIKE", "BETWEEN", "IS", "NULL", "IN", "ArithmeticOperator", - "SpatialOperator", "DistanceOperator", "POINT", "LINESTRING", "POLYGON", - "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", "GEOMETRYCOLLECTION", - "ENVELOPE", "NumericLiteral", "Identifier", "IdentifierStart", "IdentifierPart", - "ALPHA", "DIGIT", "OCTOTHORP", "DOLLAR", "UNDERSCORE", "DOUBLEQUOTE", "PERCENT", - "AMPERSAND", "QUOTE", "LEFTPAREN", "RIGHTPAREN", "LEFTSQUAREBRACKET", "RIGHTSQUAREBRACKET", - "ASTERISK", "PLUS", "COMMA", "MINUS", "PERIOD", "SOLIDUS", "CARET", "CONCAT", - "COLON", "SEMICOLON", "QUESTIONMARK", "VERTICALBAR", "BIT", "HEXIT", "UnsignedNumericLiteral", - "SignedNumericLiteral", "ExactNumericLiteral", "ApproximateNumericLiteral", - "Mantissa", "Exponent", "SignedInteger", "UnsignedInteger", "Sign", "TemporalLiteral", - "Instant", "FullDate", "DateYear", "DateMonth", "DateDay", "UtcTime", "TimeZoneOffset", - "TimeHour", "TimeMinute", "TimeSecond", "NOW", "WS", "CharacterStringLiteral", - "QuotedQuote", -} - -var ruleNames = []string{ - "cqlFilter", "booleanExpression", "booleanTerm", "predicate", "comparisonPredicate", - "binaryComparisonPredicate", "isLikePredicate", "isBetweenPredicate", "isInListPredicate", - "isNullPredicate", "scalarExpression", "scalarValue", "propertyName", "characterLiteral", - "numericLiteral", "booleanLiteral", "temporalLiteral", "spatialPredicate", - "distancePredicate", "geomExpression", "geomLiteral", "point", "pointList", - "linestring", "polygon", "polygonDef", "multiPoint", "multiLinestring", - "multiPolygon", "geometryCollection", "envelope", "coordList", "coordinate", -} -var decisionToDFA = make([]*antlr.DFA, len(deserializedATN.DecisionToState)) - -func init() { - for index, ds := range deserializedATN.DecisionToState { - decisionToDFA[index] = antlr.NewDFA(ds, index) - } -} +var _ = sync.Once{} type CQLParser struct { *antlr.BaseParser } +var CQLParserParserStaticData struct { + once sync.Once + serializedATN []int32 + LiteralNames []string + SymbolicNames []string + RuleNames []string + PredictionContextCache *antlr.PredictionContextCache + atn *antlr.ATN + decisionToDFA []*antlr.DFA +} + +func cqlparserParserInit() { + staticData := &CQLParserParserStaticData + staticData.LiteralNames = []string{ + "", "", "'<'", "'='", "'>'", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", + "", "", "", "'#'", "'$'", "'_'", "'\"'", "'%'", "'&'", "", "'('", "')'", + "'['", "']'", "'*'", "'+'", "','", "'-'", "'.'", "'/'", "'^'", "'||'", + "':'", "';'", "'?'", "'|'", "", "", "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "''''", + } + staticData.SymbolicNames = []string{ + "", "ComparisonOperator", "LT", "EQ", "GT", "NEQ", "GTEQ", "LTEQ", "BooleanLiteral", + "AND", "OR", "NOT", "LIKE", "ILIKE", "BETWEEN", "IS", "NULL", "IN", + "ArithmeticOperator", "SpatialOperator", "DistanceOperator", "POINT", + "LINESTRING", "POLYGON", "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", + "GEOMETRYCOLLECTION", "ENVELOPE", "NumericLiteral", "Identifier", "IdentifierStart", + "IdentifierPart", "ALPHA", "DIGIT", "OCTOTHORP", "DOLLAR", "UNDERSCORE", + "DOUBLEQUOTE", "PERCENT", "AMPERSAND", "QUOTE", "LEFTPAREN", "RIGHTPAREN", + "LEFTSQUAREBRACKET", "RIGHTSQUAREBRACKET", "ASTERISK", "PLUS", "COMMA", + "MINUS", "PERIOD", "SOLIDUS", "CARET", "CONCAT", "COLON", "SEMICOLON", + "QUESTIONMARK", "VERTICALBAR", "BIT", "HEXIT", "UnsignedNumericLiteral", + "SignedNumericLiteral", "ExactNumericLiteral", "ApproximateNumericLiteral", + "Mantissa", "Exponent", "SignedInteger", "UnsignedInteger", "Sign", + "TemporalLiteral", "Instant", "FullDate", "DateYear", "DateMonth", "DateDay", + "UtcTime", "TimeZoneOffset", "TimeHour", "TimeMinute", "TimeSecond", + "NOW", "WS", "CharacterStringLiteral", "QuotedQuote", + } + staticData.RuleNames = []string{ + "cqlFilter", "booleanExpression", "booleanTerm", "predicate", "comparisonPredicate", + "binaryComparisonPredicate", "isLikePredicate", "isBetweenPredicate", + "isInListPredicate", "isNullPredicate", "scalarExpression", "scalarValue", + "propertyName", "characterLiteral", "numericLiteral", "booleanLiteral", + "temporalLiteral", "spatialPredicate", "distancePredicate", "geomExpression", + "geomLiteral", "point", "pointList", "linestring", "polygon", "polygonDef", + "multiPoint", "multiLinestring", "multiPolygon", "geometryCollection", + "envelope", "coordList", "coordinate", + } + staticData.PredictionContextCache = antlr.NewPredictionContextCache() + staticData.serializedATN = []int32{ + 4, 1, 83, 320, 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, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 1, 78, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 86, + 8, 1, 10, 1, 12, 1, 89, 9, 1, 1, 2, 1, 2, 3, 2, 93, 8, 2, 1, 3, 1, 3, 1, + 3, 3, 3, 98, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 105, 8, 4, 1, 5, + 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 3, 6, 113, 8, 6, 1, 6, 1, 6, 1, 6, 1, 7, + 1, 7, 3, 7, 120, 8, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 3, 8, + 129, 8, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8, 136, 8, 8, 10, 8, 12, 8, + 139, 9, 8, 1, 8, 1, 8, 1, 8, 5, 8, 144, 8, 8, 10, 8, 12, 8, 147, 9, 8, + 3, 8, 149, 8, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 3, 9, 156, 8, 9, 1, 9, 1, + 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 166, 8, 10, 1, 10, + 1, 10, 1, 10, 5, 10, 171, 8, 10, 10, 10, 12, 10, 174, 9, 10, 1, 11, 1, + 11, 1, 11, 1, 11, 1, 11, 3, 11, 181, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, + 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, + 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, + 1, 18, 1, 19, 1, 19, 3, 19, 211, 8, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, + 20, 1, 20, 1, 20, 1, 20, 3, 20, 221, 8, 20, 1, 21, 1, 21, 1, 21, 1, 22, + 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 25, 1, + 25, 1, 25, 1, 25, 5, 25, 240, 8, 25, 10, 25, 12, 25, 243, 9, 25, 1, 25, + 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 5, 26, 252, 8, 26, 10, 26, 12, + 26, 255, 9, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 5, 27, + 264, 8, 27, 10, 27, 12, 27, 267, 9, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, + 28, 1, 28, 1, 28, 5, 28, 276, 8, 28, 10, 28, 12, 28, 279, 9, 28, 1, 28, + 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 5, 29, 288, 8, 29, 10, 29, 12, + 29, 291, 9, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, + 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 31, 5, 31, 310, + 8, 31, 10, 31, 12, 31, 313, 9, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, + 32, 0, 2, 2, 20, 33, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, + 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, + 64, 0, 1, 1, 0, 12, 13, 324, 0, 66, 1, 0, 0, 0, 2, 77, 1, 0, 0, 0, 4, 92, + 1, 0, 0, 0, 6, 97, 1, 0, 0, 0, 8, 104, 1, 0, 0, 0, 10, 106, 1, 0, 0, 0, + 12, 110, 1, 0, 0, 0, 14, 117, 1, 0, 0, 0, 16, 126, 1, 0, 0, 0, 18, 152, + 1, 0, 0, 0, 20, 165, 1, 0, 0, 0, 22, 180, 1, 0, 0, 0, 24, 182, 1, 0, 0, + 0, 26, 184, 1, 0, 0, 0, 28, 186, 1, 0, 0, 0, 30, 188, 1, 0, 0, 0, 32, 190, + 1, 0, 0, 0, 34, 192, 1, 0, 0, 0, 36, 199, 1, 0, 0, 0, 38, 210, 1, 0, 0, + 0, 40, 220, 1, 0, 0, 0, 42, 222, 1, 0, 0, 0, 44, 225, 1, 0, 0, 0, 46, 229, + 1, 0, 0, 0, 48, 232, 1, 0, 0, 0, 50, 235, 1, 0, 0, 0, 52, 246, 1, 0, 0, + 0, 54, 258, 1, 0, 0, 0, 56, 270, 1, 0, 0, 0, 58, 282, 1, 0, 0, 0, 60, 294, + 1, 0, 0, 0, 62, 305, 1, 0, 0, 0, 64, 316, 1, 0, 0, 0, 66, 67, 3, 2, 1, + 0, 67, 68, 5, 0, 0, 1, 68, 1, 1, 0, 0, 0, 69, 70, 6, 1, -1, 0, 70, 71, + 5, 42, 0, 0, 71, 72, 3, 2, 1, 0, 72, 73, 5, 43, 0, 0, 73, 78, 1, 0, 0, + 0, 74, 75, 5, 11, 0, 0, 75, 78, 3, 2, 1, 2, 76, 78, 3, 4, 2, 0, 77, 69, + 1, 0, 0, 0, 77, 74, 1, 0, 0, 0, 77, 76, 1, 0, 0, 0, 78, 87, 1, 0, 0, 0, + 79, 80, 10, 4, 0, 0, 80, 81, 5, 9, 0, 0, 81, 86, 3, 2, 1, 5, 82, 83, 10, + 3, 0, 0, 83, 84, 5, 10, 0, 0, 84, 86, 3, 2, 1, 4, 85, 79, 1, 0, 0, 0, 85, + 82, 1, 0, 0, 0, 86, 89, 1, 0, 0, 0, 87, 85, 1, 0, 0, 0, 87, 88, 1, 0, 0, + 0, 88, 3, 1, 0, 0, 0, 89, 87, 1, 0, 0, 0, 90, 93, 3, 6, 3, 0, 91, 93, 3, + 30, 15, 0, 92, 90, 1, 0, 0, 0, 92, 91, 1, 0, 0, 0, 93, 5, 1, 0, 0, 0, 94, + 98, 3, 8, 4, 0, 95, 98, 3, 34, 17, 0, 96, 98, 3, 36, 18, 0, 97, 94, 1, + 0, 0, 0, 97, 95, 1, 0, 0, 0, 97, 96, 1, 0, 0, 0, 98, 7, 1, 0, 0, 0, 99, + 105, 3, 10, 5, 0, 100, 105, 3, 12, 6, 0, 101, 105, 3, 14, 7, 0, 102, 105, + 3, 16, 8, 0, 103, 105, 3, 18, 9, 0, 104, 99, 1, 0, 0, 0, 104, 100, 1, 0, + 0, 0, 104, 101, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 104, 103, 1, 0, 0, 0, + 105, 9, 1, 0, 0, 0, 106, 107, 3, 20, 10, 0, 107, 108, 5, 1, 0, 0, 108, + 109, 3, 20, 10, 0, 109, 11, 1, 0, 0, 0, 110, 112, 3, 24, 12, 0, 111, 113, + 5, 11, 0, 0, 112, 111, 1, 0, 0, 0, 112, 113, 1, 0, 0, 0, 113, 114, 1, 0, + 0, 0, 114, 115, 7, 0, 0, 0, 115, 116, 3, 26, 13, 0, 116, 13, 1, 0, 0, 0, + 117, 119, 3, 20, 10, 0, 118, 120, 5, 11, 0, 0, 119, 118, 1, 0, 0, 0, 119, + 120, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 122, 5, 14, 0, 0, 122, 123, + 3, 20, 10, 0, 123, 124, 5, 9, 0, 0, 124, 125, 3, 20, 10, 0, 125, 15, 1, + 0, 0, 0, 126, 128, 3, 24, 12, 0, 127, 129, 5, 11, 0, 0, 128, 127, 1, 0, + 0, 0, 128, 129, 1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 131, 5, 17, 0, 0, + 131, 148, 5, 42, 0, 0, 132, 137, 3, 26, 13, 0, 133, 134, 5, 48, 0, 0, 134, + 136, 3, 26, 13, 0, 135, 133, 1, 0, 0, 0, 136, 139, 1, 0, 0, 0, 137, 135, + 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 149, 1, 0, 0, 0, 139, 137, 1, 0, + 0, 0, 140, 145, 3, 28, 14, 0, 141, 142, 5, 48, 0, 0, 142, 144, 3, 28, 14, + 0, 143, 141, 1, 0, 0, 0, 144, 147, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 145, + 146, 1, 0, 0, 0, 146, 149, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 148, 132, + 1, 0, 0, 0, 148, 140, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 151, 5, 43, + 0, 0, 151, 17, 1, 0, 0, 0, 152, 153, 3, 24, 12, 0, 153, 155, 5, 15, 0, + 0, 154, 156, 5, 11, 0, 0, 155, 154, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, + 157, 1, 0, 0, 0, 157, 158, 5, 16, 0, 0, 158, 19, 1, 0, 0, 0, 159, 160, + 6, 10, -1, 0, 160, 166, 3, 22, 11, 0, 161, 162, 5, 42, 0, 0, 162, 163, + 3, 20, 10, 0, 163, 164, 5, 43, 0, 0, 164, 166, 1, 0, 0, 0, 165, 159, 1, + 0, 0, 0, 165, 161, 1, 0, 0, 0, 166, 172, 1, 0, 0, 0, 167, 168, 10, 1, 0, + 0, 168, 169, 5, 18, 0, 0, 169, 171, 3, 20, 10, 2, 170, 167, 1, 0, 0, 0, + 171, 174, 1, 0, 0, 0, 172, 170, 1, 0, 0, 0, 172, 173, 1, 0, 0, 0, 173, + 21, 1, 0, 0, 0, 174, 172, 1, 0, 0, 0, 175, 181, 3, 24, 12, 0, 176, 181, + 3, 26, 13, 0, 177, 181, 3, 28, 14, 0, 178, 181, 3, 30, 15, 0, 179, 181, + 3, 32, 16, 0, 180, 175, 1, 0, 0, 0, 180, 176, 1, 0, 0, 0, 180, 177, 1, + 0, 0, 0, 180, 178, 1, 0, 0, 0, 180, 179, 1, 0, 0, 0, 181, 23, 1, 0, 0, + 0, 182, 183, 5, 30, 0, 0, 183, 25, 1, 0, 0, 0, 184, 185, 5, 82, 0, 0, 185, + 27, 1, 0, 0, 0, 186, 187, 5, 29, 0, 0, 187, 29, 1, 0, 0, 0, 188, 189, 5, + 8, 0, 0, 189, 31, 1, 0, 0, 0, 190, 191, 5, 69, 0, 0, 191, 33, 1, 0, 0, + 0, 192, 193, 5, 19, 0, 0, 193, 194, 5, 42, 0, 0, 194, 195, 3, 38, 19, 0, + 195, 196, 5, 48, 0, 0, 196, 197, 3, 38, 19, 0, 197, 198, 5, 43, 0, 0, 198, + 35, 1, 0, 0, 0, 199, 200, 5, 20, 0, 0, 200, 201, 5, 42, 0, 0, 201, 202, + 3, 38, 19, 0, 202, 203, 5, 48, 0, 0, 203, 204, 3, 38, 19, 0, 204, 205, + 5, 48, 0, 0, 205, 206, 5, 29, 0, 0, 206, 207, 5, 43, 0, 0, 207, 37, 1, + 0, 0, 0, 208, 211, 3, 24, 12, 0, 209, 211, 3, 40, 20, 0, 210, 208, 1, 0, + 0, 0, 210, 209, 1, 0, 0, 0, 211, 39, 1, 0, 0, 0, 212, 221, 3, 42, 21, 0, + 213, 221, 3, 46, 23, 0, 214, 221, 3, 48, 24, 0, 215, 221, 3, 52, 26, 0, + 216, 221, 3, 54, 27, 0, 217, 221, 3, 56, 28, 0, 218, 221, 3, 58, 29, 0, + 219, 221, 3, 60, 30, 0, 220, 212, 1, 0, 0, 0, 220, 213, 1, 0, 0, 0, 220, + 214, 1, 0, 0, 0, 220, 215, 1, 0, 0, 0, 220, 216, 1, 0, 0, 0, 220, 217, + 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 220, 219, 1, 0, 0, 0, 221, 41, 1, 0, + 0, 0, 222, 223, 5, 21, 0, 0, 223, 224, 3, 44, 22, 0, 224, 43, 1, 0, 0, + 0, 225, 226, 5, 42, 0, 0, 226, 227, 3, 64, 32, 0, 227, 228, 5, 43, 0, 0, + 228, 45, 1, 0, 0, 0, 229, 230, 5, 22, 0, 0, 230, 231, 3, 62, 31, 0, 231, + 47, 1, 0, 0, 0, 232, 233, 5, 23, 0, 0, 233, 234, 3, 50, 25, 0, 234, 49, + 1, 0, 0, 0, 235, 236, 5, 42, 0, 0, 236, 241, 3, 62, 31, 0, 237, 238, 5, + 48, 0, 0, 238, 240, 3, 62, 31, 0, 239, 237, 1, 0, 0, 0, 240, 243, 1, 0, + 0, 0, 241, 239, 1, 0, 0, 0, 241, 242, 1, 0, 0, 0, 242, 244, 1, 0, 0, 0, + 243, 241, 1, 0, 0, 0, 244, 245, 5, 43, 0, 0, 245, 51, 1, 0, 0, 0, 246, + 247, 5, 24, 0, 0, 247, 248, 5, 42, 0, 0, 248, 253, 3, 44, 22, 0, 249, 250, + 5, 48, 0, 0, 250, 252, 3, 44, 22, 0, 251, 249, 1, 0, 0, 0, 252, 255, 1, + 0, 0, 0, 253, 251, 1, 0, 0, 0, 253, 254, 1, 0, 0, 0, 254, 256, 1, 0, 0, + 0, 255, 253, 1, 0, 0, 0, 256, 257, 5, 43, 0, 0, 257, 53, 1, 0, 0, 0, 258, + 259, 5, 25, 0, 0, 259, 260, 5, 42, 0, 0, 260, 265, 3, 62, 31, 0, 261, 262, + 5, 48, 0, 0, 262, 264, 3, 62, 31, 0, 263, 261, 1, 0, 0, 0, 264, 267, 1, + 0, 0, 0, 265, 263, 1, 0, 0, 0, 265, 266, 1, 0, 0, 0, 266, 268, 1, 0, 0, + 0, 267, 265, 1, 0, 0, 0, 268, 269, 5, 43, 0, 0, 269, 55, 1, 0, 0, 0, 270, + 271, 5, 26, 0, 0, 271, 272, 5, 42, 0, 0, 272, 277, 3, 50, 25, 0, 273, 274, + 5, 48, 0, 0, 274, 276, 3, 50, 25, 0, 275, 273, 1, 0, 0, 0, 276, 279, 1, + 0, 0, 0, 277, 275, 1, 0, 0, 0, 277, 278, 1, 0, 0, 0, 278, 280, 1, 0, 0, + 0, 279, 277, 1, 0, 0, 0, 280, 281, 5, 43, 0, 0, 281, 57, 1, 0, 0, 0, 282, + 283, 5, 27, 0, 0, 283, 284, 5, 42, 0, 0, 284, 289, 3, 40, 20, 0, 285, 286, + 5, 48, 0, 0, 286, 288, 3, 40, 20, 0, 287, 285, 1, 0, 0, 0, 288, 291, 1, + 0, 0, 0, 289, 287, 1, 0, 0, 0, 289, 290, 1, 0, 0, 0, 290, 292, 1, 0, 0, + 0, 291, 289, 1, 0, 0, 0, 292, 293, 5, 43, 0, 0, 293, 59, 1, 0, 0, 0, 294, + 295, 5, 28, 0, 0, 295, 296, 5, 42, 0, 0, 296, 297, 5, 29, 0, 0, 297, 298, + 5, 48, 0, 0, 298, 299, 5, 29, 0, 0, 299, 300, 5, 48, 0, 0, 300, 301, 5, + 29, 0, 0, 301, 302, 5, 48, 0, 0, 302, 303, 5, 29, 0, 0, 303, 304, 5, 43, + 0, 0, 304, 61, 1, 0, 0, 0, 305, 306, 5, 42, 0, 0, 306, 311, 3, 64, 32, + 0, 307, 308, 5, 48, 0, 0, 308, 310, 3, 64, 32, 0, 309, 307, 1, 0, 0, 0, + 310, 313, 1, 0, 0, 0, 311, 309, 1, 0, 0, 0, 311, 312, 1, 0, 0, 0, 312, + 314, 1, 0, 0, 0, 313, 311, 1, 0, 0, 0, 314, 315, 5, 43, 0, 0, 315, 63, + 1, 0, 0, 0, 316, 317, 5, 29, 0, 0, 317, 318, 5, 29, 0, 0, 318, 65, 1, 0, + 0, 0, 24, 77, 85, 87, 92, 97, 104, 112, 119, 128, 137, 145, 148, 155, 165, + 172, 180, 210, 220, 241, 253, 265, 277, 289, 311, + } + deserializer := antlr.NewATNDeserializer(nil) + staticData.atn = deserializer.Deserialize(staticData.serializedATN) + atn := staticData.atn + staticData.decisionToDFA = make([]*antlr.DFA, len(atn.DecisionToState)) + decisionToDFA := staticData.decisionToDFA + for index, state := range atn.DecisionToState { + decisionToDFA[index] = antlr.NewDFA(state, index) + } +} + +// CQLParserInit initializes any static state used to implement CQLParser. By default the +// static state used to implement the parser is lazily initialized during the first call to +// NewCQLParser(). You can call this function if you wish to initialize the static state ahead +// of time. +func CQLParserInit() { + staticData := &CQLParserParserStaticData + staticData.once.Do(cqlparserParserInit) +} + +// NewCQLParser produces a new parser instance for the optional input antlr.TokenStream. func NewCQLParser(input antlr.TokenStream) *CQLParser { + CQLParserInit() this := new(CQLParser) - this.BaseParser = antlr.NewBaseParser(input) - - this.Interpreter = antlr.NewParserATNSimulator(this, deserializedATN, decisionToDFA, antlr.NewPredictionContextCache()) - this.RuleNames = ruleNames - this.LiteralNames = literalNames - this.SymbolicNames = symbolicNames + staticData := &CQLParserParserStaticData + 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 = "CQLParser.g4" return this @@ -348,6 +370,10 @@ type ICqlFilterContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + BooleanExpression() IBooleanExpressionContext + EOF() antlr.TerminalNode + // IsCqlFilterContext differentiates from other interfaces. IsCqlFilterContext() } @@ -359,18 +385,22 @@ type CqlFilterContext struct { func NewEmptyCqlFilterContext() *CqlFilterContext { var p = new(CqlFilterContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_cqlFilter return p } +func InitEmptyCqlFilterContext(p *CqlFilterContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_cqlFilter +} + func (*CqlFilterContext) IsCqlFilterContext() {} func NewCqlFilterContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CqlFilterContext { var p = new(CqlFilterContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_cqlFilter @@ -380,7 +410,13 @@ func NewCqlFilterContext(parser antlr.Parser, parent antlr.ParserRuleContext, in func (s *CqlFilterContext) GetParser() antlr.Parser { return s.parser } func (s *CqlFilterContext) BooleanExpression() IBooleanExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBooleanExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -416,23 +452,6 @@ func (s *CqlFilterContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) CqlFilter() (localctx ICqlFilterContext) { localctx = NewCqlFilterContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 0, CQLParserRULE_cqlFilter) - - 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(66) @@ -441,9 +460,23 @@ func (p *CQLParser) CqlFilter() (localctx ICqlFilterContext) { { p.SetState(67) p.Match(CQLParserEOF) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IBooleanExpressionContext is an interface to support dynamic dispatch. @@ -452,7 +485,6 @@ type IBooleanExpressionContext interface { // GetParser returns the parser. GetParser() antlr.Parser - // IsBooleanExpressionContext differentiates from other interfaces. IsBooleanExpressionContext() } @@ -464,18 +496,22 @@ type BooleanExpressionContext struct { func NewEmptyBooleanExpressionContext() *BooleanExpressionContext { var p = new(BooleanExpressionContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_booleanExpression return p } +func InitEmptyBooleanExpressionContext(p *BooleanExpressionContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_booleanExpression +} + func (*BooleanExpressionContext) IsBooleanExpressionContext() {} func NewBooleanExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BooleanExpressionContext { var p = new(BooleanExpressionContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_booleanExpression @@ -484,8 +520,8 @@ func NewBooleanExpressionContext(parser antlr.Parser, parent antlr.ParserRuleCon func (s *BooleanExpressionContext) GetParser() antlr.Parser { return s.parser } -func (s *BooleanExpressionContext) CopyFrom(ctx *BooleanExpressionContext) { - s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) +func (s *BooleanExpressionContext) CopyAll(ctx *BooleanExpressionContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) } func (s *BooleanExpressionContext) GetRuleContext() antlr.RuleContext { @@ -497,15 +533,15 @@ func (s *BooleanExpressionContext) ToStringTree(ruleNames []string, recog antlr. } type BoolExprParenContext struct { - *BooleanExpressionContext + BooleanExpressionContext } func NewBoolExprParenContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolExprParenContext { var p = new(BoolExprParenContext) - p.BooleanExpressionContext = NewEmptyBooleanExpressionContext() + InitEmptyBooleanExpressionContext(&p.BooleanExpressionContext) p.parser = parser - p.CopyFrom(ctx.(*BooleanExpressionContext)) + p.CopyAll(ctx.(*BooleanExpressionContext)) return p } @@ -519,7 +555,13 @@ func (s *BoolExprParenContext) LEFTPAREN() antlr.TerminalNode { } func (s *BoolExprParenContext) BooleanExpression() IBooleanExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBooleanExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -545,7 +587,7 @@ func (s *BoolExprParenContext) ExitRule(listener antlr.ParseTreeListener) { } type BoolExprAndContext struct { - *BooleanExpressionContext + BooleanExpressionContext left IBooleanExpressionContext right IBooleanExpressionContext } @@ -553,9 +595,9 @@ type BoolExprAndContext struct { func NewBoolExprAndContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolExprAndContext { var p = new(BoolExprAndContext) - p.BooleanExpressionContext = NewEmptyBooleanExpressionContext() + InitEmptyBooleanExpressionContext(&p.BooleanExpressionContext) p.parser = parser - p.CopyFrom(ctx.(*BooleanExpressionContext)) + p.CopyAll(ctx.(*BooleanExpressionContext)) return p } @@ -577,12 +619,20 @@ func (s *BoolExprAndContext) AND() antlr.TerminalNode { } func (s *BoolExprAndContext) AllBooleanExpression() []IBooleanExpressionContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem()) - var tst = make([]IBooleanExpressionContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IBooleanExpressionContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IBooleanExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IBooleanExpressionContext); ok { tst[i] = t.(IBooleanExpressionContext) + i++ } } @@ -590,7 +640,17 @@ func (s *BoolExprAndContext) AllBooleanExpression() []IBooleanExpressionContext } func (s *BoolExprAndContext) BooleanExpression(i int) IBooleanExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBooleanExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -612,15 +672,15 @@ func (s *BoolExprAndContext) ExitRule(listener antlr.ParseTreeListener) { } type BoolExprNotContext struct { - *BooleanExpressionContext + BooleanExpressionContext } func NewBoolExprNotContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolExprNotContext { var p = new(BoolExprNotContext) - p.BooleanExpressionContext = NewEmptyBooleanExpressionContext() + InitEmptyBooleanExpressionContext(&p.BooleanExpressionContext) p.parser = parser - p.CopyFrom(ctx.(*BooleanExpressionContext)) + p.CopyAll(ctx.(*BooleanExpressionContext)) return p } @@ -634,7 +694,13 @@ func (s *BoolExprNotContext) NOT() antlr.TerminalNode { } func (s *BoolExprNotContext) BooleanExpression() IBooleanExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBooleanExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -656,15 +722,15 @@ func (s *BoolExprNotContext) ExitRule(listener antlr.ParseTreeListener) { } type BoolExprTermContext struct { - *BooleanExpressionContext + BooleanExpressionContext } func NewBoolExprTermContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolExprTermContext { var p = new(BoolExprTermContext) - p.BooleanExpressionContext = NewEmptyBooleanExpressionContext() + InitEmptyBooleanExpressionContext(&p.BooleanExpressionContext) p.parser = parser - p.CopyFrom(ctx.(*BooleanExpressionContext)) + p.CopyAll(ctx.(*BooleanExpressionContext)) return p } @@ -674,7 +740,13 @@ func (s *BoolExprTermContext) GetRuleContext() antlr.RuleContext { } func (s *BoolExprTermContext) BooleanTerm() IBooleanTermContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanTermContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBooleanTermContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -696,7 +768,7 @@ func (s *BoolExprTermContext) ExitRule(listener antlr.ParseTreeListener) { } type BoolExprOrContext struct { - *BooleanExpressionContext + BooleanExpressionContext left IBooleanExpressionContext right IBooleanExpressionContext } @@ -704,9 +776,9 @@ type BoolExprOrContext struct { func NewBoolExprOrContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *BoolExprOrContext { var p = new(BoolExprOrContext) - p.BooleanExpressionContext = NewEmptyBooleanExpressionContext() + InitEmptyBooleanExpressionContext(&p.BooleanExpressionContext) p.parser = parser - p.CopyFrom(ctx.(*BooleanExpressionContext)) + p.CopyAll(ctx.(*BooleanExpressionContext)) return p } @@ -728,12 +800,20 @@ func (s *BoolExprOrContext) OR() antlr.TerminalNode { } func (s *BoolExprOrContext) AllBooleanExpression() []IBooleanExpressionContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem()) - var tst = make([]IBooleanExpressionContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IBooleanExpressionContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IBooleanExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IBooleanExpressionContext); ok { tst[i] = t.(IBooleanExpressionContext) + i++ } } @@ -741,7 +821,17 @@ func (s *BoolExprOrContext) AllBooleanExpression() []IBooleanExpressionContext { } func (s *BoolExprOrContext) BooleanExpression(i int) IBooleanExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanExpressionContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBooleanExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -768,35 +858,23 @@ func (p *CQLParser) BooleanExpression() (localctx IBooleanExpressionContext) { func (p *CQLParser) booleanExpression(_p int) (localctx IBooleanExpressionContext) { var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + _parentState := p.GetState() localctx = NewBooleanExpressionContext(p, p.GetParserRuleContext(), _parentState) var _prevctx IBooleanExpressionContext = localctx var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. _startState := 2 p.EnterRecursionRule(localctx, 2, CQLParserRULE_booleanExpression, _p) - - 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(77) p.GetErrorHandler().Sync(p) - switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 0, p.GetParserRuleContext()) { + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 0, p.GetParserRuleContext()) { case 1: localctx = NewBoolExprParenContext(p, localctx) p.SetParserRuleContext(localctx) @@ -805,6 +883,10 @@ func (p *CQLParser) booleanExpression(_p int) (localctx IBooleanExpressionContex { p.SetState(70) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(71) @@ -813,6 +895,10 @@ func (p *CQLParser) booleanExpression(_p int) (localctx IBooleanExpressionContex { p.SetState(72) p.Match(CQLParserRIGHTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } case 2: @@ -822,6 +908,10 @@ func (p *CQLParser) booleanExpression(_p int) (localctx IBooleanExpressionContex { p.SetState(74) p.Match(CQLParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(75) @@ -837,12 +927,19 @@ func (p *CQLParser) booleanExpression(_p int) (localctx IBooleanExpressionContex p.BooleanTerm() } + case antlr.ATNInvalidAltNumber: + goto errorExit } p.GetParserRuleContext().SetStop(p.GetTokenStream().LT(-1)) p.SetState(87) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 2, p.GetParserRuleContext()) - + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 2, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { if p.GetParseListeners() != nil { @@ -851,7 +948,11 @@ func (p *CQLParser) booleanExpression(_p int) (localctx IBooleanExpressionContex _prevctx = localctx p.SetState(85) p.GetErrorHandler().Sync(p) - switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 1, p.GetParserRuleContext()) { + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 1, p.GetParserRuleContext()) { case 1: localctx = NewBoolExprAndContext(p, NewBooleanExpressionContext(p, _parentctx, _parentState)) localctx.(*BoolExprAndContext).left = _prevctx @@ -860,11 +961,16 @@ func (p *CQLParser) booleanExpression(_p int) (localctx IBooleanExpressionContex p.SetState(79) if !(p.Precpred(p.GetParserRuleContext(), 4)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 4)", "")) + goto errorExit } { p.SetState(80) p.Match(CQLParserAND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(81) @@ -882,11 +988,16 @@ func (p *CQLParser) booleanExpression(_p int) (localctx IBooleanExpressionContex p.SetState(82) if !(p.Precpred(p.GetParserRuleContext(), 3)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 3)", "")) + goto errorExit } { p.SetState(83) p.Match(CQLParserOR) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(84) @@ -896,15 +1007,33 @@ func (p *CQLParser) booleanExpression(_p int) (localctx IBooleanExpressionContex localctx.(*BoolExprOrContext).right = _x } + case antlr.ATNInvalidAltNumber: + goto errorExit } } p.SetState(89) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 2, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 2, 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) return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IBooleanTermContext is an interface to support dynamic dispatch. @@ -914,6 +1043,10 @@ type IBooleanTermContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + Predicate() IPredicateContext + BooleanLiteral() IBooleanLiteralContext + // IsBooleanTermContext differentiates from other interfaces. IsBooleanTermContext() } @@ -925,18 +1058,22 @@ type BooleanTermContext struct { func NewEmptyBooleanTermContext() *BooleanTermContext { var p = new(BooleanTermContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_booleanTerm return p } +func InitEmptyBooleanTermContext(p *BooleanTermContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_booleanTerm +} + func (*BooleanTermContext) IsBooleanTermContext() {} func NewBooleanTermContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BooleanTermContext { var p = new(BooleanTermContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_booleanTerm @@ -946,7 +1083,13 @@ func NewBooleanTermContext(parser antlr.Parser, parent antlr.ParserRuleContext, func (s *BooleanTermContext) GetParser() antlr.Parser { return s.parser } func (s *BooleanTermContext) Predicate() IPredicateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPredicateContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -956,7 +1099,13 @@ func (s *BooleanTermContext) Predicate() IPredicateContext { } func (s *BooleanTermContext) BooleanLiteral() IBooleanLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBooleanLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -988,26 +1137,13 @@ func (s *BooleanTermContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) BooleanTerm() (localctx IBooleanTermContext) { localctx = NewBooleanTermContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 4, CQLParserRULE_booleanTerm) - - 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(92) p.GetErrorHandler().Sync(p) - switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 3, p.GetParserRuleContext()) { + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 3, p.GetParserRuleContext()) { case 1: p.EnterOuterAlt(localctx, 1) { @@ -1022,9 +1158,21 @@ func (p *CQLParser) BooleanTerm() (localctx IBooleanTermContext) { p.BooleanLiteral() } + case antlr.ATNInvalidAltNumber: + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IPredicateContext is an interface to support dynamic dispatch. @@ -1034,6 +1182,11 @@ type IPredicateContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + ComparisonPredicate() IComparisonPredicateContext + SpatialPredicate() ISpatialPredicateContext + DistancePredicate() IDistancePredicateContext + // IsPredicateContext differentiates from other interfaces. IsPredicateContext() } @@ -1045,18 +1198,22 @@ type PredicateContext struct { func NewEmptyPredicateContext() *PredicateContext { var p = new(PredicateContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_predicate return p } +func InitEmptyPredicateContext(p *PredicateContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_predicate +} + func (*PredicateContext) IsPredicateContext() {} func NewPredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PredicateContext { var p = new(PredicateContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_predicate @@ -1066,7 +1223,13 @@ func NewPredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, in func (s *PredicateContext) GetParser() antlr.Parser { return s.parser } func (s *PredicateContext) ComparisonPredicate() IComparisonPredicateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IComparisonPredicateContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IComparisonPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1076,7 +1239,13 @@ func (s *PredicateContext) ComparisonPredicate() IComparisonPredicateContext { } func (s *PredicateContext) SpatialPredicate() ISpatialPredicateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ISpatialPredicateContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ISpatialPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1086,7 +1255,13 @@ func (s *PredicateContext) SpatialPredicate() ISpatialPredicateContext { } func (s *PredicateContext) DistancePredicate() IDistancePredicateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IDistancePredicateContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IDistancePredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1118,25 +1293,11 @@ func (s *PredicateContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) Predicate() (localctx IPredicateContext) { localctx = NewPredicateContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 6, CQLParserRULE_predicate) - - 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(97) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case CQLParserBooleanLiteral, CQLParserNumericLiteral, CQLParserIdentifier, CQLParserLEFTPAREN, CQLParserTemporalLiteral, CQLParserCharacterStringLiteral: @@ -1161,10 +1322,21 @@ func (p *CQLParser) Predicate() (localctx IPredicateContext) { } 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IComparisonPredicateContext is an interface to support dynamic dispatch. @@ -1173,7 +1345,6 @@ type IComparisonPredicateContext interface { // GetParser returns the parser. GetParser() antlr.Parser - // IsComparisonPredicateContext differentiates from other interfaces. IsComparisonPredicateContext() } @@ -1185,18 +1356,22 @@ type ComparisonPredicateContext struct { func NewEmptyComparisonPredicateContext() *ComparisonPredicateContext { var p = new(ComparisonPredicateContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_comparisonPredicate return p } +func InitEmptyComparisonPredicateContext(p *ComparisonPredicateContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_comparisonPredicate +} + func (*ComparisonPredicateContext) IsComparisonPredicateContext() {} func NewComparisonPredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ComparisonPredicateContext { var p = new(ComparisonPredicateContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_comparisonPredicate @@ -1205,8 +1380,8 @@ func NewComparisonPredicateContext(parser antlr.Parser, parent antlr.ParserRuleC func (s *ComparisonPredicateContext) GetParser() antlr.Parser { return s.parser } -func (s *ComparisonPredicateContext) CopyFrom(ctx *ComparisonPredicateContext) { - s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) +func (s *ComparisonPredicateContext) CopyAll(ctx *ComparisonPredicateContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) } func (s *ComparisonPredicateContext) GetRuleContext() antlr.RuleContext { @@ -1218,15 +1393,15 @@ func (s *ComparisonPredicateContext) ToStringTree(ruleNames []string, recog antl } type PredicateBinaryCompContext struct { - *ComparisonPredicateContext + ComparisonPredicateContext } func NewPredicateBinaryCompContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateBinaryCompContext { var p = new(PredicateBinaryCompContext) - p.ComparisonPredicateContext = NewEmptyComparisonPredicateContext() + InitEmptyComparisonPredicateContext(&p.ComparisonPredicateContext) p.parser = parser - p.CopyFrom(ctx.(*ComparisonPredicateContext)) + p.CopyAll(ctx.(*ComparisonPredicateContext)) return p } @@ -1236,7 +1411,13 @@ func (s *PredicateBinaryCompContext) GetRuleContext() antlr.RuleContext { } func (s *PredicateBinaryCompContext) BinaryComparisonPredicate() IBinaryComparisonPredicateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBinaryComparisonPredicateContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBinaryComparisonPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1258,15 +1439,15 @@ func (s *PredicateBinaryCompContext) ExitRule(listener antlr.ParseTreeListener) } type PredicateInContext struct { - *ComparisonPredicateContext + ComparisonPredicateContext } func NewPredicateInContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateInContext { var p = new(PredicateInContext) - p.ComparisonPredicateContext = NewEmptyComparisonPredicateContext() + InitEmptyComparisonPredicateContext(&p.ComparisonPredicateContext) p.parser = parser - p.CopyFrom(ctx.(*ComparisonPredicateContext)) + p.CopyAll(ctx.(*ComparisonPredicateContext)) return p } @@ -1276,7 +1457,13 @@ func (s *PredicateInContext) GetRuleContext() antlr.RuleContext { } func (s *PredicateInContext) IsInListPredicate() IIsInListPredicateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IIsInListPredicateContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIsInListPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1298,15 +1485,15 @@ func (s *PredicateInContext) ExitRule(listener antlr.ParseTreeListener) { } type PredicateBetweenContext struct { - *ComparisonPredicateContext + ComparisonPredicateContext } func NewPredicateBetweenContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateBetweenContext { var p = new(PredicateBetweenContext) - p.ComparisonPredicateContext = NewEmptyComparisonPredicateContext() + InitEmptyComparisonPredicateContext(&p.ComparisonPredicateContext) p.parser = parser - p.CopyFrom(ctx.(*ComparisonPredicateContext)) + p.CopyAll(ctx.(*ComparisonPredicateContext)) return p } @@ -1316,7 +1503,13 @@ func (s *PredicateBetweenContext) GetRuleContext() antlr.RuleContext { } func (s *PredicateBetweenContext) IsBetweenPredicate() IIsBetweenPredicateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IIsBetweenPredicateContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIsBetweenPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1338,15 +1531,15 @@ func (s *PredicateBetweenContext) ExitRule(listener antlr.ParseTreeListener) { } type PredicateLikeContext struct { - *ComparisonPredicateContext + ComparisonPredicateContext } func NewPredicateLikeContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateLikeContext { var p = new(PredicateLikeContext) - p.ComparisonPredicateContext = NewEmptyComparisonPredicateContext() + InitEmptyComparisonPredicateContext(&p.ComparisonPredicateContext) p.parser = parser - p.CopyFrom(ctx.(*ComparisonPredicateContext)) + p.CopyAll(ctx.(*ComparisonPredicateContext)) return p } @@ -1356,7 +1549,13 @@ func (s *PredicateLikeContext) GetRuleContext() antlr.RuleContext { } func (s *PredicateLikeContext) IsLikePredicate() IIsLikePredicateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IIsLikePredicateContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIsLikePredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1378,15 +1577,15 @@ func (s *PredicateLikeContext) ExitRule(listener antlr.ParseTreeListener) { } type PredicateIsNullContext struct { - *ComparisonPredicateContext + ComparisonPredicateContext } func NewPredicateIsNullContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *PredicateIsNullContext { var p = new(PredicateIsNullContext) - p.ComparisonPredicateContext = NewEmptyComparisonPredicateContext() + InitEmptyComparisonPredicateContext(&p.ComparisonPredicateContext) p.parser = parser - p.CopyFrom(ctx.(*ComparisonPredicateContext)) + p.CopyAll(ctx.(*ComparisonPredicateContext)) return p } @@ -1396,7 +1595,13 @@ func (s *PredicateIsNullContext) GetRuleContext() antlr.RuleContext { } func (s *PredicateIsNullContext) IsNullPredicate() IIsNullPredicateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IIsNullPredicateContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IIsNullPredicateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1420,26 +1625,13 @@ func (s *PredicateIsNullContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) ComparisonPredicate() (localctx IComparisonPredicateContext) { localctx = NewComparisonPredicateContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 8, CQLParserRULE_comparisonPredicate) - - 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(104) p.GetErrorHandler().Sync(p) - switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 5, p.GetParserRuleContext()) { + if p.HasError() { + goto errorExit + } + + switch p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 5, p.GetParserRuleContext()) { case 1: localctx = NewPredicateBinaryCompContext(p, localctx) p.EnterOuterAlt(localctx, 1) @@ -1480,9 +1672,21 @@ func (p *CQLParser) ComparisonPredicate() (localctx IComparisonPredicateContext) p.IsNullPredicate() } + case antlr.ATNInvalidAltNumber: + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IBinaryComparisonPredicateContext is an interface to support dynamic dispatch. @@ -1510,6 +1714,11 @@ type IBinaryComparisonPredicateContext interface { // SetRight sets the right rule contexts. SetRight(IScalarExpressionContext) + // Getter signatures + AllScalarExpression() []IScalarExpressionContext + ScalarExpression(i int) IScalarExpressionContext + ComparisonOperator() antlr.TerminalNode + // IsBinaryComparisonPredicateContext differentiates from other interfaces. IsBinaryComparisonPredicateContext() } @@ -1524,18 +1733,22 @@ type BinaryComparisonPredicateContext struct { func NewEmptyBinaryComparisonPredicateContext() *BinaryComparisonPredicateContext { var p = new(BinaryComparisonPredicateContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_binaryComparisonPredicate return p } +func InitEmptyBinaryComparisonPredicateContext(p *BinaryComparisonPredicateContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_binaryComparisonPredicate +} + func (*BinaryComparisonPredicateContext) IsBinaryComparisonPredicateContext() {} func NewBinaryComparisonPredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BinaryComparisonPredicateContext { var p = new(BinaryComparisonPredicateContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_binaryComparisonPredicate @@ -1557,12 +1770,20 @@ func (s *BinaryComparisonPredicateContext) SetLeft(v IScalarExpressionContext) { func (s *BinaryComparisonPredicateContext) SetRight(v IScalarExpressionContext) { s.right = v } func (s *BinaryComparisonPredicateContext) AllScalarExpression() []IScalarExpressionContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IScalarExpressionContext)(nil)).Elem()) - var tst = make([]IScalarExpressionContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IScalarExpressionContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IScalarExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IScalarExpressionContext); ok { tst[i] = t.(IScalarExpressionContext) + i++ } } @@ -1570,7 +1791,17 @@ func (s *BinaryComparisonPredicateContext) AllScalarExpression() []IScalarExpres } func (s *BinaryComparisonPredicateContext) ScalarExpression(i int) IScalarExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IScalarExpressionContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IScalarExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -1606,23 +1837,6 @@ func (s *BinaryComparisonPredicateContext) ExitRule(listener antlr.ParseTreeList func (p *CQLParser) BinaryComparisonPredicate() (localctx IBinaryComparisonPredicateContext) { localctx = NewBinaryComparisonPredicateContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 10, CQLParserRULE_binaryComparisonPredicate) - - 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(106) @@ -1637,6 +1851,10 @@ func (p *CQLParser) BinaryComparisonPredicate() (localctx IBinaryComparisonPredi var _m = p.Match(CQLParserComparisonOperator) localctx.(*BinaryComparisonPredicateContext).op = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(108) @@ -1646,7 +1864,17 @@ func (p *CQLParser) BinaryComparisonPredicate() (localctx IBinaryComparisonPredi localctx.(*BinaryComparisonPredicateContext).right = _x } +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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IIsLikePredicateContext is an interface to support dynamic dispatch. @@ -1656,6 +1884,13 @@ type IIsLikePredicateContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + PropertyName() IPropertyNameContext + CharacterLiteral() ICharacterLiteralContext + LIKE() antlr.TerminalNode + ILIKE() antlr.TerminalNode + NOT() antlr.TerminalNode + // IsIsLikePredicateContext differentiates from other interfaces. IsIsLikePredicateContext() } @@ -1667,18 +1902,22 @@ type IsLikePredicateContext struct { func NewEmptyIsLikePredicateContext() *IsLikePredicateContext { var p = new(IsLikePredicateContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_isLikePredicate return p } +func InitEmptyIsLikePredicateContext(p *IsLikePredicateContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_isLikePredicate +} + func (*IsLikePredicateContext) IsIsLikePredicateContext() {} func NewIsLikePredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IsLikePredicateContext { var p = new(IsLikePredicateContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_isLikePredicate @@ -1688,7 +1927,13 @@ func NewIsLikePredicateContext(parser antlr.Parser, parent antlr.ParserRuleConte func (s *IsLikePredicateContext) GetParser() antlr.Parser { return s.parser } func (s *IsLikePredicateContext) PropertyName() IPropertyNameContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertyNameContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPropertyNameContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1698,7 +1943,13 @@ func (s *IsLikePredicateContext) PropertyName() IPropertyNameContext { } func (s *IsLikePredicateContext) CharacterLiteral() ICharacterLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICharacterLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICharacterLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -1744,22 +1995,6 @@ func (p *CQLParser) IsLikePredicate() (localctx IIsLikePredicateContext) { p.EnterRule(localctx, 12, CQLParserRULE_isLikePredicate) 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(110) @@ -1767,30 +2002,49 @@ func (p *CQLParser) IsLikePredicate() (localctx IIsLikePredicateContext) { } p.SetState(112) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == CQLParserNOT { { p.SetState(111) p.Match(CQLParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } - p.SetState(114) - _la = p.GetTokenStream().LA(1) + { + p.SetState(114) + _la = p.GetTokenStream().LA(1) - if !(_la == CQLParserLIKE || _la == CQLParserILIKE) { - p.GetErrorHandler().RecoverInline(p) - } else { - p.GetErrorHandler().ReportMatch(p) - p.Consume() + if !(_la == CQLParserLIKE || _la == CQLParserILIKE) { + p.GetErrorHandler().RecoverInline(p) + } else { + p.GetErrorHandler().ReportMatch(p) + p.Consume() + } } { p.SetState(115) p.CharacterLiteral() } +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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IIsBetweenPredicateContext is an interface to support dynamic dispatch. @@ -1800,6 +2054,13 @@ type IIsBetweenPredicateContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + AllScalarExpression() []IScalarExpressionContext + ScalarExpression(i int) IScalarExpressionContext + BETWEEN() antlr.TerminalNode + AND() antlr.TerminalNode + NOT() antlr.TerminalNode + // IsIsBetweenPredicateContext differentiates from other interfaces. IsIsBetweenPredicateContext() } @@ -1811,18 +2072,22 @@ type IsBetweenPredicateContext struct { func NewEmptyIsBetweenPredicateContext() *IsBetweenPredicateContext { var p = new(IsBetweenPredicateContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_isBetweenPredicate return p } +func InitEmptyIsBetweenPredicateContext(p *IsBetweenPredicateContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_isBetweenPredicate +} + func (*IsBetweenPredicateContext) IsIsBetweenPredicateContext() {} func NewIsBetweenPredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IsBetweenPredicateContext { var p = new(IsBetweenPredicateContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_isBetweenPredicate @@ -1832,12 +2097,20 @@ func NewIsBetweenPredicateContext(parser antlr.Parser, parent antlr.ParserRuleCo func (s *IsBetweenPredicateContext) GetParser() antlr.Parser { return s.parser } func (s *IsBetweenPredicateContext) AllScalarExpression() []IScalarExpressionContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IScalarExpressionContext)(nil)).Elem()) - var tst = make([]IScalarExpressionContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IScalarExpressionContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IScalarExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IScalarExpressionContext); ok { tst[i] = t.(IScalarExpressionContext) + i++ } } @@ -1845,7 +2118,17 @@ func (s *IsBetweenPredicateContext) AllScalarExpression() []IScalarExpressionCon } func (s *IsBetweenPredicateContext) ScalarExpression(i int) IScalarExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IScalarExpressionContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IScalarExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -1891,22 +2174,6 @@ func (p *CQLParser) IsBetweenPredicate() (localctx IIsBetweenPredicateContext) { p.EnterRule(localctx, 14, CQLParserRULE_isBetweenPredicate) 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(117) @@ -1914,18 +2181,29 @@ func (p *CQLParser) IsBetweenPredicate() (localctx IIsBetweenPredicateContext) { } p.SetState(119) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == CQLParserNOT { { p.SetState(118) p.Match(CQLParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } { p.SetState(121) p.Match(CQLParserBETWEEN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(122) @@ -1934,13 +2212,27 @@ func (p *CQLParser) IsBetweenPredicate() (localctx IIsBetweenPredicateContext) { { p.SetState(123) p.Match(CQLParserAND) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(124) p.scalarExpression(0) } +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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IIsInListPredicateContext is an interface to support dynamic dispatch. @@ -1950,6 +2242,19 @@ type IIsInListPredicateContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + PropertyName() IPropertyNameContext + IN() antlr.TerminalNode + LEFTPAREN() antlr.TerminalNode + RIGHTPAREN() antlr.TerminalNode + AllCharacterLiteral() []ICharacterLiteralContext + CharacterLiteral(i int) ICharacterLiteralContext + AllNumericLiteral() []INumericLiteralContext + NumericLiteral(i int) INumericLiteralContext + NOT() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + // IsIsInListPredicateContext differentiates from other interfaces. IsIsInListPredicateContext() } @@ -1961,18 +2266,22 @@ type IsInListPredicateContext struct { func NewEmptyIsInListPredicateContext() *IsInListPredicateContext { var p = new(IsInListPredicateContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_isInListPredicate return p } +func InitEmptyIsInListPredicateContext(p *IsInListPredicateContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_isInListPredicate +} + func (*IsInListPredicateContext) IsIsInListPredicateContext() {} func NewIsInListPredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IsInListPredicateContext { var p = new(IsInListPredicateContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_isInListPredicate @@ -1982,7 +2291,13 @@ func NewIsInListPredicateContext(parser antlr.Parser, parent antlr.ParserRuleCon func (s *IsInListPredicateContext) GetParser() antlr.Parser { return s.parser } func (s *IsInListPredicateContext) PropertyName() IPropertyNameContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertyNameContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPropertyNameContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2004,12 +2319,20 @@ func (s *IsInListPredicateContext) RIGHTPAREN() antlr.TerminalNode { } func (s *IsInListPredicateContext) AllCharacterLiteral() []ICharacterLiteralContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ICharacterLiteralContext)(nil)).Elem()) - var tst = make([]ICharacterLiteralContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ICharacterLiteralContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]ICharacterLiteralContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ICharacterLiteralContext); ok { tst[i] = t.(ICharacterLiteralContext) + i++ } } @@ -2017,7 +2340,17 @@ func (s *IsInListPredicateContext) AllCharacterLiteral() []ICharacterLiteralCont } func (s *IsInListPredicateContext) CharacterLiteral(i int) ICharacterLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICharacterLiteralContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICharacterLiteralContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -2027,12 +2360,20 @@ func (s *IsInListPredicateContext) CharacterLiteral(i int) ICharacterLiteralCont } func (s *IsInListPredicateContext) AllNumericLiteral() []INumericLiteralContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*INumericLiteralContext)(nil)).Elem()) - var tst = make([]INumericLiteralContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(INumericLiteralContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]INumericLiteralContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(INumericLiteralContext); ok { tst[i] = t.(INumericLiteralContext) + i++ } } @@ -2040,7 +2381,17 @@ func (s *IsInListPredicateContext) AllNumericLiteral() []INumericLiteralContext } func (s *IsInListPredicateContext) NumericLiteral(i int) INumericLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*INumericLiteralContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INumericLiteralContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -2086,22 +2437,6 @@ func (p *CQLParser) IsInListPredicate() (localctx IIsInListPredicateContext) { p.EnterRule(localctx, 16, CQLParserRULE_isInListPredicate) 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(126) @@ -2109,25 +2444,43 @@ func (p *CQLParser) IsInListPredicate() (localctx IIsInListPredicateContext) { } p.SetState(128) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == CQLParserNOT { { p.SetState(127) p.Match(CQLParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } { p.SetState(130) p.Match(CQLParserIN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(131) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(148) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case CQLParserCharacterStringLiteral: @@ -2137,12 +2490,19 @@ func (p *CQLParser) IsInListPredicate() (localctx IIsInListPredicateContext) { } p.SetState(137) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == CQLParserCOMMA { { p.SetState(133) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(134) @@ -2151,6 +2511,9 @@ func (p *CQLParser) IsInListPredicate() (localctx IIsInListPredicateContext) { p.SetState(139) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } @@ -2161,12 +2524,19 @@ func (p *CQLParser) IsInListPredicate() (localctx IIsInListPredicateContext) { } p.SetState(145) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == CQLParserCOMMA { { p.SetState(141) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(142) @@ -2175,18 +2545,36 @@ func (p *CQLParser) IsInListPredicate() (localctx IIsInListPredicateContext) { p.SetState(147) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } default: - panic(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + p.SetError(antlr.NewNoViableAltException(p, nil, nil, nil, nil, nil)) + goto errorExit } { p.SetState(150) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IIsNullPredicateContext is an interface to support dynamic dispatch. @@ -2196,6 +2584,12 @@ type IIsNullPredicateContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + PropertyName() IPropertyNameContext + IS() antlr.TerminalNode + NULL() antlr.TerminalNode + NOT() antlr.TerminalNode + // IsIsNullPredicateContext differentiates from other interfaces. IsIsNullPredicateContext() } @@ -2207,18 +2601,22 @@ type IsNullPredicateContext struct { func NewEmptyIsNullPredicateContext() *IsNullPredicateContext { var p = new(IsNullPredicateContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_isNullPredicate return p } +func InitEmptyIsNullPredicateContext(p *IsNullPredicateContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_isNullPredicate +} + func (*IsNullPredicateContext) IsIsNullPredicateContext() {} func NewIsNullPredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *IsNullPredicateContext { var p = new(IsNullPredicateContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_isNullPredicate @@ -2228,7 +2626,13 @@ func NewIsNullPredicateContext(parser antlr.Parser, parent antlr.ParserRuleConte func (s *IsNullPredicateContext) GetParser() antlr.Parser { return s.parser } func (s *IsNullPredicateContext) PropertyName() IPropertyNameContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertyNameContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPropertyNameContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2274,22 +2678,6 @@ func (p *CQLParser) IsNullPredicate() (localctx IIsNullPredicateContext) { p.EnterRule(localctx, 18, CQLParserRULE_isNullPredicate) 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(152) @@ -2298,24 +2686,49 @@ func (p *CQLParser) IsNullPredicate() (localctx IIsNullPredicateContext) { { p.SetState(153) p.Match(CQLParserIS) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } p.SetState(155) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) if _la == CQLParserNOT { { p.SetState(154) p.Match(CQLParserNOT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } } { p.SetState(157) p.Match(CQLParserNULL) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IScalarExpressionContext is an interface to support dynamic dispatch. @@ -2324,7 +2737,6 @@ type IScalarExpressionContext interface { // GetParser returns the parser. GetParser() antlr.Parser - // IsScalarExpressionContext differentiates from other interfaces. IsScalarExpressionContext() } @@ -2336,18 +2748,22 @@ type ScalarExpressionContext struct { func NewEmptyScalarExpressionContext() *ScalarExpressionContext { var p = new(ScalarExpressionContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_scalarExpression return p } +func InitEmptyScalarExpressionContext(p *ScalarExpressionContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_scalarExpression +} + func (*ScalarExpressionContext) IsScalarExpressionContext() {} func NewScalarExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ScalarExpressionContext { var p = new(ScalarExpressionContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_scalarExpression @@ -2356,8 +2772,8 @@ func NewScalarExpressionContext(parser antlr.Parser, parent antlr.ParserRuleCont func (s *ScalarExpressionContext) GetParser() antlr.Parser { return s.parser } -func (s *ScalarExpressionContext) CopyFrom(ctx *ScalarExpressionContext) { - s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) +func (s *ScalarExpressionContext) CopyAll(ctx *ScalarExpressionContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) } func (s *ScalarExpressionContext) GetRuleContext() antlr.RuleContext { @@ -2369,7 +2785,7 @@ func (s *ScalarExpressionContext) ToStringTree(ruleNames []string, recog antlr.R } type ScalarExprContext struct { - *ScalarExpressionContext + ScalarExpressionContext left IScalarExpressionContext op antlr.Token right IScalarExpressionContext @@ -2378,9 +2794,9 @@ type ScalarExprContext struct { func NewScalarExprContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ScalarExprContext { var p = new(ScalarExprContext) - p.ScalarExpressionContext = NewEmptyScalarExpressionContext() + InitEmptyScalarExpressionContext(&p.ScalarExpressionContext) p.parser = parser - p.CopyFrom(ctx.(*ScalarExpressionContext)) + p.CopyAll(ctx.(*ScalarExpressionContext)) return p } @@ -2402,12 +2818,20 @@ func (s *ScalarExprContext) GetRuleContext() antlr.RuleContext { } func (s *ScalarExprContext) AllScalarExpression() []IScalarExpressionContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IScalarExpressionContext)(nil)).Elem()) - var tst = make([]IScalarExpressionContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IScalarExpressionContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IScalarExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IScalarExpressionContext); ok { tst[i] = t.(IScalarExpressionContext) + i++ } } @@ -2415,7 +2839,17 @@ func (s *ScalarExprContext) AllScalarExpression() []IScalarExpressionContext { } func (s *ScalarExprContext) ScalarExpression(i int) IScalarExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IScalarExpressionContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IScalarExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -2441,16 +2875,16 @@ func (s *ScalarExprContext) ExitRule(listener antlr.ParseTreeListener) { } type ScalarValContext struct { - *ScalarExpressionContext + ScalarExpressionContext val IScalarValueContext } func NewScalarValContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ScalarValContext { var p = new(ScalarValContext) - p.ScalarExpressionContext = NewEmptyScalarExpressionContext() + InitEmptyScalarExpressionContext(&p.ScalarExpressionContext) p.parser = parser - p.CopyFrom(ctx.(*ScalarExpressionContext)) + p.CopyAll(ctx.(*ScalarExpressionContext)) return p } @@ -2464,7 +2898,13 @@ func (s *ScalarValContext) GetRuleContext() antlr.RuleContext { } func (s *ScalarValContext) ScalarValue() IScalarValueContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IScalarValueContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IScalarValueContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2486,16 +2926,16 @@ func (s *ScalarValContext) ExitRule(listener antlr.ParseTreeListener) { } type ScalarParenContext struct { - *ScalarExpressionContext + ScalarExpressionContext expr IScalarExpressionContext } func NewScalarParenContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *ScalarParenContext { var p = new(ScalarParenContext) - p.ScalarExpressionContext = NewEmptyScalarExpressionContext() + InitEmptyScalarExpressionContext(&p.ScalarExpressionContext) p.parser = parser - p.CopyFrom(ctx.(*ScalarExpressionContext)) + p.CopyAll(ctx.(*ScalarExpressionContext)) return p } @@ -2517,7 +2957,13 @@ func (s *ScalarParenContext) RIGHTPAREN() antlr.TerminalNode { } func (s *ScalarParenContext) ScalarExpression() IScalarExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IScalarExpressionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IScalarExpressionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2544,34 +2990,21 @@ func (p *CQLParser) ScalarExpression() (localctx IScalarExpressionContext) { func (p *CQLParser) scalarExpression(_p int) (localctx IScalarExpressionContext) { var _parentctx antlr.ParserRuleContext = p.GetParserRuleContext() + _parentState := p.GetState() localctx = NewScalarExpressionContext(p, p.GetParserRuleContext(), _parentState) var _prevctx IScalarExpressionContext = localctx var _ antlr.ParserRuleContext = _prevctx // TODO: To prevent unused variable warning. _startState := 20 p.EnterRecursionRule(localctx, 20, CQLParserRULE_scalarExpression, _p) - - 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(165) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case CQLParserBooleanLiteral, CQLParserNumericLiteral, CQLParserIdentifier, CQLParserTemporalLiteral, CQLParserCharacterStringLiteral: @@ -2594,6 +3027,10 @@ func (p *CQLParser) scalarExpression(_p int) (localctx IScalarExpressionContext) { p.SetState(161) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(162) @@ -2605,16 +3042,26 @@ func (p *CQLParser) scalarExpression(_p int) (localctx IScalarExpressionContext) { p.SetState(163) p.Match(CQLParserRIGHTPAREN) + 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(172) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 14, p.GetParserRuleContext()) - + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } for _alt != 2 && _alt != antlr.ATNInvalidAltNumber { if _alt == 1 { if p.GetParseListeners() != nil { @@ -2628,7 +3075,8 @@ func (p *CQLParser) scalarExpression(_p int) (localctx IScalarExpressionContext) p.SetState(167) if !(p.Precpred(p.GetParserRuleContext(), 1)) { - panic(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) + p.SetError(antlr.NewFailedPredicateException(p, "p.Precpred(p.GetParserRuleContext(), 1)", "")) + goto errorExit } { p.SetState(168) @@ -2636,6 +3084,10 @@ func (p *CQLParser) scalarExpression(_p int) (localctx IScalarExpressionContext) var _m = p.Match(CQLParserArithmeticOperator) localctx.(*ScalarExprContext).op = _m + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(169) @@ -2648,10 +3100,26 @@ func (p *CQLParser) scalarExpression(_p int) (localctx IScalarExpressionContext) } p.SetState(174) p.GetErrorHandler().Sync(p) - _alt = p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), 14, p.GetParserRuleContext()) + if p.HasError() { + goto errorExit + } + _alt = p.GetInterpreter().AdaptivePredict(p.BaseParser, p.GetTokenStream(), 14, 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) return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IScalarValueContext is an interface to support dynamic dispatch. @@ -2660,7 +3128,6 @@ type IScalarValueContext interface { // GetParser returns the parser. GetParser() antlr.Parser - // IsScalarValueContext differentiates from other interfaces. IsScalarValueContext() } @@ -2672,18 +3139,22 @@ type ScalarValueContext struct { func NewEmptyScalarValueContext() *ScalarValueContext { var p = new(ScalarValueContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_scalarValue return p } +func InitEmptyScalarValueContext(p *ScalarValueContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_scalarValue +} + func (*ScalarValueContext) IsScalarValueContext() {} func NewScalarValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *ScalarValueContext { var p = new(ScalarValueContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_scalarValue @@ -2692,8 +3163,8 @@ func NewScalarValueContext(parser antlr.Parser, parent antlr.ParserRuleContext, func (s *ScalarValueContext) GetParser() antlr.Parser { return s.parser } -func (s *ScalarValueContext) CopyFrom(ctx *ScalarValueContext) { - s.BaseParserRuleContext.CopyFrom(ctx.BaseParserRuleContext) +func (s *ScalarValueContext) CopyAll(ctx *ScalarValueContext) { + s.CopyFrom(&ctx.BaseParserRuleContext) } func (s *ScalarValueContext) GetRuleContext() antlr.RuleContext { @@ -2705,15 +3176,15 @@ func (s *ScalarValueContext) ToStringTree(ruleNames []string, recog antlr.Recogn } type LiteralTemporalContext struct { - *ScalarValueContext + ScalarValueContext } func NewLiteralTemporalContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralTemporalContext { var p = new(LiteralTemporalContext) - p.ScalarValueContext = NewEmptyScalarValueContext() + InitEmptyScalarValueContext(&p.ScalarValueContext) p.parser = parser - p.CopyFrom(ctx.(*ScalarValueContext)) + p.CopyAll(ctx.(*ScalarValueContext)) return p } @@ -2723,7 +3194,13 @@ func (s *LiteralTemporalContext) GetRuleContext() antlr.RuleContext { } func (s *LiteralTemporalContext) TemporalLiteral() ITemporalLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ITemporalLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ITemporalLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2745,15 +3222,15 @@ func (s *LiteralTemporalContext) ExitRule(listener antlr.ParseTreeListener) { } type LiteralNumericContext struct { - *ScalarValueContext + ScalarValueContext } func NewLiteralNumericContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralNumericContext { var p = new(LiteralNumericContext) - p.ScalarValueContext = NewEmptyScalarValueContext() + InitEmptyScalarValueContext(&p.ScalarValueContext) p.parser = parser - p.CopyFrom(ctx.(*ScalarValueContext)) + p.CopyAll(ctx.(*ScalarValueContext)) return p } @@ -2763,7 +3240,13 @@ func (s *LiteralNumericContext) GetRuleContext() antlr.RuleContext { } func (s *LiteralNumericContext) NumericLiteral() INumericLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*INumericLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(INumericLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2785,15 +3268,15 @@ func (s *LiteralNumericContext) ExitRule(listener antlr.ParseTreeListener) { } type LiteralStringContext struct { - *ScalarValueContext + ScalarValueContext } func NewLiteralStringContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralStringContext { var p = new(LiteralStringContext) - p.ScalarValueContext = NewEmptyScalarValueContext() + InitEmptyScalarValueContext(&p.ScalarValueContext) p.parser = parser - p.CopyFrom(ctx.(*ScalarValueContext)) + p.CopyAll(ctx.(*ScalarValueContext)) return p } @@ -2803,7 +3286,13 @@ func (s *LiteralStringContext) GetRuleContext() antlr.RuleContext { } func (s *LiteralStringContext) CharacterLiteral() ICharacterLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICharacterLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICharacterLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2825,15 +3314,15 @@ func (s *LiteralStringContext) ExitRule(listener antlr.ParseTreeListener) { } type LiteralNameContext struct { - *ScalarValueContext + ScalarValueContext } func NewLiteralNameContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralNameContext { var p = new(LiteralNameContext) - p.ScalarValueContext = NewEmptyScalarValueContext() + InitEmptyScalarValueContext(&p.ScalarValueContext) p.parser = parser - p.CopyFrom(ctx.(*ScalarValueContext)) + p.CopyAll(ctx.(*ScalarValueContext)) return p } @@ -2843,7 +3332,13 @@ func (s *LiteralNameContext) GetRuleContext() antlr.RuleContext { } func (s *LiteralNameContext) PropertyName() IPropertyNameContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertyNameContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPropertyNameContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -2865,15 +3360,15 @@ func (s *LiteralNameContext) ExitRule(listener antlr.ParseTreeListener) { } type LiteralBooleanContext struct { - *ScalarValueContext + ScalarValueContext } func NewLiteralBooleanContext(parser antlr.Parser, ctx antlr.ParserRuleContext) *LiteralBooleanContext { var p = new(LiteralBooleanContext) - p.ScalarValueContext = NewEmptyScalarValueContext() + InitEmptyScalarValueContext(&p.ScalarValueContext) p.parser = parser - p.CopyFrom(ctx.(*ScalarValueContext)) + p.CopyAll(ctx.(*ScalarValueContext)) return p } @@ -2883,8 +3378,14 @@ func (s *LiteralBooleanContext) GetRuleContext() antlr.RuleContext { } func (s *LiteralBooleanContext) BooleanLiteral() IBooleanLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IBooleanLiteralContext)(nil)).Elem(), 0) - + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IBooleanLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } + if t == nil { return nil } @@ -2907,25 +3408,11 @@ func (s *LiteralBooleanContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) ScalarValue() (localctx IScalarValueContext) { localctx = NewScalarValueContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 22, CQLParserRULE_scalarValue) - - 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(180) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case CQLParserIdentifier: @@ -2969,10 +3456,21 @@ func (p *CQLParser) ScalarValue() (localctx IScalarValueContext) { } 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IPropertyNameContext is an interface to support dynamic dispatch. @@ -2982,6 +3480,9 @@ type IPropertyNameContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + Identifier() antlr.TerminalNode + // IsPropertyNameContext differentiates from other interfaces. IsPropertyNameContext() } @@ -2993,18 +3494,22 @@ type PropertyNameContext struct { func NewEmptyPropertyNameContext() *PropertyNameContext { var p = new(PropertyNameContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_propertyName return p } +func InitEmptyPropertyNameContext(p *PropertyNameContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_propertyName +} + func (*PropertyNameContext) IsPropertyNameContext() {} func NewPropertyNameContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PropertyNameContext { var p = new(PropertyNameContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_propertyName @@ -3040,30 +3545,27 @@ func (s *PropertyNameContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) PropertyName() (localctx IPropertyNameContext) { localctx = NewPropertyNameContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 24, CQLParserRULE_propertyName) - - 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(182) p.Match(CQLParserIdentifier) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // ICharacterLiteralContext is an interface to support dynamic dispatch. @@ -3073,6 +3575,9 @@ type ICharacterLiteralContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + CharacterStringLiteral() antlr.TerminalNode + // IsCharacterLiteralContext differentiates from other interfaces. IsCharacterLiteralContext() } @@ -3084,18 +3589,22 @@ type CharacterLiteralContext struct { func NewEmptyCharacterLiteralContext() *CharacterLiteralContext { var p = new(CharacterLiteralContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_characterLiteral return p } +func InitEmptyCharacterLiteralContext(p *CharacterLiteralContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_characterLiteral +} + func (*CharacterLiteralContext) IsCharacterLiteralContext() {} func NewCharacterLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CharacterLiteralContext { var p = new(CharacterLiteralContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_characterLiteral @@ -3131,30 +3640,27 @@ func (s *CharacterLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) CharacterLiteral() (localctx ICharacterLiteralContext) { localctx = NewCharacterLiteralContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 26, CQLParserRULE_characterLiteral) - - 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(184) p.Match(CQLParserCharacterStringLiteral) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // INumericLiteralContext is an interface to support dynamic dispatch. @@ -3164,6 +3670,9 @@ type INumericLiteralContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + NumericLiteral() antlr.TerminalNode + // IsNumericLiteralContext differentiates from other interfaces. IsNumericLiteralContext() } @@ -3175,18 +3684,22 @@ type NumericLiteralContext struct { func NewEmptyNumericLiteralContext() *NumericLiteralContext { var p = new(NumericLiteralContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_numericLiteral return p } +func InitEmptyNumericLiteralContext(p *NumericLiteralContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_numericLiteral +} + func (*NumericLiteralContext) IsNumericLiteralContext() {} func NewNumericLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *NumericLiteralContext { var p = new(NumericLiteralContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_numericLiteral @@ -3222,30 +3735,27 @@ func (s *NumericLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) NumericLiteral() (localctx INumericLiteralContext) { localctx = NewNumericLiteralContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 28, CQLParserRULE_numericLiteral) - - 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(186) p.Match(CQLParserNumericLiteral) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IBooleanLiteralContext is an interface to support dynamic dispatch. @@ -3255,6 +3765,9 @@ type IBooleanLiteralContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + BooleanLiteral() antlr.TerminalNode + // IsBooleanLiteralContext differentiates from other interfaces. IsBooleanLiteralContext() } @@ -3266,18 +3779,22 @@ type BooleanLiteralContext struct { func NewEmptyBooleanLiteralContext() *BooleanLiteralContext { var p = new(BooleanLiteralContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_booleanLiteral return p } +func InitEmptyBooleanLiteralContext(p *BooleanLiteralContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_booleanLiteral +} + func (*BooleanLiteralContext) IsBooleanLiteralContext() {} func NewBooleanLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *BooleanLiteralContext { var p = new(BooleanLiteralContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_booleanLiteral @@ -3313,30 +3830,27 @@ func (s *BooleanLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) BooleanLiteral() (localctx IBooleanLiteralContext) { localctx = NewBooleanLiteralContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 30, CQLParserRULE_booleanLiteral) - - 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(188) p.Match(CQLParserBooleanLiteral) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // ITemporalLiteralContext is an interface to support dynamic dispatch. @@ -3346,6 +3860,9 @@ type ITemporalLiteralContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + TemporalLiteral() antlr.TerminalNode + // IsTemporalLiteralContext differentiates from other interfaces. IsTemporalLiteralContext() } @@ -3357,18 +3874,22 @@ type TemporalLiteralContext struct { func NewEmptyTemporalLiteralContext() *TemporalLiteralContext { var p = new(TemporalLiteralContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_temporalLiteral return p } +func InitEmptyTemporalLiteralContext(p *TemporalLiteralContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_temporalLiteral +} + func (*TemporalLiteralContext) IsTemporalLiteralContext() {} func NewTemporalLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *TemporalLiteralContext { var p = new(TemporalLiteralContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_temporalLiteral @@ -3404,30 +3925,27 @@ func (s *TemporalLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) TemporalLiteral() (localctx ITemporalLiteralContext) { localctx = NewTemporalLiteralContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 32, CQLParserRULE_temporalLiteral) - - 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(190) p.Match(CQLParserTemporalLiteral) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // ISpatialPredicateContext is an interface to support dynamic dispatch. @@ -3437,6 +3955,14 @@ type ISpatialPredicateContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + SpatialOperator() antlr.TerminalNode + LEFTPAREN() antlr.TerminalNode + AllGeomExpression() []IGeomExpressionContext + GeomExpression(i int) IGeomExpressionContext + COMMA() antlr.TerminalNode + RIGHTPAREN() antlr.TerminalNode + // IsSpatialPredicateContext differentiates from other interfaces. IsSpatialPredicateContext() } @@ -3448,18 +3974,22 @@ type SpatialPredicateContext struct { func NewEmptySpatialPredicateContext() *SpatialPredicateContext { var p = new(SpatialPredicateContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_spatialPredicate return p } +func InitEmptySpatialPredicateContext(p *SpatialPredicateContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_spatialPredicate +} + func (*SpatialPredicateContext) IsSpatialPredicateContext() {} func NewSpatialPredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *SpatialPredicateContext { var p = new(SpatialPredicateContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_spatialPredicate @@ -3477,12 +4007,20 @@ func (s *SpatialPredicateContext) LEFTPAREN() antlr.TerminalNode { } func (s *SpatialPredicateContext) AllGeomExpression() []IGeomExpressionContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IGeomExpressionContext)(nil)).Elem()) - var tst = make([]IGeomExpressionContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IGeomExpressionContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IGeomExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IGeomExpressionContext); ok { tst[i] = t.(IGeomExpressionContext) + i++ } } @@ -3490,7 +4028,17 @@ func (s *SpatialPredicateContext) AllGeomExpression() []IGeomExpressionContext { } func (s *SpatialPredicateContext) GeomExpression(i int) IGeomExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IGeomExpressionContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGeomExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -3530,31 +4078,22 @@ func (s *SpatialPredicateContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) SpatialPredicate() (localctx ISpatialPredicateContext) { localctx = NewSpatialPredicateContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 34, CQLParserRULE_spatialPredicate) - - 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(192) p.Match(CQLParserSpatialOperator) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(193) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(194) @@ -3563,6 +4102,10 @@ func (p *CQLParser) SpatialPredicate() (localctx ISpatialPredicateContext) { { p.SetState(195) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(196) @@ -3571,9 +4114,23 @@ func (p *CQLParser) SpatialPredicate() (localctx ISpatialPredicateContext) { { p.SetState(197) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IDistancePredicateContext is an interface to support dynamic dispatch. @@ -3583,6 +4140,16 @@ type IDistancePredicateContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + DistanceOperator() antlr.TerminalNode + LEFTPAREN() antlr.TerminalNode + AllGeomExpression() []IGeomExpressionContext + GeomExpression(i int) IGeomExpressionContext + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + NumericLiteral() antlr.TerminalNode + RIGHTPAREN() antlr.TerminalNode + // IsDistancePredicateContext differentiates from other interfaces. IsDistancePredicateContext() } @@ -3594,18 +4161,22 @@ type DistancePredicateContext struct { func NewEmptyDistancePredicateContext() *DistancePredicateContext { var p = new(DistancePredicateContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_distancePredicate return p } +func InitEmptyDistancePredicateContext(p *DistancePredicateContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_distancePredicate +} + func (*DistancePredicateContext) IsDistancePredicateContext() {} func NewDistancePredicateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *DistancePredicateContext { var p = new(DistancePredicateContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_distancePredicate @@ -3623,12 +4194,20 @@ func (s *DistancePredicateContext) LEFTPAREN() antlr.TerminalNode { } func (s *DistancePredicateContext) AllGeomExpression() []IGeomExpressionContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IGeomExpressionContext)(nil)).Elem()) - var tst = make([]IGeomExpressionContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IGeomExpressionContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IGeomExpressionContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IGeomExpressionContext); ok { tst[i] = t.(IGeomExpressionContext) + i++ } } @@ -3636,7 +4215,17 @@ func (s *DistancePredicateContext) AllGeomExpression() []IGeomExpressionContext } func (s *DistancePredicateContext) GeomExpression(i int) IGeomExpressionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IGeomExpressionContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGeomExpressionContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -3684,31 +4273,22 @@ func (s *DistancePredicateContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) DistancePredicate() (localctx IDistancePredicateContext) { localctx = NewDistancePredicateContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 36, CQLParserRULE_distancePredicate) - - 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(199) p.Match(CQLParserDistanceOperator) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(200) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(201) @@ -3717,6 +4297,10 @@ func (p *CQLParser) DistancePredicate() (localctx IDistancePredicateContext) { { p.SetState(202) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(203) @@ -3725,17 +4309,39 @@ func (p *CQLParser) DistancePredicate() (localctx IDistancePredicateContext) { { p.SetState(204) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(205) p.Match(CQLParserNumericLiteral) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(206) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IGeomExpressionContext is an interface to support dynamic dispatch. @@ -3745,6 +4351,10 @@ type IGeomExpressionContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + PropertyName() IPropertyNameContext + GeomLiteral() IGeomLiteralContext + // IsGeomExpressionContext differentiates from other interfaces. IsGeomExpressionContext() } @@ -3756,18 +4366,22 @@ type GeomExpressionContext struct { func NewEmptyGeomExpressionContext() *GeomExpressionContext { var p = new(GeomExpressionContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_geomExpression return p } +func InitEmptyGeomExpressionContext(p *GeomExpressionContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_geomExpression +} + func (*GeomExpressionContext) IsGeomExpressionContext() {} func NewGeomExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GeomExpressionContext { var p = new(GeomExpressionContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_geomExpression @@ -3777,7 +4391,13 @@ func NewGeomExpressionContext(parser antlr.Parser, parent antlr.ParserRuleContex func (s *GeomExpressionContext) GetParser() antlr.Parser { return s.parser } func (s *GeomExpressionContext) PropertyName() IPropertyNameContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPropertyNameContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPropertyNameContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3787,7 +4407,13 @@ func (s *GeomExpressionContext) PropertyName() IPropertyNameContext { } func (s *GeomExpressionContext) GeomLiteral() IGeomLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IGeomLiteralContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGeomLiteralContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3819,25 +4445,11 @@ func (s *GeomExpressionContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) GeomExpression() (localctx IGeomExpressionContext) { localctx = NewGeomExpressionContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 38, CQLParserRULE_geomExpression) - - 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(210) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case CQLParserIdentifier: @@ -3855,10 +4467,21 @@ func (p *CQLParser) GeomExpression() (localctx IGeomExpressionContext) { } 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IGeomLiteralContext is an interface to support dynamic dispatch. @@ -3868,6 +4491,16 @@ type IGeomLiteralContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + Point() IPointContext + Linestring() ILinestringContext + Polygon() IPolygonContext + MultiPoint() IMultiPointContext + MultiLinestring() IMultiLinestringContext + MultiPolygon() IMultiPolygonContext + GeometryCollection() IGeometryCollectionContext + Envelope() IEnvelopeContext + // IsGeomLiteralContext differentiates from other interfaces. IsGeomLiteralContext() } @@ -3879,18 +4512,22 @@ type GeomLiteralContext struct { func NewEmptyGeomLiteralContext() *GeomLiteralContext { var p = new(GeomLiteralContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_geomLiteral return p } +func InitEmptyGeomLiteralContext(p *GeomLiteralContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_geomLiteral +} + func (*GeomLiteralContext) IsGeomLiteralContext() {} func NewGeomLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GeomLiteralContext { var p = new(GeomLiteralContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_geomLiteral @@ -3900,7 +4537,13 @@ func NewGeomLiteralContext(parser antlr.Parser, parent antlr.ParserRuleContext, func (s *GeomLiteralContext) GetParser() antlr.Parser { return s.parser } func (s *GeomLiteralContext) Point() IPointContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPointContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPointContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3910,7 +4553,13 @@ func (s *GeomLiteralContext) Point() IPointContext { } func (s *GeomLiteralContext) Linestring() ILinestringContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ILinestringContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ILinestringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3920,7 +4569,13 @@ func (s *GeomLiteralContext) Linestring() ILinestringContext { } func (s *GeomLiteralContext) Polygon() IPolygonContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPolygonContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPolygonContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3930,7 +4585,13 @@ func (s *GeomLiteralContext) Polygon() IPolygonContext { } func (s *GeomLiteralContext) MultiPoint() IMultiPointContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IMultiPointContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMultiPointContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3940,7 +4601,13 @@ func (s *GeomLiteralContext) MultiPoint() IMultiPointContext { } func (s *GeomLiteralContext) MultiLinestring() IMultiLinestringContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IMultiLinestringContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMultiLinestringContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3950,7 +4617,13 @@ func (s *GeomLiteralContext) MultiLinestring() IMultiLinestringContext { } func (s *GeomLiteralContext) MultiPolygon() IMultiPolygonContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IMultiPolygonContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IMultiPolygonContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3960,7 +4633,13 @@ func (s *GeomLiteralContext) MultiPolygon() IMultiPolygonContext { } func (s *GeomLiteralContext) GeometryCollection() IGeometryCollectionContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IGeometryCollectionContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGeometryCollectionContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -3970,7 +4649,13 @@ func (s *GeomLiteralContext) GeometryCollection() IGeometryCollectionContext { } func (s *GeomLiteralContext) Envelope() IEnvelopeContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IEnvelopeContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IEnvelopeContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4002,25 +4687,11 @@ func (s *GeomLiteralContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) GeomLiteral() (localctx IGeomLiteralContext) { localctx = NewGeomLiteralContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 40, CQLParserRULE_geomLiteral) - - 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(220) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } switch p.GetTokenStream().LA(1) { case CQLParserPOINT: @@ -4080,10 +4751,21 @@ func (p *CQLParser) GeomLiteral() (localctx IGeomLiteralContext) { } 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IPointContext is an interface to support dynamic dispatch. @@ -4093,6 +4775,10 @@ type IPointContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + POINT() antlr.TerminalNode + PointList() IPointListContext + // IsPointContext differentiates from other interfaces. IsPointContext() } @@ -4104,18 +4790,22 @@ type PointContext struct { func NewEmptyPointContext() *PointContext { var p = new(PointContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_point return p } +func InitEmptyPointContext(p *PointContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_point +} + func (*PointContext) IsPointContext() {} func NewPointContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PointContext { var p = new(PointContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_point @@ -4129,7 +4819,13 @@ func (s *PointContext) POINT() antlr.TerminalNode { } func (s *PointContext) PointList() IPointListContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPointListContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPointListContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4161,34 +4857,31 @@ func (s *PointContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) Point() (localctx IPointContext) { localctx = NewPointContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 42, CQLParserRULE_point) - - 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(222) p.Match(CQLParserPOINT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(223) p.PointList() } +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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IPointListContext is an interface to support dynamic dispatch. @@ -4198,6 +4891,11 @@ type IPointListContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + LEFTPAREN() antlr.TerminalNode + Coordinate() ICoordinateContext + RIGHTPAREN() antlr.TerminalNode + // IsPointListContext differentiates from other interfaces. IsPointListContext() } @@ -4209,18 +4907,22 @@ type PointListContext struct { func NewEmptyPointListContext() *PointListContext { var p = new(PointListContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_pointList return p } +func InitEmptyPointListContext(p *PointListContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_pointList +} + func (*PointListContext) IsPointListContext() {} func NewPointListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PointListContext { var p = new(PointListContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_pointList @@ -4234,7 +4936,13 @@ func (s *PointListContext) LEFTPAREN() antlr.TerminalNode { } func (s *PointListContext) Coordinate() ICoordinateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICoordinateContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICoordinateContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4270,27 +4978,14 @@ func (s *PointListContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) PointList() (localctx IPointListContext) { localctx = NewPointListContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 44, CQLParserRULE_pointList) - - 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(225) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(226) @@ -4299,9 +4994,23 @@ func (p *CQLParser) PointList() (localctx IPointListContext) { { p.SetState(227) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // ILinestringContext is an interface to support dynamic dispatch. @@ -4311,6 +5020,10 @@ type ILinestringContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + LINESTRING() antlr.TerminalNode + CoordList() ICoordListContext + // IsLinestringContext differentiates from other interfaces. IsLinestringContext() } @@ -4322,18 +5035,22 @@ type LinestringContext struct { func NewEmptyLinestringContext() *LinestringContext { var p = new(LinestringContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_linestring return p } +func InitEmptyLinestringContext(p *LinestringContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_linestring +} + func (*LinestringContext) IsLinestringContext() {} func NewLinestringContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *LinestringContext { var p = new(LinestringContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_linestring @@ -4347,7 +5064,13 @@ func (s *LinestringContext) LINESTRING() antlr.TerminalNode { } func (s *LinestringContext) CoordList() ICoordListContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICoordListContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICoordListContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4379,34 +5102,31 @@ func (s *LinestringContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) Linestring() (localctx ILinestringContext) { localctx = NewLinestringContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 46, CQLParserRULE_linestring) - - 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(229) p.Match(CQLParserLINESTRING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(230) p.CoordList() } +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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IPolygonContext is an interface to support dynamic dispatch. @@ -4416,6 +5136,10 @@ type IPolygonContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + POLYGON() antlr.TerminalNode + PolygonDef() IPolygonDefContext + // IsPolygonContext differentiates from other interfaces. IsPolygonContext() } @@ -4427,18 +5151,22 @@ type PolygonContext struct { func NewEmptyPolygonContext() *PolygonContext { var p = new(PolygonContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_polygon return p } +func InitEmptyPolygonContext(p *PolygonContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_polygon +} + func (*PolygonContext) IsPolygonContext() {} func NewPolygonContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PolygonContext { var p = new(PolygonContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_polygon @@ -4452,7 +5180,13 @@ func (s *PolygonContext) POLYGON() antlr.TerminalNode { } func (s *PolygonContext) PolygonDef() IPolygonDefContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPolygonDefContext)(nil)).Elem(), 0) + var t antlr.RuleContext + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPolygonDefContext); ok { + t = ctx.(antlr.RuleContext) + break + } + } if t == nil { return nil @@ -4484,34 +5218,31 @@ func (s *PolygonContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) Polygon() (localctx IPolygonContext) { localctx = NewPolygonContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 48, CQLParserRULE_polygon) - - 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(232) p.Match(CQLParserPOLYGON) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(233) p.PolygonDef() } +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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IPolygonDefContext is an interface to support dynamic dispatch. @@ -4521,6 +5252,14 @@ type IPolygonDefContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + LEFTPAREN() antlr.TerminalNode + AllCoordList() []ICoordListContext + CoordList(i int) ICoordListContext + RIGHTPAREN() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + // IsPolygonDefContext differentiates from other interfaces. IsPolygonDefContext() } @@ -4532,18 +5271,22 @@ type PolygonDefContext struct { func NewEmptyPolygonDefContext() *PolygonDefContext { var p = new(PolygonDefContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_polygonDef return p } +func InitEmptyPolygonDefContext(p *PolygonDefContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_polygonDef +} + func (*PolygonDefContext) IsPolygonDefContext() {} func NewPolygonDefContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *PolygonDefContext { var p = new(PolygonDefContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_polygonDef @@ -4557,12 +5300,20 @@ func (s *PolygonDefContext) LEFTPAREN() antlr.TerminalNode { } func (s *PolygonDefContext) AllCoordList() []ICoordListContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ICoordListContext)(nil)).Elem()) - var tst = make([]ICoordListContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ICoordListContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]ICoordListContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ICoordListContext); ok { tst[i] = t.(ICoordListContext) + i++ } } @@ -4570,7 +5321,17 @@ func (s *PolygonDefContext) AllCoordList() []ICoordListContext { } func (s *PolygonDefContext) CoordList(i int) ICoordListContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICoordListContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICoordListContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -4616,26 +5377,14 @@ func (p *CQLParser) PolygonDef() (localctx IPolygonDefContext) { p.EnterRule(localctx, 50, CQLParserRULE_polygonDef) 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(235) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(236) @@ -4643,12 +5392,19 @@ func (p *CQLParser) PolygonDef() (localctx IPolygonDefContext) { } p.SetState(241) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == CQLParserCOMMA { { p.SetState(237) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(238) @@ -4657,14 +5413,31 @@ func (p *CQLParser) PolygonDef() (localctx IPolygonDefContext) { p.SetState(243) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(244) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IMultiPointContext is an interface to support dynamic dispatch. @@ -4674,6 +5447,15 @@ type IMultiPointContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + MULTIPOINT() antlr.TerminalNode + LEFTPAREN() antlr.TerminalNode + AllPointList() []IPointListContext + PointList(i int) IPointListContext + RIGHTPAREN() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + // IsMultiPointContext differentiates from other interfaces. IsMultiPointContext() } @@ -4685,18 +5467,22 @@ type MultiPointContext struct { func NewEmptyMultiPointContext() *MultiPointContext { var p = new(MultiPointContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_multiPoint return p } +func InitEmptyMultiPointContext(p *MultiPointContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_multiPoint +} + func (*MultiPointContext) IsMultiPointContext() {} func NewMultiPointContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MultiPointContext { var p = new(MultiPointContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_multiPoint @@ -4714,12 +5500,20 @@ func (s *MultiPointContext) LEFTPAREN() antlr.TerminalNode { } func (s *MultiPointContext) AllPointList() []IPointListContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IPointListContext)(nil)).Elem()) - var tst = make([]IPointListContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IPointListContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IPointListContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IPointListContext); ok { tst[i] = t.(IPointListContext) + i++ } } @@ -4727,7 +5521,17 @@ func (s *MultiPointContext) AllPointList() []IPointListContext { } func (s *MultiPointContext) PointList(i int) IPointListContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPointListContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPointListContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -4773,30 +5577,22 @@ func (p *CQLParser) MultiPoint() (localctx IMultiPointContext) { p.EnterRule(localctx, 52, CQLParserRULE_multiPoint) 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(246) p.Match(CQLParserMULTIPOINT) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(247) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(248) @@ -4804,12 +5600,19 @@ func (p *CQLParser) MultiPoint() (localctx IMultiPointContext) { } p.SetState(253) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == CQLParserCOMMA { { p.SetState(249) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(250) @@ -4818,14 +5621,31 @@ func (p *CQLParser) MultiPoint() (localctx IMultiPointContext) { p.SetState(255) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(256) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IMultiLinestringContext is an interface to support dynamic dispatch. @@ -4835,6 +5655,15 @@ type IMultiLinestringContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + MULTILINESTRING() antlr.TerminalNode + LEFTPAREN() antlr.TerminalNode + AllCoordList() []ICoordListContext + CoordList(i int) ICoordListContext + RIGHTPAREN() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + // IsMultiLinestringContext differentiates from other interfaces. IsMultiLinestringContext() } @@ -4846,18 +5675,22 @@ type MultiLinestringContext struct { func NewEmptyMultiLinestringContext() *MultiLinestringContext { var p = new(MultiLinestringContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_multiLinestring return p } +func InitEmptyMultiLinestringContext(p *MultiLinestringContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_multiLinestring +} + func (*MultiLinestringContext) IsMultiLinestringContext() {} func NewMultiLinestringContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MultiLinestringContext { var p = new(MultiLinestringContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_multiLinestring @@ -4875,12 +5708,20 @@ func (s *MultiLinestringContext) LEFTPAREN() antlr.TerminalNode { } func (s *MultiLinestringContext) AllCoordList() []ICoordListContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ICoordListContext)(nil)).Elem()) - var tst = make([]ICoordListContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ICoordListContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]ICoordListContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ICoordListContext); ok { tst[i] = t.(ICoordListContext) + i++ } } @@ -4888,7 +5729,17 @@ func (s *MultiLinestringContext) AllCoordList() []ICoordListContext { } func (s *MultiLinestringContext) CoordList(i int) ICoordListContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICoordListContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICoordListContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -4934,30 +5785,22 @@ func (p *CQLParser) MultiLinestring() (localctx IMultiLinestringContext) { p.EnterRule(localctx, 54, CQLParserRULE_multiLinestring) 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(258) p.Match(CQLParserMULTILINESTRING) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(259) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(260) @@ -4965,12 +5808,19 @@ func (p *CQLParser) MultiLinestring() (localctx IMultiLinestringContext) { } p.SetState(265) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == CQLParserCOMMA { { p.SetState(261) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(262) @@ -4979,14 +5829,31 @@ func (p *CQLParser) MultiLinestring() (localctx IMultiLinestringContext) { p.SetState(267) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(268) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IMultiPolygonContext is an interface to support dynamic dispatch. @@ -4996,6 +5863,15 @@ type IMultiPolygonContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + MULTIPOLYGON() antlr.TerminalNode + LEFTPAREN() antlr.TerminalNode + AllPolygonDef() []IPolygonDefContext + PolygonDef(i int) IPolygonDefContext + RIGHTPAREN() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + // IsMultiPolygonContext differentiates from other interfaces. IsMultiPolygonContext() } @@ -5007,18 +5883,22 @@ type MultiPolygonContext struct { func NewEmptyMultiPolygonContext() *MultiPolygonContext { var p = new(MultiPolygonContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_multiPolygon return p } +func InitEmptyMultiPolygonContext(p *MultiPolygonContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_multiPolygon +} + func (*MultiPolygonContext) IsMultiPolygonContext() {} func NewMultiPolygonContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *MultiPolygonContext { var p = new(MultiPolygonContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_multiPolygon @@ -5036,12 +5916,20 @@ func (s *MultiPolygonContext) LEFTPAREN() antlr.TerminalNode { } func (s *MultiPolygonContext) AllPolygonDef() []IPolygonDefContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IPolygonDefContext)(nil)).Elem()) - var tst = make([]IPolygonDefContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IPolygonDefContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IPolygonDefContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IPolygonDefContext); ok { tst[i] = t.(IPolygonDefContext) + i++ } } @@ -5049,7 +5937,17 @@ func (s *MultiPolygonContext) AllPolygonDef() []IPolygonDefContext { } func (s *MultiPolygonContext) PolygonDef(i int) IPolygonDefContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IPolygonDefContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IPolygonDefContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -5095,30 +5993,22 @@ func (p *CQLParser) MultiPolygon() (localctx IMultiPolygonContext) { p.EnterRule(localctx, 56, CQLParserRULE_multiPolygon) 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(270) p.Match(CQLParserMULTIPOLYGON) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(271) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(272) @@ -5126,12 +6016,19 @@ func (p *CQLParser) MultiPolygon() (localctx IMultiPolygonContext) { } p.SetState(277) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == CQLParserCOMMA { { p.SetState(273) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(274) @@ -5140,14 +6037,31 @@ func (p *CQLParser) MultiPolygon() (localctx IMultiPolygonContext) { p.SetState(279) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(280) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IGeometryCollectionContext is an interface to support dynamic dispatch. @@ -5157,6 +6071,15 @@ type IGeometryCollectionContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + GEOMETRYCOLLECTION() antlr.TerminalNode + LEFTPAREN() antlr.TerminalNode + AllGeomLiteral() []IGeomLiteralContext + GeomLiteral(i int) IGeomLiteralContext + RIGHTPAREN() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + // IsGeometryCollectionContext differentiates from other interfaces. IsGeometryCollectionContext() } @@ -5168,18 +6091,22 @@ type GeometryCollectionContext struct { func NewEmptyGeometryCollectionContext() *GeometryCollectionContext { var p = new(GeometryCollectionContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_geometryCollection return p } +func InitEmptyGeometryCollectionContext(p *GeometryCollectionContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_geometryCollection +} + func (*GeometryCollectionContext) IsGeometryCollectionContext() {} func NewGeometryCollectionContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *GeometryCollectionContext { var p = new(GeometryCollectionContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_geometryCollection @@ -5197,12 +6124,20 @@ func (s *GeometryCollectionContext) LEFTPAREN() antlr.TerminalNode { } func (s *GeometryCollectionContext) AllGeomLiteral() []IGeomLiteralContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*IGeomLiteralContext)(nil)).Elem()) - var tst = make([]IGeomLiteralContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(IGeomLiteralContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]IGeomLiteralContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(IGeomLiteralContext); ok { tst[i] = t.(IGeomLiteralContext) + i++ } } @@ -5210,7 +6145,17 @@ func (s *GeometryCollectionContext) AllGeomLiteral() []IGeomLiteralContext { } func (s *GeometryCollectionContext) GeomLiteral(i int) IGeomLiteralContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*IGeomLiteralContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(IGeomLiteralContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -5256,30 +6201,22 @@ func (p *CQLParser) GeometryCollection() (localctx IGeometryCollectionContext) { p.EnterRule(localctx, 58, CQLParserRULE_geometryCollection) 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(282) p.Match(CQLParserGEOMETRYCOLLECTION) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(283) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(284) @@ -5287,12 +6224,19 @@ func (p *CQLParser) GeometryCollection() (localctx IGeometryCollectionContext) { } p.SetState(289) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == CQLParserCOMMA { { p.SetState(285) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(286) @@ -5301,14 +6245,31 @@ func (p *CQLParser) GeometryCollection() (localctx IGeometryCollectionContext) { p.SetState(291) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(292) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // IEnvelopeContext is an interface to support dynamic dispatch. @@ -5318,6 +6279,15 @@ type IEnvelopeContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + ENVELOPE() antlr.TerminalNode + LEFTPAREN() antlr.TerminalNode + AllNumericLiteral() []antlr.TerminalNode + NumericLiteral(i int) antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + RIGHTPAREN() antlr.TerminalNode + // IsEnvelopeContext differentiates from other interfaces. IsEnvelopeContext() } @@ -5329,18 +6299,22 @@ type EnvelopeContext struct { func NewEmptyEnvelopeContext() *EnvelopeContext { var p = new(EnvelopeContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_envelope return p } +func InitEmptyEnvelopeContext(p *EnvelopeContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_envelope +} + func (*EnvelopeContext) IsEnvelopeContext() {} func NewEnvelopeContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *EnvelopeContext { var p = new(EnvelopeContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_envelope @@ -5400,66 +6374,99 @@ func (s *EnvelopeContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) Envelope() (localctx IEnvelopeContext) { localctx = NewEnvelopeContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 60, CQLParserRULE_envelope) - - 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(294) p.Match(CQLParserENVELOPE) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(295) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(296) p.Match(CQLParserNumericLiteral) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(297) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(298) p.Match(CQLParserNumericLiteral) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(299) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(300) p.Match(CQLParserNumericLiteral) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(301) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(302) p.Match(CQLParserNumericLiteral) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(303) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // ICoordListContext is an interface to support dynamic dispatch. @@ -5469,6 +6476,14 @@ type ICoordListContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + LEFTPAREN() antlr.TerminalNode + AllCoordinate() []ICoordinateContext + Coordinate(i int) ICoordinateContext + RIGHTPAREN() antlr.TerminalNode + AllCOMMA() []antlr.TerminalNode + COMMA(i int) antlr.TerminalNode + // IsCoordListContext differentiates from other interfaces. IsCoordListContext() } @@ -5480,18 +6495,22 @@ type CoordListContext struct { func NewEmptyCoordListContext() *CoordListContext { var p = new(CoordListContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_coordList return p } +func InitEmptyCoordListContext(p *CoordListContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_coordList +} + func (*CoordListContext) IsCoordListContext() {} func NewCoordListContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CoordListContext { var p = new(CoordListContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_coordList @@ -5505,12 +6524,20 @@ func (s *CoordListContext) LEFTPAREN() antlr.TerminalNode { } func (s *CoordListContext) AllCoordinate() []ICoordinateContext { - var ts = s.GetTypedRuleContexts(reflect.TypeOf((*ICoordinateContext)(nil)).Elem()) - var tst = make([]ICoordinateContext, len(ts)) + children := s.GetChildren() + len := 0 + for _, ctx := range children { + if _, ok := ctx.(ICoordinateContext); ok { + len++ + } + } - for i, t := range ts { - if t != nil { + tst := make([]ICoordinateContext, len) + i := 0 + for _, ctx := range children { + if t, ok := ctx.(ICoordinateContext); ok { tst[i] = t.(ICoordinateContext) + i++ } } @@ -5518,7 +6545,17 @@ func (s *CoordListContext) AllCoordinate() []ICoordinateContext { } func (s *CoordListContext) Coordinate(i int) ICoordinateContext { - var t = s.GetTypedRuleContext(reflect.TypeOf((*ICoordinateContext)(nil)).Elem(), i) + var t antlr.RuleContext + j := 0 + for _, ctx := range s.GetChildren() { + if _, ok := ctx.(ICoordinateContext); ok { + if j == i { + t = ctx.(antlr.RuleContext) + break + } + j++ + } + } if t == nil { return nil @@ -5564,26 +6601,14 @@ func (p *CQLParser) CoordList() (localctx ICoordListContext) { p.EnterRule(localctx, 62, CQLParserRULE_coordList) 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(305) p.Match(CQLParserLEFTPAREN) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(306) @@ -5591,12 +6616,19 @@ func (p *CQLParser) CoordList() (localctx ICoordListContext) { } p.SetState(311) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) for _la == CQLParserCOMMA { { p.SetState(307) p.Match(CQLParserCOMMA) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(308) @@ -5605,14 +6637,31 @@ func (p *CQLParser) CoordList() (localctx ICoordListContext) { p.SetState(313) p.GetErrorHandler().Sync(p) + if p.HasError() { + goto errorExit + } _la = p.GetTokenStream().LA(1) } { p.SetState(314) p.Match(CQLParserRIGHTPAREN) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } // ICoordinateContext is an interface to support dynamic dispatch. @@ -5622,6 +6671,10 @@ type ICoordinateContext interface { // GetParser returns the parser. GetParser() antlr.Parser + // Getter signatures + AllNumericLiteral() []antlr.TerminalNode + NumericLiteral(i int) antlr.TerminalNode + // IsCoordinateContext differentiates from other interfaces. IsCoordinateContext() } @@ -5633,18 +6686,22 @@ type CoordinateContext struct { func NewEmptyCoordinateContext() *CoordinateContext { var p = new(CoordinateContext) - p.CqlContext = NewCqlContext(nil, -1) + p.CqlContext = NewCqlContext(nil, -1) // Jim super p.RuleIndex = CQLParserRULE_coordinate return p } +func InitEmptyCoordinateContext(p *CoordinateContext) { + p.CqlContext = NewCqlContext(nil, -1) // Jim super + p.RuleIndex = CQLParserRULE_coordinate +} + func (*CoordinateContext) IsCoordinateContext() {} func NewCoordinateContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *CoordinateContext { var p = new(CoordinateContext) p.CqlContext = NewCqlContext(parent, invokingState) - p.parser = parser p.RuleIndex = CQLParserRULE_coordinate @@ -5684,34 +6741,35 @@ func (s *CoordinateContext) ExitRule(listener antlr.ParseTreeListener) { func (p *CQLParser) Coordinate() (localctx ICoordinateContext) { localctx = NewCoordinateContext(p, p.GetParserRuleContext(), p.GetState()) p.EnterRule(localctx, 64, CQLParserRULE_coordinate) - - 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(316) p.Match(CQLParserNumericLiteral) + if p.HasError() { + // Recognition error - abort rule + goto errorExit + } } { p.SetState(317) p.Match(CQLParserNumericLiteral) + 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() return localctx + goto errorExit // Trick to prevent compiler error if the label is not used } func (p *CQLParser) Sempred(localctx antlr.RuleContext, ruleIndex, predIndex int) bool { diff --git a/internal/cql/cql_test.go b/internal/cql/cql_test.go index f62cec65..c8495d86 100644 --- a/internal/cql/cql_test.go +++ b/internal/cql/cql_test.go @@ -147,6 +147,13 @@ func TestTemporal(t *testing.T) { checkCQL(t, "p > NOW()", "\"p\" > timestamp 'NOW'") } +func TestPropertyNames(t *testing.T) { + checkCQL(t, `"eo:grid" = 'MGRS-01GBQ'`, `"eo:grid" = 'MGRS-01GBQ'`) + checkCQL(t, `"datetime" = 2023-08-01T00:00:00Z`, `"datetime" = timestamp '2023-08-01T00:00:00Z'`) + checkCQL(t, `"s2:datatake_id" = 'S2C_OPER_MSI_L1C_DS_2CPS_20250412T152944_S20250412T115421_N05.11'`, `"s2:datatake_id" = 'S2C_OPER_MSI_L1C_DS_2CPS_20250412T152944_S20250412T115421_N05.11'`) + +} + func TestSyntaxErrors(t *testing.T) { checkCQLError(t, "x y") checkCQLError(t, "x == y") diff --git a/internal/cql/cqlparser_base_listener.go b/internal/cql/cqlparser_base_listener.go index 072f15bf..ca896987 100644 --- a/internal/cql/cqlparser_base_listener.go +++ b/internal/cql/cqlparser_base_listener.go @@ -1,7 +1,7 @@ -// Generated from CQLParser.g4 by ANTLR 4.7. +// Code generated from CQLParser.g4 by ANTLR 4.13.2. DO NOT EDIT. package cql // CQLParser -import "github.com/antlr/antlr4/runtime/Go/antlr" +import "github.com/antlr4-go/antlr/v4" // BaseCQLParserListener is a complete listener for a parse tree produced by CQLParser. type BaseCQLParserListener struct{} diff --git a/internal/cql/cqlparser_listener.go b/internal/cql/cqlparser_listener.go index 804744e7..d3c24d36 100644 --- a/internal/cql/cqlparser_listener.go +++ b/internal/cql/cqlparser_listener.go @@ -1,7 +1,7 @@ -// Generated from CQLParser.g4 by ANTLR 4.7. +// Code generated from CQLParser.g4 by ANTLR 4.13.2. DO NOT EDIT. package cql // CQLParser -import "github.com/antlr/antlr4/runtime/Go/antlr" +import "github.com/antlr4-go/antlr/v4" // CQLParserListener is a complete listener for a parse tree produced by CQLParser. type CQLParserListener interface { From aa9eba0449ae036303a28f7512fa3ef4d23b6c35 Mon Sep 17 00:00:00 2001 From: Konrad Date: Mon, 14 Apr 2025 17:10:28 +0200 Subject: [PATCH 2/2] fix go tests --- .github/workflows/ci.yml | 2 +- .gitignore | 2 ++ go.mod | 6 +++--- go.sum | 9 +++------ 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 380b2589..9d9f1fb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ jobs: name: CI strategy: matrix: - go-version: [1.16.x] + go-version: [1.22.x] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: diff --git a/.gitignore b/.gitignore index 02a16192..5591901a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ docs/ public/ config/pg_featureserv.toml hugo/.hugo_build.lock +vendor/ +*.interp \ No newline at end of file diff --git a/go.mod b/go.mod index f6b58c04..36fdabc4 100644 --- a/go.mod +++ b/go.mod @@ -33,10 +33,10 @@ require ( github.com/spf13/jwalterweatherman v1.0.0 // indirect github.com/spf13/pflag v1.0.3 // indirect github.com/subosito/gotenv v1.2.0 // indirect - golang.org/x/crypto v0.23.0 // indirect + golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 // indirect + golang.org/x/text v0.3.2 // indirect golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 // indirect gopkg.in/ini.v1 v1.51.0 // indirect gopkg.in/yaml.v2 v2.2.4 // indirect diff --git a/go.sum b/go.sum index 14f24a17..064a74fa 100644 --- a/go.sum +++ b/go.sum @@ -197,9 +197,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7 h1:0hQKqeLdqlt5iIwVOBErRisrHJAN57yOiPRQItI20fU= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -228,13 +227,11 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=